when use lots of \color{} command, can't change color
If I run this code with
xelatex -output-driver="xdvipdfmx -vv" zeno
I get on the console
<FONTMAP:/usr/local/texlive/2017/texmf-var/fonts/map/pdftex/updmap/pdftex.map><FONTMAP:/usr/local/texlive/2017/texmf-var/fonts/map/dvipdfmx/updmap/kanjix.map><FONTMAP:/usr/local/texlive/2017/texmf-dist/fonts/map/dvipdfmx/ckx.map>No dvi filename specified, reading standard input.
stdin -> zenorig.pdf
DVI Comment: XeTeX output 2018.04.17:1712
<AGL:texglyphlist.txt><AGL:pdfglyphlist.txt><AGL:glyphlist.txt>[1</usr/local/texlive/2017/texmf-dist/fonts/opentype/public/lm/[email protected]<NATIVE-FONTMAP:/usr/local/texlive/2017/texmf-dist/fonts/opentype/public/lm/lmroman10-regular.otf/0/H/65536/0/0>
fontmap: /usr/local/texlive/2017/texmf-dist/fonts/opentype/public/lm/lmroman10-regular.otf/0/H/65536/0/0 -> /usr/local/texlive/2017/texmf-dist/fonts/opentype/public/lm/lmroman10-regular.otf(Identity-H)
pdf_font>> Input encoding "Identity-H" requires at least 2 bytes.
pdf_font>> The -m <00> option will be assumed for "/usr/local/texlive/2017/texmf-dist/fonts/opentype/public/lm/lmroman10-regular.otf".
(CID:LMRoman10-Regular)
pdf_font>> Type0 font "/usr/local/texlive/2017/texmf-dist/fonts/opentype/public/lm/lmroman10-regular.otf" cmap_id=<Identity-H,0> opened at font_id=</usr/local/texlive/2017/texmf-dist/fonts/opentype/public/lm/lmroman10-regular.otf/0/H/65536/0/0,0>.
>
xdvipdfmx:warning: Color stack overflow. Just ignore.
xdvipdfmx:warning: Color stack overflow. Just ignore.
xdvipdfmx:warning: Color stack overflow. Just ignore.
[...several other similar lines...]
xdvipdfmx:warning: Color stack overflow. Just ignore.
xdvipdfmx:warning: Color stack overflow. Just ignore.
]
otf_cmap>> Creating ToUnicode CMap for "/usr/local/texlive/2017/texmf-dist/fonts/opentype/public/lm/lmroman10-regular.otf"...
(CID:/usr/local/texlive/2017/texmf-dist/fonts/opentype/public/lm/lmroman10-regular.otf[IXRNFR+LMRoman10-Regular][CIDFontType0][20 glyphs][2804 bytes])
Compression saved 14964 bytes
5364 bytes written
Each \color
command executes
\special {color push \current@color }\aftergroup \reset@color
but the push
is never followed by a pop
(except at the end of the job).
The color stack apparently has a limitation of 127 or 128 positions (you get red, I get blue, so it can be off by one depending on the version of the software).
Use {\color{<color>}text}
or, better,
\textcolor{<color>}{text}
for color changes.