I want to change the spacing around a section heading so that there is less of a gap between it and the paragraph that follows.
I found the following commands
\usepackage[compact]{titlesec}
\titlespacing{\section}{0pt}{0pt}{0pt}
But that produces the error Package titlesec Error: Entered in horizontal mode.. Googling has not found any useful answers for that.
Is there another way to change the spacing around headings or is there an easy fix for that error?
Im using fancyhdr and sectsty if that makes a difference.
\titlespacing{\section}{0pt}{0pt}{0pt}compiles fine for me. Though it is pretty ugly: whitespace is your friend. – Seamus Nov 06 '10 at 11:32sectsty. I was using that to set the text size and color, can I do that easily with \titleformat in the titlesec package? – Adam Pope Nov 06 '10 at 11:43\listfilesto your preamble and tell us what versions of titlesec and sectsty you're using. Also tell us what you are using sectsty for... – Seamus Nov 06 '10 at 11:44\sectionfont{\fontsizesection\color{grey}\textmd}
\subsectionfont{\fontsizesubsection\color{stormblue}\textmd}
where the fontsizes and colors are custom definitions
– Adam Pope Nov 06 '10 at 11:50\titlespacing*instead of\titlespacingbecause "[t]he starrred version kills the indentation of the paragraph following the title" (titlesec manual, p. 9). – lockstep Nov 06 '10 at 12:09