Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm wondering how to change the vertical position of the text in a frametitle? Take for instance this frametitle:

enter image description here

I'd like to place the text, in this case "Introduction", a bit higher such that it is exactly in the vertical center.

\documentclass{beamer}
\usepackage{textpos}
\usepackage{tikz}

%remove navigation symbols
\setbeamertemplate{navigation symbols}{}

\definecolor{TUeRed}{RGB}{170,0,0}
\definecolor{TUeBlue}{RGB}{0,68,170}

\addtobeamertemplate{frametitle}{}{% 
\begin{textblock*}{100mm}(.95\textwidth,-1cm) \tikz {\fill[white] (0,0) -- %
(2cm,0) -- (2cm,1.1cm) -- (0.5cm,1.1cm) -- cycle;\node[TUeBlue] at %
(0.8cm,0.5cm) {\normalsize\insertpagenumber};} \end{textblock*} }

\setbeamercolor{frametitle}{bg=TUeRed}
\setbeamercolor{frametitle}{fg=white}

\begin{document}

\begin{frame}
\frametitle{Introduction}
Some text
\end{frame}

\end{document} 

[Edit] Changed the LaTeX code, thanks @Percusse!

share|improve this question
    
As new user without image posting privileges simply include the image as normal and remove the ! in front of it to turn it into a link. A moderator or another user with edit privileges can then reinsert the ! to turn it into an image again. –  Tobi Mar 20 '12 at 10:51
    
Thanks for the editing :) –  Ailurus Mar 20 '12 at 11:28
    
Can you put a working example with two slides? I don't know where to obtain the textblock environment. –  percusse Mar 20 '12 at 12:04
    
Which beamer theme are you using? Please add to your question a complete, minimal example (with only those relevant settings) of your document settings. –  Gonzalo Medina Mar 20 '12 at 12:04
3  
A look into the beamer sources (beamerouterthemedefault.sty, ll. 140-160) shows that the off-centering of the frame title is caused by inserted \struts (l. 150). If they were removed, the frame title would be exactly vertically centered. I strongly advise you, however, not to do that - different frame titles with different heights would wiggle around vertically, which would look rather horrible in a presentation! –  diabonas Mar 26 '12 at 11:16
show 8 more comments

1 Answer 1

up vote 7 down vote accepted

A look into the beamer sources (beamerouterthemedefault.sty, ll. 140-160) shows that the off-centering of the frame title is caused by inserted \struts (l. 150). If they were removed, the frame title would be exactly vertically centered. I strongly advise you, however, not to do that - it would either cause the height of the colored frame title box to change for different frame titles, or the title would wiggle around vertically (if you set the box to a fixed height). Both would look rather horrible in a presentation...

If you feel that all frame titles are a little too low and you want to raise them just a tiny bit, you can try something like

\addtobeamertemplate{frametitle}{\vskip-0.5ex}{}
share|improve this answer
add comment

Your Answer

 
discard

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.