Setbeamercolor Bibliography Template

To do:

  • Add other packages for creating presentations.
  • Bonus: Add screenshots of the results.
  • Working with columns
  • Navigation — see here
  • Using sections & subsections

LaTeX can be used for creating presentations. There are several packages for the task, including the package.

The Beamer package[edit]

The beamer package is provided with most LaTeX distributions, but is also available from CTAN. If you use MikTeX, all you have to do is to include the beamer package and let LaTeX download all wanted packages automatically. The documentation explains the features in great detail. You can also have a look at the PracTex article Beamer by Example.[1]

The package also loads many useful packages including .

Introductory example[edit]

The beamer package is loaded by calling the class:

The usual header information may then be specified. Note that if you are compiling with XeTeX then you should use

\documentclass[xetex,mathserif,serif]{beamer}

Inside the environment, multiple environments specify the content to be put on each slide. The command specifies the title for each slide (see image):

\begin{document}\begin{frame}\frametitle{This is the first slide}%Content goes here\end{frame}\begin{frame}\frametitle{This is the second slide}\framesubtitle{A bit more information about this}%More content goes here\end{frame}% etc\end{document}

The usual environments (, , , etc.) may be used.

Inside frames, you can use environments like , , , ... Also, is possible to create the frontpage, if and are set.

Trick: Instead of using , you can also use .

For the actual talk, if you can compile it with then you could use a pdf reader with a fullscreen mode, such as Okular, Evince or Adobe Reader. If you want to navigate in your presentation, you can use the almost invisible links in the bottom right corner without leaving the fullscreen mode.

Document Structure[edit]

Title page and information[edit]

First, you give information about authors, titles and dates in the preamble.

\title[Crisis]% (optional, only for long titles){The Economics of Financial Crisis}\subtitle{Evidence from India}\author[Author, Anders]% (optional, for multiple authors){F.~Author\inst{1}\and S.~Anders\inst{2}}\institute[Universities Here and There]% (optional){\inst{1}% Institute of Computer Science\\ University Here \and\inst{2}% Institute of Theoretical Philosophy\\ University There }\date[KPT 2004]% (optional){Conference on Presentation Techniques, 2004}\subject{Computer Science}

Then, in the document, you add the title page :

Table of Contents[edit]

The table of contents, with the current section highlighted, is displayed by:

\begin{frame}\frametitle{Table of Contents}\tableofcontents[currentsection]\end{frame}

This can be done automatically at the beginning of each section using the following code in the preamble:

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

Or for subsections:

\AtBeginSubsection[]{\begin{frame}\frametitle{Table of Contents}\tableofcontents[currentsection,currentsubsection]\end{frame}}

Sections and subsections[edit]

As in all other LaTeX files, it is possible to structure the document using

\section[Section]{My section}

,

\subsection[Subsection]{My subsection}

and

\subsubsection[Subsubsection]{My subsubsection}

Those commands have to be put before and between frames. They will modify the Table of contents with the optional argument. The argument in brackets will be written on the slide, depending on the theme used.

References (Beamer)[edit]

Beamer does not officially support BibTeX. Instead bibliography items will need to be partly set "by hand" (see beameruserguide.pdf 3.12). The following example shows a references slide containing two entries:

\begin{frame}[allowframebreaks] \frametitle<presentation>{Further Reading}\begin{thebibliography}{10}\beamertemplatebookbibitems\bibitem{Autor1990} A.~Autor. \newblock{\em Introduction to Giving Presentations}. \newblock Klein-Verlag, 1990. \beamertemplatearticlebibitems\bibitem{Jemand2000} S.~Jemand. \newblock On this and that. \newblock{\em Journal of This and That}, 2(1):50--100, 2000. \end{thebibliography}\end{frame}

