通常使用 时amsthm
,我们会得到类似Theorem 1.1
、Corollary 1.2
、Definition 1.3
等的结果。但是,如何将数字放在“定理”和“推论”名称前面,即得到1.1 Theorem
、1.2 Corollary
、1.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
答案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}