How to change the font style and size for the \lstinputlisting

You can use the optional argument to provide any listings options:

\lstinputlisting[basicstyle=\ttfamily\scriptsize,language=somelang]{filename}

For multiple listings you can set this settings globally (or locally to the current group) using \lstset{<options>}. See the listings manual for more details. https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings


\lstinputlisting obeys to the same options that are set with \lstset for the environment form. So something like

\lstset{basicstyle=\ttfamily,columns=fullflexible}

should do.

Tags:

Fonts

Listings