6

I am writing a report using lncs package. In my table of contents, the title of the page and author's name is also appearing. How do i remove this?

\title{Evaluation of xyz}
\author{Alina}
\institute{University}
\setcounter{tocdepth}{3}
\begin{document}
\maketitle
\begin{abstract}
\end{abstract}
\tableofcontents

Above is the code I have written and in the picture you could see the result. I want to remove the title & author from table of contents and start it from introduction. enter image description here

2
  • Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – Runar
    Commented Jul 6, 2016 at 7:02
  • 2
    When publishing with Springer, changing the layout is not your decision. If not publishing with Springer, why use their style at all? It will just give you troubles.
    – Johannes_B
    Commented Jul 6, 2016 at 8:58

1 Answer 1

4

This will do the job:

\documentclass{llncs}
\usepackage{lipsum}

\title{Evaluation of xyz}
\author{Alina}
\institute{University}
\setcounter{tocdepth}{3}
\begin{document}
\let\oldaddcontentsline\addcontentsline
\def\addcontentsline#1#2#3{}
\maketitle
\def\addcontentsline#1#2#3{\oldaddcontentsline{#1}{#2}{#3}}

\begin{abstract}
\end{abstract}
\tableofcontents
\section{Introduction}
\lipsum
\end{document}

Note: The title is added to table of contents via \addcontentsline{}{}{} command in the definition of \maketitle of llncs class file. Hence, if you need to remove it, I have stored the definition of \addcontentsline to a temporary control sequence \oldaddcontentsline using \let. After \maketitle, the original definition is restored.

Edit: An easy alternative solution is to redefine \addcontentsline within a group for \maketitle:

\documentclass{llncs}
\usepackage{lipsum}

\title{Evaluation of xyz}
\author{Alina}
\institute{University}
\setcounter{tocdepth}{3}
\begin{document}
{\def\addcontentsline#1#2#3{}\maketitle}

\begin{abstract}
\end{abstract}
\tableofcontents
\section{Introduction}
\lipsum
\end{document}
6
  • 1
    I don't think you need to store and restore the command. Just put it within {} and it will keep it local. like this: {\let\addcontentsline\relax \maketitle}
    – Runar
    Commented Jul 6, 2016 at 7:16
  • @RunarTrollet Yea. I missed that :-) Will that work if it is relaxed? You need to \@gobble it.
    – Jagath
    Commented Jul 6, 2016 at 7:19
  • @JagathAR No, \relax will work just fine. \@gobble I think would be dangerous here, as it only throws away one argument. I am not quite sure, though. see tex.stackexchange.com/questions/85796/…
    – Runar
    Commented Jul 6, 2016 at 7:29
  • 1
    @Jagath: The scoped solution given here in your final comment is much neater than the one you present in your answer. Would you consider updating the answer accordingly? Commented Nov 10, 2016 at 11:22
  • 1
    @figlesquidge: Updated the answer.
    – Jagath
    Commented Nov 11, 2016 at 6:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .