Beamer — presentation layout

LaTeX suitable not only for compiling all sorts of documentation, but also for typesetting high-quality presentations. Using the beamer package to create presentations, no way inferior to PowerPoint presentations or Impress.



the

topics of the presentation

so, in order to begin his presentation, we need to specify the class of the document:
\documentclass[10pt,pdf,hyperref={unicode}]{beamer}
Next — specify all the usual matejovskeho document options (encoding, transfers, additional packages, etc.).

The standard aspect ratio of the beamer — 4:3, so if you want to make a presentation for the projector with other proportions (e.g. 16:9), should be in the optional argument of the command \documentclass to specify aspectratio=169.

Next we should choose some topic of the document. These themes quite a lot (see the list in the directory themes/theme beamer, I have this directory /usr/share/texmf-dist/tex/latex/beamer/themes/theme/). This is done by the command \usetheme{theme}. As an example, I covered a few topics:
Antibes

Berlin

Boadilla

Darmstadt

Dresden

Frankfurt

Goettingen

Hannover

Montpellier

Pittsburgh

Singapore


Image I generated from file-blank with a simple function:

the
function runit(){ sed -e "s/%theme%/$1/" a.tex > b.tex &&pdflatex b.tex && pdftoppm -r 100 b.pdf >
b.ppm && convert b.ppm $1.png; }

Proposed topics quite a lot (but if something happens and you can create your own — more on that later). If you don't like the color scheme of specific themes, but like the subject, you can change the color scheme using the command \usecolortheme{dove}. The color scheme that you have in your install beamer, you can look in the directory themes/color. For example, if you want to print the slides to a printer, you can use the color scheme of dove:


In addition to color themes, the beamer allows you to choose "internal" and "external" themes. The command \useinnertheme{theme} gives the ability to change the appearance of some internal elements (e.g., bullets), and the command \useoutertheme{theme} — the design of the presentation elements (header and footer).

If our presentation is a series of flashing elements, it should be said: \setbeamercovered{transparent} to the inactive elements were at least a little visible.

Even more deep color setting of the beamer can be implemented by forcibly pointing out the color of individual elements by the command \setbeamercolor{item}{bg=cvet1,fg=cvet2}. Here "element" is the name of the element whose color we want to change (for example, "normal text" — plain text), "bg" — background color, fg — text color.

After we set up color schemes, you can still a little "pokoldovat" over the header and footer. For example, the content of the directory beamer/themes/outer you can understand what they need to do to add the desired form header or footer. If we want to put into the header of the first field full name of the author and a short organization's name in quotes, the second field is the full name of the presentation (if they have not too long), and the third is the date and slide number/number of slides, we need to add in the preamble of the document as follows:
the
\makeatletter
\defbeamertemplate*{footline}{my theme}{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.3\paperwidth,ht=2.25 ex,dp=1ex,center]{author in head/foot}%
\usebeamerfont{author in head/foot}%
\insertauthor~~\beamer@ifempty{\insertshortinstitute}{}{(\insertshortinstitute)}
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.5\paperwidth,ht=2.25 ex,dp=1ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\inserttitle
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.2\paperwidth,ht=2.25 ex,dp=1ex,right]{date in head/foot}%
\usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
\insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
\end{beamercolorbox}}%
}
\makeatother

Similarly we can change the header and field name of the slide. For example, to put in the upper left corner of the field with the name of our logo and then a title slide, override the template frametitle

the
\defbeamertemplate*{frametitle}{shadow theme}{%
\vskip-2pt\leavevmode%
\hbox to \paperwidth{%
\hbox to 1.5 em{\hskip -1.6 ex\vbox to 0pt{\vskip
-1.8 ex\includegraphics[width=1.5 em]{penguin.jpg}}}%
\begin{beamercolorbox}[wd=\paperwidth,ht=2ex,dp=3pt,left]{title in head/foot}%
\ \insertframetitle
\end{beamercolorbox}}
}

