5

I'm using \setlength{\parskip}{\baselineskip} to insert vertical space between the paragraphs in my document. However this create a conflict with my list environments. To solve that I am using the enumitem package to set the space between the last line before my itemize environment and my first item to =0pt however, the paragraph spacing created with \setlength{\parskip}{\baselineskip} cancel this out. I can get at it by setting topsep to ~ -9pt, but them I loose the spacing between the last item and the next paragraph (MWE is below). I have deliberately chosen noitemsep as I also want less spacing between the individual item, I would like to keep this.

Space I am trying to get rid off

\documentclass{article}

% insert vertical space between paragraphs
\setlength{\parskip}{\baselineskip} 

% Modifies itemized lists with enumitem http://www.ctan.org/pkg/enumitem
\usepackage{enumitem}
 \setlist[itemize]{noitemsep, topsep=0pt} % , topsep=-9pt

 % http://tug.ctan.org/tex-archive/macros/latex/contrib/blindtext/blindtext.pdf
\usepackage{blindtext} 

\begin{document} 

\blindtext

\noindent
This is the things cancel each other out:
% space I would like to get rid of is here!
\begin{itemize}
\item dummy first item
\item insert vertical space between paragraphs
\item \verb|[topsep=0pt]| in \verb| \usepackage{enumitem} |
\item dummy last item
\end{itemize}

\blindtext

\blindtext

\end{document}

2 Answers 2

6

Add before={\vspace*{-\baselineskip}} to your itemize options:

\setlist[itemize]{noitemsep, topsep=0pt, before={\vspace*{-\baselineskip}}}

MWE:

\documentclass{article}

% insert vertical space between paragraphs
\setlength{\parskip}{\baselineskip}

% Modifies itemized lists with enumitem http://www.ctan.org/pkg/enumitem
\usepackage{enumitem}
 \setlist[itemize]{noitemsep, topsep=0pt, before={\vspace*{-\baselineskip}}} % , topsep=-9pt

 % http://tug.ctan.org/tex-archive/macros/latex/contrib/blindtext/blindtext.pdf
\usepackage{blindtext}

\begin{document}

\blindtext

\noindent
This is the things cancel each other out:
% space I would like to get rid of is here!
\begin{itemize}
\item dummy first item
\item insert vertical space between paragraphs
\item \verb|[topsep=0pt]| in \verb| \usepackage{enumitem} |
\item dummy last item
\end{itemize}

\blindtext

\blindtext

\end{document} 

Output:

enter image description here

3
  • thank you for a great solution! I did however not illustrate my document fully in my MWE so I ended up with a new (minor) issue. I have created a new question here where I address this. Thanks!
    – uT5r
    Feb 19, 2015 at 13:53
  • @uT5r You're welcome. I've answered your new question, too. Feb 19, 2015 at 17:32
  • I just want to say thank you. I have been looking for this solution for a while! I now use the command: \setlist[itemize]{leftmargin=*, nosep, before={\vspace*{-\baselineskip}}} in my document.
    – slew123
    Sep 13, 2021 at 15:31
0

karlkoeller's answer works great for some time, but you should be aware of the following:

Using negative vspace for the environment can have unwanted side effects as in this question happened to me. The manipulation of vspace leads to Latex calculating the wrong vertical size and can lead to the page content overflowing for example the footnote area.

Instead you should manipulate \topsep before (and after, if necessary) the environment, to make it consume less vertical space.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .