2

I use the Springer LNCS Template for my document and print the table of contents.

\documentclass{llncs}

\begin{document}

\setcounter{tocdepth}{2}
\tableofcontents

\section{Introduction}
\section{Literature Review}
\subsection{Method 1}
\subsection{Method 2}
\subsection{Method 3}
\section{Conclusion}

\end{document}

The result with \documentclass{llncs} looks like this:

Table of Contents with llncs


I would like to change the appearance of the table of contents to have bold section headings and page numbers along with more vertical spacing between sections. How can I alter the template - or replace the TOC macro - such that it will look more like \documentclass{article}?

Table of Contents with article

  • If you intend to submit this, the editors will most likely reverse your changes, if you are not explicitly asked to make these changes. – Skillmon likes topanswers.xyz Dec 16 '18 at 14:02
  • @Skillmon Thanks for pointing that out. Though, I will use it for a different purpose here. – blu3r4y Dec 16 '18 at 14:12
1

Copying over the definition for section entries of article (because that one uses the formatting you want):

\documentclass{llncs}

\makeatletter
\renewcommand*\l@section[2]
  {%
    \ifnum \c@tocdepth >\z@
      \addpenalty \@secpenalty
      \addvspace {1.0em \@plus \p@ }%
      \setlength \@tempdima {1.5em}%
      \begingroup
        \parindent \z@
        \rightskip \@pnumwidth
        \parfillskip -\@pnumwidth
        \leavevmode \bfseries
        \advance \leftskip \@tempdima
        \hskip -\leftskip
        #1\nobreak
        \hfil
        \nobreak
        \hb@xt@ \@pnumwidth {\hss #2\kern -\p@ \kern \p@ }%
        \par
      \endgroup
    \fi
  }
\makeatother

\begin{document}

\setcounter{tocdepth}{2}
\tableofcontents

\section{Introduction}
\section{Literature Review}
\subsection{Method 1}
\subsection{Method 2}
\subsection{Method 3}
\section{Conclusion}

\end{document}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.