如何将“定理 1.1”改为“1.1 定理”?

如何将“定理 1.1”改为“1.1 定理”?

通常使用 时amsthm,我们会得到类似Theorem 1.1Corollary 1.2Definition 1.3等的结果。但是,如何将数字放在“定理”和“推论”名称前面,即得到1.1 Theorem1.2 Corollary1.3 Definition(1.1) Theorem(1.2) Corollary、之类的结果(1.3) Definition呢?

我目前在这部分的代码是

\theoremstyle{theorem}
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}

\theoremstyle{definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{problem}[theorem]{Problem}
\newtheorem{definition}[theorem]{Definition}

\theoremstyle{remark}
\newtheorem*{remark}{Remark}

我该如何调整?谢谢大家的回答和帮助!

PS:如果这个问题是在 TeX.SE 中被问到的,我感到很抱歉,但我在这里尝试了很多搜索,却一无所获。

答案1

\swapnumbers包中的命令正是amsthm为此任务而设计的:

\documentclass{report}
\usepackage[T1]{fontenc}
\usepackage{amsthm}

\swapnumbers
\newtheorem{theorem}{Theorem}[chapter]

\begin{document}

\chapter{Chapter title}

\begin{theorem}
Text.
\end{theorem}

\end{document}

在此处输入图片描述

答案2

抱歉,我发现了定理风格类似(1.1 定理)和自定义定理类似(1.2 中值定理)非常有用。以下是我改编的代码:

\newtheoremstyle{theorem}% name %TeX.SE 204200
  {}%         Space above, empty = `usual value'
  {}%         Space below
  {\itshape}% Body font
  {}%         Indent amount 
  {\scshape}% Head font
  {.}%        Punctuation after head
  {12pt}% Space after head: \newline = linebreak
   {\def\temp{#3}\ifx\temp\empty\textbf{\thmnumber{#2 }}\thmname{#1}\else\thmnumber{#2}\thmnote{#3}\fi}%         Head spec
   
\newtheoremstyle{definition}% name %TeX.SE 204200
  {}%         Space above, empty = `usual value'
  {}%         Space below
  {}% Body font
  {}%         Indent amount 
  {\scshape}% Head font
  {.}%        Punctuation after head
  {12pt}% Space after head: \newline = linebreak
   {\def\temp{#3}\ifx\temp\empty\textbf{\thmnumber{#2 }}\thmname{#1}\else\thmnumber{#2}\thmnote{#3}\fi}%         Head spec


\theoremstyle{theorem}
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}

\theoremstyle{definition}
\newtheorem{example}[theorem]{Example}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{problem}[theorem]{Problem}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{convention}[theorem]{Convention}

\theoremstyle{remark}
\newtheorem*{remark}{Remark}

相关内容