# tcolorbox: raster before/after skip do not seem to work

Here is a MWE.

\usepackage{tcolorbox}%
\tcbuselibrary{skins,raster,breakable,}

\begin{tcolorbox}%
[%
boxrule=2mm,%
colback=lightcyan,%
colframe=red,%
title=TITLE,%
]%
\begin{tcbraster}%
[%Begin description raster
raster columns=1,%
raster force size=false,%
%Affects all tcboxes
raster before skip=0mm,% 240 Does not seem to work.
raster row skip=0mm,% 240
raster after skip=0mm,% 240 Does not seem to work.
raster left skip=-2mm,% 240
raster right skip=-2mm,% 240
]%End description raster
\begin{tcolorbox}% Box 1
[%Begin description Box 1
enhanced,show bounding box,%comment to prevent the bndbox from showing
unbreakable,%
colback= white,%
colframe= blue,%
boxrule=0.2mm,
arc=0mm,
sidebyside,%
lower separated=true,
sidebyside gap=3mm,%
sidebyside align=top seam,%
width=(\linewidth),%.
lefthand width=75mm,%107
%       righthand width=60mm,%107
left skip =-5mm,%
right skip =-9mm,%
left=0mm,%
right=0mm,%
top=0mm,%
bottom=0mm,%
]%End description Box 1
Text 1 left  Text 1 left Text 1 left Text 1 left Text 1 left Text 1 left Text 1 left
\tcblower
Text 1 right Text 1 right Text 1 right Text 1 right Text 1 right
\end{tcolorbox}%Box 1
%%
\begin{tcolorbox}% Box 2
[%Begin description Box 2
enhanced,show bounding box,%comment to prevent the bndbox from showing
unbreakable,%
colback= white,%
colframe= blue,%
boxrule=0.2mm,
arc=0mm,
sidebyside,%
lower separated=true,
sidebyside gap=3mm,%
sidebyside align=top seam,%
width=(\linewidth),%
%       lefthand width=40mm,%107
righthand width=80mm,%107
left skip =-5mm, %.
right skip =-9mm, %.
left=0mm,%
right=0mm,%
top=0mm,%
bottom=0mm,%
]%End description Box 5
Text  2 left Text  2 left Text  2 left Text  2 left Text  2 left
\tcblower
Text 2 right Text 2 right Text 2 right Text 2 right Text 2 right Text 2 right
\end{tcolorbox}%Box 2
\end{tcbraster}%End Raster
\end{tcolorbox}


In general, the commands tend not to be independent but here I have not been able to determine what is preventing the space between the TITLE and the first box and the space between the second box and the bottom of the main box from being 0. The other raster skips, including raster row skip work as they are supposed to:

(Notes: The numbers in the comments are the page numbers in the doc. The bounding boxes can be made not to show by commenting the corresponding lines.)

• You are aware that your document is by no means 'm' nor 'w' ? ;-) – user31729 Jul 5 '16 at 7:38
• @ChristianHupfer 'm' I think It was, 'w' it certainly was not because I had lifted it from a file that worked with a separate preamble. I realized that in the middle of last night. Really! Sorry about that. Won't happen again. – schremmer Jul 5 '16 at 14:25

Basically what is done for the inner boxes in the raster has to be done for the outer box: top=0pt etc, and in addition the nobeforeafter option for the inner boxes must be activated to eliminate any vertical spacing.

However, there should be a better organization of the box settings, i.e. with a style or a special \newtcolorbox definition for this!

\documentclass{article}

\usepackage[x11names,dvipsnames,svgnames]{xcolor}

\usepackage{tcolorbox}%
\tcbuselibrary{skins,raster,breakable,}

\begin{document}

\begin{tcolorbox}%
[%
boxrule=2mm,%
colback=cyan,%
colframe=red,%
title=TITLE,%
top=0pt,
bottom=0pt,
boxsep=0pt,
]%
\begin{tcbraster}%
[%Begin description raster
raster columns=1,%
raster force size=false,%
%Affects all tcboxes
raster before skip=0mm,% 240 Does not seem to work.
raster row skip=0mm,% 240
raster after skip=0mm,% 240 Does not seem to work.
raster left skip=-2mm,% 240
raster right skip=-2mm,% 240
]%End description raster
\begin{tcolorbox}% Box 1
[%Begin description Box 1
enhanced,show bounding box,%comment to prevent the bndbox from showing
unbreakable,%
colback= white,%
colframe= blue,%
boxrule=0.2mm,
arc=0mm,
sidebyside,%
nobeforeafter,
lower separated=true,
sidebyside gap=3mm,%
sidebyside align=top seam,%
width=(\linewidth),%.
lefthand width=75mm,%107
%       righthand width=60mm,%107
left skip =-4mm,
right skip =-8mm,%
left=0mm,%
right=0mm,%
top=0mm,%
bottom=0mm%
]%End description Box 1
Text 1 left  Text 1 left Text 1 left Text 1 left Text 1 left Text 1 left Text 1 left
\tcblower
Text 1 right Text 1 right Text 1 right Text 1 right Text 1 right
\end{tcolorbox}%Box 1
%%
\begin{tcolorbox}% Box 2
[%Begin description Box 2
enhanced,show bounding box,%comment to prevent the bndbox from showing
unbreakable,%
colback= white,%
colframe= blue,%
boxrule=0.2mm,
arc=0mm,
sidebyside,%
nobeforeafter,
lower separated=true,
sidebyside gap=3mm,%
sidebyside align=top seam,%
width=(\linewidth),%
%       lefthand width=40mm,%107
righthand width=80mm,%107
left skip =-4mm, %.
right skip =-8mm, %.
left=0mm,%
right=0mm,%
top=0mm,%
bottom=0mm,%
]%End description Box 5
Text  2 left Text  2 left Text  2 left Text  2 left Text  2 left
\tcblower
Text 2 right Text 2 right Text 2 right Text 2 right Text 2 right Text 2 right
\end{tcolorbox}%Box 2
\end{tcbraster}%End Raster
\end{tcolorbox}

