LaTeX 编号段落后的垂直间距

LaTeX 编号段落后的垂直间距

我对这个论坛和 LaTeX 都比较陌生,所以如果我重复了问题,请原谅,但我找不到令人满意的解决方案。我通过将 secnumdepth 扩展为 4 来引入编号段落。现在,我想让这些编号段落具有与小节标题和相关文本相同的外观。因此,我在段落标题后添加了换行符并在第一行文本中缩进(我使用\usepackage[indentafter]{titlesec}),但我还想在标题和相关文本之间添加与 相同的垂直间距\subsubsection。我尝试使用\titlespacing*{\paragraph}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}(=小节的默认标题间距设置,可在此处找到:获取默认章节间距放入 \t​​itlespacing* 参数中),但它没有改变任何东西。我不确定这是否相关,但我正在使用该类scrreprt。有人能帮帮我吗?这是我的代码,包括整个前言,以防某些东西干扰其他任何东西:

\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}

答案1

它比您想象的要简单,无需加载任何包。

皱眉KomaSpacingParagraph

\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}

答案2

\vspace{10pt}那么在段落标题和文本之间添加一个怎么样?您可以重新定义段落命令以在整个文档中实现它:

\renewcommand{\paragraph}[1]{{#1}\mbox{}\vspace{10pt}}

相关内容