Debian Codegraph @

texmf-dist/doc/latex/beamer/beamerug-workflow.tex

raw
1 % !TeX root = beameruserguide.tex
2 % Copyright 2003-2007 by Till Tantau
3 % Copyright 2010 by Vedran Mileti\'c
4 % Copyright 2011-2013,2015 by Vedran Mileti\'c, Joseph Wright
5 % Copyright 2021-2026 by Joseph Wright, samcarter
6 %
7 % This file may be distributed and/or modified
8 %
9 % 1. under the LaTeX Project Public License and/or
10 % 2. under the GNU Free Documentation License.
11 %
12 % See the file LICENSE.md for more details.
13
14 \section{Workflow For Creating a Beamer Presentation}
15 \label{section-workflow}
16
17 This section presents a possible workflow for creating a \beamer\ presentation and possibly a handout to go along with it. Technical questions are addressed, like which programs to call with which parameters.
18
19
20 \subsection{Step One: Setup the Files}
21
22 \beamernote
23 It is advisable that you create a folder for each presentation. Even though your presentation will usually reside in a single file, \TeX\ produces so many extra files that things can easily get very confusing otherwise. The folder's name should ideally start with the date of your talk in ISO format (like 2003-12-25 for a Christmas talk), followed by some reminder text of what the talk is all about. Putting the date at the front in this format causes your presentation folders to be listed nicely when you have several of them residing in one directory. If you use an extra directory for each presentation, you can call your main file |main.tex|.
24
25 To create an initial |main.tex| file for your talk, copy an existing file from the |beamer/doc/solutions| directory and adapt it to your needs. A list of possible \beamer\ solutions that contain templates for presentation \TeX-files can be found below.
26
27 If you wish your talk to reside in the same file as some different, non-presentation article version of your text, it is advisable to setup a more elaborate file scheme. See Section~\ref{section-article-version-workflow} for details.
28
29 \subsection{Step Two: Structure Your Presentation}
30
31 The next step is to fill the presentation file with |\section| and |\subsection| to create a preliminary outline. You'll find some hints on how to create a good outline in Section~\ref{section-structure-guidelines}.
32
33 Put |\section| and |\subsection| commands into the (more or less empty) main file. Do not create any frames until you have a first working version of a possible table of contents. The file might look like this:
34 \begin{verbatim}
35 \documentclass{beamer}
36 %% This is the file main.tex
37
38 \usetheme{Berlin}
39
40 \title{Example Presentation Created with the Beamer Package}
41 \author{Till Tantau}
42 \date{\today}
43
44 \begin{document}
45
46 \begin{frame}
47 \titlepage
48 \end{frame}
49
50
51 \section*{Outline}
52 \begin{frame}
53 \tableofcontents
54 \end{frame}
55
56 \section{Introduction}
57 \subsection{Overview of the Beamer Class}
58 \subsection{Overview of Similar Classes}
59
60 \section{Usage}
61 \subsection{...}
62 \subsection{...}
63
64 \section{Examples}
65 \subsection{...}
66 \subsection{...}
67
68 \begin{frame}
69 \end{frame} % to enforce entries in the table of contents
70
71 \end{document}
72 \end{verbatim}
73 The empty frame at the end (which should be deleted later) ensures that the sections and subsections are actually part of the table of contents. This frame is necessary since a |\section| or |\subsection| command following the last page of a document has no effect.
74
75
76 \subsection{Step Three: Creating a PDF or PostScript File}
77
78 \beamernote
79 Once a first version of the structure is finished, you should try to create a first PDF or PostScript file of your (still empty) talk to ensure that everything is working properly. This file will only contain the title page and the table of contents.
80
81 \subsubsection{Creating PDF}
82
83 \beamernote
84 To create a |PDF| version of this file, run the program |pdflatex| on |main.tex| at least twice. You need to run it twice, so that \TeX\ can create the table of contents. (It may even be necessary to run it more often since all sorts of auxiliary files are created.) In the following example, the greater-than-sign is the prompt.
85 \begin{verbatim}
86 > pdflatex main.tex
87 ... lots of output ...
88 > pdflatex main.tex
89 ... lots of output ...
90 \end{verbatim}
91 Alternatively, you can use |lualatex| or (not recommended) |xelatex| instead of |pdflatex| in above commands.
92
93 You can next use a program like the Acrobat Reader, |xpdf|, |evince| or |okular| to view the resulting presentation.
94 \begin{verbatim}
95 > acroread main.pdf
96 \end{verbatim}
97
98
99 \subsubsection{Creating PostScript}
100 \label{section-postscript}
101
102 \beamernote
103 To create a PostScript version, you should first ascertain that the \textsc{hyperref} package (which is automatically loaded by the \beamer\ class) uses the option |dvips| or some compatible option, see the documentation of the \textsc{hyperref} package for details. Whether this is the case depends on the contents of your local |hyperref.cfg| file. You can enforce the usage of this option by passing |dvips| or a compatible option to the \beamer\ class (write |\documentclass[dvips]{beamer}|), which will pass this option on to the \textsc{hyperref} package.
104
105 You can then run |latex| twice, followed by |dvips|.
106 \begin{verbatim}
107 > latex main.tex
108 ... lots of output ...
109 > latex main.tex
110 ... lots of output ...
111 > dvips -P pdf main.dvi
112 \end{verbatim}
113
114 The option (|-P pdf|) tells |dvips| to use Type~1 outline fonts instead of the usual Type~3 bitmap fonts. You may wish to omit this option if there is a problem with it.
115
116 You can convert a PostScript file to a pdf file using
117 \begin{verbatim}
118 > ps2pdf main.ps main.pdf
119 \end{verbatim}
120
121 \subsubsection{Ways of Improving Compilation Speed}
122 \label{section-speedup}
123
124 While working on your presentation, it may sometimes be useful to \TeX\ your |.tex| file quickly and have the presentation contain only the most important information. This is especially true if you have a slow machine. In this case, you can do several things to speed up the compilation. First, you can use the |draft| class option.
125
126 \begin{classoption}{draft}
127 Causes the headlines, footlines, and sidebars to be replaced by gray rectangles (their sizes are still computed, though). Many other packages, including |pgf| and |hyperref|, also ``speed up'' when this option is given.
128 \end{classoption}
129
130 Second, you can use the following command:
131
132 \begin{command}{{\includeonlyframes}\marg{frame label list}}
133 This command behaves a little bit like the |\includeonly| command: Only the frames mentioned in the list are included. All other frames are suppressed. Nevertheless, the section and subsection commands are still executed, so that you still have the correct navigation bars. By labeling the current frame as, say, |current| and then saying |\includeonlyframes{current}|, you can work on a single frame quickly.
134
135 The \meta{frame label list} is a comma-separated list (without spaces) of the names of frames that have been labeled. To label a frame, you must pass the option |label=|\meta{name} to the |\frame| command or |frame| environment.
136
137 \example
138 \begin{verbatim}
139 \includeonlyframes{example1,example3}
140
141 \begin{frame}[label=example1]
142 This frame will be included.
143 \end{frame}
144
145 \begin{frame}[label=example2]
146 This frame will not be included.
147 \end{frame}
148
149 \begin{frame}
150 This frame will not be included.
151 \end{frame}
152
153 \againframe{example1} % Will be included
154 \end{verbatim}
155 \end{command}
156
157
158 \subsection{Step Four: Create Frames}
159
160 Once the table of contents looks satisfactory, start creating frames for your presentation by adding |frame| environments. You'll find guidelines on what to put on a frame in Section~\ref{section-frame-guidelines}.
161
162
163 \subsection{Step Five: Test Your Presentation}
164
165 \emph{Always} test your presentation. For this, you should vocalize or subvocalize your talk in a quiet environment. Typically, this will show that your talk is too long. You should then remove parts of the presentation, such that it fits into the allotted time slot. Do \emph{not} attempt to talk faster in order to squeeze the talk into the given amount of time. You are almost sure to lose your audience this way.
166
167 Do not try to create the ``perfect'' presentation immediately. Rather, test and retest the talk and modify it as needed.
168
169
170 \subsection{Step Six: Create a Handout}
171
172 \subsubsection{Creating the Handout}
173
174 Once your talk is fixed, you can create a handout, if this seems appropriate. For this, you can use the class option |handout| as explained in Section~\ref{handout}. Typically, you might wish to put several handout slides on one page, see below on how to do this easily.
175
176 You may also wish to create an article version of your talk. An ``article version'' of your presentation is a normal \TeX\ text typeset using, for example, the document class |article| or perhaps |llncs| or a similar document class. The \beamer\ class offers facilities to have this version coexist with your presentation version in one file and to share code. Also, you can include slides of your presentation as figures in your article version. Details on how to setup the article version can be found in Section~\ref{section-article}.
177
178 \subsubsection{Printing the Handout}
179 \label{section-printing-version}
180
181 The easiest way to print a presentation is to use Acrobat Reader with the option ``expand small pages to paper size'' form the printer dialog enabled. This is necessary, because slides are by default only 128mm by 96mm large.
182
183 For the PostScript version and for printing multiple slides on a single page this simple approach does not work. In such cases you can use the |pgfpages| package, which works directly with |pdflatex|, |lualatex|, |xelatex| and |latex| plus |dvips|. Note however \emph{that this package destroys hyperlinks}. This is due to fundamental flaws in the \pdf-specification and it is not likely to change.
184
185 The |pgfpages| can do all sorts of tricks with pages. The most important one for printing \beamer\ slides is the following command:
186 \begin{verbatim}
187 \usepackage{pgfpages}
188 \pgfpagesuselayout{resize to}[a4paper,border shrink=5mm,landscape]
189 \end{verbatim}
190 This says ``Resize all pages to landscape A4 pages, no matter what their original size was, but shrink the pages by 5mm, so that there is a bit of a border around everything.'' Naturally, instead of |a4paper| you can also use |letterpaper| or any of the other standard paper sizes. For further options and details see the documentation of |pgfpages|.
191
192 The second thing you might wish to do is to put several slides on a single page. This can be done as follows:
193 \begin{verbatim}
194 \usepackage{pgfpages}
195 \pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm]
196 \end{verbatim}
197 This says ``Put two pages on one page and then resize everything so that it fits on A4 paper.'' Note that this time we do not need landscape as the resulting page is, after all, not in landscape mode.
198
199 Instead of |2 on 1| you can also use |4 on 1|, but then with |landscape| once more, and also |8 on 1| and even |16 on 1| to get a grand (though unreadable) overview.
200
201 If you put several slides on one page and if these slides normally have a white background, it may be useful to write the following in your preamble:
202 \begin{verbatim}
203 \mode<handout>{\setbeamercolor{background canvas}{bg=black!5}}
204 \end{verbatim}
205 This will cause the slides of the handout version to have a very light gray background. This makes it easy to discern the slides' border if several slides are put on one page.
206
207 %% If you wish each slide to completely fill a letter-sized page, use the
208 %% following commands instead:
209
210 %% \begin{verbatim}
211 %% > dvips -P pdf -tletter main.dvi -o main.temp.ps
212 %% > psnup -1 -W128mm -H96mm -pletter main.temp.ps main.ps
213 %% \end{verbatim}
214
215 %% For A4-sized paper, use:
216
217 %% \begin{verbatim}
218 %% > dvips -P pdf -ta4 main.dvi -o main.temp.ps
219 %% > psnup -1 -W128mm -H96mm -pa4 main.temp.ps main.ps
220 %% \end{verbatim}
221
222 %% In order to create a white margin around the whole page (which is sometimes
223 %% useful for printing), add the option |-m 1cm| to the options of
224 %% |psnup|.
225
226 %% To put two or four slides on one page, use |-2|, respectively
227 %% |-4| instead of |-1| as the first parameter for
228 %% |psnup|. In this case, you may wish to add the option
229 %% |-b 1cm| to add a bit of space around the individual slides. The same
230 %% trick as for the \pdf-version can be used to make the borders of
231 %% slides more pronounced in the handout version.