1. Vedran Miletić
  2. beamer
  3. Issues
Issue #44 on hold

color in \section commands

Anonymous created an issue

Hello,

I have a problem using a \usebeamercolor[fg]{mycolor} command in the title of a section:

\setbeamercolor{mycolor}{fg=red,bg=white}

\section{My section with some text in {\usebeamercolor*[fg]{mycolor} red}}

does not compile.

More generally, something like

\section{My section with some text in {\alert{red}} \section{My section with some text in {\structure{red}} \section{My section with some text in {\color{mycolor.fg} red}}} \section{My section with some text in {\textcolor{mycolor.fg}{red}}}

does not work.

Thierry

Comments (5)

  1. Joseph Wright
    • marked as bug
    • removed milestone

    This turns out to seriously problematic, as we can't simply use the LaTeX2e robust command system. For example

    \let\saved@mycmd\mycmd
    \renewcommand<>\mycmd ...
    

    relies on the fact that the original version of \mycmd still works. However, if it is robust then there is also a command '\mycmd ' which is used by LaTeX. The space is important, and more importantly that name is hard-coded into \mycmd. That means we cannot use LaTeX2e's mechanism for our new definition (it leads to an infinite loop).

    Changing how this works will break far too many existing documents for us to go for. The only realistic fix would be to use e-TeX's protected mechanism. That is engine-level robustness, and works. However, it changes the requirements to use beamer: not everyone has the extensions.

    I need to think about this, and to survey users. I will bring this up in the appropriate forums.

  2. Joseph Wright

    Okay, I've thought some more about this. Regrettably, the only sensible approach is to require the use of \protect in places where the colour macros are in a moving argument.

    The reason for this is that any change here will break stuff, and it's at such a low level that I don't feel it's appropriate. Requiring e-TeX is as I said the easy way out, but that is a major change and is not really a 'small bug fix'.

    For the moment, I'm therefore going to put this 'on hold': there is no good solution at the moment, but it's a real issue that we need to bear in mind.

  3. Log in to comment