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 Answer 1

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

5
  • that's not a prime. it's an apostrophe. May 22, 2018 at 21:06
  • @barbarabeeton That's what the OP is using in the body of the question. If a prime is wanted, \ref{foo}$'$ can be used.
    – egreg
    May 22, 2018 at 21:07
  • yes, but in the title he has $1'$ which definitely indicates a prime. the appearance of an apostrophe is a limitation of what's available on a keyboard. May 22, 2018 at 21:11
  • @barbarabeeton Happier now? ;-)
    – egreg
    May 22, 2018 at 21:32
  • yes. the pedant is indeed happier. thank you. May 23, 2018 at 13:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .