TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using beamer with Copenhagen theme. I want to use a logo in the right-most corner of all slides. I achieved this using textblock and addtobeamertemplate facilities.

My question is, when I add more sections to my presentation, the banner height increases. When the banner heights increases, I want my logo gets bigger too. So, I need to know the height (see added image) programmatically.

Is that possible?

First slide

share|improve this question
Please add a minimal working example (MWE) that helps other to help you. – jens_bo Nov 24 '12 at 6:36
up vote 2 down vote accepted

Here is a possible solution for this particular case. It completely redefines the headline to achieve the wanted effect. The headline is taken from the split outer theme. Note that subsections are not included, as your image shows, although they can be added with little effort.

Redefined header (to be inserted in the preamble):

  \multiply\@tempdimb by\beamer@sectionmax%
    \advance\@tempdimb by 1.125ex%
    \begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{section in head/foot}%
      \vbox to\@tempdimb{\vfil\insertsectionnavigation{.5\paperwidth}\vfil}%
    \begin{beamercolorbox}[wd=.5\paperwidth,ht=\@tempdimb]{subsection in head/foot}%
      \vbox to\@tempdimb{\vfil\hfill \includegraphics[height=0.8\@tempdimb]{logo.jpeg} \hspace{1mm}~\vfil}%

The height of the header is calculated from the total number of sections and stored in \@tempdimb. This height is used throughout the definition of the headline. In the code above the logo is included taking 80% of the height of the headline, so it will be automatically resized according to the total number of sections.

Example renderings

  • Two sections: image

  • Five sections: image5

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.