1

I am using package minted within beamer in order to display LaTeX source code.

Actually, I am having this code to display:

\newcommand{\vektor}[1]{\vec{#1}}

so i coded something like this within an \uncover instruction:

\mint{latex}|\newcommand{\vektor}[1]{\vec{#1}}|

and tried different options like \mint[escapeinside=||,mathescape=true]{l... but nothing helped so far. The problem is, that the # will be presented twice in the output :-(

Here is an MWE

\documentclass{beamer}

\usepackage[T1]{fontenc}
\usepackage{minted}

\begin{document}
  \begin{frame}[fragile]
    \uncover<1->{\mint{latex}|\newcommand{\vektor}[1]{\vec{#1}}|}
  \end{frame}
\end{document}

The problem occurs from using the \uncover, but I would love to use that feature :-(

This is the unpleasant result:

One hash to much

3

You can't put verbatim material in an argument. Use the uncoverenv instead:

\documentclass{beamer}

\usepackage[T1]{fontenc}
\usepackage{minted}

\begin{document}
  \begin{frame}[fragile]
    \begin{uncoverenv}<1->\mint{latex}|\newcommand{\vektor}[1]{\vec{#1}}|\end{uncoverenv}
  \end{frame}
\end{document}
  • Dear @Ulrike Fischer, thank you so much. It worked! – Jan Nov 8 '19 at 6:56

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.