[Tex/LaTex] How to get new line after \subparagraph title

line-breakingsectioningsections-paragraphsspacing

Is there a default way to change the style of the \subparagraph title, namely to add a new line after the title? Is there a way to do it without \renewcommand (some style changes of something else) – if not, how to do it with \renewcommand corectly?

Best Answer

You didn't specify the document class, so I assume for the moment you're using a standard class. The titlesec package offers a way to change the definition of \section & friends.

\documentclass{article}

\usepackage{titlesec}

% Definition of \subparagraph emulating that of the standard classes
% \titleformat{\subparagraph}[runin]
%     {\normalfont\normalsize\bfseries}{\thesubparagraph}{1em}{}
% \titlespacing*{\subparagraph}{\parindent}{3.25ex plus 1ex minus .2ex}{1em}

% Definition of \subparagraph starting new line after heading
\titleformat{\subparagraph}
    {\normalfont\normalsize\bfseries}{\thesubparagraph}{1em}{}
\titlespacing*{\subparagraph}{\parindent}{3.25ex plus 1ex minus .2ex}{.75ex plus .1ex}

\begin{document}

\subparagraph{foo}

Some text.

\end{document}

EDIT: Herbert's answer reminded me that the vertical space after the subparagraph heading should be stretchable. Code example changed accordingly.