![如何抑制 mdframed 标题中的缩进](https://linux22.com/image/361985/%E5%A6%82%E4%BD%95%E6%8A%91%E5%88%B6%20mdframed%20%E6%A0%87%E9%A2%98%E4%B8%AD%E7%9A%84%E7%BC%A9%E8%BF%9B.png)
考虑以下乳胶文件:
\documentclass[11pt]{report}
\usepackage[english,frenchb]{babel}
\usepackage[framemethod=TikZ]{mdframed}
\mdfdefinestyle{defstyle}{%
linecolor=red,linewidth=2pt,%
frametitlerule=true,%
frametitlebackgroundcolor=gray!20,
innertopmargin=\topskip,
}
\mdtheorem[style=defstyle]{definition}{Definition}
\begin{document}
\begin{definition}
An infinite set $A$ is countable if there exists a bijection $f$ from the
natural numbers into $A$.
\end{definition}
\end{document}
因为有这么一行字:
\usepackage[english,frenchb]{babel}
段落有默认缩进(我想保留)。但是此缩进还会将 \mdtheorem 命令创建的 mdframed 框的标题移到右侧。有没有办法保留段落的正默认缩进,但使 mdframed 的框标题保持正常对齐?
答案1
像这样?
\documentclass[11pt]{report}
\usepackage[english,french]{babel}
\usepackage[framemethod=TikZ]{mdframed}
\mdfdefinestyle{defstyle}{%
linecolor=red, linewidth=2pt,%
frametitlerule=true,%
frametitlebackgroundcolor=gray!20,
innertopmargin=\topskip,
frametitlealignment =\raggedright\noindent
}
\mdtheorem[style=defstyle]{definition}{Definition}
\begin{document}
\begin{definition}
An infinite set $A$ is countable if there exists a bijection $f$ from the
natural numbers into $A$.
\end{definition}
\end{document}