It seems that the fadings library is not compatible with precompiled preambles.


\usetikzlibrary{fadings}% Incompatible with precompiled preamble?


   \fill[color=blue, path fading=south] (0,0) rectangle (2,2);

When precompiling the preamble with:

pdftex -shell-escape -ini -jobname="mwe" "&pdflatex" mylatexformat.ltx mwe.tex

I get the following warning in terminal:

pdfTeX warning: pdftex: dangling objects discarded, no output file produced.

and the document compilation fails. But when \usetikzlibrary{fadings} is commented and path fading=south is removed in the picture, there is no warning during preamble or document compilation... Any idea?

  • 1
    Seems like the library typeset/output something to the PDF. If I recalled correctly (can't find cite) you can't output anything to the PDF in precompiled preamble part.
    – user202729
    Commented May 6, 2022 at 15:01
  • 1
    Well, it's just incompatible, you can't do anything but to (rewrite/fix it yourself, contact author or) put it outside the preamble.
    – user202729
    Commented May 6, 2022 at 15:02
  • 1
    The fadings pgf library, which is loaded by the corresponding tikz library, declares (predefined) fadings, which will write XForm objects to PDF. Commented May 8, 2022 at 7:38
  • Hmmm... Hence the "dangling objects" that get discarded. Then I guess the only way is to load the fadings library outside the precompiled part.
    – Bibi
    Commented May 9, 2022 at 9:49

1 Answer 1


As noted in comments, the fadings library writes XForm objects to PDF, which explains the dangling objects that get discarded (no PDF is produced when precompiling the preamble).

A simple solution is thus to put \usetikzlibrary{fadings} after \endofdump (i.e. outside the precompiled part of the preamble).

You must log in to answer this question.

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