How do I control the spacing above a new \paragraph?
Now that your document class is known, the rest isn't too hard. The definition of \paragraph
needs to be changed. The following code snippet (to be added to your preamble) would reproduce the original definition of \paragraph
in the article
class:
\makeatletter
\renewcommand{\paragraph}{%
\@startsection{paragraph}{4}%
{\z@}{3.25ex \@plus 1ex \@minus .2ex}{-1em}%
{\normalfont\normalsize\bfseries}%
}
\makeatother
Change 3.25ex
to a smaller value, and the vertical spacing before a paragraph section will be reduced. (The values after \@plus
and \@minus
are parameters for stretching and shrinking the standard space - you may change those also, but don't need to.) The -1em
in the following argument controls the spacing after the paragraph section -- the negative sign effects that horizontal space is added, i.e., \paragraph
will produce an inline heading.
Package titlesec provides many tools for customizing chapter/section/paragraph/etc headings. Here is an example (which also serves as an example of minimal working example ;-) ):
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{lmodern}
\usepackage{titlesec}
\usepackage{lipsum}% provides filler text
\titlespacing{\paragraph}{%
0pt}{% left margin
0.5\baselineskip}{% space before (vertical)
1em}% space after (horizontal)
\begin{document}
\lipsum[1]
\paragraph{Lipsum 2} \lipsum[2]
\end{document}
Unfortunately, there is no easy way (that I know) to change only the vertical spacing before, you need to specify the other parameters too, namely 0pt
for left margin and 1em
for the spacing after (got that one from guessing and checking). I made the vertical spacing 0.5\baselineskip
which mean half the height of a normal line, and looks smaller that the default spacing. Obviously, you can use 0pt
to squeeze this space completely.
The titlesec
package allows changing the section margins:
\usepackage{titlesec}
\titlespacing*{\paragraph}{0pt}{3.25ex plus 1ex minus .2ex}{1em}
The above are the default values, that you can modify as needed.
I recommend using plus and minus for spacing to adapt to how much space is left on the page.