Por que o tcolorbox insere quebras de página tão estranhas?

Por que o tcolorbox insere quebras de página tão estranhas?

No MWE inferior gostaria de criar uma seção formatada para exemplos. No entanto, o pacote tcolorbox insere quebras de página estranhas. Gostaria de ter alguns, mas não entendo porque não os configura para que tudo seja consecutivo. Alguém pode me ajudar?

Também estaria interessado em sugestões para melhorar a realização das flechas e a justaposição da posição alvo, caso alguém tenha mais conhecimento - ao contrário de mim.

\documentclass{article}

\usepackage{graphicx, color, colortbl}
\usepackage{xltabular}
\usepackage{scrextend}
\usepackage[breakable, most]{tcolorbox}
\usepackage{lipsum}

\newtcolorbox{exampleFieldFrame}[1]{
    breakable,
    enhanced,
    boxrule=.25pt,
    colframe=blue,
    colback=white,
    attach boxed title to top left,
    boxed title style={
        colback=blue,
        arc=0pt,
        top=3pt,
        bottom=3pt,
    },
    outer arc = 8mm, 
    arc = 8mm, 
    sharp corners = northwest, 
    sharp corners = southeast, 
    title={#1},
}

\newenvironment{exampleField}[2][false]{
    \vspace{2\baselineskip}
    \bgroup\setlength{\parindent}{0cm}
    \begin{exampleFieldFrame}{Beispiel xxx:}
}{
    \end{exampleFieldFrame}
    \vspace{\baselineskip}
    \egroup
}

\newenvironment{exampleBody}[1][Aufgabenstellung]{
    \xltabular{\textwidth}{@{}l p{3cm} X@{}}
    \hspace{5pt}\begin{tikzpicture}
        \fill[fill=blue] (0, 2pt) node[anchor=south]{}
        -- (0, 10pt) node[anchor=north]{}
        -- (20pt,6pt) node[anchor=south]{}
        -- cycle;
    \end{tikzpicture} & \textit{#1:} & }{
    \endxltabular
    \vspace{-15pt}
}

\newenvironment{exampleBody*}[1][Lösung]{
    \begin{xltabular}{\textwidth}{@{}l p{\dimexpr\textwidth-3cm} X@{}}
        \hspace{5pt}\begin{tikzpicture}         
            \fill[fill=blue] (0,2pt) node[anchor=south]{}
            -- (0, 10pt) node[anchor=north]{}
            -- (20pt,6pt) node[anchor=south]{}
            -- cycle;
        \end{tikzpicture} & \textit{#1:} & 
    \end{xltabular}
    \vspace{\baselineskip}
    \begin{addmargin}[44pt]{0pt}
    }{
    \end{addmargin}
}

\begin{document}

\begin{exampleField}{\textwidth}
    \begin{exampleBody}[Zielstellung]
        Es soll der Ersatzwiderstand (= Eingangswiderstand) des toten Netzwerkes aus Abbildung bezüglich der herausgeführten Klemmen berechnet werden.
    \end{exampleBody}
    \begin{exampleBody}[Zielstellung]
        Es soll der Ersatzwiderstand (= Eingangswiderstand) des toten Netzwerkes aus Abbildung bezüglich der herausgeführten Klemmen berechnet werden.
    \end{exampleBody}
    \begin{exampleBody*}
        \lipsum[1-5]
    \end{exampleBody*}
    \begin{exampleBody}[Zielstellung]
        Es soll der Ersatzwiderstand (= Eingangswiderstand) des toten Netzwerkes aus Abbildung bezüglich der herausgeführten Klemmen berechnet werden.
    \end{exampleBody}
\end{exampleField}

\end{document}

Responder1

Acho que xltabularnão funciona dentro de breakable tcolorbox. Não sei por que você define exampleFieldenv. Tem dois argumentos, mas você não os usou na definição. IMHO, você não precisa xltabularatingir a meta. O formato pode ser facilmente definido em um ambiente por alguns \leftskipe remover o \leftskipda primeira linha e depois colocar o marcador e o título antes do conteúdo real.

\documentclass{article}
\usepackage[breakable, most]{tcolorbox}
\usepackage{lipsum}

\newtcolorbox{exampleFieldFrame}[1]{
    breakable,
    enhanced,
    boxrule=.25pt,
    colframe=blue,
    colback=white,
    attach boxed title to top left,
    boxed title style={
        colback=blue,
        arc=0pt,
        top=3pt,
        bottom=3pt,
    },
    outer arc = 8mm, 
    arc = 8mm, 
    sharp corners = northwest, 
    sharp corners = southeast, 
    title={#1},
}

\newenvironment{exampleBody}[1][Aufgabenstellung]{%
\par\bgroup\leftskip4cm\hskip-\leftskip\hbox to 4cm{\begin{tikzpicture}         
\fill[fill=blue] (0,2pt) -- (0, 10pt) -- (20pt,6pt) -- cycle;
\end{tikzpicture}\quad\textit{#1:}\hss}\ignorespaces}{%
\par\egroup%
}

\begin{document}
\begin{exampleFieldFrame}{Beispiel xxx:}
\begin{exampleBody}[Zielstellung]
    \lipsum[2]
\end{exampleBody}
\begin{exampleBody}[Zielstellung]
    \lipsum[2]
\end{exampleBody}
\begin{exampleBody}[Lösung]
    \lipsum[1-5]
\end{exampleBody}
\begin{exampleBody}
    \lipsum[2]
\end{exampleBody}
\end{exampleFieldFrame}
\end{document}

insira a descrição da imagem aqui

informação relacionada