For each figures in my document, I need to have corresponding supplementary figures: e.g. for figure 1, I might have figure 1 – S1, figure 1 – S2, and so on.

I use renewcommand to get these names. Within the new definition of \thefigure, I simply have a \ref* pointing to the main figure to get the first number. All is well.

But the links for the supplementary figures point to the wrong places. If I try to redefine \theHfigure, I get all sorts of weird errors.



\section*{Main text}

This is my \cref{figure}.

  \caption{Some figure.}


This figure concerns the \cref{figure} and is the \cref{suppfigure}.

\renewcommand\thefigure{\ref*{figure} -- S\arabic{figure}}

  \caption{Juicy details.}



(...) ! Argument of \Hy@tempa has an extra }. \par l.382 }

The error seems to be caused by the \ref* within the new definition of \thefigure, because it works fine if I remove it.

Is there a way to fix this?

  • Welcome to TeX.SE. Please tell us more about structure of the supplementary figures. E.g., are they supposed be independent, standalone floats, or will they always occur on the same page as the "main" figure?
    – Mico
    Commented Mar 1, 2021 at 8:10
  • \renewcommand{\theHfigure}{S{\arabic{figure}}}. Commented Mar 1, 2021 at 8:11
  • @Mico The appear in the appendix, so on a different page.
    – cheersmate
    Commented Mar 1, 2021 at 8:16
  • @UlrikeFischer That works, thanks a lot! Can you post an answer so I can accept?
    – cheersmate
    Commented Mar 1, 2021 at 8:16

1 Answer 1


Your definition of \theHfigure is too complicated. As it contains a \ref command, hyperref can't build a name with it. All \theH... definition need to follow two rules: they should be simple (expandable) and lead to something unique. So use e.g.


You must log in to answer this question.

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