is there a package that allows one to import a selection of lines from an external .txt file?
I know minted has a command that can be customized this way: \inputminted[firstline=3,lastline=5]{c}{hello.c}
(see this link), but I'm looking for something more neutral, not specific to any programming language. This is because I'm writing a commands.txt file with a long list of Cisco's router/switch configuration commands that I'm learning, and I'd like to import only few required lines as a way to showcase examples. Obviously, minted doesn't include any 'cisco' language. I know of \verb
and the verbatim
environment, but I gather there could be problems with breaking long lines.
Best Answer
Instead of specifying a proper computer language for syntax highlighting in the environments of the
minted
package, you can use the optiontext
. This will just typeset the input verbatim-like without syntax-highlighting but with the full functionality of theminted
package.In your case, you probably want to do use
\inputminted
with thefirstline
andlastline
option. Additionally, just givetext
as first mandatory argument: