额外部分级别

额外部分级别

我使用以下代码来添加额外级别的部分:

\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
            {-2.5ex\@plus -1ex \@minus -.25ex}%
            {2.25ex \@plus .25ex}%
            {\normalfont\normalsize\textit}}
\makeatother
\setcounter{secnumdepth}{4} % how many sectioning levels to assign numbers to
\setcounter{tocdepth}{4}    % how many sectioning levels to show in ToC

如何删除图中指定的空间?

数字

答案1

\textit接受一个参数,但在本例中该参数使用不当。您需要使用字体开关 - \itshape

在此处输入图片描述

\documentclass{article}

\makeatletter
\newcommand\subsubsubsection{\@startsection{paragraph}{4}{\z@}%
            {-2.5ex\@plus -1ex \@minus -.25ex}%
            {2.25ex \@plus .25ex}%
            {\normalfont\normalsize\itshape}}
\makeatother
\setcounter{secnumdepth}{4} % how many sectioning levels to assign numbers to
\setcounter{tocdepth}{4}    % how many sectioning levels to show in ToC
\begin{document}

\setcounter{section}{7}

\section{A section}
\subsection{A sub-section}
\subsubsection{A sub-sub-section}
\subsubsubsection{A sub-sub-sub-section}

\end{document}

有关中参数的信息\@startsection,请参阅在哪里可以找到类似\@startsectionLaTeX 的命令的帮助文件或文档?

相关内容