Document ClassesFrame numbers in Beamer, Dresden theme

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
midan
Posts: 5
Joined: Thu Aug 14, 2008 10:38 pm

Frame numbers in Beamer, Dresden theme

Post by midan »

Hi,
I am using Beamer's Dresden for my presentation. I have two questions related to this theme:
1. This theme has a footline with two lines: top one with the authors' names and the bottom one with the title of the presentation. I would like to add the frame number and total number of frames (format m/n) flush right in the title line. (m is the current frame, n total) Tried many things, all failed :-(
2. The head and foot lines have two colored lines each with various texts in white. On the title frame, I would like to remove the white text and just keep the colored lines. If I use the [plain] option I loose also those colored lines. Suggestions?
Thanks a lot,
MI

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Frame numbers in Beamer, Dresden theme

Post by Stefan Kottwitz »

Hi Midan,

welcome to the board!
You could use another theme that supports the display of frame numbers inside the foot line, like Boadilla, Madrid, AnnArbor, CambridgeUS, Pittsburgh or Rochester. If you really want to use the Dresden theme for your presentation I could show you a hack by redefining \insertshorttitle.

Concerning this and your other question it would be useful if you provide a minimal working example. Without a piece of working code readers could answer in the abstract or may be forced to create a compilable example by themselves following your description. I know beamer and the Dresden theme but don't like to post untested code, and instead of creating test examples by myself I'm looking at other forum posts containing concrete code in the meanwhile.

Stefan
LaTeX.org admin
midan
Posts: 5
Joined: Thu Aug 14, 2008 10:38 pm

Frame numbers in Beamer, Dresden theme

Post by midan »

Hello Stefan and thanks for the prompt reply.

1. I wouldn't mind redefining \insertshorttitle.

2. Here is a peace of code (trivial is it can be):

Code: Select all

\documentclass[t]{beamer}
\usepackage{graphicx}
\usetheme[compress]{Dresden}
\usefonttheme{professionalfonts}
\title{Example of using Beamer}
\author{John Smith Jr.}
\institute{UCLA}
\date{Honolulu, Hawaii, August 21, 2008}

\begin{document}

\begin{frame}
  % this is where I want to get rid of the while text in the head and foot lines
  % The option [plain] doesn't do the job
  \titlepage
\end{frame}

\section[Intro]{Introduction}
\subsection[]{}
\begin{frame}
Just some text
\end{frame}

\end{document}
The questions remain as before.
Thanks,
MI
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Frame numbers in Beamer, Dresden theme

Post by Stefan Kottwitz »

Hi Midan,

good code example, so I could test my idea and it works:

Code: Select all

\expandafter\def\expandafter\insertshorttitle\expandafter{%
  \insertshorttitle\hfill\insertframenumber\,/\,\inserttotalframenumber}
I've used the TeX primitive \expandafter, without that it could be a bit longer.

Concerning the other question I suggest a quick workaround. Here it's already late at night, even though there might be a more appropriate solution I don't have time to search. Try this, temporarily deactivating those text producing commands:

Code: Select all

\begingroup
\renewcommand*\insertshorttitle{}
\renewcommand*\insertshortauthor{}
\renewcommand*\insertshortinstitute{}
\renewcommand*\dohead{\rule{0em}{1.5em}}
\begin{frame}
  \titlepage
\end{frame}
\endgroup
After \endgroup those commands will work like before.

Stefan
LaTeX.org admin
midan
Posts: 5
Joined: Thu Aug 14, 2008 10:38 pm

Frame numbers in Beamer, Dresden theme

Post by midan »

Stefan,
Thank you SO much. All works as expected. You don't have to bother finding a cleaner solution for the second issue. I am not that particular about saving a few lined of code.
By the way, for the second issue, I changed the 1.5em to 1.45em - fits better. I tried to get the exact height by looking at the head definition in beamerouterthememiniframes.sty, where it uses something like (line 104 of v1.8):

Code: Select all

\vskip2pt\insertnavigation{\paperwidth}\vskip2pt
but I couldn't figure out how hight \insertnavigation really is.
Anyway, this is plenty good for me. Thanks again,
MI
Post Reply