我已经使用mdframed
并期望输出相同innertopmargin space
并继续next page
:
我的 MWE 是:
\documentclass{book}
\usepackage{mathptmx,lipsum,mdframed,showframe}
\global\mdfdefinestyle{greenbox}{%
linecolor=white,
linewidth=0pt,%
frametitlerule=false,%
frametitlefont=\bfseries\fontsize{10}{13}\selectfont,
hidealllines=true,
backgroundcolor=green,
innertopmargin=25pt,
font=\fontsize{9}{12}\selectfont,
innerleftmargin=14pt,
innerrightmargin=14pt,
innerbottommargin=13pt
}
\begin{document}
\chapter{Chapter Title}
\lipsum[1-4]
\lipsum[5-7]
\begin{mdframed}[style=greenbox]
\lipsum[8-10]
\end{mdframed}
\end{document}
答案1
与往常一样,您提出问题mdframed
,我/我们使用来回答tcolorbox
;-)
\documentclass{book}
\usepackage{mathptmx,lipsum,showframe}
\usepackage[most]{tcolorbox}
\newtcolorbox{greenbox}[1][]{%
enhanced jigsaw,
arc=0pt,
outer arc=0pt,
boxsep=1pt,
top=25pt,
bottom=13pt,
left=14pt,
right=14pt,
boxrule=0pt,
colback=green,
breakable,
parbox=false,
#1
}
\begin{document}
\chapter{Chapter Title}
\lipsum[1-4]
\lipsum[5-7]
\begin{greenbox}
\lipsum[8-10]
\end{greenbox}
\end{document}