1

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.

4
  • 2
    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...
    – Rmano
    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?
    – JardaFait
    May 21, 2021 at 14:13
  • 1
    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 1

0

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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.