When using Section headers in margins to put paragraph headings in the margin, when the paragraph starts with an itemize or enumerate, an extra space appears at the top of the paragraph, which is not the case if it starts with a normal text.
How do I prevent this?
Example code:
\documentclass{report}
\usepackage[a4paper]{geometry}
\usepackage[compact]{titlesec}
\usepackage{lipsum}
\titleformat{\paragraph}[leftmargin]
{\normalfont
\bfseries\filleft}
{}{0pt}{}
\titlespacing{\paragraph}
{4pc}{1.5ex plus .1ex minus .2ex}{1pc}
\begin{document}
\section{Section}
\paragraph{first paragraph with title}
\begin{itemize}
\item item one
\item item two
\item item three
\end{itemize}
\lipsum[1]
\paragraph{second paragraph with title}
\lipsum[1]
\end{document}


enumitemto remove the space. I updated my example with such environments. – Vincent May 03 '23 at 18:13