# New line without paragraph indentation [duplicate]

Possible Duplicate:
Define latex command to create new type of heading

I have to create a new command that makes a new heading style. Here is a simplified version:

\newcommand{\subheading}[1] {\vspace*{1em}\normalfont {#1}}


And a minimal example:

\documentclass{scrartcl}
\usepackage{ucs} \usepackage[utf8x]{inputenc} \usepackage{lipsum}

\begin{document}

\lipsum[1]
\lipsum[1]

\end{document}


The problem here is that the subsequent line will be indented, as LaTeX will interpret it as a new paragraph. Obviously, however, the first line of a new section should not be indented. How can I achieve this?

Update: The subheading should also be left aligned, and itself not be indented.

-

## marked as duplicate by lockstep, Joseph Wright♦Sep 3 '11 at 11:38

How about a minimal working example, that shows the problem, so I can see it and try to correct? –  Tom Bombadil Sep 3 '11 at 10:17
Simple but rather ugly: \newcommand{\subheading}[1] {\vspace*{1em}\normalfont {#1}\par\vspace*{1ex}\noindent} and then continue the text immediately, e.g. \subheading{Guarantee}The guarantee is .... If that doesn't work then please do as Tom suggested and provide a MWE –  mas Sep 3 '11 at 10:32
Sorry for my stupidity, should have added a MWE in the first place. Here you go! Also, I noticed that the heading is also indented, which should not be the case. –  Ingo Sep 3 '11 at 11:05

You are using a KOMA class. KOMA provides the command minisec. The space above of minisec is set to 1.5ex.

To set the font series you can use addkomafont or setkomafont

\documentclass{scrartcl}
\usepackage{ucs} \usepackage[utf8x]{inputenc} \usepackage{lipsum}
\begin{document}

\lipsum[1]
\lipsum[1]

\end{document}


To create our own minisec you can use the internal definition as master:

\documentclass{scrartcl}
\usepackage{color}
\usepackage{ucs} \usepackage[utf8x]{inputenc} \usepackage{lipsum}
\makeatletter
{\parindent \z@
\ifnum \scr@compatibility>\@nameuse{scr@v@2.96}\relax
\setlength{\parfillskip}{\z@ plus 1fil}\fi
\raggedsection\normalfont\sectfont\nobreak
}
\makeatother

\begin{document}

\lipsum[1]
\lipsum[1]

\end{document}


One advantage you can use the KOMA commands setkomafont, addtokomafont and usekomafont

-
Very elegant, Marco. Thanks! –  Ingo Sep 3 '11 at 11:30

You could define a heading using LaTeX's \@startsection command, such as:

\newcounter{subheading}[subparagraph]
\makeatletter