Can you define which lines and columns from a .txt file to show up in LaTeX? I tried the \lstinputlisting command where it seems I can only limit the output to specific lines and not columns as well, like in \lstinputlisting[firstline=1,lastline=1]{filename.txt} My aim is to only have to change the text in .txt file values in specific places so that I can easily keep my output updated. Is there a way to include columns in the \lstinputlisting command or is there another way to define specific text passages from .txt file?
Asked
Active
Viewed 30 times
listings. But as long a your question is absolutely unclear and as long a you don't show a MWE showing, whylistingscannot be use, it IMHO does not make much sense to search for one, because I would suggest to uselistings. – cabohah Mar 06 '24 at 14:05\input. AFAIK there isn't any solution to input (and interpret) only some lines of a tex file. – cabohah Mar 06 '24 at 14:11\lstinputlisting[firstline=,lastline=]{filename.txt}
– Charles TeXavier Mar 06 '24 at 14:37firstlineandlastlineexpect a value (e.g.firstline=5,lastline=10see also the examples on the linked page and thelistingsuser manual). – cabohah Mar 06 '24 at 14:43firstline=1:5, lastline=2:10would select a 'block' of 2x5 characters from the middle of line 1 and 2. Or maybe a simpler version where only the columns on a single line can be given, (also nonexisting)line=3:5:10for characters 5-10 on line 3. – Marijn Mar 06 '24 at 21:12