0

I' am using titlesec for removing space between section and text \titlespacing{\section}{0pt}{0em}{0pt}{} but this is not working between paragraph end and section, negative values are just ignored \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}

How can I remove this space between paragraph end and section?

Sorry for my bad English.

example

  • Looks as if you have an enumerate there, so you would probably have to change the list spacing, but without (small) complete example it is difficult to say more. – Ulrike Fischer Apr 24 '17 at 7:50
  • @UlrikeFischer, thanks for answering, no, there is nothing wrong with enumerate because the same thing happen with standard paragraph. I added an example. – Ivan LockeF21 Apr 24 '17 at 10:02
  • May be you are looking for the savetrees package? ctan.org/pkg/savetrees – Keks Dose Apr 24 '17 at 10:15
0

Use \centering instead of \center. center is a list command and introduce spacing.

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

enter image description here

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.