在我的自定义定理和证明环境中使用 mdframed 框时,我收到很多“Overfull \vbox”错误。我已将问题简化为下面的最小示例。我使用方程式来下推环境,以便它们可以拆分到两个页面。
问题是什么?我该如何解决这些过满的 \vbox 警告?
\documentclass[a4paper, 12pt]{article}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{amsthm}
\usepackage{amsmath}
\newmdenv{proofbox}
\newmdenv{theorembox}
\newtheorem{theorem_}[equation]{Theorem}
\newenvironment{theorem}
{
\begin{theorembox}
\begin{theorem_}
}
{
\end{theorem_}
\end{theorembox}
}
\newenvironment{fproof}[1][]
{
\begin{proofbox}
#1
}
{
\end{proofbox}
}
\begin{document}
\begin{equation}
\begin{aligned}
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2.
\end{aligned}
\end{equation}
\begin{theorem}
A theorem.
\end{theorem}
\begin{fproof}
\begin{equation}
\begin{aligned}
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2.
\end{aligned}
\end{equation}
\end{fproof}
\end{document}
PDF 格式如下:
答案1
不要使用mdframed
:它已被废弃,因为与此同时tcolorbox
出现了更强大的软件包。
\documentclass[a4paper, 12pt]{article}
\usepackage[many]{tcolorbox}
\usepackage{amsthm}
\usepackage{amsmath}
\newtheorem{theorem}[equation]{Theorem}
\NewEnvironmentCopy{fproof}{proof}
\tcolorboxenvironment{theorem}{sharp corners,colback=white,boxrule=0.4pt}
\tcolorboxenvironment{fproof}{}
\begin{document}
\begin{equation}
\begin{aligned}
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2.
\end{aligned}
\end{equation}
\begin{theorem}
A theorem.
\end{theorem}
\begin{fproof}
We see that
\begin{equation}
\begin{aligned}
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2 \\
E & = mc^2.
\end{aligned}
\end{equation}
so we finished our proof.
\end{fproof}
\end{document}
proof
根据您的喜好定制您的盒子。