I'm using the Stockholm (sthlm) Beamer theme. The template for this theme shows how to use its Light Yellow font color:


My question is, how would I set a single word in a line of text to be sthlmLightYellow, leaving the other words black? And suppose I wanted to have a few colors in this line -- how would I achieve that?

This is what I've come up with:

\setbeamercolor{sthlmLightYellow}{fg=sthlmLightYellow, bg=white}
\begin{beamercolorbox}[wd=\linewidth, ht=2ex, dp=0.7ex]{sthlmLightYellow}
  \centerline{\texttt{Merkel cells} {\color{black} and}
    {\color{cyan} \texttt{A$\beta$ sensory neurons}}
    {\color{black} form Merkel cell-neurite complexes.}}

But I feel like there's got to be a simpler way.

  • With \textcolor{<selected color>}{colored text}? – Zarko Sep 20 '15 at 20:14
  • @dbliss Does the comment from Zarko answer your question? – samcarter is at topanswers.xyz Dec 29 '15 at 18:21
  • @dbliss: Zarko's comment was made soon after you posted the question. You gave no feedback on it -- Perhaps nobody can work with the fragments you provided, now three months later the question is unclear. That's why we like to have feedback by comments/votes/accepts. – user31729 Dec 29 '15 at 21:21
  • 1
    @dbliss, what job you expect from me? To wrote an answer? You not respond on my comment, so I concluded that it doesn't work for you. When I use suggested solution it always wars! Anyway, I will convert my comment to answer .... – Zarko Dec 29 '15 at 21:25

Regardless to Beamer theme you can always change font color with:

\textcolor{<selected color>}{colored text}

This is valid for any document class, not only for Beamer. Of course, for this command the preamble of document should explicit or implicit loaded color or xcolor package.

To show, how this will work in your case, please provide minimal working example. I will insert in it an example of this command use.

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