1

How can I get space between paragraphs, which I want in a raggedright document with block paragraphs, and avoid extra space before a list that is not preceeded by whitespace?

If I set topsep=-\parskip, the lists are properly not separated from the text immediately above them. But I also lose the space after the list before the next paragraph.

Here's my MWE:

\documentclass{article}
\usepackage{enumitem}
\newlist{myshortlist}{itemize}{4}

% Attempt 1: lose space after list before next paragraph
%\setlist[myshortlist]{label=\textbullet,nolistsep,topsep=-\parskip}

% Attempt 2: get extra space between list and immediately preceeding text.
\setlist[myshortlist]{label=\textbullet,nolistsep}

\begin{document}
\raggedright\setlength\parskip{\baselineskip}

Want these paragraphs separated by whitespace.

Want these paragraphs separated by whitespace.

Want space before this line, but not between this line and list:
\begin{myshortlist}
  \item one
  \item two
\end{myshortlist}

Want space before this line, but not between this line and list:
\begin{myshortlist}
  \item one
  \item two
\end{myshortlist}
\end{document}
3
\documentclass{article}
\usepackage{enumitem}
\newlist{myshortlist}{itemize}{4}

\makeatletter
\setlist[myshortlist]{label=\textbullet,nolistsep,topsep=-\parskip, after*={\@topsepadd\parskip}}
\makeatother
\begin{document}
\raggedright\setlength\parskip{\baselineskip}

Want these paragraphs separated by whitespace.

Want these paragraphs separated by whitespace.

Want space before this line, but not between this line and list:
\begin{myshortlist}
  \item one
  \item two
\end{myshortlist}

Want space before this line, but not between this line and list:
\begin{myshortlist}
  \item one
  \item two
\end{myshortlist}

\end{document}

enter image description here

  • Exactly what I needed! – dedded Dec 29 '18 at 3:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.