# Placing a star before (swapped) theorem number in amsart

I'm using the amsart document class with swapped theorem numbers (by using \swapnumbers), and I'd like to label some of my theorems, lemmas, examples, etc. with a star in front of the number like *4.5. Theorem to indicate that they're not necessary for the reader to know. Is there a simple way to do this?

• Should the asterisk also appear in cross-references? – egreg Sep 25 '16 at 16:56
• if it's acceptable to have the asterisk always in the outside margin, the marginnote package may be used, with \marginnote{*} inserted just before the text of the theorem. – barbara beeton Sep 25 '16 at 17:11
• For my purposes appearing in the cross references is okay because I don't need to cross reference these starred pieces, but I wouldn't want anything to spill over into the margin. – Peter Haine Sep 25 '16 at 17:53

It is easy if the asterisk should also appear in cross-references.

\documentclass{amsart}
\usepackage{etoolbox}

\swapnumbers
\newtheorem{theorem}{Theorem}
\numberwithin{theorem}{section}
\newenvironment{theorem*}
{\preto{\thetheorem}{*}\theorem}
{\endtheorem}

\begin{document}

\section{Title}

\begin{theorem}\label{easy}
This is an easy theorem.
\end{theorem}

\begin{theorem*}\label{hard}
The zeros of the zeta function have real part equal to $1/2$.
\end{theorem*}

Theorem~\ref{easy} is an easy consequence of theorem~\ref{hard}
a proof of which is too long for this short note.

\end{document}


A non hacked version without the asterisk in cross-references allows for having the asterisk out in the margin.

\documentclass{amsart}

\newtheoremstyle{swapped}%  <name>
{\topsep}%                <space above>
{\topsep}%                <space below>
{\itshape}%               <body font>
{}%                       <indent amount>
{\thmnumber{\textnormal{#2} }\thmname{#1}\thmnote{ (#3)}}% <theorem head spec>
\newtheoremstyle{starred}%  <name>
{\topsep}%                <space above>
{\topsep}%                <space below>
{\itshape}%               <body font>
{}%                       <indent amount>
{\thmnumber{\textnormal{\makebox[0pt][r]{*}#2} }\thmname{#1}\thmnote{ (#3)}}% <theorem head spec>

\theoremstyle{swapped}
\newtheorem{theorem}{Theorem}
\numberwithin{theorem}{section}

\theoremstyle{starred}
\newtheorem{theorem*}[theorem]{Theorem}

\begin{document}

\section{Title}

\begin{theorem}\label{easy}
This is an easy theorem.
\end{theorem}

\begin{theorem*}\label{hard}
The zeros of the zeta function have real part equal to $1/2$.
\end{theorem*}

Theorem~\ref{easy} is an easy consequence of theorem~\ref{hard}
a proof of which is too long for this short note.

\end{document}


A hacked version of the same, which allows avoiding \newtheoremstyle:

\documentclass{amsart}
\usepackage{etoolbox}

\swapnumbers
\newtheorem{theorem}{Theorem}
\numberwithin{theorem}{section}

\makeatletter
\newenvironment{theorem*}
{\patchcmd\@thm{\csname}{\makebox[0pt][r]{*}\csname}{}{}\theorem}
{\endtheorem}
\makeatother

\begin{document}

\section{Title}

\begin{theorem}\label{easy}
This is an easy theorem.
\end{theorem}

\begin{theorem*}\label{hard}
The zeros of the zeta function have real part equal to $1/2$.
\end{theorem*}

Theorem~\ref{easy} is an easy consequence of theorem~\ref{hard}
a proof of which is too long for this short note.

\end{document}

• Thanks for such a thorough answer! This is exactly what I was looking for. – Peter Haine Sep 25 '16 at 17:51
• @PeterHaine Which one of the three? – egreg Sep 25 '16 at 17:52
• for what I'm doing at the moment, the first is the most convenient, but I'm genuinely interested in how to do all of them. – Peter Haine Sep 25 '16 at 17:58