1

I color my inline math in beamer to improve readability. However, when I use array environment, it will include some inline math being put inside array which is display math. I would like inline math to be colored only when it is put outside any display math environment. Also, the tags of the equations seem to change to the same color of the inline math. I would rather like it black

enter image description here

\documentclass[aspectratio=169, xcolor={x11names}]{beamer}

\usecolortheme{seahorse}
\usefonttheme[onlylarge]{structurebold}
\setbeamercolor{math text inlined}{fg=SpringGreen3}

\begin{document}

    \begin{equation}
        \bar{I}_{R}(n) = \left\lbrace
            \begin{array}{ccl}
                I_{R, \thinspace i} &\text{if} &n = i
            \\
                I_{R, \thinspace j} &\text{if} &n = j
            \\
                0 & \text{if} &n \neq i \text{~or~} j
            \end{array}
                        \right.
    \end{equation}

\end{document}
1

One possibility could be to change the colour back to black by using custom defined column types:

\documentclass[aspectratio=169, xcolor={x11names}]{beamer}

\usecolortheme{seahorse}
\usefonttheme[onlylarge]{structurebold}
\setbeamercolor{math text inlined}{fg=SpringGreen3}

\usepackage{array}
\newcolumntype{C}{>{\color{black}}c}
\newcolumntype{L}{>{\color{black}}l}

\makeatletter
\def\tagform@#1{\maketag@@@{\color{black}(\ignorespaces#1\unskip\@@italiccorr)}}
\makeatother

\begin{document}

\begin{frame}
    \begin{equation}
        \bar{I}_{R}(n) = \left\lbrace
            \begin{array}{CCL}
                I_{R, \thinspace i} &\text{if} &n = i
            \\
                I_{R, \thinspace j} &\text{if} &n = j
            \\
                0 & \text{if} &n \neq i \text{~or~} j
            \end{array}
                        \right.
    \end{equation}
\end{frame}

\end{document}

enter image description here

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.