¿Cómo eliminar la línea vacía superflua antes del entorno de lista?

¿Cómo eliminar la línea vacía superflua antes del entorno de lista?

Quiero poner el título de la sección en el margen izquierdo usando titlesec. Sin embargo, da como resultado una línea vacía superflua cuando se utiliza listel entorno. ¿Cómo debo quitarlo sin usarlo vspace?

Ejemplo mínimo:

\documentclass{article}

\usepackage{geometry}
\geometry{
  a4paper,
  top=2cm,
  bottom=2cm,
  left=4.5cm,
  right=1.5cm,
}

\usepackage{titlesec}
\titleformat{\section}[leftmargin]{\large\scshape\sffamily}{}{0cm}{}
\titlespacing{\section}{2.5cm}{2ex}{0.5cm}

\usepackage{enumitem}

\usepackage{mwe}

\begin{document}

\section{Section A}

This line is aligned with the section title.

\blindtext

\section{Section B}

\begin{itemize}[nosep]
  \item This line is not aligned with the section title.
\end{itemize}

\end{document}

resultado

Respuesta1

Puedes cambiar el comienzo de itemizeasí:

\begin{itemize}[nosep,before=\leavevmode\vspace*{-1\baselineskip}] 

Agregué una opción showframey un poco de texto para deshacerme de posibles problemas causados ​​por \blindtextel directo anterior \begin{itemize}.

Por favor consulte el siguiente MWE

\documentclass{article}

\usepackage{geometry}
\geometry{%
  a4paper,
  top=2cm,
  bottom=2cm,
  left=4.5cm,
  right=1.5cm,
  showframe % <=========================================================
}

\usepackage{titlesec}
\titleformat{\section}[leftmargin]{\large\scshape\sffamily}{}{0cm}{}
\titlespacing{\section}{2.5cm}{2ex}{0.5cm} 

\usepackage{enumitem}
\usepackage{blindtext}


\begin{document}

\section{Section A}

This line is aligned with the section title.

\blindtext

Some text to get rid of blindtext.

\section{Section B}
%This is some text. 

\begin{itemize}[nosep,before=\leavevmode\vspace*{-1\baselineskip}] % [nosep]
  \item This line is not aligned with the section title.
  \item second item. second item. second item. second item. second item. 
     second item. second item. second item. second item. second item. second item. 
\end{itemize}

\end{document}

y el resultado:

ingrese la descripción de la imagen aquí

Respuesta2

Aquí hay una solución con enumitem:

\documentclass{article}

\usepackage{geometry}
\geometry{
  a4paper,
  vmargin=2cm,
  left=4.5cm,
  right=1.5cm,
}

\usepackage{titlesec}
\titleformat{\section}[leftmargin]{\large\scshape\sffamily}{}{0cm}{}
\titlespacing{\section}{2.5cm}{2ex}{0.5cm}

\usepackage{enumitem}

\usepackage{mwe}

\begin{document}

\section{Section A}

This line is aligned with the section title.

\blindtext

\section{Section B}

\begin{itemize}[topsep=0pt, before =\leavevmode\vspace*{-\baselineskip}]
  \item This line is aligned with the section title.
\end{itemize}

\end{document} 

ingrese la descripción de la imagen aquí

información relacionada