I will start with an example of what I would like to do.
Here is some enumeration:
\begin{enumerate}
\item First item.
\item Second item.
\end{enumerate}
And the text continues in the same paragraph.
Here is some enumeration:
\begin{enumerate}
\item First item.
\item Second item.
\end{enumerate}
And the text continues, but in a new paragraph.
The code above should produce the following output (notice the spacing between the lines at the end of the itemize).
In some situations, I want to insert an enumeration (itemize or enumerate) inside a paragraph, and sometimes I want to insert it in the end and start a new paragraph after it, leaving an empty space. What I call a "paragraph" is not something starting with \paragraph{title} but simply a block of text delimited by empty lines in the code, which produces also a block of text delimited by two empty spaces in the output.
The mental image I have is that an enumeration is a part of my paragraph and I want it to behave the same way as anything else I put inside of my paragraph. So if it's the last thing in it, there should be a space after, and if not, then there should be no space. (Also, I put no space before my enumeration.)
I know how to always put a space after an enumeration or to never put anything after. But I don't know how to adapt the behaviour in the same way as when a paragraph ends. The way I do it now is to put no space by default and to add some \vspace{\parskip} if I end a paragraph with an enumeration.
How can I achieve what I described?
Complete example:
\documentclass{article}
\usepackage{parskip}
\usepackage{enumitem}
\setlist[1]{
label=(\arabic*),
% What do I do here to insert a space if there is a
% new paragraph
% after=\vspace{\parskip},
}
\begin{document}
\noindent
\section{Non-working example (no space)}
Here is some enumeration:
\begin{enumerate}
\item First item.
\item Second item.
\end{enumerate}
And the text continues in the same paragraph.
Here is some enumeration:
\begin{enumerate}
\item First item.
\item Second item.
\end{enumerate}
And the text continues, but in a new paragraph.
\section{Desired output (manual space)}
Here is some enumeration:
\begin{enumerate}
\item First item.
\item Second item.
\end{enumerate}
And the text continues in the same paragraph.
Here is some enumeration:
\begin{enumerate}
\item First item.
\item Second item.
\end{enumerate}
\vspace{\parskip}
And the text continues, but in a new paragraph.
\end{document}


enumitemyou can addafter=\vspace{\parskip}just to the list that ends the paragraph. This isn't automatic though. – Alan Munn Nov 23 '20 at 00:49enumitem. Slightly different than the OP's example, but hopefully clear. (The example is a little contrived and does not look ideal with short snipits of text... but should give the idea.) – mforbes Sep 24 '23 at 20:59parskippackage but only after lists, not anywhere else? – Alan Munn Sep 24 '23 at 21:05parskipto the MWE and think what the OP wants and what I want are the same: extra space when the list is followed by a new paragraph. Sorry for confusing matters with my MWE that had different formatting. – mforbes Sep 25 '23 at 02:54\parskipwhich just needs to be suppressed. My case does not use\parskipand so I still need a way to add the extra space. See the questions I linked below the answer. – mforbes Sep 27 '23 at 00:11