# siunitx version v3.0.2 with xr-hyper

I am typeset the multivolume book. Simplest form looks like:

main file for volume one (vol01.tex)

  \documentclass{scrbook}
\usepackage{xr-hyper}
\usepackage{siunitx}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{hyperref}

\begin{document}
\section{First section}\label{section}
\begin{figure}[ht!]
\centering
\includegraphics{example-image-a}
\caption{Units \qty{10}{\m}}
\label{fig:example}
\end{figure}
\end{document}


Tex file for volume two (vol02.tex):

\documentclass{scrbook}
\usepackage{xr-hyper}
\usepackage{hyperref}

\externaldocument[B-]{vol01}[vol01.pdf]%

\begin{document}
Link to file \texttt{vol1} figure \ref{B-fig:example} in section \ref{B-section}.
\end{document}


But the units used in caption leads to error:

...
/uniquecounter.sty")))
! Undefined control sequence.
<argument> Units \qty
{10}{\m }\relax
l.11 ...nt[B-]{vol01}[vol01.pdf]


For previous version of siunitx package the solution was to use \protect\SI{10}{\protect\m} according to the Ulrike Fischer solution here. Unfortunately it is no longer be valid.

Is there any other alterntive? For example usage of the zref-xref package.

• no it not longer works. siunitx doesn't like the inner \protect. May 21, 2021 at 13:43
• Not related but you should change vol01 in the second file with vol1... May 21, 2021 at 13:46
• @Ulrike Fischer: Is there any other alterntive? For example usage of the zref-xref package. How to work around this problem, or suggestion? May 21, 2021 at 14:13
• well it works if you load siunitx and move the \externaldocument[B-]{vol01}[vol01.pdf]% after \begin{document}. May 21, 2021 at 15:13

## 1 Answer

According to the Ulrike Fischer's comment the solution is:

 \documentclass{scrbook}
\usepackage{xr-hyper}
\usepackage{hyperref}
\usepackage{siunitx}

\begin{document}
\externaldocument[B-]{vol01}[vol01.pdf]%

Link to file \texttt{vol1} figure \ref{B-fig:example} in section \ref{B-section}.
\end{document}
`