# Remove spacing between repeated empty subsubsections

I'm writing a technical specification document, and each section is one part of the specification. But in many situations it makes sense to group together multiple parts of the specification and write about them together. Like the following:

\subsubsection{Subsubsection A}
\subsubsection{Subsubsection B}
\subsubsection{Subsubsection C}

% This text concerns the subsubsections A, B and C
This is the subsubsection text.

\subsubsection{Subsubsection D}

% This text concerns the subsubsection D
This is the subsubsection text.

\subsubsection{Subsubsection F}

% This text concerns the subsubsection F
This is the subsubsection text.


I want it to be typeset like the following:

What I get with the default typesetting is:

So what I would like is for multiple repeated empty subsubsection to be group together, without vertical spaces between them.

Just for fun...

BTW, 1px is about as small as TeX can get. 0pt gives different results.

\documentclass{article}

\makeatletter
\newenvironment{mygroup}{\par\vskip 3.25ex\@plus 1ex \@minus .2ex % normal skip at beginning
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-1px}{1px}% for positive/negative tests
{\normalfont\normalsize\bfseries}}}%
{\vskip 1.5ex \@plus .2ex}% normal skip at end
\makeatother

\begin{document}

\section{Section A}

\subsection{Section A}

\begin{mygroup}
\subsubsection{Subsubsection A}
\subsubsection{Subsubsection B}
\subsubsection{Subsubsection C}
\end{mygroup}

This is the text.

\subsubsection{Subsubsection D}

This is the text.

\subsubsection{Subsubsection F}

This is the text.

\end{document}


Found one solution (using \vspace) which does what I want.

\documentclass{article}
\usepackage{titlesec}
\usepackage{lipsum}
\usepackage{parskip}
\begin{document}

\section{Section A}

\subsection{Section A}

\subsubsection{Subsubsection A} \vspace{-1.0\parskip}
\subsubsection{Subsubsection B} \vspace{-1.0\parskip}
\subsubsection{Subsubsection C}

This is the text.

\subsubsection{Subsubsection D}

This is the text.

\subsubsection{Subsubsection F}

This is the text.

\end{document}

• the space between section headings isn't \parskip (it depends on the heading declaration in the class) so while this might be OK, it could also cause the headings to over-print or have no effect at all, depending on the relative sizes of parskip and the heading space. – David Carlisle Sep 21 '19 at 15:18