# New line and no indent after \paragraph?

I tried to use a \paragraph-environment, but I do want a new line after the title and no indent in the first textline.

New line is easy, but the first line is indented even if I use \noindent, \setlength{\parindent}{0pt} and \hangafter=0

I extracted an example:

\documentclass[12pt,a4paper,twoside]{scrreprt}

\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{blindtext}

\setlength{\parindent}{0pt}
\hangafter=0

\begin{document}
\subsection{subsection}
\blindtext
%\noindent %does not bring any effect
\paragraph{paragraphNewline\newline}
\blindtext
\end{document}


The first block is ok, but the second is not. I expect to try a \renewcommand / \renewenvironment, but I do not know what to write in.

In general: Is there an overview, where I can see the implementation of LaTeX-commands and -environments?

-
Duplicate of tex.stackexchange.com/questions/2787/…? –  Martin Schröder Jan 13 '12 at 10:21

Since you asked, here's how you would redefine \paragraph:

\documentclass[12pt,a4paper,twoside]{scrreprt}

\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{blindtext}

\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
{-3.25ex \@plus -1ex \@minus -0.2ex}%
{0.01pt}%
{\raggedsection\normalfont\sectfont\nobreak\size@paragraph}%
}
\makeatother

\begin{document}
\subsection{subsection}
\blindtext
\paragraph{paragraph}
\blindtext
\end{document}


The original definition is in your class file – here, scrreprt.cls. It uses the LaTeX command \@startsection, which is described in source2e. The 0.01pt is the amount of space to insert between the heading and text. As described in source2e, section ltsect.dtx, it must be above zero if you don't want a run-in head.

-
worked great :) –  Wiebke Jan 13 '12 at 9:43

Instead of tweaking several different values and adding newlines manually, I would recommend setting parindent to zero in the documentclass parameters, and to use the titlesec package to give a paragraph heading the desired format.

\documentclass[parindent=0pt,12pt,a4paper,twoside]{scrreprt}

\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{blindtext}

\usepackage{titlesec}

\titleformat{\paragraph}
{\normalfont\bfseries}
{}
{0pt}
{}

\begin{document}
\subsection{subsection}
\blindtext
\paragraph{paragraphNewline}
\blindtext
\end{document}


See the titlesec documentation for a wealth of formatting options.

-
If you want to disable indentation in KOMA-Script, the best option is parskip=half or parskip=full. The option parindent is obsolete, and parindent=0pt did nothing on my installation. –  rdhs Jan 13 '12 at 9:52
did not help :( –  Wiebke Jan 13 '12 at 9:55
@Wiebke: "Did not help" does not help. Anyway, glad you found a solution. ;-) –  DevSolar Jan 13 '12 at 10:05
@rdhs: parskip adds vertical space, which might not be desired...? –  DevSolar Jan 13 '12 at 10:15
To change the vertical spacing using titlesec you could use, e.g., \titlespacing*{\paragraph}{0pt}{1ex}{-\parskip}. Or to have the entire document with no skips and no indents, \parskip=0pt – but that's just bad typography. –  rdhs Jan 13 '12 at 10:23