我刚刚搜索了一种方法,可以在使用阴影theorem
环境时允许分页符thmtools
。我发现我的问题在某种程度上得到了回答这里(第二种解决方案)并附有该包作者 Ulrich Schwarz 的评论。但是,我想继续定义theorem
类似环境,如下所示
\declaretheorem[shaded={bgcolor=LightGrey},name=Definition,parent=chapter,
% refname={definition,definitions},
Refname={Definition,Definitions}]{Def}
即无需theoremstyle
为我定义的每个环境声明额外的(相当庞大的)内容。
是否可以全局使用“ preheadhook
- postfoothook
-trick” mdframed
,同时保留上述示例的整体界面和样式\declaretheorem
?
据我所知,无论如何,阴影theorem
环境thmtools
已经实现了mdframed
,所以我认为应该可以通过重新定义一些内部thmtools
命令、设置一些全局选项或类似的东西来允许分页符。
我希望这实际上是一个有效的问题,因为它或多或少在 2011 年已经得到解答了。
答案1
中的阴影定理thmtools
是用shadethm
包实现的,而不是mdframed
。
mdframed
你可以通过传递选项来做阴影
mdframed={backgroundcolor=LightGrey}
到定理声明。这将允许在定义中分页,并给出如下例所示的输出。
如果要传递的选项mdframed
比较复杂,可以设置样式
\usepackage{mdframed}
\mdfdefinestyle{thmstyle}{backgroundcolorl=LightGrey,
leftmargin=40pt,
rightmargin=40pt}
然后通过
mdframed={style=thmstyle}
到声明而不是选项shaded
。
\documentclass{book}
\usepackage{amsthm}
\usepackage[svgnames]{xcolor}
\usepackage{thmtools}
\declaretheorem[mdframed={backgroundcolor=LightGrey},
name=Definition,parent=chapter,
Refname={Definition,Definitions}]{Def}
\begin{document}
\mbox{}
\vspace{14cm}
\begin{Def}
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
Some long definition.
\end{Def}
\end{document}