0

I'm using the following code in latex for inserting R output from the package verbatim. First I put the output in a text file then call it from the following code,

\verbatiminput{2.txt}

The font size is a bit big. How can I change the font size to footnotesize for all the command \verbatiminput{}?

1 Answers1

0
\begin{filecontents}[noheader]{2.txt}
This is file "2.txt".
\end{filecontents}

\documentclass{article}
\usepackage{verbatim}
\usepackage{etoolbox}

\makeatletter
\appto\verbatim@font{\footnotesize}
\makeatother

\begin{document}
Normal text\par
{\footnotesize Footnote-size text}
\verbatiminput{2.txt}
\end{document}

enter image description here

muzimuzhi Z
  • 26,474