![thmtools:框和文本之间的间距](https://linux22.com/image/472977/thmtools%EF%BC%9A%E6%A1%86%E5%92%8C%E6%96%87%E6%9C%AC%E4%B9%8B%E9%97%B4%E7%9A%84%E9%97%B4%E8%B7%9D.png)
使用包thm工具我怎样才能使 box-box、text-box 和 box-text 的间距都相同?box-text 和 text-box 的间距不一样。而且 box-box 的间距通常较大(我假设每个框的额外空间都已添加),当多个框连续时,会产生不必要的空间。
这是我使用的全部代码:
\documentclass{article}
%%Packages%%
\usepackage{amsmath,amssymb,amsthm}
\usepackage[usenames,svgnames,dvipsnames]{xcolor}
\usepackage{thmtools}
\usepackage[framemethod=TikZ]{mdframed}
%%Thmtools%%
%Theorem style
\declaretheoremstyle[
headfont=\bfseries,
bodyfont=\itshape,
mdframed={
linewidth=0.5pt,
nobreak=true,
innerbottommargin=7pt
}
]{theoremstyle}
\declaretheorem[
style=theoremstyle,
name=Theorem,
numbered=no
]{theorem]
\begin{document}
\begin{theorem}
This is a theorem.
\end{theorem}
This is some text.
\begin{theorem}
This is a theorem.
\end{theorem}
\begin{theorem}
This is a theorem.
\end{theorem}
\end{document}
答案1
由于 mdframed 并未得到积极维护,我建议您使用tcolorbox
。该\tcolorboxenvironment
命令可以使用带有自定义选项的 tcolorbox 包装任何环境。
\documentclass{article}
%%Packages%%
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{tcolorbox}
%%Thmtools%%
%Theorem style
\declaretheoremstyle[
headfont=\bfseries,
bodyfont=\itshape,
]{theoremstyle}
\declaretheorem[
style=theoremstyle,
name=Theorem,
numbered=no,
]{theorem}
\tcolorboxenvironment{theorem}{
colback=white,
sharp corners,
boxrule=0.5pt,
left=0.3cm,
right=0.3cm,
}
\begin{document}
\begin{theorem}
This is a theorem.
\end{theorem}
This is some text.
\begin{theorem}
This is a theorem.
\end{theorem}
\begin{theorem}
This is a theorem.
\end{theorem}
\end{document}