1

Can anyone explain the thrown error and is there a way to avoid it?

It seems the packages hyperref and subcaption don't get along very well. The document compiles and all seems alright, but I get the error

Command \theHsubfigure already defined.

with the following MWE

\documentclass[hyperref]{labbook}
\usepackage{caption} % I think I can't use subcaption without caption, so it is included here
\usepackage{subcaption}
\usepackage{hyperref}

\begin{document}
something
\end{document}

If you need the rest of the preamble (approx. 100 lines in this case) please tell me and I will include it.

1 Answer 1

3

You can do the following:

\usepackage{subcaption}
\let\theHsubfigure\relax
\usepackage{hyperref}

This class does some really odd changes if hyperref is added, among others:

\newcommand*\theHsubfigure{%
\theHfigure.\arabic{subfigure}}

You must log in to answer this question.

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