![tcolorbox はなぜこのような奇妙なページ区切りを挿入するのでしょうか?](https://rvso.com/image/472715/tcolorbox%20%E3%81%AF%E3%81%AA%E3%81%9C%E3%81%93%E3%81%AE%E3%82%88%E3%81%86%E3%81%AA%E5%A5%87%E5%A6%99%E3%81%AA%E3%83%9A%E3%83%BC%E3%82%B8%E5%8C%BA%E5%88%87%E3%82%8A%E3%82%92%E6%8C%BF%E5%85%A5%E3%81%99%E3%82%8B%E3%81%AE%E3%81%A7%E3%81%97%E3%82%87%E3%81%86%E3%81%8B%3F.png)
下の MWE に、例のフォーマットされたセクションを作成したいと思います。ただし、tcolorbox パッケージは奇妙な改ページを挿入します。改ページをいくつか挿入したいのですが、すべてが連続するように設定されない理由がわかりません。誰か助けてくれませんか?
私とは違って、もっと詳しい知識をお持ちの方がいらっしゃれば、矢印の実現やターゲット位置の並置を改善するための提案にも興味があります。
\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}
答え1
xltabular
breakable 内では動作しないと思いますtcolorbox
。env を定義する理由がわかりませんexampleField
。引数が 2 つありますが、定義では使用していません。私見ですが、目標を達成する必要はありませんxltabular
。このフォーマットは、一部の人が環境で簡単に設定でき\leftskip
、\leftskip
最初の行の を削除してから、実際のコンテンツの前にマーカーと見出しを配置できます。
\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}