(This is based on my workaround related to my answer to using emoticons with pdflatex
— this workaround is discussed in another answer). The gist is: it turns out that in the years after I posted the answer, the behavior of xelatex
changed!
Up to TeXLive2018
, the PDF files produced by xelatex
were “color-neutral”: when \includegraphics
ed, they would inherit the current foreground color from the parent document. However, with TeXLive2021
the generated PDF file has color-setting commands. The result: one must binary-edit (unreliable and inconvenient) this PDF file before it may be fully used in other documents. (The details of the change and which postprocessing is needed is discussed in the link above. The core is the following change:)
- q 1 0 0 1 72 -62.967 cm BT /F1 9.9626 Tf -72 64.65 Td[<1841>]TJ ET Q
+ q 1 0 0 1 72 -62.967 cm 0 G 0 g 0 g 0 G BT /F1 9.9626 Tf -72 64.65 Td[<1841>]TJ ET Q
Question: is there a way to advice xelatex
to not use color-setting commands?
In more detail: with the input file like
\documentclass[crop]{standalone}
\usepackage{fontspec}
\setmainfont{DejaVu Sans} % https://dejavu-fonts.github.io/
\begin{document}
⇢
\end{document}
then uncompressing with pdftk file.pdf output uncompress-file.pdf uncompress
(every) page’s content looks like what is shown above.
To test color-neutrality, one can include the generated PDF
file as in:
\documentclass{article}
\usepackage{graphicx,xcolor}
\begin{document}
\color{red}\includegraphics[height=1in]{emoji-from-list.pdf}
\end{document}
(with color-neutral included PDF
file the content should be red).