我想在 tcolorbox tcbitemize 环境排版的第 1 行和第 2 行之间自动插入一些内容。这里的“自动”是指将方法放在 tcolorbox 选项中,而不是放在环境主体中(也就是说,不是通过 \tcbitem),如下所示:
\documentclass[12pt,a4paper]{article}
\usepackage{tcolorbox}
\tcbuselibrary{skins,breakable,raster}
\begin{document}
\begin{tcbitemize}[<...,the method to insert something between row 1 and row 2,...>]
%The first row
\tcbitem some text
\tcbitem some text
%the second row
\tcbitem some text
\tcbitem some text
.
.
.
\end{tcbitemize}
\end{document}
你能帮我解答这个问题吗?谢谢。
答案1
用于在对其内部内容有非常严格限制的环境\tcbitem[raster multicolumn=2,enhanced,frame hidden]
中在两列线上生成普通的“文本” 。tcbitemize
\documentclass[12pt,a4paper]{article}
\usepackage[most]{tcolorbox}
\begin{document}
\begin{tcbitemize}[raster columns=2]
% The first row
\tcbitem some text
\tcbitem some text
\tcbitem[raster multicolumn=2,enhanced,frame hidden,colback=white]
Foo text
% the second row
\tcbitem some text
\tcbitem some text
\end{tcbitemize}
\end{document}
更新对于特殊文本应该出现的特定行,有一些“自动”行为:
使用包含一些常用选项的raster row 2/.style={...}
地方或定义一个样式(见下文){...}
tcolorbox
\tcbset{}
\documentclass[12pt,a4paper]{article}
\usepackage[most]{tcolorbox}
\tcbset{
myhiddenbox/.style={raster multicolumn=2,enhanced,frame hidden,colback=white}
}
\begin{document}
\begin{tcbitemize}[raster columns=2,raster row 2/.style=myhiddenbox]
% The first row with 'important' boxes
\tcbitem some text
\tcbitem some text
% Second row with some other text
\tcbitem Foo text
% Third row with 'important' boxes
\tcbitem some text
\tcbitem some text
\end{tcbitemize}
\end{document}