\end{document}


A better style, in my point of view:

\documentclass{article}

\usepackage[x11names,dvipsnames,svgnames]{xcolor}

\usepackage{tcolorbox}%
\tcbuselibrary{skins,raster,breakable,}

\begin{document}

\makeatletter

\newlength{\leftshift}
\newlength{\rightshift}

\newcommand{\determineshifts}{%
\global\leftshift=-\kvtcb@leftupper
\global\rightshift=-8mm
}

\tcbset{%
boxcommonstyle/.style={%
enhanced,show bounding box,%comment to prevent the bndbox from showing
unbreakable,%
colback= white,%
colframe= blue,%
boxrule=0.2mm,
arc=0mm,
sidebyside,%
nobeforeafter,
lower separated=true,
sidebyside gap=3mm,%
sidebyside align=top seam,%
width=(\linewidth),%
left skip=\leftshift,
right skip=\rightshift,%
left=0mm,%
right=0mm,%
top=0mm,%
bottom=0mm,%
},
boxstyle1/.style={%
boxcommonstyle,
lefthand width=75mm,%107
},
boxstyle2/.style={%
boxcommonstyle,
righthand width=80mm,%107
},
outerboxstyle/.style={%
boxrule=2mm,%
colback=cyan,%
colframe=red,%
title=TITLE,%
top=0pt,
outer arc=\kvtcb@bottom@rule@stand,
bottom=0pt,
boxsep=0pt
}
}

\newtcolorbox{topbox}[1][]{%
code={\determineshifts},
boxstyle1,
#1
}

\newtcolorbox{bottombox}[1][]{%
code={\determineshifts},
boxstyle2,
#1,
}

\makeatother

\begin{tcolorbox}[outerboxstyle]
\begin{tcbraster}%
[%Begin description raster
raster columns=1,%
raster force size=false,%
%Affects all tcboxes
raster before skip=0mm,% 240 Does not seem to work.
raster row skip=0mm,% 240
raster after skip=0mm,% 240 Does not seem to work.
raster left skip=-2mm,% 240
raster right skip=-2mm,% 240
]%End description raster
\begin{topbox}
Text 1 left  Text 1 left Text 1 left Text 1 left Text 1 left Text 1 left Text 1 left
\tcblower
Text 1 right Text 1 right Text 1 right Text 1 right Text 1 right
\end{topbox}%
%%
\begin{bottombox}%
Text  2 left Text  2 left Text  2 left Text  2 left Text  2 left
\tcblower
Text 2 right Text 2 right Text 2 right Text 2 right Text 2 right Text 2 right
\end{bottombox}%
\end{tcbraster}%End Raster
\end{tcolorbox}
\end{document}

• The second version corrects the style and the arc arrow by the overshooting lower box – user31729 Jul 5 '16 at 9:39
• It worked. As for the style, it was part of the 'm' aspect and I agree that it is very ugly. The actual box is a bit better. Or so I hope. I will post a link when I have ported your correction to the magnum opus. (But I will study your second version before the port.) Thanks again. – schremmer Jul 5 '16 at 14:43
• @schremmer: Apart from my solution: A \tcbset{foo/.style=....} is in most cases a good idea as well as specialized \newtcolorbox boxes – user31729 Jul 5 '16 at 18:58
• Actually, I have been using many \newtcolorboxboxes and I want to do a \tcbset for each one. Right now, though, I still have a problem with the above: in the case of a page break, I got an artifact between the inner boxes across the break. See the "Work Zone" in 6.pdf at (freemathtexts.org/InProgress/RAFv7.1) – schremmer Jul 5 '16 at 20:23
• @schremmer: That's possible a result of being a nested box -- those aren't breakable really – user31729 Jul 5 '16 at 20:35