4

This is a question similar to

Dash after theorem number: e.g. Theorem 1'

I mimic the answer 1 in the following way. But it doesn't display proposition 1'.

\documentclass[12pt]{amsart}

\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\newtheorem{proposition}[theorem]{Proposition}

\newtheorem{manualtheoreminner}{Theorem}
\newenvironment{manualtheorem}[1]{%
  \renewcommand\themanualtheoreminner{#1}%
  \manualtheoreminner
}{\endmanualtheoreminner}


\newtheorem{manualpropositionminner}{Proposition}
\newenvironment{manualproposition}[1]{%
  \renewcommand\themanualtheoreminner{#1}%
  \manualpropositionminner
}{\endmanualpropositionminner}


\begin{document}

\begin{proposition} \label{a}
text a
\end{proposition}

\begin{manualproposition}{\ref{a}'} 
text

\end{manualproposition}

\end{document}

1 Answers1

5

You're using the wrong counter name:

\documentclass[12pt]{amsart}

\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\newtheorem{proposition}[theorem]{Proposition}

\newtheorem{manualtheoreminner}{Theorem}
\newenvironment{manualtheorem}[1]{%
  \renewcommand\themanualtheoreminner{#1}%
  \manualtheoreminner
}{\endmanualtheoreminner}

\newtheorem{manualpropositioninner}{Proposition}
\newenvironment{manualproposition}[1]{%
  \renewcommand\themanualpropositioninner{#1}%
  \manualpropositioninner
}{\endmanualpropositioninner}

\begin{document}

\begin{proposition} \label{a}
text a
\end{proposition}

\begin{manualproposition}{\ref{a}'} 
text
\end{manualproposition}

\end{document}

enter image description here

A more general solution that avoids defining different environments:

\documentclass[12pt]{amsart}

\usepackage{amsthm,xparse}

\newtheorem{theorem}{Theorem}
\newtheorem{proposition}[theorem]{Proposition}

\NewDocumentEnvironment{manual}{O{theorem}m}
 {%
  \addtocounter{theorem}{-1}%
  \renewcommand\thetheorem{#2}%
  \begin{#1}
 }
 {\end{#1}}

\begin{document}

\begin{proposition}\label{a}
text a
\end{proposition}

\begin{manual}[proposition]{\ref{a}'} 
text
\end{manual}

\begin{theorem}\label{b}
text b
\end{theorem}

\begin{manual}{\ref{b}'} 
text
\end{manual}

\begin{theorem}
Next
\end{theorem}

\end{document}

enter image description here

A version with a proper prime that uses boldface when appropriate.

\documentclass[12pt]{amsart}

\usepackage{amsthm,xparse}

\makeatletter
\DeclareRobustCommand{\thmprime}{%
  \begingroup
  \expandafter\in@\expandafter b\expandafter{\f@series}%
  \ifin@ \boldmath \fi
  $\m@th{}^{\prime}$%
  \endgroup
}
\makeatother

\newtheorem{theorem}{Theorem}
\newtheorem{proposition}[theorem]{Proposition}

\NewDocumentEnvironment{manual}{O{theorem}m}
 {%
  \addtocounter{theorem}{-1}%
  \renewcommand\thetheorem{#2}%
  \begin{#1}
 }
 {\end{#1}}

\begin{document}

\begin{proposition}\label{a}
text a
\end{proposition}

\begin{manual}[proposition]{\ref{a}\thmprime}\label{a'}
text
\end{manual}

\begin{theorem}\label{b}
text b
\end{theorem}

\begin{manual}{\ref{b}\thmprime}
text
\end{manual}

\begin{theorem}
Next
\end{theorem}

\ref{a} and \ref{a'}

\end{document}

enter image description here

egreg
  • 1,121,712