Declaretheoremstyle headpostspace = \newline + indent?

Declaretheoremstyle headpostspace = \newline + indent?

我在声明定理样式时遇到了问题。我希望定义的第一行位于新行上,并采用正常缩进。如果我尝试添加\par而不是\newlinefor postheadspace,则会出错。而且postheadhook似乎不起作用。

先感谢您 :)

\documentclass[12pt,reqno]{amsbook}

\usepackage{thmtools}

\declaretheoremstyle[
headfont=\scshape\bfseries, 
headindent = \parindent,
postheadhook = {\hspace{0mm}\newline},
postheadspace = \newline, 
spaceabove = 0.5cm, 
spacebelow = 0.5cm]{mydef}

\newtheorem{Theorem}{Theorem}[chapter]

\theoremstyle{mydef}

\newtheorem{Definition}[Theorem]{Definition}
\begin{document}

\begin{Definition}
This is a very long definition which i want to start with indent on the next row instead of from the beggining

Like this
\end{Definition}

\end{document}

在此处输入图片描述

答案1

为了正确应用样式,您需要使用\declaretheorem来定义结构,而不是\newtheorem。使用postheadhook = {\hspace*{\parindent}}您将获得所需的输出(我将结构保留Theorem为 ,\newtheorem因为显然它不应该具有mydef样式;如果您想将此样式应用于Theorem,请使用\declaretheorem;如果您不想要头部的缩进,请删除行headindent = \parindent):

\documentclass[12pt,reqno]{amsbook}
\usepackage{thmtools}

\declaretheoremstyle[
headfont=\scshape\bfseries, 
headindent = \parindent,
postheadhook = {\hspace*{\parindent}},
postheadspace = \newline, 
spaceabove = 0.5cm, 
spacebelow = 0.5cm]{mydef}

\newtheorem{Theorem}{Theorem}[chapter]
\declaretheorem[style=mydef,numberlike=Theorem]{Definition}

\begin{document}

\begin{Definition}
This is a very long definition which will start with indent on the next row instead of from the beginning.

Like this
\end{Definition}

\end{document}

在此处输入图片描述

相关内容