Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
    
What documentclass are you using? –  Harald Hanche-Olsen Jan 2 '11 at 13:05
    
I use article... –  user1996 Jan 3 '11 at 0:08
add comment

3 Answers

up vote 7 down vote accepted

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.

share|improve this answer
add comment
\documentclass{article}
\makeatletter
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
    {3.25ex \@plus1ex \@minus .2ex}%
    {0.75ex plus 0.1ex}% space after heading
    {\normalfont\normalsize\bfseries}}
\makeatother

\begin{document}

\subparagraph{foo}
text after heading

\end{document}
share|improve this answer
add comment

I add space then \\

\paragraph{XYZ}~\\

This section.....

share|improve this answer
3  
I'm sorry but this is really bad advice. The already posted solutions are better and in general you should almost never use \\ in a document other than to end table rows. The visual layout of headings should be specified by the document class, perhaps as modified in the preamble, not with forced spacing within the document. –  David Carlisle Apr 2 '13 at 22:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.