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.

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

2 Answers 2

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

4

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

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .