Fantazyjny styl twierdzenia
Sep 04 2020
Chcę napisać kilka twierdzeń z wyjściami, które są nieco samokreślone, takie jak „Twierdzenie A, Twierdzenie B, Twierdzenie B ^ +, Twierdzenie B ^ #” itd. I chcę, aby teorie specjalne były poza normalnym licznikiem twierdzeń, tj. twierdzenia zachowują swoją własną numerację, taką jak „Twierdzenie 1.1, Twierdzenie 1.2”, nawet jeśli „Twierdzenie B” jest między nimi. Czy jest na to łatwy sposób?
Może to być związane z pytaniem tutaj, ale myślę, że to nie jest cenne dla mojego pytania tutaj. Z góry dziękuję!
Odpowiedzi
6 egreg Sep 03 2020 at 23:27
Coś takiego?
\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*Środowisko ma obowiązkową argument na specjalnej etykiecie.