The text at the bottom of page 2 is red, despite the fact that the color change in the code below originates from \color{red}\normalcolor
within the multicols
within the figure
and should naively not have had such an impact. No effect is seen if either:
one comments out the
\begin{multicols}
and\end{multicols}
lines,one comments out the
\begin{figure*}
and\end{figure*}
lines.
My question is why does this happen? (I expect to hear about some kind of whatsit
subtlety).
and is there a work-around ? (in my context I have \color{red}
and later \normalcolor
before the text, more or less as here, and I can not change that, so the solution should not change anything to the inside of the multicols
and the only customizing possibility would be to add extra stuff either before or after the multicols environment or both).
Update David's proposal to add a group or brace pair inside the multicols
cures the problem (I initially thought I had no access to these contents, but I had forgotten my own hooks) and another way is to add \normalcolor
or even \color{green}
(sic) inside the figure*
environment before the multicols
environment. This second medicine avoids to have to insert anything inside the multicols
.
\documentclass{article}
\usepackage[paperheight=6cm]{geometry}
\usepackage{multicol}
\usepackage{color}
% COLOR LEAK IF COLOR WITHIN MULTICOLS WITHIN FIGURE
\begin{document}
Hello World World World World World World World
World World World World World World World
World World World World World World World
World World World World World World World
World World
World World World
World World World World World World World
World World World World World World World
World World World World World World World
World World World World World World World
World World
\begin{figure*}[ht!]
\begin{multicols}{2}
\color{red}\normalcolor
Hello. World World World
World World World World World World
World World World World World World
World World World World World World
World World World World World World
World World World World World World
World World World World
World World World World World World
World World World World World World
World World World World World World
World World World World World World
World World World World World\par
\end{multicols}
\end{figure*}
World World World
World World World World World World World
World World World World World World World
World World World World World World World
World World World World World World World
World World
World World World
World World World World World World World
World World World World World World World
World World World World World World World
World World World World World World World
World World
World World World
World World World World World World World
World World World World World World World
World World World World World World World
World World World World World World World
World I AM RED, WHY?
\end{document}
dvipng
but compilation viapdflatex
gives the same output.\normalcolor
withinfigure*
after\end{multicols}
does not modify anything.multicols
contents, but I had forgotten my own hooks precisely designed for that. So I could solve my real life problem following David's advice and using the hooks to put the entire stuff from inside themulticols
within a group inside themulticols
.