10

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}
Keila
  • 581
  • 3
  • 11

1 Answers1

9

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}