0

Compiling the following document with pdflatex gives me a cryptic error message.

\documentclass{article}
\usepackage{amsmath}
\usepackage{cleveref}
\usepackage{hyperref}

\begin{document}

\begin{subequations}
\begin{equation}
    x
\end{equation}
\end{subequations}

\begin{equation}
    x
\end{equation}

\end{document}

The error message says

! Undefined control sequence.
\theHequation ->\theHparentequation
                                .\the \value {equation}
l.14 \begin{equation}

If I remove either the hyperref package or the cleveref package, the document compiles fine. If I remove the last equation environment, it compiles fine.

Googling the error message made be no less confused. I assume this is some bug on conflict somehow in one of these packages, but is it possible to find a workaround to make this compile?

3
  • 1
    I got this message: Package cleveref Error: cleveref must be loaded after hyperref!. Do that and be happy.
    – Sigur
    Sep 14, 2018 at 18:25
  • Try loading cleveref ` after hyperref.
    – Bernard
    Sep 14, 2018 at 18:25
  • Switching the order solved the problem. If one of you will post this as an answer, I'll accept it, and the next person trying to google this problem will also be happy.
    – Tor
    Sep 14, 2018 at 19:12

1 Answer 1

4

The error when compiling says:

Package cleveref Error: cleveref must be loaded after hyperref!

So, simply use

\usepackage{hyperref}
\usepackage{cleveref}

You must log in to answer this question.

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