label 和 sectiontitle 之间的间距

问题描述

我想更改标签和部分标题间的间距。现在我将 titlesecscrartcl 一起使用,但有警告。我猜是因为 titlesec 的 KOMA 脚本存在一些问题。

所以我想通过使用 KOMA-Script 命令来创建相同的内容。你有什么想法吗?

\documentclass[pdftex,a4paper]{scrartcl}
\usepackage{titlesec}

\titleformat{\section}[hang]
{\normalfont\bfseries}{\thesection}{1cm}{}


\titleformat{\subsection}[hang]
{\normalfont\bfseries}{\thesubsection}{3cm}{}

\titleformat{\subsubsection}[hang]
{\normalfont\bfseries}{\thesubsubsection}{5cm}{}

\begin{document}

\section{Ein erster Abschnitt}
\subsection{Unterabschnitt}
\subsubsection{Unter-Unterabschnitt}

\end{document}

Warnings

Output document

解决方法

快速破解:

\documentclass[
%pdftex,a4paper]{scrartcl}

\renewcommand*{\sectionformat}{\thesection\autodot\enskip\hspace{2cm}}
\renewcommand*{\subsectionformat}{\thesubsection\autodot\enskip\hspace{2cm}} 
\renewcommand*{\subsubsectionformat}{\thesubsubsection\autodot\enskip\hspace{2cm}}

\begin{document}

\section{Ein erster Abschnitt}
\subsection{Unterabschnitt}
\subsubsection{Unter-Unterabschnitt}

\end{document}

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...