mtheme icon indicating copy to clipboard operation
mtheme copied to clipboard

Issue with alert and example colors

Open sgargbugreporter opened this issue 9 years ago • 4 comments

I was trying to change the example color and ran into a few problems.

  • mwe_title.txt is a minimal working example (MWE) that outputs 2 slides - 1st one is a title and the second one is the slide of interest. This is simply slide 14 (Blocks) from demo.tex. I am attempting to change the color of the alerted text and the example text. The color of the alerted text gets changed, but the example text remains the same. This seems to be a bug somewhere. See the output: mwe_title.pdf

  • mwe_NOtitle.txt is another minimal working example (MWE) where I have commeted out the \maketitle command so that it only outputs 1 slides - the Blocks slide. In this case none of the colors gets changed, not even the alerted that was getting changed earlier. See the output: mwe_NOtitle.pdf

So, to recap:

  1. example text color does not change
  2. If there is no \maketitle no color-changing occurs.

sgargbugreporter avatar Nov 02 '16 05:11 sgargbugreporter

For a practical solution, moving the \setbeamercolor declarations to the preamble seem to fix both problems.

rchurchley avatar Nov 02 '16 06:11 rchurchley

Thank you. Although that does solve the problem, it begs a larger question - should the color declarations be in the body (as in the demo.tex file) or in the preamble? As putting them in the preamble does solve these issues, IMHO the preamble is the right place. If so, then demo.tex and other examples should do that and put a warning about this.

sgargbugreporter avatar Nov 02 '16 15:11 sgargbugreporter

It's my own habit to generally put declarations in the preamble. That said, you are right to report this behaviour as a bug; changing the colours mid-presentation should be possible, and we should keep this issue open until we figure out how to fix it.

Just thought I'd provide a quick work-around until I (or someone else) can find time to delve deeper into Beamer's colour management system and see why this is happening.

rchurchley avatar Nov 02 '16 16:11 rchurchley

It is weird. The beamer colors alerted text and example text need to be used at least once, that the derived colors get updated. So this seems to work fine:

\setbeamercolor{alerted text}{fg=CardinalRed}
\setbeamercolor{example text}{fg=Tangerine}
{
  \usebeamercolor[fg]{alerted text}
  \usebeamercolor[fg]{example text}
}
...

Looks like a beamer bug.

benjamin-weiss avatar Nov 09 '16 02:11 benjamin-weiss