The result is:


If necessary, you can allocate a block with specified us color:

the
\begin{colormixin}{color}
block color "color"
\end{colormixin}

The parameter "color" may be already defined (by analogy with the colour boxes above) and specified by the user (including as a mixture of several colors). In order to take some color with opacity N (N—%), we write "N! color." Entry "cvet1!N! cvet2" mixes (100-N) parts color "cvet1" with N pieces of color "cvet2". The command \averagebackgroundcolor returns the current background color.

Besides color, you can also change the font. In the directory themes/font/ are "character themes" that can be used in the presentation. Change the "font" you can use the command \usefonttheme{font}. For example, if we want to use the default font (sans serif), but in formulas — serif, give the command:

the
\usefonttheme[onlymath]{serif}

If you want to change the slide background, use the command \usebackgroundtemplate inside which can be any matejovska of the user (including posting images). For example, we can put the background of the entire frame image:

the
\usebackgroundtemplate{\includegraphics[width=\paperwidth,height=\paperheight]{penguin.jpg}}



the

Basic details


Now on to filling in the common fields of the presentation. This can also be done in the document preamble. Most of the commands to set the values of fields have optional arguments — short description of this field (this is the short designation is usually placed in the footer, so it makes sense to fill it). Some of the fields — standard matejovska: \title (presentation title), \author — the author, \date — date; and the part — specific: \institute — an organization of \subtitle — subtitle \logo — the logo of the organization (some presentation styles place logo on their own, but in some it is not — it must be borne in mind).

In addition, in the preamble you can specify the command \AtBeginSection which will display additional information at the beginning of each section of the presentation. For example, to display the contents with highlighting of the current section, we write:

the
\AtBeginSection{
\begin{frame}
\frametitle{Contents}
\tableofcontents[currentsection]
\end{frame}
}

Similarly, code executed at the beginning of each subsection, is determined by the command \AtBeginSubsection. Both commands have the optional argument — its contents will be placed before the section/subsection specified command with an asterisk (i.e., not within the table of contents and not numerouses).

the

Slides


Further, in the body of the document, we begin to arrange a presentation. Each frame is enclosed in a frame environment. If we want to put at the beginning of the presentation title and content, you can make separate frames standard commands \maketitle and \tableofcontents.

To mark logical blocks within each frame you can use the environment block with a required parameter — the name of the unit (since the environments theorem, lemma and example have the default English name, you can instead use the environment block, or to override the names of these blocks). A separate color is allocated exampleblock environment also has a required parameter block name. If you wish to pay special attention to some text, it can be placed inside the command \alert or \color{color}.
If your frame contains a verbatim environment or command \verb, you must add an optional parameter to the environment containsverbatim frame

