4

I used the following code to add an extra level of section:

\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

How can I remove the space that is specified in the figure?

Figure

Linda
  • 329
  • 3
  • 8

1 Answers1

5

\textit takes an argument, which is not properly used in this instance. Instead you need to use a font swith - \itshape:

enter image description here

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

For information on the parameters in \@startsection, see Where can I find help files or documentation for commands like \@startsection for LaTeX?

Werner
  • 603,163