Skip to main content
replaced http://tex.stackexchange.com/ with https://tex.stackexchange.com/
Source Link

There are similar questions around, for example:

The main question is that at the end of \textcolor there is a \reset@color which does not know what is the proper color to restore.


The problem evolves when comes in. Basically the story is as follows:

  1. loads pdftex.def or xetex.def according to the current compiler.
  2. pdftex.def will define \reset@color;
    xetex.def will define \reset@color@nostack and \reset@color@stack.
  3. redefines \reset@color.
  4. xetex.def will decide whether \reset@color@nostack or \reset@color@stack will be the \reset@color.

Here 1, 2, 3 happens at \documentclass{beamer} and 4 happens at \begin{document}.

Now you can see a problem: for XeLaTeX, since 4 happens after 3, reset@color is redefined to be a non-beamer version.


The following code illustrate the difference more clearly

\documentclass{beamer}
\usepackage{tikz}

\setbeamercolor{background canvas}{bg=teal}
\setbeamercolor{normal text}{fg=white}

\begin{document}

\frame{
    \tikz{
        \node[text=yellow]{
            Yellow
            \textcolor{red}{Red}
            What?
        };
    }
}

\end{document}

LaTeX gives

and XeLaTeX gives

Neither of them is expected. What we want is yellow. But reluctantly, white is better than black. And white is indeed done by the beamer version of \reset@color and black is done by the xetex.def version.

There are similar questions around, for example:

The main question is that at the end of \textcolor there is a \reset@color which does not know what is the proper color to restore.


The problem evolves when comes in. Basically the story is as follows:

  1. loads pdftex.def or xetex.def according to the current compiler.
  2. pdftex.def will define \reset@color;
    xetex.def will define \reset@color@nostack and \reset@color@stack.
  3. redefines \reset@color.
  4. xetex.def will decide whether \reset@color@nostack or \reset@color@stack will be the \reset@color.

Here 1, 2, 3 happens at \documentclass{beamer} and 4 happens at \begin{document}.

Now you can see a problem: for XeLaTeX, since 4 happens after 3, reset@color is redefined to be a non-beamer version.


The following code illustrate the difference more clearly

\documentclass{beamer}
\usepackage{tikz}

\setbeamercolor{background canvas}{bg=teal}
\setbeamercolor{normal text}{fg=white}

\begin{document}

\frame{
    \tikz{
        \node[text=yellow]{
            Yellow
            \textcolor{red}{Red}
            What?
        };
    }
}

\end{document}

LaTeX gives

and XeLaTeX gives

Neither of them is expected. What we want is yellow. But reluctantly, white is better than black. And white is indeed done by the beamer version of \reset@color and black is done by the xetex.def version.

There are similar questions around, for example:

The main question is that at the end of \textcolor there is a \reset@color which does not know what is the proper color to restore.


The problem evolves when comes in. Basically the story is as follows:

  1. loads pdftex.def or xetex.def according to the current compiler.
  2. pdftex.def will define \reset@color;
    xetex.def will define \reset@color@nostack and \reset@color@stack.
  3. redefines \reset@color.
  4. xetex.def will decide whether \reset@color@nostack or \reset@color@stack will be the \reset@color.

Here 1, 2, 3 happens at \documentclass{beamer} and 4 happens at \begin{document}.

Now you can see a problem: for XeLaTeX, since 4 happens after 3, reset@color is redefined to be a non-beamer version.


The following code illustrate the difference more clearly

\documentclass{beamer}
\usepackage{tikz}

\setbeamercolor{background canvas}{bg=teal}
\setbeamercolor{normal text}{fg=white}

\begin{document}

\frame{
    \tikz{
        \node[text=yellow]{
            Yellow
            \textcolor{red}{Red}
            What?
        };
    }
}

\end{document}

LaTeX gives

and XeLaTeX gives

Neither of them is expected. What we want is yellow. But reluctantly, white is better than black. And white is indeed done by the beamer version of \reset@color and black is done by the xetex.def version.

Source Link
Symbol 1
  • 37.2k
  • 3
  • 71
  • 168

There are similar questions around, for example:

The main question is that at the end of \textcolor there is a \reset@color which does not know what is the proper color to restore.


The problem evolves when comes in. Basically the story is as follows:

  1. loads pdftex.def or xetex.def according to the current compiler.
  2. pdftex.def will define \reset@color;
    xetex.def will define \reset@color@nostack and \reset@color@stack.
  3. redefines \reset@color.
  4. xetex.def will decide whether \reset@color@nostack or \reset@color@stack will be the \reset@color.

Here 1, 2, 3 happens at \documentclass{beamer} and 4 happens at \begin{document}.

Now you can see a problem: for XeLaTeX, since 4 happens after 3, reset@color is redefined to be a non-beamer version.


The following code illustrate the difference more clearly

\documentclass{beamer}
\usepackage{tikz}

\setbeamercolor{background canvas}{bg=teal}
\setbeamercolor{normal text}{fg=white}

\begin{document}

\frame{
    \tikz{
        \node[text=yellow]{
            Yellow
            \textcolor{red}{Red}
            What?
        };
    }
}

\end{document}

LaTeX gives

and XeLaTeX gives

Neither of them is expected. What we want is yellow. But reluctantly, white is better than black. And white is indeed done by the beamer version of \reset@color and black is done by the xetex.def version.