我在一篇论文的正文中给出了一个定理,即定理 2,标签为 {theorem-abc}。我想在附录中提供这个定理的证明。
1) 如何在附录章节标题中交叉引用该定理?
我想要的章节标题是“定理 2 的证明”。
2)我该如何在上述章节中再次重申该定理?
我想要的是“定理 2. xxxxxxx”,然后是它的证明。
添加:文档类文件关于附录的定义如下。
\def\appendix{\par
\section*{APPENDIX}
\setcounter{section}{0}
\setcounter{subsection}{0}
\def\thesection{\Alph{section}} }
我发现了类似的问题这里。但是它也没有解决我的问题1)。
MWE:课程文件可供下载这里。
\documentclass{vldb}
\usepackage{thmtools, thm-restate}
\usepackage{hyperref}
\declaretheorem{theorem}
\begin{document}
\section{Test Section}
\begin{theorem}
Test theorem
\end{theorem}
\begin{restatable}[Fundamental Theorem of Algebra]{theorem}{fta}
\label{thm:FTA}
Every non-constant single-variable polynomial with complex coefficients has at least one complex root.
\end{restatable}
\appendix
\section[Proof of the Fundamental Theorem of Algebra]{Proof of Theorem~\ref{thm:FTA} (See page~\pageref{thm:FTA})}
\fta*
\begin{proof}
Assume...
\end{proof}
\end{document}
答案1
2- 您可以使用restatable
提供的环境thmtools
。
1- 由于环境生成了一个锚点,因此您可以使用标准的\label
, \ref
( \pageref
) 机制进行交叉引用。
完整示例:
\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools, thm-restate}
\usepackage{hyperref}
\declaretheorem{theorem}
\begin{document}
\section{Test Section}
\begin{theorem}
Test theorem
\end{theorem}
\begin{restatable}[Fundamental Theorem of Algebra]{theorem}{fta}
\label{thm:FTA}
Every non-constant single-variable polynomial with complex coefficients has at least one complex root.
\end{restatable}
\appendix
\section[Proof of the Fundamental Theorem of Algebra]{Proof of Theorem~\ref{thm:FTA} (See page~\pageref{thm:FTA})}
\fta*
\begin{proof}
Assume...
\end{proof}
\end{document}
现在问题已经编辑完毕,并且所使用的文档类已知,下面是一个使用vldb
文档类的解决方案(可以在问题中找到该类的链接):
\documentclass{vldb}
\usepackage{textcase}
\usepackage{thmtools,thm-restate}
\usepackage{hyperref}
\makeatletter
\def\@sect#1#2#3#4#5#6[#7]#8{%
\ifnum #2>\c@secnumdepth
\let\@svsec\@empty
\else
\refstepcounter{#1}%
\edef\@svsec{%
\begingroup
%\ifnum#2>2 \noexpand\rm \fi % changed to next 29 July 2002 gkmt
\ifnum#2>2 \noexpand#6 \fi
\csname the#1\endcsname
\endgroup
\ifnum #2=1\relax .\fi
\hskip 1em
}%
\fi
\@tempskipa #5\relax
\ifdim \@tempskipa>\z@
\begingroup
#6\relax
\@hangfrom{\hskip #3\relax\@svsec}%
\begingroup
\interlinepenalty \@M
\if@uchead
\MakeTextUppercase{#8}% HERE
\else
#8%
\fi
\par
\endgroup
\endgroup
\csname #1mark\endcsname{#7}%
\vskip -12pt %gkmt, 11 aug 99 and GM July 2000 (was -14) - numbered section head spacing
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
\protect\numberline{\csname the#1\endcsname}%
\fi
#7%
}%
\else
\def\@svsechd{%
#6%
\hskip #3\relax
\@svsec
\if@uchead
\uppercase{#8}%
\else
#8%
\fi
\csname #1mark\endcsname{#7}%
\addcontentsline{toc}{#1}{%
\ifnum #2>\c@secnumdepth \else
\protect\numberline{\csname the#1\endcsname}%
\fi
#7%
}%
}%
\fi
\@xsect{#5}\hskip 1pt
\par
}
\makeatother
\declaretheorem{theorem}
\begin{document}
\section{Test Section}
\begin{theorem}
Test theorem
\end{theorem}
\begin{restatable}[Fundamental Theorem of Algebra]{theorem}{fta}
\label{thm:FTA}
Every non-constant single-variable polynomial with complex coefficients has at least one complex root.
\end{restatable}
\appendix
\section[Proof of the Fundamental Theorem of Algebra]{Proof of Theorem~\ref{thm:FTA}}
\fta*
\begin{proof}
Assume...
\end{proof}
\end{document}
解释:
问题在于vldb.cls
将章节(以及部分)标题设置为大写,并使用旧的 TeX\uppercase
命令来实现这一点;如果特殊命令(例如)位于(或)\ref
的参数中,则会产生问题,因为不会将它们识别为特殊命令并以错误的方式处理它们(LaTeX 命令在这方面也会表现不佳)。为了纠正这种情况,可以重新定义(或修补)内部命令,以使用(来自包)而不是有问题的命令。在上面的示例代码中,更改是用 表示的。\section
\part
\uppercase
\MakeUppercase
\@sect
\MakeTextUppercase
textcase
\uppercase
% HERE