0

As it says in the cleveref documentation hyperref must be loaded before cleveref. But at me I have to load at least one package between them and I would really like to know why.

The not working minimal example is

\documentclass{scrartcl}
\usepackage{amsthm}
\usepackage{hyperref}
\usepackage{cleveref}
\theoremstyle{definition}
\newtheorem{Def}{Definition}
\newtheorem{Lemma}[Def]{Lemma}
\begin{document}
a
\begin{Lemma}
\label{Lem:fastdis}
\[ a+b=c? \]
\end{Lemma}
\end{document}

This just gives an error and doesn't compile, but switching amsthm and hyperref like this

\documentclass{scrartcl}
\usepackage{hyperref}
\usepackage{amsthm}
\usepackage{cleveref}
\theoremstyle{definition}
\newtheorem{Def}{Definition}
\newtheorem{Lemma}[Def]{Lemma}
\begin{document}
a
\begin{Lemma}
\label{Lem:fastdis}
\[ a+b=c? \]
\end{Lemma}
\end{document}

it compiles without even a warning. Why do i need to load a package between them?

  • "Just gives an error"? What error? The first MWE works just fine for me. Maybe you’re using outdated version of the packages. – Qrrbrbirlbel May 10 '13 at 15:32
  • @Qrrbrbirlbel the only thing that looks like an error is " \AtBegShi@Output ...ipout \box \AtBeginShipoutBox \fi \fi l.14 \end{document} ] Package atveryend Info: Empty hook `AfterLastShipout' on input line 14." The last time I updated is about 2 weeks ago I just gonna check for updates – Dominic Michaelis May 10 '13 at 15:37
  • I guess you just answered yourself: putting amsthm between hyperref and cleveref seems to solve the issue. – egreg May 10 '13 at 15:37
  • @Qrrbrbirlbel Updated and here with MiKTeX 2.9 and WinEdt 7.1 it doesn't compile anything. – Dominic Michaelis May 10 '13 at 15:47

0 Answers0