In addition to the option containsverbatim, the environment frame has the following options:
    the
  • label=label — label of the slide (for the \ref command, and hyperlinks);
  • the
  • b, c, t is the vertical alignment (top, center default, on the bottom edge;
  • the
  • plain — slide without clearance;
  • the
  • shrink=number — if the contents of the frame "does not fit" on the screen, a beamer will try to scale it for at least a number of interest;
  • the
  • squeeze — another way to "cram" a lot of objects on the slide: vertical gaps are minimized,
  • the
  • fragile — says bimaru that the inside of the frame is "fragile" text (for example, the same verbatim environment.

By default, the slide is typeset in a single column, however, using the columns environment can break the slide into multiple columns. Each column within this environment is set by the command \column{width}. For example, to split the slide into two columns, do this:

the
\begin{frame}\frametitle{Title of frame}
\begin{columns}
\column{0.5\textwidth}
The content in the left column
\column{0.5\textwidth}
The contents of the right column
\end{columns}
\end{frame}


the

Overlays


It often happens that the information on the frame that you want to apply gradually, line by line, as narrative. That is, the contents of one frame is divided into several consecutive slides. For this purpose overlays — different types of transitions to new pieces of information within the same frame. Just note: in reality, each slide requires the layout of the new pages of the pdf file, however, when using the "competent" pdf-viewer, to pay attention to meta information, these transitions are invisible (and even can be inserted into presentation animated overlays).

To control the visibility of blocks on different slides within the same frame use the following commands (pay attention: the slide numbering starts with 1):
    the
  • \onslide<N>{text} is the text visible on the slide N, on the other it is marked by the color of inactive text;
  • the
  • \only<N>{text} — the text is visible only on the slide N, without taking up space on the other;
  • the
  • \visible<N>{text} — the text is present only on the slide N, and on the other is not visible, but occupies a place;
  • the
  • \invisible<N>{text} — N on the slide the text is not visible, but takes place, on the other it is present;
  • the
  • \alt<N>{text 1}{text 2} — on a slide of N will appear "text 1", the "text 2";
  • the
  • \temporal<N>{before}{text}{after} — on a slide of N will appear "text" in the previous slides — "before" subsequent "after";
  • the
  • \uncover<N>{text} — reverse the command \onslide;

All these commands operate only on sentences that contain one paragraph. If we need to allocate a block thus contains multiple paragraphs, you must enclose them inside the same environment: onlyenv, altenv, visibleenv, uncoverenv, invisibleenv.

In addition to these blocks, we can divide it into several slides items of itemize and enumerate environments: to do this immediately after the command \item it is necessary to insert a bill of materials that specifies the slide numbers on which to receive this information. On other slides it will not be visible, but will take place, however, if we want those hidden items are displayed by the color of inactive text into the preamble to indicate:

the
\setbeamercovered{transparent}

The specification of the slide numbers are enclosed in angle brackets and are of the form <a-b,c-d,e->: hyphenated lists the number ranges of slides, a comma — separated rooms. These specifications can be specified and selection commands, like \alert.

Another option to display blocks in turn — to specify after each block, the command \pause. This command works and at the end of the rows of tables and even in plain text. In short, this command instructs the split shot on the slides: leave on the previous slide all that is before her and everything after, move on to the next.
the

Animation and sound


If you will show your presentation using Adobe Reader or another program able to play the files that the document contains hyperlinks that you can include in their presentation a video or audio file.

To enable video you must use the command

the
\includemovie[poster,mouse=true]{width}{height}{file}

To turn the sound on:

the
\sound[options]{poster}{file}

Options options: loop, repeat, palindrome, borderwidth, showcontrols, externalviewer, inlinesound (their essence is clear from the title).

The option "poster" defines what to display on the slide to start the sound or video file. If left blank, the file will be played automatically.

Please note that the introduction to the presentation of media files may need to manually connect the multimedia package (if the beamer won't let his "self").

You can use the media9 package to embed the media with it.

Sam beamer allows you to animate overlays a pdf: this frame is divided into N slides by changing the value of a user-defined variable (this may be a count or length). The command \animate apply animate the range of the slides. Changing a variable is done using the command \animatevalue{variable}{initial value}{final value}. I.e. a user defined variable on the range of numbers slides "range" uniformly changes from the value "initial value" to "end value".

To specify the type of animation overlays, you must use the command \transOVR<slides>[options], where OVR:
    the
  • blindshorizontal — slide sectioned vertical bars;
  • the
  • blindsvertical — a slide "are cut" by a horizontal band;
  • the
  • boxin — old slide "shrinks" to a point in the center of the screen;
  • the
  • boxout — the new slide is "stretched" from a point in the center.
  • the
  • dissolve — slide is replaced by mosaics;
  • the
  • glitter — mix dissolve wipe with;
  • the
  • splitverticalin "contracts" on the top and bottom;
  • the
  • splitverticalout "stretched" at the top and bottom;
  • the
  • wipe — the next slide "leaves" on the left.
"slides" is optional, indicating to what exactly the variations of this sequence within the slide apply transitions to. options — optional options: duration=seconds — time in transition; direction=degrees — the direction of the transition.

When you use the command \animate you need to set the display duration of each slide, for this we need to use the command \transduration{duration}.

Here is an example using animation tools beamer:

the
\newcount\ooo
\newdimen\offset
\begin{frame}
\animate<2-10>
\animatevalue<1-10>{\ooo}{100}{0}
\animatevalue<1-10>{\offset}{0cm}{5cm}
\begin{colormixin}{\the\ooo!averagebackgroundcolor}
\frametitle{Color slide}
fade
\hskip\offset\alert{and leaving!}
\end{colormixin}
\transduration{0.1}
\end{frame}

Here animation is used counter the "ooo" specifies the opacity of text, and the size of the "offset" specifies the offset of the phrase "and fly away!" on the word "fade". For nine of the ten slides of the values of these variables change, resulting in the opacity of the text changes from 0 to 100 in increments of 10, and the offset of the "flying" phrase is from 0 to 5 centimeters in increments of 5mm.

the

Other


Because the beamer machine connects the hyperref package you can insert into a document hyperlink. For example, at the end of the presentation, we can insert an optional slides, and inside — to make hyperlinks on them ("suddenly" ask — and you're right — again, and ACE from the sleeve). You can also make a hyperlink to an object (formula, etc.) inside the slide. The General principle is: the object on which we want to refer to, is labeled (the optional argument label=label surrounded by a frame or the command \label{tag} inside the frame), and the hyperlink is performed by the command \hyperlink{label}{link text}. In addition to text, you can insert a "button": \beamerbutton{text}. If the frame contains multiple slides, you can reference a specific slide of a frame: it should be specified in triangular brackets between the \label command and its argument[a] to the desired slide. Similarly, if we need to refer to an element with a specific slide of this frame, the first parameter ("label") immediately after the label to indicate the specification of the slide number. Labeling a hyperlink can be another and specific commands \beamergotobutton (in front of text icon-arrow), \beamerskipbutton (double arrow), \beamerreturnbutton (left arrow).
At the end of a decent presentation, you may want to place the bibliography. This is also possible: just place it on the slide in a known environment thebibliography or using bibtex.

When working with a projector and a screen, you can use the screen for the display prompts. To do this, we write

the
\setbeameroption{second mode text on second screen=[location]}

Here the optional parameter "location" says bimaru, where is the screen relative to the projector (top, bottom, left, right; default is right). "Option typeset second" encirclement frame bimaru will say that the inside of the frame are slides whose content should be displayed on the second screen. What you need to show there, declared the specification "only: the number of the slide". For example,

the
\setbeameroption{second mode text on second screen}
\begin{frame}[typeset second]
This text will appear on both screens.
\only<second>{This is just to the right}
\only<second:0>{left}
\end{frame}

Explanations and translations can also be displayed on two screens: on the one hand a single text, and with another — another. Define the command \twoscreen, the argument of which is separated with a vertical bar: everything on the left appears on the left monitor on the right is on the right.

the
\setbeameroption{second mode text on second screen}
\makeatletter
\def\twoscreen#1{\tw@scr#1\relax}
\long\def\tw@scr#1|#2\relax{\alt<second>{#2}{#1}}
\makeatother
...
\begin{document}
\begin{frame}[typeset second]
\frametitle{\twoscreen{Title of the frame| and here is our tip}}
\begin{itemize}
\item<1-> \twoscreen{Times|Hint about the paragraph}.
\item<2-> \twoscreen{the Two|the Hint about the paragraph}.
\item<3-> \twoscreen{Three|the Hint about the paragraph}.
\end{itemize}
\end{frame}

All the rest of what I said here can be found in user guide. And download the most recent version of — here.

PS here's a example to lift the spirit: after all, the beamer is not so complicated. But result + videos.
Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

Briefly on how to make your Qt geoservice plugin

Database replication PostgreSQL-based SymmetricDS

Yandex.Widget + adjustIFrameHeight + MooTools