![tcolorbox가 이상한 페이지 나누기를 삽입하는 이유는 무엇입니까?](https://rvso.com/image/472715/tcolorbox%EA%B0%80%20%EC%9D%B4%EC%83%81%ED%95%9C%20%ED%8E%98%EC%9D%B4%EC%A7%80%20%EB%82%98%EB%88%84%EA%B8%B0%EB%A5%BC%20%EC%82%BD%EC%9E%85%ED%95%98%EB%8A%94%20%EC%9D%B4%EC%9C%A0%EB%8A%94%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%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
깨지기 쉬운 내부에서는 작동하지 않는 것 같아요 tcolorbox
. 왜 env를 정의하는지 모르겠습니다 exampleField
. 여기에는 두 개의 인수가 있지만 정의에서는 이를 사용하지 않았습니다. IMHO, 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}