1

I want to give two versions of a theorem and number them theorem 1 and theorem 1', like with the questions Dash after theorem number: e.g. Theorem 1' and Theorem numbering like Theorem $1'$.

I later want to refer to theorem 1' using cleveref, and recognise that it is a theorem, so be able to say eg "Theorems 1' and 3". I haven't been able to make this work, either using the cited answers or otherwise. My attempted code and a screenshot of the output are below. Any suggestions of what I'm doing wrong (or just an alternative approach to the problem) would be gratefully received. One thing I've noticed is that changing for example to \Crefname{manualtheorem}{Test}{Tests} does not change the third line of output at all, so something funny is going on there.

\documentclass{article}
\usepackage{amsthm}
\usepackage{cleveref}

\newtheorem{theorem}{Theorem}

\newtheorem{manualtheoreminner}{Theorem}
\newenvironment{manualtheorem}[1]{%
  \renewcommand\themanualtheoreminner{#1}%
  \manualtheoreminner
}{\endmanualtheoreminner}
\Crefname{manualtheorem}{Theorem}{Theorems}
\crefname{manualtheorem}{theorem}{theorems}
\begin{document}

\begin{theorem}\label{foo}
This is a theorem.
\end{theorem}
\begin{theorem}\label{foo2}
    This is another theorem
    \end{theorem}

\begin{manualtheorem}{\ref{foo}'}\label{baz}
This is a theorem'.
\end{manualtheorem}
\begin{manualtheorem}{\ref{foo2}'}\label{baz2}
    This is another theorem'.
\end{manualtheorem}

\Cref{foo,foo2}, as desired, gives  ``Theorems 1 and 2.''

\Cref{baz,baz2}, does not give the desired ``Theorems 1' and 2'.''

\Cref{foo,baz} does not give the desired ``Theorems 1 and 1'.''
\end{document}

Output of the latex code.

1 Answer 1

0

Cleveref adapts the label command to include an optional extra argument which describes which name to give the object. So one simply needs to replace \label{baz} with \label[theorem]{baz} and \label{baz2} with \label[theorem]{baz2}.

You must log in to answer this question.

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