10

I need to change the page number color to black in latex beamer. What do I need to add to the following code?

\defbeamertemplate{headline}{page number}{%
    \vskip1pt%
    \setbeamertemplate{footline}[page number]%
    \usebeamertemplate{footline}%
}
\setbeamertemplate{headline}[page number]
| improve this question | | | | |
5

The page number option to the footline template is found in beamerbaseauxtemplates.sty:

\defbeamertemplate{footline}{page number}
{%
  \hfill%
  \usebeamercolor[fg]{page number in head/foot}%
  \usebeamerfont{page number in head/foot}%
  \insertpagenumber\,/\,\insertpresentationendpage\kern1em\vskip2pt%
}

So when setting the footline beamer will use a font and a color page number in head/foot. That color can be configured as you wish, like so:

\documentclass{beamer}
\usepackage{lipsum}

\defbeamertemplate{headline}{page number}{%
    \vskip1pt%
    \setbeamertemplate{footline}[page number]%
    \usebeamertemplate{footline}%
}
\setbeamertemplate{headline}[page number]
\setbeamercolor{page number in head/foot}{fg=green}
\setbeamerfont{page number in head/foot}{size=\large}

\begin{document}

\begin{frame}{Lorem ipsum}
\lipsum[1]
\end{frame}

\begin{frame}{Dolor sit amet}
\lipsum[2]
\end{frame}
\end{document}

sample code output

To learn more about these configurations, read Section 1.4, 17, and 18 of the beamer manual.

| improve this answer | | | | |
  • It worked .thank u...I also need to change the size of page number..what i need to add above code? – Emalka May 18 '13 at 15:57
  • Ah, there is a configurable font as well. Give me a minute to update. – Matthew Leingang May 18 '13 at 15:57
  • thanx :)..what is a way to change "size of page number"? – Emalka May 18 '13 at 16:02
  • @Emalka: see updates. Thanks for the check but voting up is also nice. :-) – Matthew Leingang May 18 '13 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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