リスト環境の前の余分な空行を削除するにはどうすればよいでしょうか?

リスト環境の前の余分な空行を削除するにはどうすればよいでしょうか?

を使用してセクションタイトルを左余白に配置したいのですtitlesecが、 環境を使用すると余分な空行が発生しますlist。 を使用せずにこれを削除するにはどうすればよいですかvspace?

最小限の例:

\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}

結果

答え1

の冒頭部分をitemize次のように変更できます。

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

直接の beforeによって発生する可能性のある問題を排除するために、オプションshowframeと少しのテキストを追加しました。\blindtext\begin{itemize}

以下の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}

そして結果:

ここに画像の説明を入力してください

答え2

解決策は次のとおりです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} 

ここに画像の説明を入力してください

関連情報