38

There is now 4 hours that I'm Googling to found a solution to my problem but it's still impossible!

Here is the situation: I have some frames in a presentation using the Warsaw theme, on the first one I wanted to remove both headline and footline so I use the \begin{frame}[plain], but I want to, for the next frame, keep the footline but only hide the headline.

I tried the following:

{
\setbeamertemplate{headline}{} %or \setbeamertemplate{headline}[default]
\begin{frame}{Sommaire}
    \tableofcontents
\end{frame}
}

But, although the content of the headline is removed, it keeps the space blank (as it is used, but not available for my content). So, there is a white space below my frame title... (Table of Contents).

I don't want to have the plan of my presentation in the header here as it is a frame showing the plan ...

Is there anyone here who could help me?

3
  • Just to add element to my question (and current research...), when I use the \setbeamertemplate{headline}[default] before the \begin{document}, the "white space" is not here on all the frames. But none of the frames have the headline. And here, I want to keep the headline on all the frames except the ones I choose (table of contents here, as the title page is on plain format). Thanks
    – XaF
    Feb 18, 2012 at 22:46
  • The reason why using \setbeamertemplate{headline}[default] before \begin{document} works is that the relevant lengths like \headheight, \textheight, ... are calculated once (with \beamer@calculateheadfoot) at the beginning of the document. Anyway, that's a nice solution you found! :-)
    – diabonas
    Feb 19, 2012 at 15:03
  • This post is rather old, but in case someone else is facing this problem using beamer. You can use \vskip-20ex to remove spaces just after frame starts as suggested here tex.stackexchange.com/questions/56946/… Feb 5, 2014 at 17:51

2 Answers 2

43

Ok, after more investigation (in the beamer sources :)), I have found the solution. For those who will search like me in the future, here it is in a simple small example :

{ % to delimit a block (we only want to remove the header for this frame)
\makeatletter % to change template
    \setbeamertemplate{headline}[default] % not mandatory, but I though it was better to set it blank
    \def\beamer@entrycode{\vspace*{-\headheight}} % here is the part we are interested in :)
\makeatother
\begin{frame}{Table of contents} % and our simple frame
    \tableofcontents
\end{frame}
}

It is also possible to define an environment to be able to use it more easily. To do so, use this part of code before the \begin{document} :

\makeatletter
    \newenvironment{withoutheadline}{
        \setbeamertemplate{headline}[default]
        \def\beamer@entrycode{\vspace*{-\headheight}}
    }{}
\makeatother

And for your frame :

\begin{withoutheadline}
    \begin{frame}{Table of contents} % and our simple frame
        \tableofcontents
    \end{frame}
\end{withoutheadline}

Hope this will help :)

Enjoy!

4
  • 2
    How can this be changed, so that only the text (section information) is removed, i.e. the colored bar remains but no information is presented in it?
    – MLC
    May 23, 2015 at 12:47
  • If you want to remove the heading in several consecutive frames, or in the entire document, see the answer by den2042. Dec 20, 2016 at 18:32
  • Thanks! And to make it a template: \defbeamertemplate{headline}{noheadline}{}[action]{\def\beamer@entrycode{\vspace*{-\headheight}}}. To be used as: \setbeamertemplate{headline}[noheadline].
    – paime
    May 24, 2021 at 19:03
  • In my case \headheight doesn't remove headline height exactly, it removes a little bit more. Jul 31 at 19:43
5
\makeatletter
\newenvironment{noheadline}{
    \setbeamertemplate{headline}{}
    \addtobeamertemplate{frametitle}{\vspace*{-0.9\baselineskip}}{}
}{}
\makeatother

With this little modification you can use noheadline environment for several slides together.

\begin{noheadline}
\begin{frame}{Table of contents} % and our simple frame
    \tableofcontents
\end{frame}

\begin{frame}{Table of contents 2} % and our simple frame
    \tableofcontents
\end{frame}
\end{noheadline}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .