我正在使用可重述定理,以便我可以在附录中重述它们。我不希望出现一些原始定理陈述。有没有办法隐藏原始陈述,同时保留定义\标签以便可以引用它?
\documentclass[12pt,oneside]{book}
\usepackage{amsmath}
\newtheorem{theorem}{Theorem}
\usepackage{thmtools}
\usepackage{thm-restate}
\begin{document}
\begin{restatable}[Thm 1]{theorem}{thmone}\label{thm1}
Thm 1
\end{restatable}
\thmone*
\end{document}
答案1
这里有一个解决方法——放置一个\nexttheorem{<label>}
以获得一个按顺序编号的a theorem
,并将一个fixedtheorem
环境放在附录中的\ref{<label>}
原始位置:
\documentclass{article}
\usepackage{amsmath}
\newtheorem{theorem}{Theorem}
\usepackage{thmtools,thm-restate}
\newcommand{\nexttheorem}[1]{%
\refstepcounter{theorem}%
\label{#1}%
\ignorespaces}
\newenvironment{fixedtheorem}[1]
{\renewcommand{\thetheorem}{#1}%
\renewcommand{\refstepcounter}[1]{}%
\begin{theorem}}
{\end{theorem}}
\begin{document}
\section{A section}
See Theorems~\ref{thm:first}, \ref{thm:second} and~\ref{thm:third}.
\begin{theorem}[first]\label{thm:first}
This is the first theorem.
\end{theorem}
\begin{restatable}[second]{theorem}{thmtwo}\label{thm:second}
This is the second theorem.
\end{restatable}
\nexttheorem{thm:third}
\section*{Appendix}
\thmtwo*
\begin{fixedtheorem}{\ref{thm:third}}[third]
This is the third theorem.
\end{fixedtheorem}
\end{document}