Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
standalone_verbatim.tex is parametrized tex template, that genrates cropped pdf containing given text verbatim of given file in monospace. Just compile below, or get some ascii art penguin into penguin.txt (e.g. from: http://chris.com/ascii/index.php?art=logos%20and%20insignias/linux ) and run: $ pdflatex '\def\txtfile{penguin.txt} \input{standa…
% Following standalone configuration: http://tex.stackexchange.com/a/94395/7128
\documentclass[varwidth=\maxdimen]{standalone}
% Usage: pdflatex '\def\txtfile{input.txt} \input{this_document_template.tex}'
% Example pdflatex '\def\txtfile{penguin.txt} \input{standalone_verbatim.tex}'
\usepackage{verbatim}
\begin{document}
% following http://tex.stackexchange.com/a/1495/7128
\ifdefined\txtfile
%
%Specified file: \txtfile
%
\verbatiminput{\txtfile}
\else
\begin{verbatim}
/\
/ \
/ \
/ \
/ \
| |
| Please |
| define |
| txtfile |
| |
|__________|
Usage: pdflatex '\def\txtfile{input.txt} \input{this_document_template.tex}'
example: pdflatex '\def\txtfile{penguin.txt} \input{standalone_verbatim.tex}'
_
/ \
\_/
\end{verbatim}
\fi
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.