12

Why is there a space between \documentclass and {article} in my inline code?

There are no errors in the log.

% arara: pdflatex: { shell : yes }
\documentclass{beamer}
\usepackage{minted}
\newminted{latex}{fontsize=\footnotesize}
\newmintinline{latex}{fontsize=\footnotesize}

\begin{document}
\begin{frame}
\frametitle{An example}
Why is there a spaces between \latexinline{\documentclass} and \latexinline{{article}} in this inline code: \latexinline{\documentclass{article}}?
\end{frame}
\end{document}

enter image description here

Disclaimer: I already know the answer, but since it took me an hour to realize it, I thought a Q&A could be useful to future users.

14

The frame option [fragile] is needed.

See Section 12.9 of the beamer documentation.

% arara: pdflatex: { shell : yes }
\documentclass{beamer}
\usepackage{minted}
\newminted{latex}{fontsize=\footnotesize}
\newmintinline{latex}{fontsize=\footnotesize}

\begin{document}
\begin{frame}[fragile]
\frametitle{An example}
Why is there a spaces between \latexinline{\documentclass} and \latexinline{{article}} in this inline code: \latexinline{\documentclass{article}}?
\end{frame}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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