花俏的定理風格

花俏的定理風格

我想寫一些輸出有點自訂的定理,例如「定理 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*有一個特殊標籤的強制參數。

相關內容