问题描述
我想更改标签和部分标题之间的间距。现在我将 titlesec
与 scrartcl
一起使用,但有警告。我猜是因为 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}
解决方法
快速破解:
\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}