セクションとテキスト間のスペースを削除するために titlesec を使用しています\titlespacing{\section}{0pt}{0em}{0pt}{}
が、段落の終わりとセクションの間では機能せず、負の値は無視されます\titlespacing{\section}{0pt}{-1em}{0pt}{}
。
\documentclass[12pt, a4paper]{extreport}
\usepackage[margin=2cm, top=2cm, right=1.4cm, bottom=2cm, left=2.8cm]{geometry}
\setlength{\parskip}{0em}
\usepackage{setspace}
\linespread{1.5}
\usepackage{titlesec}
\titlespacing{\chapter}{0pt}{-32pt}{0pt}{}
\titlespacing{\section}{0pt}{0em}{0pt}{}
\titlespacing{\subsection}{0pt}{0pt}{0pt}{}
\titlespacing{\subsubsection}{0pt}{0pt}{0pt}{}
\titleformat{\chapter}[hang]
{\normalsize\bfseries\center}
{\thechapter.}
{0.5em}
{\uppercase}
\titleformat{\section}[hang]
{\normalsize\bfseries\center}
{\thetitle.}
{0.5em}
{\uppercase}
\titleformat{\subsection}[hang]
{\normalsize\bfseries\center}
{\thetitle.}
{0.5em}
{\uppercase}
\begin{document}
\section{Section 1}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur dapibus quam quis ornare mattis. Fusce nec leo sit amet quam suscipit feugiat at nec nisl. Nullam ullamcorper ipsum quis ante tempus efficitur. Mauris et erat at neque tincidunt vestibulum in quis nulla. Donec venenatis vulputate vulputate.
\section{Section 1}
Aliquam rutrum blandit mauris, et sagittis libero vestibulum id. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed aliquam velit id sem eleifend, in tincidunt felis semper. Quisque non libero vel lectus sagittis consectetur. Aenean vehicula, tortor vitae rutrum porta, arcu urna viverra dui, sed sollicitudin libero nibh eu ligula.
\section{Section 1}
\section{Section 1}
\end{document}
段落の終わりとセクションの間のスペースを削除するにはどうすればよいですか?
英語が下手ですみません。
答え1
.\centering
の代わりにリスト コマンドを使用してスペースを導入します。\center
center
\documentclass[12pt, a4paper]{extreport}
\usepackage[margin=2cm, top=2cm, right=1.4cm, bottom=2cm, left=2.8cm]{geometry}
\setlength{\parskip}{0em}
\usepackage{setspace}
\linespread{1.5}
\usepackage{titlesec}
\titlespacing{\chapter}{0pt}{-32pt}{0pt}{}
\titlespacing{\section}{0pt}{0em}{0pt}{}
\titlespacing{\subsection}{0pt}{0pt}{0pt}{}
\titlespacing{\subsubsection}{0pt}{0pt}{0pt}{}
\titleformat{\chapter}[hang]
{\normalsize\bfseries\centering}
{\thechapter.}
{0.5em}
{\uppercase}
\titleformat{\section}[hang]
{\normalsize\bfseries\centering}
{\thetitle.}
{0.5em}
{\uppercase}
\titleformat{\subsection}[hang]
{\normalsize\bfseries\centering}
{\thetitle.}
{0.5em}
{\uppercase}
\begin{document}
\section{Section 1}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur dapibus quam quis ornare mattis. Fusce nec leo sit amet quam suscipit feugiat at nec nisl. Nullam ullamcorper ipsum quis ante tempus efficitur. Mauris et erat at neque tincidunt vestibulum in quis nulla. Donec venenatis vulputate vulputate.
\section{Section 1}
Aliquam rutrum blandit mauris, et sagittis libero vestibulum id. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed aliquam velit id sem eleifend, in tincidunt felis semper. Quisque non libero vel lectus sagittis consectetur. Aenean vehicula, tortor vitae rutrum porta, arcu urna viverra dui, sed sollicitudin libero nibh eu ligula.
\section{Section 1}
\section{Section 1}
\end{document}