# Why does the \color-command eliminate/decrease vertical spacing?

I have been wrecking my brain to figure out why some elements are too high above the horizontal line/rule and some are arguably well placed.

I found out it is because of the \color-command.

Why does that happen?

How can I have the parts without the \color-command behave the same way as it were there?

# MWE

\documentclass[
11pt,
a4paper,
]
{scrartcl}

\usepackage{
lmodern,
multicol,
}

\usepackage[svgnames]{xcolor}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\listfiles

\begin{document}
\begin{center}\huge
Title stuff
\end{center}

\begin{multicols*}{2}
\section{Word}

\begin{center}
\sffamily
\fbox{
\begin{minipage}[t]{0.9\columnwidth}
\centering\begin{minipage}[t]{0.95\columnwidth}\raggedright%
\color{DarkBlue}\textbf{Stuff:} aaaaaaaa [asdf: 1111]
\begin{minipage}[t]{0.95\columnwidth}\small
Words.

Sentence words and aaaa asdf lorem.
Ipsum.
Words words more.
\end{minipage}
\end{minipage}}
\end{center}

\begin{center}
\sffamily
\fbox{
\begin{minipage}[t]{0.9\columnwidth}
\centering\begin{minipage}[t]{0.95\columnwidth}\raggedright%
\textbf{Stuff:} aaaaaaaa [asdf: 1111]
\begin{minipage}[t]{0.95\columnwidth}\small
Words.

Sentence words and aaaa asdf lorem.
Ipsum.
Words words more.
\end{minipage}
\end{minipage}}
\end{center}

\end{multicols*}

\end{document}

• texdoc grfguide footnote page 6 Mar 26 at 22:48
• Mar 26 at 22:50
• @IanThompson ooh I gave same answer (more or less:-) Mar 26 at 22:59

Unlike a font change, \color adds a node into the document and it is hard in all cases to avoid that node affecting spacing. (There is a footnote on page 6 of grfguide which can be summarised as "it's not my fault").

It is usually easier to get understandable behaviour if the colour whatsit is inserted in horizontal rather than vertical mode. \textcolor uses \leavevmode at the start (like all latex box commands) to ensure this. Uising \textcolor in your example you get the same spacing in each case.

\documentclass[
11pt,
a4paper,
]
{scrartcl}

\usepackage{
lmodern,
multicol,
}

\usepackage[svgnames]{xcolor}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\listfiles

\begin{document}
\begin{center}\huge
Title stuff
\end{center}

\begin{multicols*}{2}
\section{Word}

\begin{center}
\sffamily
\fbox{%%%%%
\begin{minipage}[t]{0.9\columnwidth}
\centering\begin{minipage}[t]{0.95\columnwidth}\raggedright
\textcolor{DarkBlue}{\textbf{Stuff:} aaaaaaaa [asdf: 1111]}%
\begin{minipage}[t]{0.95\columnwidth}\small
Words.

Sentence words and aaaa asdf lorem.
Ipsum.
Words words more.
\end{minipage}
\end{minipage}}
\end{center}

\begin{center}
\sffamily
\fbox{%%%%
\begin{minipage}[t]{0.9\columnwidth}
\centering\begin{minipage}[t]{0.95\columnwidth}\raggedright%
\textbf{Stuff:} aaaaaaaa [asdf: 1111]
\begin{minipage}[t]{0.95\columnwidth}\small
Words.

Sentence words and aaaa asdf lorem.
Ipsum.
Words words more.
\end{minipage}
\end{minipage}}
\end{center}

\end{multicols*}

\end{document}

• Thank you, David. Would you have a hint for my second question, i.e. which command I would have to use to yield the decrease in vertical spacing anyway? Note: If you prefer a new question, a note would suffice and I will make one for this. Mar 26 at 23:07
• @henry above the rule? You are adding space there, just add less eg change .4ex to \addvspace{-1ex}% ? Mar 26 at 23:12
• Well it's a manual solution based on incremental checks... but it works. Thanks. :) Mar 26 at 23:24