0

This question already has an answer here:

While using minted I can change font size (Change font size in minted) on each individual place using the fontsize=\footnotesize:

\begin{listing}
\inputminted[fontsize=\footnotesize]{javascript}{file.js}
\end{listing}

Can I set this once for the entire document?

marked as duplicate by CarLaTeX, user156344, Stefan Pinnow, Raaja, Andrew Swann Apr 14 at 18:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

With \setminted{fontsize=...} you can set the default font size for all your minted environments.

If you explicitly indicate a font size in a single minted environment, it overrides the default.

I think your question is a duplicate of Minted, setstretch and font size, but there the more correct answer is Himura's one.

\documentclass{article}
\usepackage{minted}
\setminted{fontsize=\footnotesize}
\begin{document}
\noindent\verb|\footnotesize| is the default font size:
\begin{minted}{objc}
if you do not specify another fontsize
your minted environment will be footnotesize
\end{minted}
\begin{minted}{objc}
all your minted evronments will be footnotesize
\end{minted}
Unless you specify another font size:
\begin{minted}[fontsize=\large]{objc}
this is large
\end{minted}
\end{document}

enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.