我想写一些输出有些自定义的定理,如“定理 A、定理 B、定理 B^+、定理 B^#”等,并希望这些特殊定理位于正常定理计数器之外,即其他定理保留自己的编号,如“定理 1.1、定理 1.2”,即使“定理 B”位于它们之间。有没有简单的方法来实现这一点?
这可能与问题有关这里但我认为这不是我的问题。提前谢谢!
答案1
像这样吗?
\documentclass{article}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{theoremvar}{Theorem}
\newenvironment{theorem*}[1]
{\renewcommand{\thetheoremvar}{#1}\theoremvar}
{\endtheoremvar}
\begin{document}
\section{Title}
\ref{normal1},
\ref{normal2},
\ref{normal3},
\ref{normal4},
\ref{special1},
\ref{special2},
\ref{special3}
\begin{theorem}\label{normal1}
This is a normal theorem.
\end{theorem}
\begin{theorem}\label{normal2}
This is a normal theorem.
\end{theorem}
\begin{theorem*}{A}\label{special1}
This is a special theorem.
\end{theorem*}
\begin{theorem}\label{normal3}
This is a normal theorem.
\end{theorem}
\begin{theorem*}{B$^+$}\label{special2}
This is a special theorem.
\end{theorem*}
\begin{theorem*}{B$^{\sharp}$}\label{special3}
This is a special theorem.
\end{theorem*}
\begin{theorem}\label{normal4}
This is a normal theorem.
\end{theorem}
\end{document}
环境theorem*
对于特殊标签有一个强制参数。