If you want bad typography, just set topsep=-\parskip
; if you want less bad typography, don't use parskip
.
\documentclass[12pt, a4paper]{article}
\usepackage[a4paper,margin=1in]{geometry}
\usepackage[compact]{titlesec}
\usepackage[parfill]{parskip}
\usepackage{enumitem}
\begin{document}
Bunch of text here.
New paragraph here\newline
New line here.
\begin{itemize}[partopsep=0pt, topsep=-\parskip, parsep=0pt, itemsep=0pt, leftmargin=*]
\item First item
\item second one
\item etc.
\end{itemize}
More here.
\end{document}
Here, I take parskip.sty
, rename it as myparskip.sty
and make the following changes:
1) change to \ProvidesPackage{myparskip}
2) change
\parskip=0.5\baselineskip \advance\parskip by 0pt plus 2pt
to
\ifdim\parskip>0pt\relax
\advance\parskip by 0pt plus 2pt
\else
\parskip=0.5\baselineskip \advance\parskip by 0pt plus 2pt
\fi
This has the effect if called with a zero value of \parskip
, it mimics what the parskip
package would do (which is to set \parskip
to a value of 0.5\baselineskip
). On the other hand, if \parskip
is specified to a non-zero value in advance of calling the package, it will take that as the new default value and do the other things the parskip
package would do, such as adding glue to the \parskip
dimension, and adjusting vertical dimensions associated with list making.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{myparskip}
\ifdim\parskip>0pt\relax
\advance\parskip by 0pt plus 2pt
\else
\parskip=0.5\baselineskip \advance\parskip by 0pt plus 2pt
\fi
\parindent=\z@
%
% from a suggestion by Donald Arseneau on comp.text.tex:
\DeclareOption{parfill}{\setlength{\parfillskip}{30\p@ \@plus 1fil}}
\ProcessOptions
% To accompany this, the vertical spacing in the list environments is changed
% to use the same as \parskip in all relevant places (for normalsize only):
% \parsep = \parskip
% \itemsep = \z@ % add nothing to \parskip between items
% \topsep = \z@ % add nothing to \parskip before first item
\def\@listI{\leftmargin\leftmargini
\topsep\z@ \parsep\parskip \itemsep\z@}
\let\@listi\@listI
\@listi
\def\@listii{\leftmargin\leftmarginii
\labelwidth\leftmarginii\advance\labelwidth-\labelsep
\topsep\z@ \parsep\parskip \itemsep\z@}
\def\@listiii{\leftmargin\leftmarginiii
\labelwidth\leftmarginiii\advance\labelwidth-\labelsep
\topsep\z@ \parsep\parskip \itemsep\z@}
% and, now...
% \partopsep = \z@ % don't even add anything before first item (beyond
% % \parskip) even if the list is preceded by a blank line
\partopsep=\z@
% Note that listiv, listv and listvi don't change vertical parameters.
% deal with a problem raised on comp.text.tex in april 2001
%
% don't expand the table of contents any further
%
% first: check that the definition of \@starttoc is unchanged from
% that in latex.ltx
\@ifundefined{CheckCommand}{}{%
\CheckCommand*{\@starttoc}[1]{%
\begingroup
\makeatletter
\@input{\jobname.#1}%
\if@filesw
\expandafter\newwrite\csname tf@#1\endcsname
\immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
\fi
\@nobreakfalse
\endgroup}}
%
% now having generated any warning that might help, redefine
\renewcommand*{\@starttoc}[1]{%
\begingroup
\makeatletter
\parskip\z@
\@input{\jobname.#1}%
\if@filesw
\expandafter\newwrite\csname tf@#1\endcsname
\immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
\fi
\@nobreakfalse
\endgroup
}
\endinput
Consider this MWE, which gives the default parskip
package behavior:
\documentclass{article}
\usepackage{lipsum}
%\parskip\baselineskip
\usepackage{myparskip}
\begin{document}
\lipsum[1]
\begin{itemize}
\item the first
\item the second
\item the third
\end{itemize}
\lipsum[2-6]
\end{document}
When the \parskip
value is set in advance (uncomment the one line in the preamble), it affects the paragraph and list-making spacing both:
Best Answer
To get a better version of
parskip
-like spacing, use a KOMA-Script document class with the parskip option. Assuming you are writing an article or other simple document, just use this:Then experiment with
parksip=half
orparskip=full+
and see whether your document looks better. If you want more details read the excellent and detailed (perhaps too detailed :-) KOMA-Script documentation on CTAN.If you can't or don't want to do that, then you will have to resort to some good old plain TeX. All that the
parskip
package does is to set the\parskip
and\parindent
parameters. So you can do this yourself if you want. Try adding these lines to your preamble instead of\usepackage{parskip}
:BUT there are some issues with doing this. First other parts of TeX may make assumptions about the values; in plain TeX for example the
\narrower
macro assumes that\parindent
is positive; or the page breaking algorithm might give you slightly nicer pages if there was some stretchability in the\parskip
glue.Secondly for any serious work, you should think carefully about the typography. With a blank line between paragraphs, you probably want to have the last line of each paragraph reasonably full so you may want to fiddle with
\parfillskip
as well. And the spacing around your headings and displays may not look so good, so you may want to start customising the headings and the spacing around displays.At this point you might consider writing your own package.
Or using the nice simple option that KOMA-Script already provides.