I've just started using the new tikzposter class (having previously used the fancytikzposter package from the same author) and immediately discovered that using the microtype package causes TeX to fail.

I'm wondering whether anybody else has come across this as I'm not sure what to do. My MWE is:


The commented out line in the middle is one of the reasons for using microtype, i.e. to get more control over letter spacing. I get the same in pdftex, xetex and lualatex and I'm using a freshly updated TeXlive installation.

The failing error is:

! Missing endcsname inserted.
<to be read again>
l.5 \end{document}

  • 1
    This is most certainly a bug. Mar 16, 2014 at 13:02
  • Yes, looks like a bug to me as well—any clues as to where to start looking? Having it fail at the \end{document} doesn't provide many clues.
    – Sam Mason
    Mar 17, 2014 at 9:01

1 Answer 1


This was a rather tricky one ... I would contend it's a bug in tikzposter.

The problem is that tikzposter uses \AtBeginDocument for starting a tikzpicture environment, which is then closed \AtEndDocument. This means that any other code that a package (in this case microtype) inserts AtBeginDocument is executed inside a group, hence any local assignments will become undone AtEndDocument. Specifically, microtype disables some commands that are only allowed inside the preamble ABD, which triggers the error AED.

The clsguide advises:

The \AtBeginDocument hook should not be used for code that does any typesetting since the typeset result would be unpredictable.

Even though the actual typesetting that tikzposter does is not the real problem here but rather the group that it opens, I would still say that this qualifies as improper use of \AtBeginDocument. tikzposter could instead use the \AfterEndPreamble command from etoolbox (which it loads anyway).

  • well spotted! thanks for pointing out those hooks, I'll have to remember them for my next debugging excursions… I'll report the bug to the class authors with a patch
    – Sam Mason
    Mar 17, 2014 at 16:08
  • For reference, the necessary (one-line) patch to tikzposter.cls is described here, but not yet in CTAN. Feb 8, 2016 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.