I ran into a problem of including a tex
file via \inputminted
from the minted package. When I try to add a frame around the code with frame=single
I get lots of errors referring to missing $
's missing }
's and missing \item
's.
The MWE is a self-referential tex
-file with the following contents:
% this is: frames_for_minted_in_beamer.tex
\documentclass{beamer}
\usepackage{minted}
\begin{document}
\begin{frame}[fragile]
\inputminted[%
label=frames_for_minted_in_beamer.tex,%
% frame=single,% this does not work
]{latex}{./frames_for_minted_in_beamer.tex}
\end{frame}
\end{document}
What went wrong here?
Ty for any help,
Franz
Best Answer
The problem are the special characters you use in the label. Using the
frame=single
style will typeset the label at the top and unescaped math characters like_
will cause an error.You can either escape them:
or use the
tcolorbox
package to draw a simple frame without the label: