我正在使用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
包中。