Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When I try to make the checkmark black using the following code, it doesn't work; the checkmark shows up red. How do I make it black?

\documentclass{beamer}
\usepackage{amsmath, amsthm, amssymb, amsfonts}
\usepackage{color, xcolor, graphicx}
\usepackage[english]{babel}

\usetheme{Warsaw}
\usecolortheme{beaver}
\setbeamercolor{math text}{fg=darkred!70!black}

\begin{document}
\begin{frame}{Title}
    \begin{block}{Example}
        Let $G = <a, b, c \mid [ab], [bc]>$, $w_1 = c$, and $w_2 = ab$.

        Shortest? \pause \textcolor{black}{\checkmark}
    \end{block}
\end{frame}
\end{document}
share|improve this question
1  
enclose it in $...$: $\textcolor{black}{\checkmark}$ –  cmhughes Dec 20 '12 at 23:33
    
@cmhughes, I had tried '\textcolor{black}{$\checkmark$}', but not the whole thing inside '$...$'. Your answer also works! –  Keila Dec 21 '12 at 0:08
add comment

1 Answer

up vote 12 down vote accepted

You have defined the color of math text as red. Hence, you get it in red. To get some other math in some other color, you may adopt these techniques:

Redefine the math text color in a group:

{\setbeamercolor{math text}{fg=black}{\checkmark}}

See the opening and closing braces (group)

Or define a macro with an optional color (default is black):

\newcommand{\blaak}[2][black]{%
\bgroup
\setbeamercolor{math text}{fg=#1}{#2}
\egroup
}%

and use it as:

\blaak[blue]{\checkmark} %% or
\blaak{\checkmark}

Code:

\documentclass{beamer}
\usepackage{amsmath, amsthm, amssymb, amsfonts}
\usepackage{color, xcolor, graphicx}
\usepackage[english]{babel}

\usetheme{Warsaw}
\usecolortheme{beaver}
\setbeamercolor{math text}{fg=darkred!70!black}
\newcommand{\blaak}[2][black]{%
\bgroup
\setbeamercolor{math text}{fg=#1}{#2}
\egroup
}%

\begin{document}
\begin{frame}{Title}
    \begin{block}{Example}
        Let $G = <a, b, c \mid [ab], [bc]>$, $w_1 = c$, and $w_2 = ab$.

        Shortest? \pause {\setbeamercolor{math text}{fg=black}{\checkmark}} $\textcolor{black}{\checkmark}$
        \blaak[blue]{\checkmark} \blaak{\checkmark}
    \end{block}
\end{frame}
\end{document}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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