As the reference list grows, the reference slide will divide into two slides and so on, through use of the option. Individual items can be cited after adding an 'optional' label to the relevant stanza. The citation call is simply . Beamer also supports limited customization of the way references are presented (see the manual). Those who wish to use natbib, for example, with Beamer may need to troubleshoot both their document setup and the relevant BibTeX style file.

The different types of referenced work are indicated with a little symbol (e.g. a book, an article, etc.). The Symbol is set with the commands and . It is also possible to use directly, like so

\begin{frame}[allowframebreaks] \frametitle<presentation>{Further Reading}\begin{thebibliography}{10}\setbeamertemplate{bibliography item}[book] \bibitem{Autor1990} A.~Autor. \newblock{\em Introduction to Giving Presentations}. \newblock Klein-Verlag, 1990. \setbeamertemplate{bibliography item}[article] \bibitem{Jemand2000} S.~Jemand. \newblock On this and that. \newblock{\em Journal of This and That}, 2(1):50--100, 2000. \end{thebibliography}\end{frame}

Other possible types of bibliography items, besides and , include e.g. , and . It is also possible to have user defined bibliography items by including a graphic.

If one wants to have full references appear as foot notes, use the . For example, it is possible to use

\documentclass[10pt,handout,english]{beamer}\usepackage[english]{babel}\usepackage[backend=biber,style=numeric-comp,sorting=none]{biblatex}\addbibresource{biblio.bib}\begin{frame}\frametitle{Title} A reference~\footfullcite{ref_bib}, with ref_bib an item of the .bib file. \end{frame}

Style[edit]

Themes[edit]

The first solution is to use a built-in theme such as Warsaw, Berlin, etc. The second solution is to specify colors, inner themes and outer themes.

The Built-in solution[edit]

To the preamble you can add the following line:

to use the "Warsaw" theme. has several themes, many of which are named after cities (e.g. Frankfurt, Madrid, Berlin, etc.).

This Theme Matrix contains the various theme and color combinations included with . For more customizing options, have a look to the official documentation included in your distribution of , particularly the part Change the way it looks.

The full list of themes is:

  • AnnArbor
  • Antibes
  • Bergen
  • Berkeley
  • Berlin
  • Copenhagen
  • Darmstadt
  • Dresden
  • Frankfurt
  • Goettingen
  • Hannover
  • Ilmenau
  • JuanLesPins
  • Luebeck
  • Madrid
  • Malmoe
  • Marburg
  • Montpellier
  • PaloAlto
  • Pittsburgh
  • Rochester
  • Singapore
  • Szeged
  • Warsaw
  • boxes
  • default

Color themes, typically with animal names, can be specified with

The full list of color themes is:

  • default
  • albatross
  • beaver
  • beetle
  • crane
  • dolphin
  • dove
  • fly
  • lily
  • orchid
  • rose
  • seagull
  • seahorse
  • whale
  • wolverine
The do it yourself solution[edit]

First you can specify the outertheme. The outertheme defines the head and the footline of each slide.

\useoutertheme{infolines}

Here is a list of all available outer themes:

  • infolines
  • miniframes
  • shadow
  • sidebar
  • smoothbars
  • smoothtree
  • split
  • tree

Then you can add the innertheme:

\useinnertheme{rectangles}

Here is a list of all available inner themes:

  • rectangles
  • circles
  • inmargin
  • rounded

You can define the color of every element:

