使用xr-hyper套件製作多卷書時如何啟用智慧參考?

使用xr-hyper套件製作多卷書時如何啟用智慧參考?

我正在使用xr-hyper@David Carlisle 的包和smartrefGiuseppe Bilotta 的包來編譯一本多卷書。xr-hyper啟用不同磁碟區之間的交叉引用,如下列程式碼區塊所示:

\newcommand{Volume}{1}% put this is PlasmaBook1.tex 

% This is the code shared by all volumes
\usepackage{xr-hyper}
\usepackage{hyperref}

\ifnum\Volume=1
    \externaldocument{PlasmaBook2}
    \externaldocument{PlasmaBook3}
\else\ifnum\Volume=2
    \externaldocument{PlasmaBook1}
    \externaldocument{PlasmaBook3}
\else\ifnum\Volume=3
    \externaldocument{PlasmaBook1}
    \externaldocument{PlasmaBook2}
\fi\fi\fi

此套件smartref用於隱藏方程式編號的一部分,如中所述交叉引用時如何丟棄方程式編號的一部分?

\usepackage{smartref}
\addtoreflist{chapter}
\newcommand*{\srefaux}[1]{%
    \ischapterchanged{#1}% checks if section number has changed
    \ifchapterchanged% if current chapter is different
        \chapterref{#1}.% put the section reference
    \fi% else do nothing
    \ref*{#1}%  <- we changed this to ref*
}

\makeatletter
\renewcommand \theequation {\@arabic\c@equation}
\renewcommand \thefigure   {\@arabic\c@figure}
\renewcommand \thetable    {\@arabic\c@table}
\makeatother

\newcommand*\sref[1]{\hyperref[#1]{\srefaux{#1}}}
\newcommand*\seqref[1]{(\hyperref[#1]{\srefaux{#1}})}

不幸的是,smartref該機制僅在單一卷內起作用。我認為這是因為xr-hyper包僅從文件中讀取\newlabel字串aux並忽略由實際文件借用的以下示例所示\newsmartlabel寫入的標籤:smartrefaux

\newlabel{ch01}{{1}{6}{Общие сведения о плазме}{chapter.4}{}}
\newsmartlabel{ch01}{{1}{1}}

所以我的問題是

如何指示xr-hyper讀取\newlabel\newsmartlabel標籤?

也許,適當的程式碼可以包含在新版本的xr-hyper套件中。

相關內容