[Tex/LaTex] Extreme vertical spacing between list items & nested lists

line-spacinglists

How can I fine tune and reduce the vertical spacing of list items and nested lists so characters from lines above and below are almost pixel-touching each other?

Example:

enter image description here

UPDATE 1:

@egreg:

When I try:

\begin{enumerate}[label=\arabic*.,before*=\tighten,noitemsep]
\item List 1
\begin{enumerate}[label=\Alph*.,before*=\tighten,noitemsep]
\item Item Aabcg
\item Item Bagcb
\item Item Cabcg
\item Item Dagcb
\end{enumerate}
\end{enumerate}

there is a tall space between List 1 and Item Aabcg

Can you further modify your answer to fix this?

UPDATE 2:

@egreg:

Thanks but I still get:

1. List 1

     A. Item Aabcg
     B. Item Bagcb
     C. Item Cabcg
     D. Item Dagcb

Can you get rid of that space between List 1 and Item Aabcg to get:

1. List 1
     A. Item Aabcg
     B. Item Bagcb
     C. Item Cabcg
     D. Item Dagcb

Best Answer

Based on the answer to this other question, here is a solution that preserves even distance between baselines.

\makeatletter
\let\tightset@fontsize\set@fontsize
\patchcmd\tightset@fontsize{#3}{#2}{}{}
\newcommand{\tighten}{\let\set@fontsize\tightset@fontsize
  \fontsize{\f@size}{\f@baselineskip}\selectfont}
\makeatother

Then the list can be input as

\begin{enumerate}[parsep=0pt]
\item List 1
  \begin{enumerate}[label=\Alph*.,before*=\tighten,noitemsep,topsep=0pt]
  \item Item Aabcg
  \item Item Bagcb
  \item Item Cabcg
  \item Item Dagcb
  \end{enumerate}
\end{enumerate}

Minimal example:

\documentclass[a4paper]{article}
\usepackage{etoolbox,enumitem}

\makeatletter
\let\tightset@fontsize\set@fontsize
\patchcmd\tightset@fontsize{#3}{#2}{}{}
\newcommand{\tighten}{\let\set@fontsize\tightset@fontsize
  \fontsize{\f@size}{\f@baselineskip}\selectfont}
\makeatother

\begin{document}
\begin{enumerate}[parsep=0pt]
  \item List 1
  \begin{enumerate}[label=\Alph*.,before*=\tighten,nolistsep,topsep=0pt]
    \item Item A
    \item Item B
    \item Item C
    \item Item D
  \end{enumerate}
\end{enumerate}

\end{document}

Checking the output with \showbox proves that the spacing is the same: between the "List 1" line and the "Item A" line, TeX inserts 3.16669pt glue, exactly the same as the glue inserted between the "Item A" and the "Item B" lines (and the others as well), which is right, since those lines have no descenders. The height of the "Item A" line is 6.83331pt, which added to 3.16669pt gives 10pt.

There might be a slight difference in a real document if \topsep in the inner list is not set to zero (the nolistsep key sets it to 0pt plus 0.1pt), but not with the article class which does \raggedbottom.

Related Question