Issue #296 resolved

Handling of \everydisplay/\everymath by \donotcoloroutermaths/\donotcolorouterdisplaymaths

jfbu
created an issue

I wish to point out that any non-beamer material put by the user or a package in \everydisplay is made inoperative by \donotcolorouterdisplaymaths which is added by beamer in beamerbasecolor.sty to many environments:

\newcommand\donotcolorouterdisplaymaths{%
  \everydisplay{\everydisplay{\beamer@setdisplaymathcolor}}}

It appears that the intention is to preempt the following definitions made by beamer:

\AtBeginDocument
{
  \everymath\expandafter{\the\everymath\beamer@setmathcolor}
  \everydisplay\expandafter{\the\everydisplay\beamer@setdisplaymathcolor}
}

These definitions respect user/package stuff put in \everymath/\everydisplay. But the definition in \donotcoloroutermaths and \donotcolorouterdisplaymaths do not. Could it be possible to follow another strategy like for example:

\let\beamer@colorhackprefix\relax 

\newcommand\donotcoloroutermaths{\def\beamer@colorhackprefix ##1{\def\beamer@colorhackprefix ####1{\let\beamer@colorhackprefix\relax}}}

\newcommand\donotcolorouterdisplaymaths{\def\beamer@colorhackprefix ##1{\def\beamer@colorhackprefix ####1{\let\beamer@colorhackprefix\relax}}}


\AtBeginDocument
{
  \everymath\expandafter{\the\everymath\beamer@colorhackprefix\beamer@setmathcolor}
  \everydisplay\expandafter{\the\everydisplay\beamer@colorhackprefix\beamer@setdisplaymathcolor}
}

This proposal is a little bit of guess work, its aim is to preserve non-beamer contents in \everymath/\everydisplay. Perhaps there should be a mathprefix and a displayprefix.

Nota Bene: the motivation is compatibility with package mathastext, which puts important stuff in \everydisplay and \everymath.

JF B.

Comments (3)

  1. Log in to comment