定理编号如定理 $1'$

定理编号如定理 $1'$

这个问题类似于

定理编号后加破折号:例如定理 1'

我按照以下方式模仿答案 1。但它没有显示命题 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

您使用了错误的计数器名称:

\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}

在此处输入图片描述

避免定义不同环境的更通用的解决方案:

\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}

在此处输入图片描述

带有适当撇号的版本,并在适当的时候使用粗体。

\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}

在此处输入图片描述

相关内容