2

I'm relatively new to this forum and LaTeX in general, so please excuse me if I'm duplicating a question, but I can't find a satisfying solution to my problem. I have introduced numbered paragraphs by extending the secnumdepth to 4. Now, I would like to have the same appearance as with the subsubsection titles and the associated text for these numbered paragraphs. Therefore, I have added a line break after the paragraph title and indentation to the first line of text (I'm using \usepackage[indentafter]{titlesec}), but I would also like to add the same vertical spacing between the title and the associated text as done with \subsubsection. I tried using \titlespacing*{\paragraph}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex} (= default titlespacing settings for subsubsections, found here: Obtaining the default section spacing into the \titlespacing* parameters), but it didn't change anything. I'm not sure whether this is relevant, but I'm using the scrreprt class. Can anyone help me, please? Here is my code including the entire preamble in case that something interferes with anything else:

\documentclass[12pt,a4paper]{scrreprt}
\usepackage{graphicx}
\usepackage{lineno}
\usepackage[english]{babel}
\usepackage[super]{natbib}
\usepackage{subscript}
\usepackage{booktabs}
\usepackage[indentafter]{titlesec}
\usepackage{textcomp, gensymb}
\usepackage{color}
\usepackage{colortbl}
\usepackage[onehalfspacing]{setspace}
\usepackage{enumitem}
\usepackage{comment}
\usepackage{caption}
\setkomafont{disposition}{\normalcolor\bfseries}
\setkomafont{descriptionlabel}{\normalcolor\bfseries}
\setkomafont{captionlabel}{\normalcolor\bfseries}
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
\renewcommand{\labelitemi}{-}
\renewcommand{\labelenumi}{\arabic{enumi}.)}

    \begin{document}

    \chapter{Chapter title}

    Sample text

    \section{Section title}

    Sample text

    \subsection{Subsection title}

    Sample text

    \subsubsection{Subsubsection title}

    Sample text

    \paragraph{Paragraph title}

    \ \\
    \indent Sample text

    \end{document}
  • Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Tom Bombadil Oct 30 '15 at 11:28
2

It is easier than you might think, without loading any package.

frownKomaSpacingParagraph

\documentclass[12pt,a4paper,
egregdoesnotlikesansseriftitles% The name of this option might change in the future
]{scrreprt}
\usepackage{graphicx}
\usepackage{lineno}
\usepackage[english]{babel}
\usepackage[super]{natbib}
\usepackage{booktabs}
\usepackage{textcomp, gensymb}
\usepackage[table]{xcolor}
\usepackage[onehalfspacing]{setspace}
\usepackage{comment}
\usepackage{caption}
\setkomafont{captionlabel}{\normalcolor\bfseries}
\setcounter{secnumdepth}{4}
\setcounter{tocdepth}{4}
\usepackage{enumitem}
\renewcommand{\labelitemi}{-}
\renewcommand{\labelenumi}{\arabic{enumi}.)}

\RedeclareSectionCommands[%
  beforeskip=3.25explus -1ex minus -.2ex,%
]{section,subsection,subsubsection}
\RedeclareSectionCommand[%
  afterskip=1.5ex plus .2ex,%
]{paragraph}
\begin{document}

\chapter{Walter Wombat}

He lives in Australia.

\section{Carl Capybara}

He lives in South America.

\subsection{Milli Mara}

She lives in Patagonia

\subsubsection{Brigitte Beaver}

She lives in Europe.

\paragraph{Nadja Nasenb\"ar}

Maybe she lives in M\"onchengladbach.

\end{document}
-1

What about adding a \vspace{10pt} between your paragraph title and the text? You could redefine the paragraph command to implement it in your whole document:

\renewcommand{\paragraph}[1]{{#1}\mbox{}\vspace{10pt}}
  • Oh my god, I thought I had tried adding \vspace at every possible position between the title and the text, but I just realised that I obviously missed one because now, I simply inserted \vspace{12pt} between "\ " and "\\" (see above code) and it works perfectly! Sorry for bothering you guys unnecessarily and thank you for your suggestion anyways, LeCoco! Just for sake of completeness: I simply copied your suggestion into my document and it caused the paragraph title to lose both its numbering and its bold font, no idea why, maybe someone can explain? – Frown Oct 30 '15 at 12:49
  • 3
    i'm not a user of the koma classes, but unless scrreport is very much different from other classes, adding explicit vertical space between the heading and the text permits the heading to be left alone at the bottom of a page, which is undesirable. the redefinition of \paragraph in the answer, on the other hand, removes all formatting of the heading except for placing it on a separate line. – barbara beeton Oct 30 '15 at 13:21
  • 3
    This redefinition of \paragraph manages to lose all of the desirable properties of the macro, including automatic numbering, bold-facing of the argument, non-indentation, space above the paragraph-level header. In short, don't employ this redefinition. – Mico Feb 27 '16 at 17:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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