\setbeamercolor{alerted text}{fg=orange}\setbeamercolor{background canvas}{bg=white}\setbeamercolor{block body alerted}{bg=normal text.bg!90!black}\setbeamercolor{block body}{bg=normal text.bg!90!black}\setbeamercolor{block body example}{bg=normal text.bg!90!black}\setbeamercolor{block title alerted}{use={normal text,alerted text},fg=alerted text.fg!75!normal text.fg,bg=normal text.bg!75!black}\setbeamercolor{block title}{bg=blue}\setbeamercolor{block title example}{use={normal text,example text},fg=example text.fg!75!normal text.fg,bg=normal text.bg!75!black}\setbeamercolor{fine separation line}{}\setbeamercolor{frametitle}{fg=brown}\setbeamercolor{item projected}{fg=black}\setbeamercolor{normal text}{bg=black,fg=yellow}\setbeamercolor{palette sidebar primary}{use=normal text,fg=normal text.fg}\setbeamercolor{palette sidebar quaternary}{use=structure,fg=structure.fg}\setbeamercolor{palette sidebar secondary}{use=structure,fg=structure.fg}\setbeamercolor{palette sidebar tertiary}{use=normal text,fg=normal text.fg}\setbeamercolor{section in sidebar}{fg=brown}\setbeamercolor{section in sidebar shaded}{fg=grey}\setbeamercolor{separation line}{}\setbeamercolor{sidebar}{bg=red}\setbeamercolor{sidebar}{parent=palette primary}\setbeamercolor{structure}{bg=black, fg=green}\setbeamercolor{subsection in sidebar}{fg=brown}\setbeamercolor{subsection in sidebar shaded}{fg=grey}\setbeamercolor{title}{fg=brown}\setbeamercolor{titlelike}{fg=brown}

Colors can be defined as usual:

\definecolor{chocolate}{RGB}{33,33,33}

Block styles can also be defined:

\setbeamertemplate{blocks}[rounded][shadow=true] \setbeamertemplate{background canvas}[vertical shading][bottom=white,top=structure.fg!25] \setbeamertemplate{sidebar canvas left}[horizontal shading][left=white!40!black,right=black]

You can also suppress the navigation bar:

\beamertemplatenavigationsymbolsempty

Fonts[edit]

You may also change the fonts for particular elements. If you wanted the title of the presentation as rendered by to occur in a serif font instead of the default sanserif, you would use:

\setbeamerfont{title}{family=\rm}

You could take this a step further if you are using OpenType fonts with Xe(La)TeX and specify a serif font with increased size and oldstyle proportional alternate number glyphs:

\setbeamerfont{title}{family=\rm\addfontfeatures{Scale=1.18, Numbers={Lining, Proportional}}}
Math Fonts[edit]

The default settings for use a different set of math fonts than one would expect from creating a simple math article. One quick fix for this is to use at the beginning of the file the option

\documentclass[mathserif]{beamer}

Others have proposed to use the command

\usefonttheme[onlymath]{serif}

but it is not clear if this works for absolutely every math character.

Frames Options[edit]

The plain option. Sometimes you need to include a large figure or a large table and you don't want to have the bottom and the top off the slides. In that case, use the plain option:

If you want to include lots of text on a slide, use the shrink option.

The allowframebreaks option will auto-create new frames if there is too much content to be displayed on one.

\frame[allowframebreaks]{% ...}


Before using any verbatim environment (like ), you should pass the option to the environment, as verbatim environments need to be typeset differently. Usually, the form is usable (for details see the manual). Note that the option may not be used with commands since it expects to encounter a , which should be alone on a single line.

\begin{frame}[fragile] \frametitle{Source code}\begin{lstlisting}[caption=First C example] int main() { printf("Hello World!"); return 0; }\end{lstlisting}\end{frame}

Hyperlink navigation[edit]

Internal and external hyperlinks can be used in beamer to assist navigation. Clean looking buttons can also be added.

To do:

  • add information about
  • add information about and friends

By default the beamer class adds navigation buttons in the bottom right corner. To remove them one can place

\beamertemplatenavigationsymbolsempty

in the preamble.

Animations[edit]

The following is merely an introduction to the possibilities in beamer. Chapter 8 of the beamer manual provides much more detail, on many more features.

Making items appear on a slide is possible by simply using the statement:

\begin{frame}\frametitle{Some background} We start our discussion with some concepts. \pause The first concept we introduce originates with Erd\H os. \end{frame}

