With package xespotcolor, I can define and use spot colors with XeLaTeX. This works, even together with tikz.

I am, however, having trouble when I try to use spot colors in externalized tikz pictures. The pdf file produced for the picture is corrupt, and, as a consequence, the final pdf file after including the picture (second tex run) as well.

I have tracked down the problem to a color space definition being missing in the picture pdf. There should be code as follows in the pdf

  /ColorSpace <<
    /PANTONE285C [
      632 0 R

but there isn't. It seems that tikzexternalize skips the output generated by xespotcolor when generating the picture pdf.

Is there any way to force tikzexternalize not to skip something when generating the picture pdf? Or to include particular code in every picture pdf? I need something like a hook.

Minimum non-working example -- compiling it by xelatex --shell-escape [filename] produces a corrupt figure pdf, where the color space definition is missing.



\AddSpotColor{PANTONE}{PANTONE285C}{PANTONE\SpotSpace 285\SpotSpace C} {1 .45 0 0.19}

\draw [myblue] (0,0) -- (2,0);
  • looks ok to me. The colorspace is there. Which tex system are you using? Jan 21, 2021 at 13:50

1 Answer 1


I can reproduce your problem with texlive 2019.

But in texlive 2020 and a new LaTeX 2020-10-01 and the new everypage which uses the new LaTeX hooks, the pdf is fine and the color space is there.

  • Thank you so much for looking into that. Upgrading to texlive 2020 indeed solves the problem!
    – JohnB
    Jan 22, 2021 at 11:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .