1

I would like to have a tcbitemize-environment over the full linewidth, which has a frame around with no gaps?

If I put the tcbitemize into another tcolorbox I get gaps.

What is the correct way to add this outer frame without gaps?

Hint: The inner itemize-boxes should not have frames, but here shown for better seeing.

enter image description here

% 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 Answer 1

2

The gap between box frame and box contents of a tcolorbox environment is controlled by options left, right, top, and bottom, respectively. They are shown in tcolorbox's documentation, sec. 2 and documented in sec. 4.7.4.

With each of them set to 0pt, you get

\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}

enter image description here

1
  • Ah, very good. :)
    – cis
    Jul 13, 2020 at 16:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .