对已接受答案的后续问题这里和这里后者看起来很有希望,但有一个警告,那就是它不起作用。
- 我在用着
mdframed
和tikz
- 但没有“定理”。但是,我也想在分页符处看到带有“继续”提示的标题。怎么做?
截屏, 其次是平均能量损失:
\documentclass[a4paper]{article}
\usepackage{graphicx}
% \usepackage[heightrounded=true, textheight=735pt, textwidth=430pt, layoutvoffset=27pt, hcentering, includefoot, headheight=26pt, headsep=10pt, footskip=10pt, showframe]{geometry}
\usepackage[framemethod=TikZ]{mdframed}
% \mdfsetup{skipabove=0pt,skipbelow=1\topskip, nobreak=true, innertopmargin=0.5\baselineskip, innerbottommargin=0.5\baselineskip, frametitleaboveskip=2pt, frametitlebelowskip=1pt}
%%%
\mdfdefinestyle{my_style_testing}{frametitlebackgroundcolor=pink}
\usepackage{lipsum}
\begin{document}
\lipsum[4]
\vspace{5cm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{mdframed}[style=my_style_testing,frametitle=\color{blue}{What an interesting title this is...}]
hello world
\lipsum[1]
\vspace{5cm}
\lipsum[3]
\vspace{5cm}
\lipsum[2]
\end{mdframed}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
答案1
可能你需要做一些小的调整:
\documentclass[a4paper]{article}
\usepackage{graphicx}
\usepackage[framemethod=TikZ]{mdframed}
% \mdfsetup{skipabove=0pt,skipbelow=1\topskip, nobreak=true, innertopmargin=0.5\baselineskip, innerbottommargin=0.5\baselineskip, frametitleaboveskip=2pt, frametitlebelowskip=1pt}
%%%
\makeatletter
\mdfdefinestyle{my_style_testing}{
frametitlebackgroundcolor=pink,
splittopskip=3\baselineskip,
middleextra={
\node[
text width=\the\dimexpr\linewidth-2\mdf@outerlinewidth@length-%
2\mdf@middlelinewidth@length-2\mdf@innerlinewidth@length-%
2\mdf@innerleftmargin@length\relax,
anchor=north west,
font=\mdf@frametitlefont,
inner xsep=\mdf@innerleftmargin@length,
outer sep=0pt,
mdfframetitlebackground,
rounded corners={max(\mdf@roundcorner@length%
-\mdf@innerlinewidth@length%
-.5\mdf@middlelinewidth@length,0)%
}%
] at (P-|O) {\mdf@frametitle\ (Continued)};
},
secondextra={
\node[
text width=\the\dimexpr\linewidth-2\mdf@outerlinewidth@length-%
2\mdf@middlelinewidth@length-2\mdf@innerlinewidth@length-%
2\mdf@innerleftmargin@length\relax,
anchor=north west,
font=\mdf@frametitlefont,
inner xsep=\mdf@innerleftmargin@length,
outer sep=0pt,
mdfframetitlebackground,
rounded corners={max(\mdf@roundcorner@length%
-\mdf@innerlinewidth@length%
-.5\mdf@middlelinewidth@length,0)%
}%
] at (P-|O)
{%
\vbox{%
\parskip\z@\relax%
\parindent\z@\relax%
\vskip\mdf@frametitleaboveskip@length%
\mdf@frametitle\ (Continued)%
\mdf@@frametitlerule\relax%
\unvbox\mdf@splitbox@one\relax%
}%
};
}
}
\makeatother
\usepackage{lipsum}
\begin{document}
\lipsum[4]
\vspace{5cm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{mdframed}[style=my_style_testing,frametitle=\color{blue}{What an interesting title this is...}]
hello world
\lipsum[1]
\vspace{5cm}
\lipsum[3]
\vspace{5cm}
\lipsum[2]
\end{mdframed}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
答案2
如果是短文档,则“手动的”解决方案,即“伪造它”:只是另一个带有continued
在标题中,就可以了。对于较长的文档“自动的”但解决方案是可取的。