分页符问题

分页符问题

请问我找不到这个分页符问题的解决方案,谢谢。

\documentclass{article}
\usepackage{tcolorbox}
\usepackage[margin=1.5cm]{geometry}
\usepackage{tikz}
\tcbuselibrary{skins,breakable}
\usepackage{lipsum}
%%
\newtcolorbox[auto counter]{mybox}[1][]
{enhanced ,frame hidden,colback=white,breakable,title=#1,attach boxed title to top left={xshift=+1.5cm,yshift*=-0.6cm},
 boxed title style={top=.5mm,bottom=+.5mm},
overlay ={
\fill[white]([xshift=-0.4cm]title.north west) rectangle
([xshift=+0.4cm,yshift=-0.05cm]title.south east);
\node[font=\bf] at(title.center){\textcolor{blue}{#1}};
%
\draw[blue,line width=1pt, fill=cyan!30]
(frame.north west)--([xshift=-0.53cm,yshift=0.3cm]title.west)--([xshift=-0.1cm,yshift=-0.32cm]title.west)--
([xshift=0.1cm,yshift=-0.32cm]title.east)--([xshift=0.5cm,yshift=0.3cm]title.east)--(frame.north east)--( frame.south east)--( frame.south west)-- cycle;
}
}
\begin{document}

\begin{mybox}[Definition]
\lipsum[1-10]
\end{mybox}
\end{document}

在此处输入图片描述

答案1

您需要修改损坏的案例的覆盖图。手册第 75 页对此进行了描述tcolorbox。首先,您可以这样做

\documentclass{article}
\usepackage{tcolorbox}
\usepackage[margin=1.5cm]{geometry}
\usepackage{tikz}
\tcbuselibrary{skins,breakable}
\usepackage{lipsum}
%%
\tikzset{pics/mybox/first/.style={code={
\fill[white]([xshift=-0.4cm]title.north west) rectangle
([xshift=+0.4cm,yshift=-0.05cm]title.south east);
\node[font=\bfseries,text=blue] at(title.center){#1};
}}}
\newtcolorbox[auto counter]{mybox}[1][]
{enhanced ,frame hidden,colback=white,breakable,title=#1,attach boxed title to top left={xshift=+1.5cm,yshift*=-0.6cm},
 boxed title style={top=.5mm,bottom=+.5mm},
 /tcb/overlay unbroken={
 \fill[white]([xshift=-0.4cm,yshift=4pt]title.north west) rectangle
([xshift=+0.4cm,yshift=-0.05cm]title.south east);
\node[font=\bfseries,text=blue] at(title.center){#1};
%
\draw[blue,line width=1pt, fill=cyan!30]
(frame.north west)--([xshift=-0.53cm,yshift=0.3cm]title.west)--([xshift=-0.1cm,yshift=-0.32cm]title.west)--
([xshift=0.1cm,yshift=-0.32cm]title.east)--([xshift=0.5cm,yshift=0.3cm]title.east)--(frame.north east)--(frame.south east)--(frame.south west)-- cycle;},
overlay first={
\fill[white]([xshift=-0.4cm,yshift=4pt]title.north west) rectangle
([xshift=+0.4cm,yshift=-0.05cm]title.south east);
\node[font=\bfseries,text=blue] at(title.center){#1};
%
\draw[blue,line width=1pt, fill=cyan!30]
(frame.south west)--(frame.north west)--([xshift=-0.53cm,yshift=0.3cm]title.west)--
([xshift=-0.1cm,yshift=-0.32cm]title.west)--
([xshift=0.1cm,yshift=-0.32cm]title.east)
--([xshift=0.5cm,yshift=0.3cm]title.east)--(frame.north east)
--(frame.south east);
},
overlay middle={
\path[fill=cyan!30]
    (frame.north west) rectangle (frame.south east);
\draw[blue,line width=1pt] (frame.north west) -- (frame.south west)
    (frame.north east) -- (frame.south east);
},
overlay last={
\path[fill=cyan!30]
    (frame.north west) rectangle (frame.south east);
\draw[blue,line width=1pt] (frame.north west) -- (frame.south west)
  -- (frame.south east) -- (frame.north east);},
}
\begin{document}

\begin{mybox}[Definition]
\lipsum[1-10]
\end{mybox}
\end{document}

在此处输入图片描述

相关内容