# incompatibility between tikzposter class, microtype and hyperref package

MWE:

\documentclass{tikzposter}

\usepackage{microtype}
\usepackage{hyperref}
% Ref: https://tex.stackexchange.com/questions/254257/tikzposter-and-doi-package-conflict
\def\HyperFirstAtBeginDocument#1{#1}

\title{Title}
\institute{Inst}
\author{Auth}

\begin{document}

\maketitle

\block{Blocktitle}{Text}

\end{document}


Error messages:

./test.tex:18: Undefined control sequence.
\pdfstringdefPreHook ->\MT@ltx@pickupfont
\let \textmicrotypecontext \@secon...
l.18 \end{document}


This is different than incompatibility between tikzposter class and microtype package

How should I fix it?

tikzposter inserts with \AtBeginDocument and \AtEndDocument a center and tikzpicture enviroment, and this introduce groups. This is not a good idea and one of the bad side effects is that this breaks the microtype. You can get similar error with this simpler example:

\documentclass{article}
\AtBeginDocument{\begingroup}
\AtEndDocument{\endgroup}

\usepackage{microtype}
\usepackage{hyperref}

\begin{document}
text
\end{document}


I don't see a sensible workaround, it doesn't help to use \center and \tikzpicture in the code, as \tikzpicture creates a group in any case. I suggest to use something else for the poster, e.g. the poster library from tcolorbox.

• Thanks for the information. But I don't understand why having groups in \AtBeginDocument and \AtEndDocument is bad. – xucheng Mar 28 '19 at 12:19
• It is bad as it breaks things as you can see in your example. – Ulrike Fischer Mar 28 '19 at 12:40