Beamer vs. Minted: overlays












8















How to use beamer overlay inside minted code? The obvious solution does not work:



documentclass{beamer}
usepackage{minted}

begin{document}

begin{frame}[fragile]

frametitle{Foo}

begin{minted}{lua}
uncover<1>{print("foo")}
uncover<2>{print("bar")}
uncover<3>{print("baz")}
end{minted}

end{frame}

end{document}









share|improve this question



























    8















    How to use beamer overlay inside minted code? The obvious solution does not work:



    documentclass{beamer}
    usepackage{minted}

    begin{document}

    begin{frame}[fragile]

    frametitle{Foo}

    begin{minted}{lua}
    uncover<1>{print("foo")}
    uncover<2>{print("bar")}
    uncover<3>{print("baz")}
    end{minted}

    end{frame}

    end{document}









    share|improve this question

























      8












      8








      8








      How to use beamer overlay inside minted code? The obvious solution does not work:



      documentclass{beamer}
      usepackage{minted}

      begin{document}

      begin{frame}[fragile]

      frametitle{Foo}

      begin{minted}{lua}
      uncover<1>{print("foo")}
      uncover<2>{print("bar")}
      uncover<3>{print("baz")}
      end{minted}

      end{frame}

      end{document}









      share|improve this question














      How to use beamer overlay inside minted code? The obvious solution does not work:



      documentclass{beamer}
      usepackage{minted}

      begin{document}

      begin{frame}[fragile]

      frametitle{Foo}

      begin{minted}{lua}
      uncover<1>{print("foo")}
      uncover<2>{print("bar")}
      uncover<3>{print("baz")}
      end{minted}

      end{frame}

      end{document}






      beamer overlays minted






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 29 '11 at 21:04









      Alexander GladyshAlexander Gladysh

      3312518




      3312518






















          6 Answers
          6






          active

          oldest

          votes


















          5














          Unfortunately, there is no obvious way to make this work due to the way minted works internally. In fact, it is vital that the code is not parsed by TeX in the usual way.



          There might be some trickery possible to circumvent this but for now I suggest that the easiest way to approximate the desired behaviour is to use multiple sequential minted environments:



          uncover<1>{begin{minted}{lua}
          print("foo")
          end{minted}}
          uncover<2>{begin{minted}{lua}
          print("bar")
          end{minted}}
          uncover<3>{begin{minted}{lua}
          print("baz")
          end{minted}}


          Though to be honest I’m not certain if this even works.






          share|improve this answer





















          • 1





            Wouldn't it be uncover<x>{begin{minted}...end{minted}}?

            – Aaron
            Aug 31 '11 at 6:11











          • @Aaron Damn, of course. Which makes the whole thing much more difficult. I hope the above works at all.

            – Konrad Rudolph
            Aug 31 '11 at 7:03








          • 2





            It does not work for me.

            – rgrig
            Oct 6 '14 at 9:21



















          7














          After some trial and error the following is the only solution that works for me:



          begin{frame}

          begin{overprint}
          onslide<1>
          begin{minted}{c++}
          ...
          end{minted}

          onslide<2>
          begin{minted}{c++}
          ...
          end{minted}
          end{overprint}

          end{frame}





          share|improve this answer































            2














            I used something similar to what Konrad Rudolph suggested, I used onslide<n> before the minted block (actually #+begin_src in emacs' orgmode). It does not require curly brackets around the block.






            share|improve this answer































              1














              I can add that @VZ.'s solution also works if you want to "single-step" some code (in my case, C code with pointers) together with illustrations using tikzpicture. The "obvious" solution did not work, neither did using escapeinside due to a bug in pygments (see https://github.com/gpoore/minted/issues/70). In the solution below, highlightlines is used to highlight the current instruction. Too bad the actual C code need to be duplicate - but hey, it works!



              documentclass{beamer}
              usepackage{minted}
              usepackage{tikz}
              begin{document}
              begin{frame}[fragile]
              frametitle{Foo}
              begin{overprint}
              onslide<1>
              begin{minted}[linenos,highlightlines={3}]{c}
              int main(void) {
              char *p;
              p=(char *)malloc(5);
              /* do stuff */
              p=(char *)malloc(7);
              free(p);
              return 0;
              }
              end{minted}
              onslide<2>
              begin{minted}[linenos,highlightlines={5}]{c}
              int main(void) {
              char *p;
              p=(char *)malloc(5);
              /* do stuff */
              p=(char *)malloc(7);
              free(p);
              return 0;
              }
              end{minted}
              end{overprint}
              begin{tikzpicture}
              node<1->[rectangle,draw] (p) {p};
              node<1->[rectangle,draw,right of=p] (q1) {q1};
              draw<1>[->] (p) -- (q1);
              uncover<2->{node[rectangle,draw,below right of=p] (q2) {q2};};
              draw<2->[->] (p) -- (q2);
              end{tikzpicture}
              end{frame}
              end{document}





              share|improve this answer

































                0














                The following worked for me: (I'm using Pygments 1.5 which is pre-release at the moment.)



                begin{frame}[fragile]
                frametitle{...}

                begin{minted}{haskell}
                data C a = ...
                end{minted}

                begin{minted}{c++}
                template<typename T> class C {...};
                end{minted}

                begin{minted}{scala}
                class C[T] {...};
                end{minted}
                end{frame}


                The fragile keyword is in fact what does the trick for me. (Note its use after begin{frame}.)






                share|improve this answer



















                • 8





                  Don't see any overlays in your code.

                  – Alexander Gladysh
                  Dec 14 '11 at 5:47



















                0














                You cannot put a minted environment inside only or uncover, but you can use it inside minted environments. As usual, you still need the fragile option for frame. Here's an example (where code is a minted environment).



                newminted[code]{scala}{}
                begin{frame}[fragile]
                begin{code}
                snippet1
                end{code}
                begin{onlyenv}<2>
                begin{code}
                snippet2
                end{code}
                end{onlyenv}
                note[item]{M}
                end{frame}





                share|improve this answer























                  Your Answer








                  StackExchange.ready(function() {
                  var channelOptions = {
                  tags: "".split(" "),
                  id: "85"
                  };
                  initTagRenderer("".split(" "), "".split(" "), channelOptions);

                  StackExchange.using("externalEditor", function() {
                  // Have to fire editor after snippets, if snippets enabled
                  if (StackExchange.settings.snippets.snippetsEnabled) {
                  StackExchange.using("snippets", function() {
                  createEditor();
                  });
                  }
                  else {
                  createEditor();
                  }
                  });

                  function createEditor() {
                  StackExchange.prepareEditor({
                  heartbeatType: 'answer',
                  autoActivateHeartbeat: false,
                  convertImagesToLinks: false,
                  noModals: true,
                  showLowRepImageUploadWarning: true,
                  reputationToPostImages: null,
                  bindNavPrevention: true,
                  postfix: "",
                  imageUploader: {
                  brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                  contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                  allowUrls: true
                  },
                  onDemand: true,
                  discardSelector: ".discard-answer"
                  ,immediatelyShowMarkdownHelp:true
                  });


                  }
                  });














                  draft saved

                  draft discarded


















                  StackExchange.ready(
                  function () {
                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f26917%2fbeamer-vs-minted-overlays%23new-answer', 'question_page');
                  }
                  );

                  Post as a guest















                  Required, but never shown

























                  6 Answers
                  6






                  active

                  oldest

                  votes








                  6 Answers
                  6






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes









                  5














                  Unfortunately, there is no obvious way to make this work due to the way minted works internally. In fact, it is vital that the code is not parsed by TeX in the usual way.



                  There might be some trickery possible to circumvent this but for now I suggest that the easiest way to approximate the desired behaviour is to use multiple sequential minted environments:



                  uncover<1>{begin{minted}{lua}
                  print("foo")
                  end{minted}}
                  uncover<2>{begin{minted}{lua}
                  print("bar")
                  end{minted}}
                  uncover<3>{begin{minted}{lua}
                  print("baz")
                  end{minted}}


                  Though to be honest I’m not certain if this even works.






                  share|improve this answer





















                  • 1





                    Wouldn't it be uncover<x>{begin{minted}...end{minted}}?

                    – Aaron
                    Aug 31 '11 at 6:11











                  • @Aaron Damn, of course. Which makes the whole thing much more difficult. I hope the above works at all.

                    – Konrad Rudolph
                    Aug 31 '11 at 7:03








                  • 2





                    It does not work for me.

                    – rgrig
                    Oct 6 '14 at 9:21
















                  5














                  Unfortunately, there is no obvious way to make this work due to the way minted works internally. In fact, it is vital that the code is not parsed by TeX in the usual way.



                  There might be some trickery possible to circumvent this but for now I suggest that the easiest way to approximate the desired behaviour is to use multiple sequential minted environments:



                  uncover<1>{begin{minted}{lua}
                  print("foo")
                  end{minted}}
                  uncover<2>{begin{minted}{lua}
                  print("bar")
                  end{minted}}
                  uncover<3>{begin{minted}{lua}
                  print("baz")
                  end{minted}}


                  Though to be honest I’m not certain if this even works.






                  share|improve this answer





















                  • 1





                    Wouldn't it be uncover<x>{begin{minted}...end{minted}}?

                    – Aaron
                    Aug 31 '11 at 6:11











                  • @Aaron Damn, of course. Which makes the whole thing much more difficult. I hope the above works at all.

                    – Konrad Rudolph
                    Aug 31 '11 at 7:03








                  • 2





                    It does not work for me.

                    – rgrig
                    Oct 6 '14 at 9:21














                  5












                  5








                  5







                  Unfortunately, there is no obvious way to make this work due to the way minted works internally. In fact, it is vital that the code is not parsed by TeX in the usual way.



                  There might be some trickery possible to circumvent this but for now I suggest that the easiest way to approximate the desired behaviour is to use multiple sequential minted environments:



                  uncover<1>{begin{minted}{lua}
                  print("foo")
                  end{minted}}
                  uncover<2>{begin{minted}{lua}
                  print("bar")
                  end{minted}}
                  uncover<3>{begin{minted}{lua}
                  print("baz")
                  end{minted}}


                  Though to be honest I’m not certain if this even works.






                  share|improve this answer















                  Unfortunately, there is no obvious way to make this work due to the way minted works internally. In fact, it is vital that the code is not parsed by TeX in the usual way.



                  There might be some trickery possible to circumvent this but for now I suggest that the easiest way to approximate the desired behaviour is to use multiple sequential minted environments:



                  uncover<1>{begin{minted}{lua}
                  print("foo")
                  end{minted}}
                  uncover<2>{begin{minted}{lua}
                  print("bar")
                  end{minted}}
                  uncover<3>{begin{minted}{lua}
                  print("baz")
                  end{minted}}


                  Though to be honest I’m not certain if this even works.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Aug 31 '11 at 7:03

























                  answered Aug 30 '11 at 21:19









                  Konrad RudolphKonrad Rudolph

                  26.7k1786140




                  26.7k1786140








                  • 1





                    Wouldn't it be uncover<x>{begin{minted}...end{minted}}?

                    – Aaron
                    Aug 31 '11 at 6:11











                  • @Aaron Damn, of course. Which makes the whole thing much more difficult. I hope the above works at all.

                    – Konrad Rudolph
                    Aug 31 '11 at 7:03








                  • 2





                    It does not work for me.

                    – rgrig
                    Oct 6 '14 at 9:21














                  • 1





                    Wouldn't it be uncover<x>{begin{minted}...end{minted}}?

                    – Aaron
                    Aug 31 '11 at 6:11











                  • @Aaron Damn, of course. Which makes the whole thing much more difficult. I hope the above works at all.

                    – Konrad Rudolph
                    Aug 31 '11 at 7:03








                  • 2





                    It does not work for me.

                    – rgrig
                    Oct 6 '14 at 9:21








                  1




                  1





                  Wouldn't it be uncover<x>{begin{minted}...end{minted}}?

                  – Aaron
                  Aug 31 '11 at 6:11





                  Wouldn't it be uncover<x>{begin{minted}...end{minted}}?

                  – Aaron
                  Aug 31 '11 at 6:11













                  @Aaron Damn, of course. Which makes the whole thing much more difficult. I hope the above works at all.

                  – Konrad Rudolph
                  Aug 31 '11 at 7:03







                  @Aaron Damn, of course. Which makes the whole thing much more difficult. I hope the above works at all.

                  – Konrad Rudolph
                  Aug 31 '11 at 7:03






                  2




                  2





                  It does not work for me.

                  – rgrig
                  Oct 6 '14 at 9:21





                  It does not work for me.

                  – rgrig
                  Oct 6 '14 at 9:21











                  7














                  After some trial and error the following is the only solution that works for me:



                  begin{frame}

                  begin{overprint}
                  onslide<1>
                  begin{minted}{c++}
                  ...
                  end{minted}

                  onslide<2>
                  begin{minted}{c++}
                  ...
                  end{minted}
                  end{overprint}

                  end{frame}





                  share|improve this answer




























                    7














                    After some trial and error the following is the only solution that works for me:



                    begin{frame}

                    begin{overprint}
                    onslide<1>
                    begin{minted}{c++}
                    ...
                    end{minted}

                    onslide<2>
                    begin{minted}{c++}
                    ...
                    end{minted}
                    end{overprint}

                    end{frame}





                    share|improve this answer


























                      7












                      7








                      7







                      After some trial and error the following is the only solution that works for me:



                      begin{frame}

                      begin{overprint}
                      onslide<1>
                      begin{minted}{c++}
                      ...
                      end{minted}

                      onslide<2>
                      begin{minted}{c++}
                      ...
                      end{minted}
                      end{overprint}

                      end{frame}





                      share|improve this answer













                      After some trial and error the following is the only solution that works for me:



                      begin{frame}

                      begin{overprint}
                      onslide<1>
                      begin{minted}{c++}
                      ...
                      end{minted}

                      onslide<2>
                      begin{minted}{c++}
                      ...
                      end{minted}
                      end{overprint}

                      end{frame}






                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Apr 12 '12 at 0:12









                      VZ.VZ.

                      17113




                      17113























                          2














                          I used something similar to what Konrad Rudolph suggested, I used onslide<n> before the minted block (actually #+begin_src in emacs' orgmode). It does not require curly brackets around the block.






                          share|improve this answer




























                            2














                            I used something similar to what Konrad Rudolph suggested, I used onslide<n> before the minted block (actually #+begin_src in emacs' orgmode). It does not require curly brackets around the block.






                            share|improve this answer


























                              2












                              2








                              2







                              I used something similar to what Konrad Rudolph suggested, I used onslide<n> before the minted block (actually #+begin_src in emacs' orgmode). It does not require curly brackets around the block.






                              share|improve this answer













                              I used something similar to what Konrad Rudolph suggested, I used onslide<n> before the minted block (actually #+begin_src in emacs' orgmode). It does not require curly brackets around the block.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Jan 25 '12 at 20:49









                              mltmlt

                              394212




                              394212























                                  1














                                  I can add that @VZ.'s solution also works if you want to "single-step" some code (in my case, C code with pointers) together with illustrations using tikzpicture. The "obvious" solution did not work, neither did using escapeinside due to a bug in pygments (see https://github.com/gpoore/minted/issues/70). In the solution below, highlightlines is used to highlight the current instruction. Too bad the actual C code need to be duplicate - but hey, it works!



                                  documentclass{beamer}
                                  usepackage{minted}
                                  usepackage{tikz}
                                  begin{document}
                                  begin{frame}[fragile]
                                  frametitle{Foo}
                                  begin{overprint}
                                  onslide<1>
                                  begin{minted}[linenos,highlightlines={3}]{c}
                                  int main(void) {
                                  char *p;
                                  p=(char *)malloc(5);
                                  /* do stuff */
                                  p=(char *)malloc(7);
                                  free(p);
                                  return 0;
                                  }
                                  end{minted}
                                  onslide<2>
                                  begin{minted}[linenos,highlightlines={5}]{c}
                                  int main(void) {
                                  char *p;
                                  p=(char *)malloc(5);
                                  /* do stuff */
                                  p=(char *)malloc(7);
                                  free(p);
                                  return 0;
                                  }
                                  end{minted}
                                  end{overprint}
                                  begin{tikzpicture}
                                  node<1->[rectangle,draw] (p) {p};
                                  node<1->[rectangle,draw,right of=p] (q1) {q1};
                                  draw<1>[->] (p) -- (q1);
                                  uncover<2->{node[rectangle,draw,below right of=p] (q2) {q2};};
                                  draw<2->[->] (p) -- (q2);
                                  end{tikzpicture}
                                  end{frame}
                                  end{document}





                                  share|improve this answer






























                                    1














                                    I can add that @VZ.'s solution also works if you want to "single-step" some code (in my case, C code with pointers) together with illustrations using tikzpicture. The "obvious" solution did not work, neither did using escapeinside due to a bug in pygments (see https://github.com/gpoore/minted/issues/70). In the solution below, highlightlines is used to highlight the current instruction. Too bad the actual C code need to be duplicate - but hey, it works!



                                    documentclass{beamer}
                                    usepackage{minted}
                                    usepackage{tikz}
                                    begin{document}
                                    begin{frame}[fragile]
                                    frametitle{Foo}
                                    begin{overprint}
                                    onslide<1>
                                    begin{minted}[linenos,highlightlines={3}]{c}
                                    int main(void) {
                                    char *p;
                                    p=(char *)malloc(5);
                                    /* do stuff */
                                    p=(char *)malloc(7);
                                    free(p);
                                    return 0;
                                    }
                                    end{minted}
                                    onslide<2>
                                    begin{minted}[linenos,highlightlines={5}]{c}
                                    int main(void) {
                                    char *p;
                                    p=(char *)malloc(5);
                                    /* do stuff */
                                    p=(char *)malloc(7);
                                    free(p);
                                    return 0;
                                    }
                                    end{minted}
                                    end{overprint}
                                    begin{tikzpicture}
                                    node<1->[rectangle,draw] (p) {p};
                                    node<1->[rectangle,draw,right of=p] (q1) {q1};
                                    draw<1>[->] (p) -- (q1);
                                    uncover<2->{node[rectangle,draw,below right of=p] (q2) {q2};};
                                    draw<2->[->] (p) -- (q2);
                                    end{tikzpicture}
                                    end{frame}
                                    end{document}





                                    share|improve this answer




























                                      1












                                      1








                                      1







                                      I can add that @VZ.'s solution also works if you want to "single-step" some code (in my case, C code with pointers) together with illustrations using tikzpicture. The "obvious" solution did not work, neither did using escapeinside due to a bug in pygments (see https://github.com/gpoore/minted/issues/70). In the solution below, highlightlines is used to highlight the current instruction. Too bad the actual C code need to be duplicate - but hey, it works!



                                      documentclass{beamer}
                                      usepackage{minted}
                                      usepackage{tikz}
                                      begin{document}
                                      begin{frame}[fragile]
                                      frametitle{Foo}
                                      begin{overprint}
                                      onslide<1>
                                      begin{minted}[linenos,highlightlines={3}]{c}
                                      int main(void) {
                                      char *p;
                                      p=(char *)malloc(5);
                                      /* do stuff */
                                      p=(char *)malloc(7);
                                      free(p);
                                      return 0;
                                      }
                                      end{minted}
                                      onslide<2>
                                      begin{minted}[linenos,highlightlines={5}]{c}
                                      int main(void) {
                                      char *p;
                                      p=(char *)malloc(5);
                                      /* do stuff */
                                      p=(char *)malloc(7);
                                      free(p);
                                      return 0;
                                      }
                                      end{minted}
                                      end{overprint}
                                      begin{tikzpicture}
                                      node<1->[rectangle,draw] (p) {p};
                                      node<1->[rectangle,draw,right of=p] (q1) {q1};
                                      draw<1>[->] (p) -- (q1);
                                      uncover<2->{node[rectangle,draw,below right of=p] (q2) {q2};};
                                      draw<2->[->] (p) -- (q2);
                                      end{tikzpicture}
                                      end{frame}
                                      end{document}





                                      share|improve this answer















                                      I can add that @VZ.'s solution also works if you want to "single-step" some code (in my case, C code with pointers) together with illustrations using tikzpicture. The "obvious" solution did not work, neither did using escapeinside due to a bug in pygments (see https://github.com/gpoore/minted/issues/70). In the solution below, highlightlines is used to highlight the current instruction. Too bad the actual C code need to be duplicate - but hey, it works!



                                      documentclass{beamer}
                                      usepackage{minted}
                                      usepackage{tikz}
                                      begin{document}
                                      begin{frame}[fragile]
                                      frametitle{Foo}
                                      begin{overprint}
                                      onslide<1>
                                      begin{minted}[linenos,highlightlines={3}]{c}
                                      int main(void) {
                                      char *p;
                                      p=(char *)malloc(5);
                                      /* do stuff */
                                      p=(char *)malloc(7);
                                      free(p);
                                      return 0;
                                      }
                                      end{minted}
                                      onslide<2>
                                      begin{minted}[linenos,highlightlines={5}]{c}
                                      int main(void) {
                                      char *p;
                                      p=(char *)malloc(5);
                                      /* do stuff */
                                      p=(char *)malloc(7);
                                      free(p);
                                      return 0;
                                      }
                                      end{minted}
                                      end{overprint}
                                      begin{tikzpicture}
                                      node<1->[rectangle,draw] (p) {p};
                                      node<1->[rectangle,draw,right of=p] (q1) {q1};
                                      draw<1>[->] (p) -- (q1);
                                      uncover<2->{node[rectangle,draw,below right of=p] (q2) {q2};};
                                      draw<2->[->] (p) -- (q2);
                                      end{tikzpicture}
                                      end{frame}
                                      end{document}






                                      share|improve this answer














                                      share|improve this answer



                                      share|improve this answer








                                      edited Jan 22 '17 at 13:38









                                      Johannes_B

                                      20.9k350200




                                      20.9k350200










                                      answered Jan 22 '17 at 13:32









                                      Niclas BörlinNiclas Börlin

                                      1968




                                      1968























                                          0














                                          The following worked for me: (I'm using Pygments 1.5 which is pre-release at the moment.)



                                          begin{frame}[fragile]
                                          frametitle{...}

                                          begin{minted}{haskell}
                                          data C a = ...
                                          end{minted}

                                          begin{minted}{c++}
                                          template<typename T> class C {...};
                                          end{minted}

                                          begin{minted}{scala}
                                          class C[T] {...};
                                          end{minted}
                                          end{frame}


                                          The fragile keyword is in fact what does the trick for me. (Note its use after begin{frame}.)






                                          share|improve this answer



















                                          • 8





                                            Don't see any overlays in your code.

                                            – Alexander Gladysh
                                            Dec 14 '11 at 5:47
















                                          0














                                          The following worked for me: (I'm using Pygments 1.5 which is pre-release at the moment.)



                                          begin{frame}[fragile]
                                          frametitle{...}

                                          begin{minted}{haskell}
                                          data C a = ...
                                          end{minted}

                                          begin{minted}{c++}
                                          template<typename T> class C {...};
                                          end{minted}

                                          begin{minted}{scala}
                                          class C[T] {...};
                                          end{minted}
                                          end{frame}


                                          The fragile keyword is in fact what does the trick for me. (Note its use after begin{frame}.)






                                          share|improve this answer



















                                          • 8





                                            Don't see any overlays in your code.

                                            – Alexander Gladysh
                                            Dec 14 '11 at 5:47














                                          0












                                          0








                                          0







                                          The following worked for me: (I'm using Pygments 1.5 which is pre-release at the moment.)



                                          begin{frame}[fragile]
                                          frametitle{...}

                                          begin{minted}{haskell}
                                          data C a = ...
                                          end{minted}

                                          begin{minted}{c++}
                                          template<typename T> class C {...};
                                          end{minted}

                                          begin{minted}{scala}
                                          class C[T] {...};
                                          end{minted}
                                          end{frame}


                                          The fragile keyword is in fact what does the trick for me. (Note its use after begin{frame}.)






                                          share|improve this answer













                                          The following worked for me: (I'm using Pygments 1.5 which is pre-release at the moment.)



                                          begin{frame}[fragile]
                                          frametitle{...}

                                          begin{minted}{haskell}
                                          data C a = ...
                                          end{minted}

                                          begin{minted}{c++}
                                          template<typename T> class C {...};
                                          end{minted}

                                          begin{minted}{scala}
                                          class C[T] {...};
                                          end{minted}
                                          end{frame}


                                          The fragile keyword is in fact what does the trick for me. (Note its use after begin{frame}.)







                                          share|improve this answer












                                          share|improve this answer



                                          share|improve this answer










                                          answered Dec 12 '11 at 21:33









                                          HosseinHossein

                                          173




                                          173








                                          • 8





                                            Don't see any overlays in your code.

                                            – Alexander Gladysh
                                            Dec 14 '11 at 5:47














                                          • 8





                                            Don't see any overlays in your code.

                                            – Alexander Gladysh
                                            Dec 14 '11 at 5:47








                                          8




                                          8





                                          Don't see any overlays in your code.

                                          – Alexander Gladysh
                                          Dec 14 '11 at 5:47





                                          Don't see any overlays in your code.

                                          – Alexander Gladysh
                                          Dec 14 '11 at 5:47











                                          0














                                          You cannot put a minted environment inside only or uncover, but you can use it inside minted environments. As usual, you still need the fragile option for frame. Here's an example (where code is a minted environment).



                                          newminted[code]{scala}{}
                                          begin{frame}[fragile]
                                          begin{code}
                                          snippet1
                                          end{code}
                                          begin{onlyenv}<2>
                                          begin{code}
                                          snippet2
                                          end{code}
                                          end{onlyenv}
                                          note[item]{M}
                                          end{frame}





                                          share|improve this answer




























                                            0














                                            You cannot put a minted environment inside only or uncover, but you can use it inside minted environments. As usual, you still need the fragile option for frame. Here's an example (where code is a minted environment).



                                            newminted[code]{scala}{}
                                            begin{frame}[fragile]
                                            begin{code}
                                            snippet1
                                            end{code}
                                            begin{onlyenv}<2>
                                            begin{code}
                                            snippet2
                                            end{code}
                                            end{onlyenv}
                                            note[item]{M}
                                            end{frame}





                                            share|improve this answer


























                                              0












                                              0








                                              0







                                              You cannot put a minted environment inside only or uncover, but you can use it inside minted environments. As usual, you still need the fragile option for frame. Here's an example (where code is a minted environment).



                                              newminted[code]{scala}{}
                                              begin{frame}[fragile]
                                              begin{code}
                                              snippet1
                                              end{code}
                                              begin{onlyenv}<2>
                                              begin{code}
                                              snippet2
                                              end{code}
                                              end{onlyenv}
                                              note[item]{M}
                                              end{frame}





                                              share|improve this answer













                                              You cannot put a minted environment inside only or uncover, but you can use it inside minted environments. As usual, you still need the fragile option for frame. Here's an example (where code is a minted environment).



                                              newminted[code]{scala}{}
                                              begin{frame}[fragile]
                                              begin{code}
                                              snippet1
                                              end{code}
                                              begin{onlyenv}<2>
                                              begin{code}
                                              snippet2
                                              end{code}
                                              end{onlyenv}
                                              note[item]{M}
                                              end{frame}






                                              share|improve this answer












                                              share|improve this answer



                                              share|improve this answer










                                              answered 30 mins ago









                                              BlaisorbladeBlaisorblade

                                              311318




                                              311318






























                                                  draft saved

                                                  draft discarded




















































                                                  Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                                                  • Please be sure to answer the question. Provide details and share your research!

                                                  But avoid



                                                  • Asking for help, clarification, or responding to other answers.

                                                  • Making statements based on opinion; back them up with references or personal experience.


                                                  To learn more, see our tips on writing great answers.




                                                  draft saved


                                                  draft discarded














                                                  StackExchange.ready(
                                                  function () {
                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f26917%2fbeamer-vs-minted-overlays%23new-answer', 'question_page');
                                                  }
                                                  );

                                                  Post as a guest















                                                  Required, but never shown





















































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown

































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown







                                                  Popular posts from this blog

                                                  Futebolista

                                                  F# list compare

                                                  Jornalista