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.

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?

share|improve this question
    
Duplicate of tex.stackexchange.com/questions/2787/…? –  Martin Schröder Jan 13 '12 at 10:21
add comment

2 Answers

up vote 8 down vote accepted

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.

share|improve this answer
    
worked great :) –  Wiebke Jan 13 '12 at 9:43
add comment

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.

share|improve this answer
    
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
1  
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
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.