我有一个包含附录和手稿的文件。为了提交,我必须将这两个部分拆分成两个单独的文件。但是,从附录到手稿再到手稿有数百个引用,就像在简化的 MWE 中一样,如果我只是将它们拆分并独立编译,就会产生未定义的引用:
\documentclass[reqno, a4paper,11pt]{amsart}
\usepackage{xcolor}
\title{Manuscript and appendix}
\usepackage[bookmarks=false]{hyperref}
\hypersetup{
colorlinks = true,
citecolor =green!70!black,
linkcolor=green!70!black
}
\begin{document}
\maketitle
\section{Some important section}\label{sec:Important}
Because of eq. \eqref{didntfit} in Appendix \ref{sec:Unimportant}...
\appendix
\section{Some formulae}\label{sec:Unimportant}
We prove here
\begin{align}
a^2+b^2= c^2 \label{didntfit}
\end{align}
which was the main tool in Sec. \ref{sec:Important}
\end{document}
我希望有如下两个文件,无需手动给出引用的方程式和章节的编号/字母,保留每个部分内的超链接(保留手稿-手稿和附录-附录的超链接),但仅打印交叉引用附录<->手稿的编号/字母。
答案1
大卫卡莱尔 (David Carlisle) 的xr
包裹做到了这一点。
下一个文件是SE_Question_Ap
,与附录无关的文件。
\documentclass[reqno, a4paper,11pt]{amsart}
\usepackage{xr}
\externaldocument{SE_Question_Split}
\usepackage{xcolor}
\title{Appendix}
\usepackage[bookmarks=false]{hyperref}
\hypersetup{
colorlinks = true,
citecolor =green!70!black,
linkcolor=green!70!black
}
% \hypersetup{}
\begin{document}
\maketitle
% \section{Some important section}\label{sec:Important}
%
% Because of eq. (1) in Appendix A.
%
\appendix
\section{Some formulae}\label{sec:Unimportant}
We prove here
\begin{align}
a^2+b^2\neq c^2 \label{didntfit}
\end{align}
which was the main tool in Sec. \ref{sec:Important}
\end{document}
下一个文件是SE_Question_Split
。
\documentclass[reqno, a4paper,11pt]{amsart}
\usepackage{xr}
\externaldocument{SE_Question_Split_App}
\usepackage{xcolor}
\title{Manuscript and appendix}
\usepackage[bookmarks=false]{hyperref}
\hypersetup{
colorlinks = true,
citecolor =green!70!black,
linkcolor=green!70!black
}
% \hypersetup{}
\begin{document}
\maketitle
\section{Some important section}\label{sec:Important}
Because of eq. \eqref{didntfit} in Appendix \ref{sec:Unimportant}
% \appendix
%
% \section{Some formulae}\label{sec:Unimportant}
%
% We prove here
% \begin{align}
% a^2+b^2\neq c^2 \label{didntfit}
% \end{align}
% which was the main tool in Sec. \ref{sec:Important}
\end{document}