Text or figures after will display after one of the following events (which may vary between PDF viewers): pressing space, return or page down on the keyboard, or using the mouse to scroll down or click the next slide button. Pause can be used within etc.

Text animations[edit]

For text animations, for example in the itemize environment, it is possible to specify appearance and disappearance of text by using where a and b are the numbers of the events the item is to be displayed for (inclusive). For example:

\begin{itemize}\item This one is always shown \item<1-> The first time (i.e. as soon as the slide loads) \item<2-> The second time \item<1-> Also the first time \only<1-1> {This one is shown at the first time, but it will hide soon (on the next event after the slide loads).}\end{itemize}

A simpler approach for revealing one item per click is to use .

\begin{frame}\frametitle{`Hidden higher-order concepts?'}\begin{itemize}[<+->] \item The truths of arithmetic which are independent of PA in some sense themselves `{contain} essentially {\color{blue}{hidden higher-order}}, or infinitary, concepts'??? \item `Truths in the language of arithmetic which \ldots\item That suggests stronger version of Isaacson's thesis. \end{itemize}\end{frame}

In all these cases, pressing page up, scrolling up, or clicking the previous slide button in the navigation bar will backtrack through the sequence.

Handout mode[edit]

In beamer class, the default mode is presentation which makes the slides. However, you can work in a different mode that is called handout by setting this option when calling the class:

\documentclass[12pt,handout]{beamer}

This mode is useful to see each slide only one time with all its stuff on it, making any environments visible all at once (for instance, printable version). Nevertheless, this makes an issue when working with the command, because its purpose is to have only some text or figures at a time and not all of them together.

If you want to solve this, you can add a statement to specify precisely the behavior when dealing with commands in handout mode. Suppose you have a code like this

\only<1>{\includegraphics{pic1.eps}}\only<2>{\includegraphics{pic2.eps}}

These pictures being completely different, you want them both in the handout, but they cannot be both on the same slide since they are large. The solution is to add the handout statement to have the following:

\only<1| handout:1>{\includegraphics{pic1.eps}}\only<2| handout:2>{\includegraphics{pic2.eps}}

This will ensure the handout will make a slide for each picture.

Now imagine you still have your two pictures with the only statements, but the second one show the first one plus some other graphs and you don't need the first one to appear in the handout. You can thus precise the handout mode not to include some only commands by:

\only<1| handout:0>{\includegraphics{pic1.eps}}\only<2>{\includegraphics{pic2.eps}}

The command can also be used to hide frames, e.g.

\begin{frame}<handout:0>

or even, if you have written a frame that you don't want anymore but maybe you will need it later, you can write

\begin{frame}<0| handout:0>

and this will hide your slide in both modes. (The order matters. Don't put handout:0|beamer:0 or it won't work.)

A last word about the handout mode is about the notes. Actually, the full syntax for a frame is

\begin{frame} ... \end{frame}\note{...}\note{...} ...

and you can write your notes about a frame in the field note (many of them if needed). Using this, you can add an option to the class calling, either

\documentclass[12pt,handout,notes=only]{beamer}

or

\documentclass[12pt,handout,notes=show]{beamer}

The first one is useful when you make a presentation to have only the notes you need, while the second one could be given to those who have followed your presentation or those who missed it, for them to have both the slides with what you said.

Note that the 'handout' option in the \documentclass line suppress all the animations.

Important: the notes=only mode is literally doing only the notes. This means there will be no output file but the DVI. Thus it requires you to have run the compilation in another mode before. If you use separate files for a better distinction between the modes, you may need to copy the .aux file from the handout compilation with the slides (w/o the notes).

Columns and Blocks[edit]

There are two handy environments for structuring a slide: "blocks", which divide the slide (horizontally) into headed sections, and "columns" which divides a slide (vertically) into columns. Blocks and columns can be used inside each other.

Columns[edit]

Example

\begin{frame}{Example of columns 1}\begin{columns}[c] % the "c" option specifies center vertical alignment\column{.5\textwidth}% column designated by a command Contents of the first column \column{.5\textwidth} Contents split \\ into two lines \end{columns}\end{frame}\begin{frame}{Example of columns 2}\begin{columns}[T] % contents are top vertically aligned\begin{column}[T]{5cm}% each column can also be its own environment Contents of first column \\ split into two lines \end{column}\begin{column}[T]{5cm}% alternative top-align that's better for graphics\includegraphics[height=3cm]{graphic.png}\end{column}\end{columns}\end{frame}

Blocks[edit]

Enclosing text in the block environment creates a distinct, headed block of text (a blank heading can be used). This allows to visually distinguish parts of a slide easily. There are three basic types of block. Their formatting depends on the theme being used.

Simple

\begin{frame}\begin{block}{This is a Block} This is important information \end{block}\begin{alertblock}{This is an Alert block} This is an important alert \end{alertblock}\begin{exampleblock}{This is an Example block} This is an example \end{exampleblock}\end{frame}

PDF options[edit]

You can specify the default options of your PDF.[2]

\hypersetup{pdfstartview={Fit}}% fits the presentation to the window when first displayed

Numbering slides[edit]

It is possible to number slides using this snippet:

\insertframenumber/\inserttotalframenumber

However, this poses two problems for some presentation authors: the title slide is numbered as the first one, and the appendix or so-called "backup" (aka appendix, reserve) slides are included in the total count despite them not being intended to be public until a "hard" question is asked.[3] This is where two features come in:

  • Ability to reset the frames counter at any slide. For instance, this may be inserted at the title slide to avoid counting it:
\addtocounter{framenumber}{-1}

Or alternatively this:

\setcounter{framenumber}{0} or \setcounter{framenumber}{1}
  • The first of the above applies to section slides to avoid counting them.
  • This stuff works around the problem of counting the backup slides:
% (Thanks, David Gleich!)% All your regular slides% After your last numbered slide\appendix\newcounter{finalframe}\setcounter{finalframe}{\value{framenumber}}% Backup frames\setcounter{framenumber}{\value{finalframe}}\end{document}

The powerdot package[edit]

The powerdot package is an alternative to beamer. It is available from CTAN. The documentation explains the features in great detail.

The powerdot package is loaded by calling the class:

The usual header information may then be specified.

Inside the usual environment, multiple environments specify the content to be put on each slide.

\begin{document}\begin{slide}{This is the first slide}%Content goes here\end{slide}\begin{slide}{This is the second slide}%More content goes here\end{slide}% etc\end{document}

Simple presentations[edit]

The class is very powerful and provides lots of features. For a very simple presentation, a class based on can be used.

\documentclass[paper=160mm:90mm,fontsize=10pt,DIV=16]{scrartcl}\usepackage{lmodern}\pagestyle{empty}\renewcommand{\familydefault}{\sfdefault}\newenvironment{slide}[1]{\clearpage{\LARGE\bfseries#1\par}\vspace{\baselineskip}}{}\usepackage{enumitem}\setlist{noitemsep}\title{XeTaL}\author{Carl Capybara}\begin{document}\maketitle\begin{slide}{slide title} This is just some text \begin{itemize}\item Wombat \item Capybara \item Mara \end{itemize}\end{slide}\begin{slide}{Wombat title} This is just some different text \end{slide}\end{document}

References[edit]

Links[edit]

Contents

Have you ever been to Frankfurt? I’ve had the pleasure of visiting Frankfurt a few times, albeit usually just through the airport. It’s the first city where I stayed in a Doppelzimmer mit Frühstück (double room with breakfast). Frankfurt is also the name of a popular theme in the LaTeX document class Beamer, which is used for making presentations (not coincidentally, Beamer is the German word for projector).

Beamer has a nice selection of themes with different layouts, but one downside is that the themes don’t offer many choices in terms of color. There’s dark blue, light blue … the yellow one … some red. But mostly blue. This can get tiring after watching three talks in a row by presenters who made their slides the night before and went with a default color scheme.

Some institutions are fortunate to have their own (un)official Beamer theme with the institution’s colors. UBC’s ECE department did not, so my quest for color began last year to replace a default Beamer blue with … UBC blue (believe me, it’s a different blue). I didn’t want to tinker too much with the underpinnings of Beamer, but I found that the generally excellent official documentation lacked some direction about what color options I could change (beyond the basics). So, a colleague and I went exploring. This post explains two ways to change Beamer colors by setting up your own custom color scheme. The first method is very quick with . The second method takes a little bit of tinkering with , but ultimately gives you much more control.

Picking Beamer Colors

The first decision is to pick a color(s). I suggest defining two colors for variety, where one is your primary and one is your secondary. However, only one color is needed for the method. There are two ways to pick colors:

  • Choose from the list of known Beamer colors. By default, Beamer uses the package, so you can immediately use any of ‘s pre-defined colors. As of this writing, these colors are listed in Section 2.4 of the official documentation. For example, the list includes blue, red, green, yellow, etc. A list of 68 colors is available if you load with the option when you load Beamer ().
  • Define your own custom colors. Use the command to assign a custom name and then define the parameters for your color (such as RGB values). This is handy if you want to use a very specific color, as I did.

Change Beamer Colors Method 1:

The command can be used to load any of the default Beamer color themes (as displayed here). But this post is about not using the default color themes. You can use with any color you want by applying the color to the of the presentation.

Here is a minimal example. I’ve chosen to use the Madrid theme (sorry Frankfurt) with the outer theme (to add a header) and the inner theme (to replace the shiny default circles).

Here is how the PDF looks:

Pro: One line of LaTeX code and you’re done.

Con: The shading of the color is automatically modified for different parts of the presentation (i.e., lighter or darker), so you don’t have full control over how the color appears. In my case, some elements are dark enough to appear black.

Change Beamer Colors Method 2:

If you just want a break from the default color themes, then is sufficient. If you want to define exactly what colors are used, then a little more work is required (but not much). My goal was to use UBC’s official colors, so a better solution was needed.

A key find was Thierry Masson’s Beamer appearance cheat sheet. This document lists many of the properties that you can manipulate. Page 1 of the sheet lists things that you can color using . You can play around with it, but here is a quick method to color your entire presentation:

  1. Set the background color of ALL FOUR palettes to your primary color. Set the foreground color of each palette to your desired text color (most likely black or white).
  2. Set the color of elements that are not defined by the palettes. You can use your primary or secondary color. This might be the hardest step and could take some trial and error to catch everything. The most important one is (for bullets and numbers in lists). If you have a table of contents, then you will also want to set . Anything you don’t catch will appear in the default colour theme.
  3. (optional) Select some palette elements where you would like to see the secondary color and set the color for just those elements. For example, setting to the secondary color has a nice clean appearance in themes that use a header or footer. Why not set a whole palette to the secondary color? You can, but I’ve found that you can end up with some undesirable results in headers.

Here is the same example as above but now using :

And here is how the PDF looks:

Pro: Much more control over how your colors are used, and can be accomplished with less than 10 added lines of code (depending on how much you want to use your secondary color).

Con: Trial and error to catch elements that still use the default color scheme. One way to speed this up visually is to call  first to set everything to a color that has a strong contrast with the colors you want to use.

Summary

I recommend using these two methods to change Beamer colors as follows:

  • If your presentation starts in 10 minutes and you don’t want to look like you just finished your slides, use .
  • If you want to consistently display a desired color, whether for branding or any other reason, then use .

0 thoughts on “Setbeamercolor Bibliography Template”

    -->

Leave a Comment

Your email address will not be published. Required fields are marked *