I know this subject has been mentioned before, but I'm still having a problem in creating a space under a section title. I used the titlesec package and then tried using the command \titlespacing{\section}...

This is my code. Can anybody help?

\chapter*{Kapitel 1}
\subsection*{1.1 Motivation}
  • 1
    Welcome to TeX.SX. A tip: If you indent lines by 4 spaces, then they're marked as a code sample. You can also highlight the code and click the "code" button ({}) or hit Ctrl+K. – Claudio Fiandrino Apr 14 '13 at 13:05
  • Thanks! But sorry I didn't get what you mean. So leave the titlespacing and just use the \\ to make the spaces? – abdu Apr 14 '13 at 13:56
  • @user29019 but exactly what kind of space are you trying to get? Exactly how much space do you want after \chapter and \section? – Gonzalo Medina Apr 14 '13 at 14:55
  • @GonzaloMedina yes I tried it, it works. The \begin{large} is for the font size of the text. So everything is working till now. But I need create a titlespacing under the 'Einleitung' so between the section title und the text beneath it. I'm a new LaTeX user, I'm writing a scientific thesis. so there would be chapters, section and subsections. I searched in the internet for packages and commands I found things like \vspace, \titlespacing{\section}... but non of them worked, I compile the .tex file through a terminal (ubuntu) but I get no changes. – abdu Apr 14 '13 at 16:16
  • So I need like about 3 empty lines between section title and subsection title! – abdu Apr 14 '13 at 16:20

Using the titlesec package you can use \titlespacing* you can change the spacing before and after the title; the syntax of the command is:


(there's an additional optional argument, but it's not important here). <left> increases the left margin; <before-sep> controls the vertical space before the title; <after-sep> controls the vertical space after the title. (Please refer to the package documentation for further information). A complete example:

\usepackage{lipsum}% just to generate text for the example

{0pt}{5.5ex plus 1ex minus .2ex}{4.3ex plus .2ex}
{0pt}{5.5ex plus 1ex minus .2ex}{4.3ex plus .2ex}


\chapter{Kapitel 1}


enter image description here

I used ex (approximately the height of an "x" in the current font) as the unit for the lengths used, but you can use instead any other valid LaTeX unit (cm, in, mm, pt, among others); you can also use multiples of predefined lengths such as \baselineskip:


I used ex since in this way the space is font-dependent. If you want to change the formatting of the titles, you can also use the same package and its powerful \titleformat command.

  • thanks very much! Everything worked, so now I know that I only have to use the titlesec package. I used the cm unit to change the spacing before the chapter and it worked! However I still have a problem, the one with the error. I can ignore it but it bothers while compiling through the terminal. I usually seperate two paragraphs with \\ \\ and this makes the error I think. Is there a way I can seperate paragraphs? – abdu Apr 15 '13 at 11:08
  • @abdu Yes, using two consecutive \\ commands will result in errors. You can use \par\bigskip instead at the end of each paragraph. Another option would be to load the parskip package which automatically suppresses indentation and increases separation between paragraphs. Yet another option would be to switch to the document class scrreprt and use its parskip features. – Gonzalo Medina Apr 15 '13 at 12:49
  • \pas\bigskip worked. I tried the parskip package by defining the skip length: \setlength{\parskip}{0pt} and then typing \parskip between the paragraphs, but I got errors while compiling. – abdu Apr 15 '13 at 13:16
  • @abdu The idea with the parskip package is just to load it; no need to set \parskip nor to explicitly call \parskip. You don't need the line \setlength{\parskip}{0pt} (you can delete it) and you don't need to use \parskip in your document. – Gonzalo Medina Apr 15 '13 at 13:34
  • 2
    @Adam_G texdoc texbytopic (or The TeXbook) and search for glue. The answer to tex.stackexchange.com/q/64756/3954 can also give you an explanation. – Gonzalo Medina Nov 4 '15 at 23:50

If you don't need all the "baggage" of an additional package like titlesec, you can simply modify these aspects of your headings yourself. See this example. I use a few sections and save the original section definition, so we can see a comparison.

I then define and use a section "prelude" prior to the invocation of the original section command. Then I add a "postlude" to the sectioning command. The prelude and the postlude here both add an extra em of vertical space, but you could use it to put in other sectioning highlights like rules, etc.

\section{First Section}

This is the first line of text.  Note the vertical spacing.  

\section{Second Section}

Observe the spacing prior to and following the sectioning command. Now let me
redefine a few things.






\section{Next Section}
Did this text drop 1em lower relative to the heading than the prior
section?  If so, we have succeeded.

\section{Final Section}

And the result is permananent, as you can see.


enter image description here

  • Hey thanks for your answer Steven. But I think I'll use the titlesec package just because I know how it works now. And since I'm using the report class I need chapters sections and subsections it's makes more sense to use the titlesec package. But thanks a lot, I'll save your code and try to use it in the future! =) – abdu Apr 15 '13 at 11:01
  • @abdu. I understand completely. It's just one more option, depending on the particular need. – Steven B. Segletes Apr 15 '13 at 11:03
  • Nice! How would this work if I wanted to do the same for \subsection*'s? – texfan Aug 9 '16 at 13:52
  • 3
    @texfan If you take my source and do a global search and replace from section to subsection, recompile and see the result. – Steven B. Segletes Aug 9 '16 at 13:55
  • @StevenB.Segletes Ah ok, I thought maybe there was a way to do both at once, but this works, thanks :)! – texfan Aug 10 '16 at 9:49

In case anybody wants to adjust the spaces while using KOMAscript -- @gonzalo's answer is not recommended since KOMA and titlesec are incompatible. However, KOMA provides commands to modify the section commands. The command

\RedeclareSectionCommand[beforeskip=-5.5ex plus -1ex minus -.2ex,afterskip=4.3ex plus -.2ex]{section}

modifies the space before and after a section title to similar values.

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.