How can I include the contents of a text file in my latex document as verbatim?
I tried (the text file does not contain any @)
\documentclass{article}
\begin{document}
\verb@
\input{temp.txt}
@
\end{document}
but I get the error: \verb ended by end of line.
PS: of course the above cannot work even without the error, because if it worked the output file would just contain the single line \input{temp.txt}
fancyvrbas discussed in Using \input in a fancyvrb verbatim environment - problem with hyphens. This isn't exactly a duplicate of that one, but I'm sure there is a question that covers this exactly. – Chris H Jan 30 '17 at 13:36moreverb,verbatim, orlistingsor another package from CTAN topic verbatim. Evenallttcould be enough. – Schweinebacke Jan 30 '17 at 13:38verbatimboxpackage offers options here. – Steven B. Segletes Jan 30 '17 at 13:40\VerbatimInputmacro , which takes one argument -- the name of the file whose contents are to be included in verbatim mode. – Mico Jan 30 '17 at 13:52