6

How can I \pause in the middle of a minted source code in Beamer?

\documentclass[12pt]{beamer}

\usepackage{minted}

...

\newminted{csharp}{bgcolor=gray!25,fontsize=\footnotesize,mathescape}

...

\begin{frame}[fragile]
    \begin{csharpcode}
    public class Objet
    {
        public int Attr1 { get; set; };

        % I want to \pause here

        public int Attr2 { get; set; };
    }
    \end{csharpcode}
\end{frame}

I want to show the audience just a part of the code in a first frame and the following in a second frame.

It's useful because if I show everything they will not be able to focus on what I am talking about in the first place.

  • I'm not sure this is possible; why not breaking the code into two parts? – egreg Nov 10 '13 at 17:18
4

Use two environments:

\documentclass[12pt]{beamer}
\usepackage{minted}
\newminted{csharp}{bgcolor=gray!25,fontsize=\footnotesize,mathescape}
\begin{document}

\begin{frame}[fragile]
\begin{csharpcode}
    public class Objet
    {
        public int Attr1 { get; set; };

\end{csharpcode}
\pause\vspace{-2pt}
\begin{csharpcode}

        public int Attr2 { get; set; };
    }
\end{csharpcode}
\end{frame}
\end{document}

enter image description here

| improve this answer | |
3

Put the code in an external file and use inputminted with different start and end lines. Use the standard frame selection tokens for beamer.

| improve this answer | |

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.