![可破碎的并排 tcolorbox](https://linux22.com/image/411868/%E5%8F%AF%E7%A0%B4%E7%A2%8E%E7%9A%84%E5%B9%B6%E6%8E%92%20tcolorbox.png)
我最初的目标是有一个布局结构,其中有盲文,然后并排放置文本框,然后再次使用盲文,依此类推。我尝试将两个迷你页面并排放置,都带有0.5\textwidth
,但不幸的是,这无法完成任务,因为迷你页面不可破坏。现在我遇到了tcolorbox
包。它有一个额外的功能,称为并排 tcolorboxes,但这些永远不会被破坏。我目前的方法是将两个 tcolorboxes 与 tcbraster 环境并排放置。这很有效,直到我将 breakable 属性分配给两个都的 tcolorboxes。
我的代码
\section{A section}
\begin{tcbraster}[raster columns=2,raster equal height, nobeforeafter, boxrule=0pt,width=0.45\textwidth, colback=white]
\begin{tcolorbox}[breakable]
erste Spalte
\end{tcolorbox}
\begin{tcolorbox}
zweite Spalte
\end{tcolorbox}
\end{tcbraster}
产生这个
尽管
\section{A section}
\begin{tcbraster}[raster columns=2,raster equal height, nobeforeafter, boxrule=0pt,width=0.45\textwidth, colback=white]
\begin{tcolorbox}[breakable]
erste Spalte
\end{tcolorbox}
\begin{tcolorbox}[breakable]
zweite Spalte
\end{tcolorbox}
\end{tcbraster}
产生这个
但我希望两个文本框的文本可以跨越多页。
顺便问一下:我该如何摆脱边界线?
答案1
阅读问题时,在我看来,您并不是在寻找实际的盒装框,而只是希望并排显示文本,同时允许分页。paracol
支持此类功能。
\documentclass{article}
\usepackage{paracol}
\usepackage{lipsum}
\begin{document}
\section{A section}
\lipsum[1-4]
\begin{paracol}{2}
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
\switchcolumn[1]
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
\end{paracol}
\lipsum[4]
\end{document}
tcolorbox
如果需要,您可以将其与 结合使用。
\documentclass{article}
\usepackage{paracol}
\usepackage{lipsum}
\usepackage[breakable]{tcolorbox}
\begin{document}
\section{A section}
\lipsum[1-4]
\begin{paracol}{2}
\begin{tcolorbox}[breakable]
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
\end{tcolorbox}
\switchcolumn[1]
\begin{tcolorbox}[breakable]
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
\end{tcolorbox}
\end{paracol}
\lipsum[4]
\end{document}
如果您想保留这些框,您可能需要更改它们的布局。
正如您所说,它们应该是隐形的,这里有一种方法可以实现这一点。
\documentclass{article}
\usepackage{paracol}
\usepackage{lipsum}
\usepackage[breakable]{tcolorbox}
\newtcolorbox{invbox}[1][]{breakable,boxrule=0pt,colback=white,colframe=white,#1}
\begin{document}
\section{A section}
\lipsum[1-4]
\begin{paracol}{2}
\begin{invbox}
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
Many lines of text. Many lines of text.
\end{invbox}
\switchcolumn[1]
\begin{invbox}
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
Many more lines of text. Many more lines of text.
\end{invbox}
\end{paracol}
\lipsum[4]
\end{document}
但是,在这种情况下,我可能只会采用简单的paracol
解决方案并根据需要更改一些缩进。