15

I'm going crazy just trying to change the color of the text within a frame environment.

\begin{frame}[plain]
  I want this text to be red!!!
\end{frame}

I have tried almost every single environment listed on the Latex Wiki.

{
  %\usebackgroundtemplate{\includegraphics[width=\paperwidth]{dark_galaxy.jpg}}
  \begin{frame}[plain]
    \setbeamercolor{alerted text}{fg=red}
    \setbeamercolor{background canvas}{fg=red}
    \setbeamercolor{block body alerted}{fg=red}
    \setbeamercolor{block body}{fg=red}
    \setbeamercolor{block body example}{fg=red}
    \setbeamercolor{block title}{fg=red,bg=blue}
    \setbeamercolor{fine separation line}{}
    \setbeamercolor{frametitle}{fg=red}
    \setbeamercolor{item projected}{fg=red}
    \setbeamercolor{normal text}{fg=red}
    \setbeamercolor{section in sidebar}{fg=red}
    \setbeamercolor{section in sidebar shaded}{fg=red}
    \setbeamercolor{separation line}{fg=red}
    \setbeamercolor{sidebar}{fg=red}
    \setbeamercolor{structure}{fg=red}
    \setbeamercolor{subsection in sidebar}{fg=red}
    \setbeamercolor{subsection in sidebar shaded}{fg=red}
    \setbeamercolor{title}{fg=red}
    \setbeamercolor{titlelike}{fg=red}

    Electromagnetic radiation from hydrogen gas in VIRGOHI 21 suggests it is
    part of a system with a mass of \approximately $10^{11}$ solar masses.
  \end{frame}
}
9

For a single frame in a different colour, a regular \color{<col>} works:

enter image description here

\documentclass{beamer}% http://ctan.org/pkg/beamer
\begin{document}
\begin{frame}
  \color{red}%
  I want this text to be red!!!
\end{frame}
\end{document}​
  • Why on earth isn't this listed in any of the tutorials!!! – user545424 Jun 27 '12 at 23:37
  • 2
    @user545424: Because you should use the semantic commands provided by beamer, which are discussed. (Btw, have a look at en.wikibooks.org/wiki/LaTeX/Colors.) – Caramdir Jun 27 '12 at 23:51
10

To highlight some text in beamer, use \alert{some text}.

From the beamer tutorial (specifically Section 3.8)

beamer offers the command \alert, which is used like \emph and, by default, typesets its argument in bright red.

The command is again described in Section 12.3 of the manual, along with the alertenv environment.

Why doesn't changing the color of normal text work? The beamer manual says:

The color [normal text] is used for normal text. At the beginning of the document the foreground color is installed as \normalcolor.

What this means is that it has to be changed before \begin{document} and then affects all frames. There doesn't seem to be an easy way around that particular limitation of the beamer's themes. I guess the reason for this (except for being easier to implement) is to force users to use semantic markup instead of constantly changing the normal text color.

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.