I realise similar questions have been asked before, but no solution worked for me so far.
Consider this document:
\documentclass{beamer}
\usepackage{minted}
\begin{document}
\begin{frame}[fragile]
\only<2>{
\begin{minted}{agda}
test
\end{minted}
}
\end{frame}
\end{document}
It gives the following error:
! FancyVerb Error:
Extraneous input ` test \end {minted} ' between \begin{minted}[<key=value>] a
nd line end
.
\FV@Error ... {FancyVerb Error:
\space \space #1
}
l.5 }
This input will be discarded. Hit <return> to continue.
)
Runaway argument?
! File ended while scanning use of \FancyVerbGetLine.
<inserted text>
\par
l.13 \end{frame}
I suspect you have forgotten a `}', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type `E' or `X' now and fix your file.
! FancyVerb Error:
Couldn't find `\end{minted}' to end a verbatim environment on input line 5.
.
\FV@Error ... {FancyVerb Error:
\space \space #1
}
l.13 \end{frame}
Probably you mistyped the environment name or included an extraneous
space, or are using an improperly defined verbatim environment.
Hit return and I will try to terminate this job.
[...]
Things are pretty mixed up, but I think the worst is over.
(That last line was beautiful, I needed to include it.)
What's the matter? How do I fix it? Note that \mintinline works fine.
\begin{frame}[fragile] \begin{onlyenv}<2> \begin{minted}{agda} test \end{minted} \end{onlyenv} \end{frame}? (I don't have the necessary programs for minted) – samcarter_is_at_topanswers.xyz May 24 '17 at 15:37