To align multiple boxes vertically, without any additional space between them, I'm generating each box with a minipage environment, to exactly control the size (and eventually to use multi-paragraph text).
There is 1pt of vertical space appearing between the boxes, and it doesn't seem to be controlled by \baselineskip, \parsep, \parskip, or similar, and I'm lost as to where it's coming from. It seems to be exactly 1pt every time, and it is throwing off the vertical alignment. The same space appears whether I separate the boxes with a line-break or a new paragraph.
Here is my MWE. The first column contains 3 rules, each 1in high, and the second contains a single rule 3in high. I expect both columns to be exactly 3in high, but the first one contains two extra 1pt spaces, seen as white gaps between the rules.
I've tried various combinations of the alignment options for minipage, to no effect.
Code: Select all
\documentclass{minimal}
\usepackage{color}
\begin{document}
\setlength{\parsep}{0pt}
\setlength{\parskip}{0pt}
\setlength{\parindent}{0pt}
\setlength{\abovedisplayskip}{0pt}
\setlength{\belowdisplayskip}{0pt}
\renewcommand{\baselinestretch}{1}
\begin{minipage}[b][3in][s]{0.25in}%
\begin{minipage}[b][1in][s]{0.250in}%
\textcolor{red}{\rule{0.25in}{1in}}%
\end{minipage}\par% 1pt extra space; why?
\begin{minipage}[b][1in][s]{0.250in}%
\textcolor{green}{\rule{0.25in}{1in}}%
\end{minipage}\\% 1pt extra space; why?
\begin{minipage}[b][1in][s]{0.250in}%
\textcolor{blue}{\rule{0.25in}{1in}}%
\end{minipage}
\end{minipage}% minipage gives no overfull warnings.
\begin{minipage}[b][3in][s]{0.25in}%
\rule{0.25in}{3in}% does not line up.
\end{minipage}
\end{document}