2

LNCS format has a run in style for subsubsection. I followed some instructions to modify the class file for LNCS, then there are newlines after each subsubsection, however, the header is missing. How to make the subsubsection looks like this:

1.1.1 example
example, example, example

now it lookes like this

example
example, example, example

The modified class file:

\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                       {-18\p@ \@plus -4\p@ \@minus -4\p@}%
                       {4\p@ \@plus 2\p@ \@minus 2\p@}%
                       {\normalfont\normalsize\bfseries\boldmath
                        \rightskip=\z@ \@plus 8em\pretolerance=10000 }}
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
                       {-12\p@ \@plus -4\p@ \@minus -4\p@}%
                       {2\p@ \@plus 1\p@ \@minus 1\p@}%
                       {\normalfont\normalsize\itshape
                        \rightskip=\z@ \@plus 8em\pretolerance=10000 }}

Besides, I'm using lncs.cls, a working example should look like this:

\documentclass[runningheads,a4paper]{llncs}
%\documentclass{article}
\usepackage{listings}
\usepackage{graphicx}
\usepackage{float}
\usepackage{hyperref}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{caption}
\usepackage{subcaption}
\begin{document}

\title{xxxxxxxxxxxxxxxxxxxxxxxxxxxx}

\author{xxxxxxxxxxxxxxxxxxxxxx}
\institute{ xxxx \\ xxxxxxxxxxxxxxx}
\maketitle

\begin{xx}
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
\end{xx}

\section{xxxx}~\label{xxxx}

xxxxxx

\subsection{xxxx}\label{xxx}

xxxxxxxxxxxxxxxxxxxxxx
\subsubsection{xxxx}

xxxxxxxxxxxxxxx


\bibliography{kk}
\bibliographystyle{splncs}
\end{document}

where subsubsection doesn't have a head like this:

1.1.1 example subsubsection

instead, the numbers are missing.

Werner
  • 603,163
Zhao
  • 123
  • Welcome to TeX.SX!! Rather than posting code fragments it is better to give a full minimal working example. Currently we have to guess what packages etc you are using and this makes it really hard to help you. A MWE should start with a \documentclass command, have a minimal preamble and then \begin{document}...\end{document}. The code should compile and be as small as possible to demonstrate your problem. This makes it much easier for people to help you --- and much more likely that they will! –  Sep 15 '16 at 02:09

1 Answers1

3

There are two things that is sufficient to update the display of \subsubsection to

  1. have enumeration; and
  2. is formatted as a display (with a line-break after the title).

For the first requirement, add

\setcounter{secnumdepth}{3}% Number up to \subsubsection

to your preamble. \subsubsections are "level 3" sectional units. The default setting under llncs is to have the secnumdepth counter set to 2, numbering only up to \subsection.

For the second requirement you need to understand what the arguments of \@startsection does. Read up on this at Where can I find help files or documentation for commands like \@startsection for LaTeX? The <afterskip> length - argument #5 - should be positive rather than negative. Here is the default definition within llncs.cls for \subsubsection:

\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                       {-18\p@ \@plus -4\p@ \@minus -4\p@}%
                       {-0.5em \@plus -0.22em \@minus -0.1em}%
                       {\normalfont\normalsize\bfseries\boldmath}}

We can change this to

\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                       {-18\p@ \@plus -4\p@ \@minus -4\p@}%
                       {0.5em \@plus 0.22em \@minus 0.1em}%
                       {\normalfont\normalsize\bfseries\boldmath}}

(or something similar).

enter image description here

\documentclass{llncs}

\makeatletter
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                       {-18\p@ \@plus -4\p@ \@minus -4\p@}%
                       {0.5em \@plus 0.22em \@minus 0.1em}%
                       {\normalfont\normalsize\bfseries\boldmath}}
\makeatother
\setcounter{secnumdepth}{3}

\begin{document}

\section{A section}
This is part of a section.

\subsection{A subsection}
This is part of a subsection.

\subsubsection{A subsubsection}
This is part of a subsubsection.

\end{document}
Werner
  • 603,163