![使用xr-hyper套件製作多卷書時如何啟用智慧參考?](https://rvso.com/image/281499/%E4%BD%BF%E7%94%A8xr-hyper%E5%A5%97%E4%BB%B6%E8%A3%BD%E4%BD%9C%E5%A4%9A%E5%8D%B7%E6%9B%B8%E6%99%82%E5%A6%82%E4%BD%95%E5%95%9F%E7%94%A8%E6%99%BA%E6%85%A7%E5%8F%83%E8%80%83%EF%BC%9F.png)
我正在使用xr-hyper
@David Carlisle 的包和smartref
Giuseppe 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
寫入的標籤:smartref
aux
\newlabel{ch01}{{1}{6}{Общие сведения о плазме}{chapter.4}{}}
\newsmartlabel{ch01}{{1}{1}}
所以我的問題是
如何指示
xr-hyper
讀取\newlabel
和\newsmartlabel
標籤?
也許,適當的程式碼可以包含在新版本的xr-hyper
套件中。