1

I wonder how to use \pause in tikz with beamerarticle. My MWE is below which throws errors. I know this code will work fine if I don't load beamerarticle with beamer. But I need to load beamerarticle with beamer to make handouts. Any help will be highly appreciated. Thanks

\documentclass{beamer}
\usepackage{beamerarticle}
\usepackage{tikz}

\begin{document}

\begin{frame}[plain]
    \begin{tikzpicture}
    \draw[red, very thick] (0.35, -5.35) ellipse (0.6cm and 0.25cm);
    \pause
    \draw[red, very thick] (1.65, -5.35) ellipse (0.6cm and 0.25cm);
    \pause
    \draw[red, very thick] (3.7, -5.25) ellipse (0.9cm and 0.3cm);
    \end{tikzpicture}
\end{frame}

\end{document}

Edited

Would be sufficient for me if someone help me to disable \pause statements!!!

MYaseen208
  • 8,587
  • What are you trying to accomplish? What should your output look like, if you don't want the normal beamer or beamerarticle output? – Juri Robl Mar 05 '14 at 15:10
  • Thanks @JuriRobl for your interest in my problem. Actually I'm using LyX for my beamer slide. Then I use beamerarticle in LyX to make handouts. I want to stick with this protocol because I'm lazy user of LaTeX. Now I've tikz code in my beamer which works fine but the same code throws error with beamerarticle. If I delete \pause statement, every thing works fine. – MYaseen208 Mar 05 '14 at 15:17
  • If you compile it normally with pdflatex it doesn't work with beamer + beamerarticle, because they try to declare the same commands. Maybe LyX is doing something different internally? – Juri Robl Mar 05 '14 at 15:21
  • @JuriRobl I suspect LyX is compiling in non-stop mode. If you plough through the errors, you do get a PDF in the end (at least if you comment out the \pause commands - I didn't test with them uncommented). Clearly a Bad Idea. But I can see why it might appear to work if LyX doesn't make the complaints obvious and/or you don't pay much attention to them. (I don't know if LyX does this or not.) – cfr Mar 06 '14 at 01:46
  • If you really want to do what you say, put \gdef\pause{\relax} after \begin{document}. Note that doing this is a terrible idea and you will still get error after error after error. You should use one of the solutions provided by beamer specifically for making handouts. Really. But this will get you a 'flat' result. What else it will do I am not prepared to even guess. Or put \RequirePackage{beamerarticle} before \documentclass. This is just as ugly and will produce equally horrible errors but will also flatten things. – cfr Mar 15 '14 at 03:48
  • @cfr \let\pause=\relax may be better, as in contrast to \gdef it is not expanded on every call. It may save you some milliseconds. – Henri Menke Mar 15 '14 at 10:31
  • @HenriMenke You're right. I actually tried that first and then tried \gdef when it didn't work. But I think it was because I had it in the wrong place initially. – cfr Mar 15 '14 at 15:32
  • @cfr You can also \global\let\pause=\relax if you're unsure of grouping in a particular case. – Henri Menke Mar 15 '14 at 18:03
  • @HenriMenke Thanks. I actually tried that. But it didn't work when I placed it before \begin{document}. – cfr Mar 15 '14 at 18:56
  • 1
    @cfr Maybe \pause is defined in \AtBeginDocument or things like that. Then all efforts are futile. :-) (This is my last comment. I don't want to exaggerate the discussion.) – Henri Menke Mar 15 '14 at 19:28

2 Answers2

5

Don't load beamerarticle with beamer, but load it with an article-class (article, scrartcl, etc.).

beamerarticle is used to "convert" a presentation into a normal article. To do that it declares the same commands as beamer, that's why all commands are already declared and why you can't use both together.

Juri Robl
  • 4,763
5

As others have said, you cannot use beamerarticle with the beamer class. Compile interactively or look at the log/output to see the errors this produces. You can ignore these and get a PDF but things are going to go awry in subtle, and not so subtle, ways if you do that. Besides, there are better options:

Handout Mode

Here is the effect of using beamer's handout mode:

handout mode

That is, all slides on a frame are 'flattened' to produce a single snapshot of the completed frame.

The Code

\documentclass[handout]{beamer}
\usepackage{tikz}

\begin{document}

\begin{frame}[plain]
    \begin{tikzpicture}
    \draw[red, very thick] (0.35, -5.35) ellipse (0.6cm and 0.25cm);
    \pause
    \draw[red, very thick] (1.65, -5.35) ellipse (0.6cm and 0.25cm);
    \pause
    \draw[red, very thick] (3.7, -5.25) ellipse (0.9cm and 0.3cm);
    \end{tikzpicture}
\end{frame}

\end{document}

Article Mode

If you want to produce a more traditional handout which doesn't look like slides at all, you can use beamerarticle, as others have pointed out, with the class of your choice. For example:

article mode

The Code

\documentclass{article}
\usepackage{beamerarticle}
\usepackage{tikz}
\usepackage{kantlipsum}

\begin{document}

\mode<article>{
\section{This is only in the article}

\kant[1]
}

\section{In all modes}

\begin{frame}[plain]
    \begin{tikzpicture}
    \draw[red, very thick] (0.35, -5.35) ellipse (0.6cm and 0.25cm);
    \pause
    \draw[red, very thick] (1.65, -5.35) ellipse (0.6cm and 0.25cm);
    \pause
    \draw[red, very thick] (3.7, -5.25) ellipse (0.9cm and 0.3cm);
    \end{tikzpicture}
\end{frame}

\end{document}

Presentation Mode

Note that replacing the article class with beamer and commenting \usepackage{beamerarticle} puts you in 'regular' beamer mode with all the bells and whistles used in presentations. That is, essentially the same code:

% \documentclass{article}
\documentclass{beamer}
% \usepackage{beamerarticle}
\usepackage{tikz}
\usepackage{kantlipsum}


\begin{document}

\mode<article>{
\section{This is only in the article}

\kant[1]
}

\section{In all modes}

\begin{frame}[plain]
    \begin{tikzpicture}
    \draw[red, very thick] (0.35, -5.35) ellipse (0.6cm and 0.25cm);
    \pause
    \draw[red, very thick] (1.65, -5.35) ellipse (0.6cm and 0.25cm);
    \pause
    \draw[red, very thick] (3.7, -5.25) ellipse (0.9cm and 0.3cm);
    \end{tikzpicture}
\end{frame}

\end{document}

produces quite different output:

presentation mode

Handout Mode Revisited

One problem with the standard handout produced by beamer is that it is not very efficient in terms of paper. If your presentation has 10 or 20 slides, you do not really need 10 or 20 pages in your handout. The solution suggested in the manual is to use pgfpages which avoids the need for a separate source file. This allows you to display several frames on one page. Suppose, for example, you have four frames rather than one in green, blue and yellow as well as red. In conjunction with handout mode, pgfpages allows you to produce something like this:

handout mode revisited

The Code

% \documentclass{article}
\documentclass[handout]{beamer}
% \usepackage{beamerarticle}
\usepackage{tikz}
\usepackage{kantlipsum}
\usepackage{pgfpages}
\pgfpagesuselayout{4 on 1}[a4paper,border shrink=5mm,landscape]
\pgfpageslogicalpageoptions{1}{border code=\pgfstroke}
\pgfpageslogicalpageoptions{2}{border code=\pgfstroke}
\pgfpageslogicalpageoptions{3}{border code=\pgfstroke}
\pgfpageslogicalpageoptions{4}{border code=\pgfstroke}

\begin{document}

\mode<article>{
\section{This is only in the article}

\kant[1]
}

\section{In all modes}

\begin{frame}[plain]
    \begin{tikzpicture}
    \draw[red, very thick] (0.35, -5.35) ellipse (0.6cm and 0.25cm);
    \pause
    \draw[red, very thick] (1.65, -5.35) ellipse (0.6cm and 0.25cm);
    \pause
    \draw[red, very thick] (3.7, -5.25) ellipse (0.9cm and 0.3cm);
    \end{tikzpicture}
\end{frame}
\begin{frame}[plain]
    \begin{tikzpicture}
    \draw[blue, very thick] (0.35, -5.35) ellipse (0.6cm and 0.25cm);
    \pause
    \draw[blue, very thick] (1.65, -5.35) ellipse (0.6cm and 0.25cm);
    \pause
    \draw[blue, very thick] (3.7, -5.25) ellipse (0.9cm and 0.3cm);
    \end{tikzpicture}
\end{frame}
\begin{frame}[plain]
    \begin{tikzpicture}
    \draw[green, very thick] (0.35, -5.35) ellipse (0.6cm and 0.25cm);
    \pause
    \draw[green, very thick] (1.65, -5.35) ellipse (0.6cm and 0.25cm);
    \pause
    \draw[green, very thick] (3.7, -5.25) ellipse (0.9cm and 0.3cm);
    \end{tikzpicture}
\end{frame}
\begin{frame}[plain]
    \begin{tikzpicture}
    \draw[yellow, very thick] (0.35, -5.35) ellipse (0.6cm and 0.25cm);
    \pause
    \draw[yellow, very thick] (1.65, -5.35) ellipse (0.6cm and 0.25cm);
    \pause
    \draw[yellow, very thick] (3.7, -5.25) ellipse (0.9cm and 0.3cm);
    \end{tikzpicture}
\end{frame}
\end{document}

Other Options

There are other possibilities. For example, if you don't mind having an additional source file, you can use pdfpages rather than pgfpages to put multiple frames on a single page. (This is the option I tend to use most for handouts.)

Moreover, you can load a different theme to produce your handout e.g. one suitable for printing on a black-and-white printer or for photocopying.

cfr
  • 198,882