I'm writing up a résumé, and I am very particular about making sure that each section is separated by the exact-right-looking amount of spacing. My sections are divided with an \hrule (although in my real document I use the titlesec package to define their format). The rule makes it easy to notice when one section's spacing is different from another's.
The following example shows several of the elements that I need in my document. I have placed the rules very close to the text, to make the difference even more obvious. Depending on whether a section contains text or a list or columns, the subsequent section gets spaced an irregular amount below it.
Edit: I've used \myrule instead of \hrule and followed other suggestions already given by @Ulrike.
\documentclass[10pt]{article}
\usepackage[letterpaper,margin=1in]{geometry}
\usepackage{enumitem}
\usepackage{multicol}
\newcommand{\sampletext}{Here is some sample text\strut}
\newcommand{\myrule}{\par\vspace{-1\baselineskip}\noindent\strut\rule{\textwidth}{0.4pt}}
\newenvironment{compactlist}%
{\begin{itemize}[topsep=0pt,itemsep=0pt,parsep=0pt,labelindent=0em,partopsep=0pt,leftmargin=*]}
{\end{itemize}}
\begin{document}
\section{Plain}
\sampletext
\myrule
\section{Itemized}
\begin{compactlist}
\item \sampletext
\item \sampletext
\end{compactlist}
\myrule
\section{Itemized With Text}
\noindent\sampletext
\begin{compactlist}
\item \sampletext
\item \sampletext
\end{compactlist}
\myrule
\section{Parbox Itemized}
\hbox{
\parbox[t]{7in}{
\begin{compactlist}
\item \sampletext
\item \sampletext
\end{compactlist}
}
}
\myrule
\section{Parbox Itemized With Text}
\parbox[t]{6.5in}{
\sampletext
\begin{compactlist}
\item \sampletext
\item \sampletext
\end{compactlist}
}
\myrule
\section{Multicols}
\setlength{\multicolsep}{0pt}
\begin{multicols}{3}
\begin{compactlist}
\item \sampletext
\item \sampletext
\item \sampletext
\item \sampletext
\item \sampletext
\item \sampletext
\end{compactlist}
\end{multicols}
\myrule
\end{document}
Is there any way to enforce consistent vertical spacing?
\section,itemizeandmulticolsthat do various things with spacing. – egreg Feb 13 '12 at 00:00\multicolsepcommand, diving into themulticolsource to see what spacing is explicitly added, redefining commands like\addvspaceso I can log other stray space sources, setting lengths like\parskipand\parsep, and finally just adding an arbitrary\vspacehack. I've come to the conclusion that LaTeX is not the best tool for precision typesetting. Hopefully someone can take up this challenge and show me how to gain control of the vertical spacing. – Chad Parry Feb 13 '12 at 02:49\parboxthat confuses it? – Todd Lehman Feb 13 '12 at 03:25\hrulebut a\myruledefined e.g. like this:\newcommand\myrule{\par\noindent\strut\rule{\textwidth}{0.4pt}}– Ulrike Fischer Feb 13 '12 at 10:24\newcommand\myrule{\par\vspace{-1\baselineskip}\noindent\strut\rule{\textwidth}{0.4pt}}. – Chad Parry Feb 13 '12 at 14:48\hrule. You can further improve it by usingpartopsep=0ptin your list definition. It could also be sensible to add a\strutto you sample text. – Ulrike Fischer Feb 13 '12 at 15:05partopsepoption does fix those problems. (Why a top space length fixes the bottom spacing, I have no idea). And the addition of\parfixed section 6. Taken together, that makes a big difference. I'll see if these suggestions still fix things in a real-world document, and report back. Thanks so much! – Chad Parry Feb 13 '12 at 16:32\strutis removed from the sample text). Is there an explanation or a workaround for this last inconsistency? – Chad Parry Feb 14 '12 at 07:09moderncvor others. Even if you don't want to use the other packages, then looking at them may be worth your while because it may give you inspiration for your own style. – Feb 14 '12 at 07:57\baselineskipso that minute imperfections would be easier to spot and then correct. Now that the vertical spaces are fixed, I can add back in a consistent\vspaceamount before each rule. – Chad Parry Feb 14 '12 at 14:38gridmanual and the paper by Bazargan and Radhakrishnan. – Feb 14 '12 at 15:07