0

I apologize if this question has been asked before, I searched the site I found some similar questions but didn't exactly find this.

I would like to eliminate the space after the section title. This can be normally done by the package titlesec. The problem is that I use baselineskip and this prevent titlesec package to completely eliminate this space. A solution without using titlesec is also welcomed.

\documentclass{book}
\usepackage{lipsum}

\usepackage[compact]{titlesec}

\begin{document}
\setlength{\baselineskip}{2\baselineskip}
\section{section}
\lipsum[1]
\end{document}
2

You can use the third argument of the \titlespacing command of titlesec with negative values

\documentclass{book}
\usepackage{lipsum}

\usepackage[compact]{titlesec}

\titlespacing*{\section}{0pt}{\baselineskip}{-0.5\baselineskip}

\begin{document}
\setlength{\baselineskip}{2\baselineskip}
\section{section}
\lipsum[1]
\end{document}

Setting double linespaces like you do is not recommended however if I'm not mistaken. An alternative way is using the setspace package and putting \doublespacing in the preamble.

  • Let me add that doublespacing is not, as one might naively think doubling \baselineskip, because of optical effects of blank spaces. Actually, it multiplies by 1.667, 1.618 or 1.655, depending on the font size of the document. – Bernard Sep 14 '16 at 18:09
  • Good to know, I took a peek in the source (there is no proper documentation for some reason...) and you can use the \setstrech command for arbitrary spacing. So \setstrech{2} would do the job if \doublespacing is truly not sufficient. – Danieru Sep 14 '16 at 18:38
  • Generally, it is recommended to use setspace, which takes care of lists, footnotes and a few other things. See more information in l2tabu. – Bernard Sep 14 '16 at 19:05
  • Many thanks, I would like that the space before the section to not being changed. Is it the case with your solution? – Name Sep 14 '16 at 19:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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