[Tex/LaTex] Changing the text color for a cell does change alignment

beamercolortables

If i color the text of a table cell, the text gets aligned wrong.

Without color:

enter image description here

With color:

Cell text colored

MWE:

\documentclass[10pt, handout]{beamer}

\usepackage{tabulary}
\usepackage{xcolor}

\begin{document}
    \begin{frame}{Test}
        \begin{tabulary}{\textwidth}{LLLL}
            test & test & test & test \\
            test & \color{red}test & test & test \\
        \end{tabulary}
    \end{frame}
\end{document}

I want to use it in a way like this:

\newcommand{\highlight}{\color{black}\cellcolor{red}}

\begin{tabulary}{\textwidth}{LLLL}
    test & test & test & test \\
    test & \highlight test & test & test \\
\end{tabulary}

Best Answer

Either use \leavevmode or \textcolor

\documentclass[10pt, handout]{beamer}

\usepackage{tabulary}
\usepackage{xcolor}

\begin{document}
    \begin{frame}{Test}
        \begin{tabulary}{\textwidth}{LLLL}
            test & test & test & test \\
            test & \leavevmode\color{red}test & \textcolor{red}{test} & test \\
        \end{tabulary}
    \end{frame}
\end{document}

enter image description here