How to change spacing before and after \paragraph command?

I tried to control the spacing before \paragraph{} using a command such as

\setlength{\parskip}{3pt plus 1pt minus 1pt}


but that doesn't influence it. (It influences spacing between regular paragraphs).

How do I control the space before \paragraph?

• As far as I know, \parskip and \paragraph are not connected. A \paragraph is a structuring command whereas \parskip is used for the paragraph skip, which is rather visually outstanding element
– user31729
Dec 27 '14 at 16:41
• You shouldn't be using \paragraph{} to begin with. This is a sectioning command, not the marker for a paragraph start; just leave a blank line between paragraphs. And don't use vertical space between paragraphs, please! Dec 27 '14 at 16:45

As egreg stated in his comment, \paragraph should not be used to start a text paragraph, but only (if at all) to use the structuring level 'paragraph', which is already below subsubsection.

If there are subsubsection levels, it's ok (in some sense) to reduce the space, but this is a matter of taste.

I used the \xpatchcmd to replace the paragraph spacings

{3.25ex \@plus1ex \@minus.2ex}


by

{3pt plus 1pt minus 1pt}


Have a look on the screenshot!

\documentclass{report}
\usepackage{xpatch}

\usepackage{blindtext}

\begin{document}

\noindent Unpatched

\paragraph{First}

\paragraph{Second}

\blindtext[1]

Now patching it... compare!

\makeatletter
\xpatchcmd{\paragraph}{3.25ex \@plus1ex \@minus.2ex}{3pt plus 1pt minus 1pt}{\typeout{success!}}{\typeout{failure!}}
\makeatother

\paragraph{First}
\paragraph{Second}

\blindtext[1]

\end{document}


Here is the code for \paragraph from report.cls.

Don't forget to use \renewcommand and also \makeatletter \makeatother.

\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
{3.25ex \@plus1ex \@minus.2ex}%
{-1em}%
{\normalfont\normalsize\bfseries}}

\makeatother


You can control the space changing the 2nd line.

• Or patch the command ;-)
– user31729
Dec 27 '14 at 16:43
• Or use \titlespacing from the titlesec package. Dec 27 '14 at 23:44