Я использую 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}