Unwanted vertical separation between tcolorboxes
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}
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
.
The spacing is due to \lineskip
; the usual setting of \parskip
is to have zero natural width, so it can add vertical space only when \flushbottom
is set, because it has a stretch component of 1pt. In this case, you should set it to zero and also set \lineskip
to zero, but in a group to avoid the setting going on forever.
\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}
\begingroup
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}
\setlength{\lineskip}{0pt}
\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}
\endgroup % the empty line is needed
\end{document}
Why is \lineskip
intervening? Because each line has height plus depth larger than \baselineskip
, so the difference between “depth of the line above plus height of the line below” and \baselineskip
is larger than \lineskiplimit
(usually 0pt), hence TeX inserts \lineskip
glue, thinking that the lines are too near to each other.
A different solution, from a comment by Thomas F. Sturm, is adding after=\par\nointerlineskip
to the options to tcolorbox
:
\tcbset{height=61mm,top=2cm,after=\par\nointerlineskip,before={}}