[Tex/LaTex] Unwanted vertical separation between tcolorboxes

spacingtcolorbox

I am trying to prepare printer labels for the spine of ring binders. The text is designed to be printed on label paper sheets with A4 format, having top and bottom margins of 26.5mm and left/right margins of 9mm.

The format of the labels is 61mm by 192mm, there are 4 of them on the sheet, without any separation between them.

I use the tcolorbox environment as a 'frame' for the labels and and perhaps my idea is to naive, but I just wrote four of such environments in a row with nobeforeafter setting for each (well, using \tcbset command).

Even with \parskip set to 0pt there is small spacing between the boxes of about 1mm, which would lead to a shift of the content consecutively, and the 4th box appears on the next page. Reducing the bottom margin is not an option, of course. I believe, that \parskip is of no use here anyway.

I am pretty sure, that the content of the boxes has no influence on the spacing, as long as the height is not too large, which does not seem to be the case here.

How can I reduce the space between those colorboxes to a effectively 'zero' value, resulting in no shift when printed?

Note

I checked the margins etc. after print out, they are correct!

Even if there might be other solution for such label printing, I would like to have some solution to reduce the spacing between the boxes (Ok, it might be a very trivial solution.)

enter image description here

This is the code I tried so far

\documentclass[12pt,paper=a4]{article}

\usepackage[lmargin=0.9cm,rmargin=0.9cm,tmargin=26.5mm,bmargin=26.5mm,showframe=true,a4paper]{geometry}
\usepackage{tcolorbox}
\usepackage{lmodern}


\begin{document}
\setlength{\parindent}{0pt}%
\setlength{\parskip}{0pt}%
\pagestyle{empty}%

\fontsize{80}{96}\selectfont 
\tcbset{height=61mm,nobeforeafter,top=2cm}
\begin{tcolorbox}%
\textbf{\LaTeX}%
\end{tcolorbox}
\begin{tcolorbox}%
\textbf{is}%
\end{tcolorbox}
\begin{tcolorbox}%
\textbf{very}%
\end{tcolorbox}
\begin{tcolorbox}%
\textbf{sophisticated}%
\end{tcolorbox}

\end{document}

I looked into other 'similar' questions here, none of them seems to be connected to this problem

Note

Here is the result with some features of the tcolorbox package and the solutions by Gonzalo Medina and egreg together with the comment by Thomas F. Sturm.

enter image description here

Best Answer

You need to cancel the natural \lineskip:

\documentclass[12pt,paper=a4]{scrartcl}

\usepackage[lmargin=0.9cm,rmargin=0.9cm,tmargin=26.5mm,bmargin=26.5mm,showframe=true,a4paper]{geometry}
\usepackage{tcolorbox}
\usepackage{lmodern}


\begin{document}
\setlength{\parindent}{0pt}%
\setlength{\parskip}{0pt}%
\pagestyle{empty}%

\fontsize{80}{96}\selectfont 
\offinterlineskip
\tcbset{height=61mm,nobeforeafter,top=2cm}
\begin{tcolorbox}%
\textbf{\LaTeX}%
\end{tcolorbox}
\begin{tcolorbox}%
\textbf{is}%
\end{tcolorbox}
\begin{tcolorbox}%
\textbf{very}%
\end{tcolorbox}
\begin{tcolorbox}%
\textbf{sophisticated}%
\end{tcolorbox}

\end{document}

enter image description here

In the above example, \offinterlineskip will have effect from the point where it was issued on. To have suppress the \lineskip in a more controlled way, one could use the after key in with

after=\par\nointerlineskip

as Thomas F. Sturm suggested in his comment.

Related Question