定理编号:使用破折号代替句点

定理编号:使用破折号代替句点

在下面的代码中,我的定理头如下所示:

1.1 定理

我希望它看起来像这样:

1-1 定理

梅威瑟:

\documentclass{report}
\usepackage{amsthm}

\newtheoremstyle{theorem}
{1em} % Space above
{} % Space below
{\itshape} % Body font
{} % Indent amount
% Indent amount: empty = no indent; \parindent = normal paragraph indent
{\bfseries\itshape} % Theorem head font
{} % Punctuation after theorem head
{1em} % Space after theorem head
% Space after theorem head: { } = normal interword space; \newline = line break
{\thmnumber{#2\hspace{0.375cm}}\thmname{#1}\thmnote{ (\normalfont\textit{#3})}} % Theorem head spec

\theoremstyle{theorem}
\newtheorem{thm}{Theorem}[chapter]

\begin{document}
\begin{thm}
\end{thm}
\end{document}

欢迎对此代码进行任何其他改进。

答案1

创建定理后立即通过以下方式更改定理编号的显示方式\renewcommand

\renewcommand{\thethm}{\thechapter-\arabic{thm}}

这是一个完整的最小示例:

在此处输入图片描述

\documentclass{report}
\usepackage{amsthm}

\newtheoremstyle{theorem}
{1em} % Space above
{} % Space below
{\itshape} % Body font
{} % Indent amount
% Indent amount: empty = no indent; \parindent = normal paragraph indent
{\bfseries\itshape} % Theorem head font
{} % Punctuation after theorem head
{1em} % Space after theorem head
% Space after theorem head: { } = normal interword space; \newline = line break
{\thmnumber{#2\hspace{0.375cm}}\thmname{#1}\thmnote{ (\normalfont\textit{#3})}} % Theorem head spec

\theoremstyle{theorem}
\newtheorem{thm}{Theorem}[chapter]
\renewcommand{\thethm}{\thechapter-\arabic{thm}}

\begin{document}
\setcounter{chapter}{1}
\begin{thm}
\end{thm}
\end{document}

相关内容