Document ClassesBeamer: How to color parts of equation?

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
SteffenBri
Posts: 1
Joined: Thu Feb 26, 2009 12:23 pm

Beamer: How to color parts of equation?

Post by SteffenBri »

Dear Latex-Crowd,
I try to color parts of an equation differently. Say: D=A+B+C and would like A be in red, B in blue and so on.
Your help would be appreciated.
Steffen

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Beamer: How to color parts of equation?

Post by gmedina »

Hi,

It doesn't seem to be (at least for me) an aesthetically pleasant option, but you can use the \textcolor and \color commands, as the following example suggests:

Code: Select all

\documentclass{beamer}

\begin{document}

\begin{frame}
\begin{equation}
  \textcolor{blue}{A}\color{green}=\textcolor{red}{B}\color{purple}+\textcolor{yellow}{C}\normalcolor. 
\end{equation}
\end{frame}

\end{document}
Refer to the xcolor package documentation for further information.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply