我想要一个覆盖整个线宽的 tcbitemize 环境,它周围有一个框架无缝隙?
如果我将 tcbitemize 放入另一个 tcolorbox,就会出现间隙。
添加这个外框且没有间隙的正确方法是什么?
提示:内部项目框不应该有框架,但这里显示以便更好观察。
% arara: pdflatex
% arara: pdflatex
\documentclass{article}
\usepackage[showframe=true,
]{geometry}
\usepackage[most]{tcolorbox}
\tcbset{enhanced, fontupper=\bfseries, notitle, halign=center, valign=center}
\begin{document}
\tcbset{sharp corners,}
\begin{tcolorbox}[
colframe=red, % for better seeing
boxsep=0pt, % no effekt
before skip=0cm, % no effekt
]
\begin{tcbitemize}[
% boxrule=0pt,frame hidden, % not used for better seeing
raster columns=3,
raster equal height,
raster column skip=2pt,
raster row skip=2pt,
colback=white
]
\tcbitem A
\tcbitem B
\tcbitem C
\tcbitem[raster multicolumn=2] X
\tcbitem Y
\end{tcbitemize}
\end{tcolorbox}
\end{document}
答案1
环境中的框框和框内容之间的间隙分别由选项、、和tcolorbox
控制。它们显示在的文档第 2 节中,并记录在 4.7.4 节中。left
right
top
bottom
tcolorbox
将每个值设置0pt
为
\documentclass{article}
\usepackage[showframe=true,
]{geometry}
\usepackage[most]{tcolorbox}
\tcbset{enhanced, fontupper=\bfseries, notitle, halign=center, valign=center}
\begin{document}
\tcbset{sharp corners,}
\begin{tcolorbox}[
colframe=red, % for better seeing
boxsep=0pt, % no effekt
before skip=0cm, % no effekt
left=0pt, right=0pt,
top=0pt, bottom=0pt
]
\begin{tcbitemize}[
% boxrule=0pt,frame hidden, % not used for better seeing
raster columns=3,
raster equal height,
raster column skip=2pt,
raster row skip=2pt,
colback=white
]
\tcbitem A
\tcbitem B
\tcbitem C
\tcbitem[raster multicolumn=2] X
\tcbitem Y
\end{tcbitemize}
\end{tcolorbox}
\end{document}