4

Could someone please tell me how to get the page numbers to appear in the header line of the Berkeley theme?

Thanks

1
  • 1
    Where would you like it to be placed? Aligned on the right?
    – Alan Munn
    Nov 19, 2013 at 18:43

1 Answer 1

11

Although beamer provides many hooks for modifying the way things look, the author couldn't think of every possible tweak, and so some things that you might think would be simple are not. This is one of those cases, since it involves hunting through the beamer source code (specifically in beamerouterthemesidebar.sty) to find the definition of the frametitle and then modifying a copy of the relevant code in the preamble of the document.

\documentclass{beamer}
\usetheme{Berkeley}

\makeatletter
\setbeamertemplate{frametitle}{%
    \nointerlineskip%
    \vskip-\beamer@headheight%
    \vbox to \beamer@headheight{%
      \vfil
      \leftskip=-\beamer@leftmargin%
      \advance\leftskip by0.3cm%
      \rightskip=-\beamer@rightmargin%
      \advance\rightskip by0.3cm plus1fil%
      {\usebeamercolor[fg]{frametitle}
          \usebeamerfont{frametitle}\insertframetitle\hfill\insertframenumber\par}% added number
      {\usebeamercolor[fg]{framesubtitle}
           \usebeamerfont{framesubtitle}\insertframesubtitle\par}%
      \vbox{}%
      \vskip-1em%
      \vfil
    }%
  }
\makeatother
\begin{document}
\section{A section}
\begin{frame}{A frame}
\end{frame}
\end{document}

output of code

1
  • 2
    I have no words to describe your generousness or genius, so please accept my simple thanks.
    – MLT
    Nov 19, 2013 at 21:42

You must log in to answer this question.

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