LaTeX \parskip
and parskip
Package
\parskip
In LaTeX, we can use the \parskip
command to control the inter-paragraph spacing1, for example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
\documentclass[a4paper]{article}
\usepackage[margin=1in]{geometry}
\usepackage[x11names]{xcolor}
\pagecolor{AntiqueWhite1}
\usepackage{lipsum}
\begin{document}
\thispagestyle{empty}
\lipsum[1-2]
The value of \verb*|\parskip| is \the\parskip, and \verb*|\baselineskip| is \the\baselineskip.
\parskip 3em
\lipsum[1-2]
The value of \verb*|\parskip| is \the\parskip, and \verb*|\baselineskip| is \the\baselineskip.
\setlength{\parskip}{10pt}
\lipsum[1-2]
The value of \verb*|\parskip| is \the\parskip, and \verb*|\baselineskip| is \the\baselineskip.
\end{document}
And, the font size would affect line spacing, but not affect paragraph spacing:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
\documentclass[a4paper]{article}
\usepackage[margin=1in]{geometry}
\usepackage[x11names]{xcolor}
\pagecolor{AntiqueWhite1}
\usepackage{lipsum}
\begin{document}
\thispagestyle{empty}
\lipsum[1-3]
\vspace{3em}
The value of \verb*|\parskip| is \the\parskip, and \verb*|\baselineskip| is \the\baselineskip.
\end{document}



It should be noted that, \parskip
is traditionally not set as a fixed value, but as a flexible glue2 (see the first default case in the above figure) using syntax like:
1
\setlength{\parskip}{fixed amount plus amount to stretch minus amount to shrink}
to stretch or shrink the space between paragraphs, helping to fit content on the page and find a “good” place for a page break1.
The parskip
package
However, the parskip
package suggest not directly modifying the value of \parskip
1:
The parskip
package advises that directly modifying \parskip
can “result in vertical spaces in unexpected places” (within a LaTeX document). The parskip
package attempts to fix spacing issues that might arise from changes to the value of \parskip
—such as within table of contents and list environments.
As for the parskip
package, it doesn’t provide any user-level commands, but uses package options to configure settings, mainly including four options1:
skip
: specify\parskip
, the vertical space between paragraphs;tocskip
: specify a non-zero\parskip
value for use in\tableofcontents
and similar lists;indent
: set the value of\parindent
, the paragraph indentation;parfill
: adjusts the value of\parfillskip
, the glue added at the end of the last line in a paragraph. (\parfillskip
is inserted at the end of a paragraph. By this option, i.e. by raising this value, you avoid that a paragraph ends almost flush right. So, paragraphs could easier be distinguished.3)
Here is an example of importing the parskip
package with no option:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
\documentclass[a4paper]{article}
\usepackage[margin=1in]{geometry}
\usepackage[x11names]{xcolor}
\pagecolor{AntiqueWhite1}
\usepackage{lipsum}
\usepackage{parskip}
\begin{document}
\thispagestyle{empty}
\lipsum[1-3]
\vspace{3em}
The value of \verb*|\parskip| is \the\parskip, and \verb*|\baselineskip| is \the\baselineskip.
\end{document}



By default, the parskip
package sets \parindent
to 0pt
and provides a non-zero \parskip
value of .5\baselineskip plus 2pt
.”1
and that of with skip
and indent
options:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
\documentclass[a4paper]{article}
\usepackage[margin=1in]{geometry}
\usepackage[x11names]{xcolor}
\pagecolor{AntiqueWhite1}
\usepackage{lipsum}
\usepackage[skip=10pt plus 1pt,indent=2em]{parskip}
\begin{document}
\thispagestyle{empty}
\lipsum[1-3]
\vspace{3em}
The value of \verb*|\parskip| is \the\parskip, and \verb*|\baselineskip| is \the\baselineskip.
\end{document}



At last, like defining other LaTeX glues2, we can use fill
when specifying the skip
option:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
\documentclass[a4paper]{article}
\usepackage[margin=1in]{geometry}
\usepackage[x11names]{xcolor}
\pagecolor{AntiqueWhite1}
\usepackage{lipsum}
\usepackage[skip=0pt plus 1fill,indent=2em]{parskip}
\begin{document}
\thispagestyle{empty}
\lipsum[1-3]
\vspace{3em}
The value of \verb*|\parskip| is \the\parskip, and \verb*|\baselineskip| is \the\baselineskip.
\end{document}
References