3

The table of content, list of figures, list of tables all shows nothing!

Hello there, please help with this issue. I've compiled more than twice. There shows no error. My code is as follows:

\documentclass[12pt]{llncs}
\usepackage[table]{xcolor}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage{bm}
\usepackage{graphicx}
\usepackage{float}
\usepackage{bbm}
\graphicspath{{images/}}
\usepackage{exscale,latexsym}
\usepackage{epic}
\usepackage{setspace}
\onehalfspacing
\usepackage[flushmargin]{footmisc}
\usepackage[ngerman, english]{babel}
\usepackage[small]{caption}
\usepackage{graphpap}
\usepackage{rotating}
\usepackage{wasysym}
\usepackage{multirow}
\usepackage{acronym}
\usepackage{array}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\usepackage[a4paper, lmargin=6cm, rmargin = 2cm, tmargin = 3cm, bmargin = 3cm]{geometry}
\usepackage{mathptmx}
\setcounter{secnumdepth}{4}
\usepackage{fancyref}

\begin{document}

\begin{titlepage}           
\end{titlepage}

\tableofcontents

\newpage
\pagenumbering{Roman}
\setcounter{page}{1}

\addcontentsline{toc}{section}{List of Figures\vspace{0pt}}
\listoffigures

\addcontentsline{toc}{section}{List of Tables\vspace{0pt}}
\listoftables

\newpage
\section{Table of Abbreviations}   
\section{Table of Symbols} 

\end{document}

Thank you very much!!

5
  • Welcome to TeX.SX! Please complete your code to a minimal working example (MWE), that starts with \documentclass and ends with \end{document}. Do you compile twice?
    – Bobyandbob
    Commented Aug 5, 2017 at 17:50
  • 1
    Off-topic: As you're already loading the amssymb package, there can be no justification for loading the deprecated latexsym package as well. And, since you're loading the graphicx package, there can be no justification for loading the epsfig package. Next, since you load the setspace package and execute \onehalfspacing, running \renewcommand{\baselinestretch}{1.5} can only be counterproductive. Finally, don't load packages more than once.
    – Mico
    Commented Aug 5, 2017 at 18:19
  • thank you!! I didn't notice since I've just copy-paste from the template and during writing added some packages again. But why are they empty??
    – Gwen Yang
    Commented Aug 5, 2017 at 18:37
  • 1
    @GwenYang: Never use templates, they are most times rubbish. The main reason you don't see entries in the ToC is the fact that tocdepth is 0 by default in llncs. See my answer below for more explanations
    – user31729
    Commented Aug 5, 2017 at 18:58
  • 1
    One side -note: There is a reason that llncs has \setcounter{tocdepth}{0} -- Springer journals/books guidelines apparently demand that structure levels below chapter should not appear in the ToC. So if this should be a submission to Springer, changing tocdepth will be rejected, eventually (Don't ask me why Springer designed it this way, however)
    – user31729
    Commented Aug 5, 2017 at 19:18

2 Answers 2

4

By default, llncs tocdepth value is 0, so only chapters and parts are shown in the ToC, but no sections and deeper levels of structure.

If \setcounter{tocdepth}{1} is used, the sections show up in the ToC.

I suggest to use \usepackage{tocbibind} in order to add the LoF and LoT in the ToC as well, if the ToC should not be listed itself, use \usepackage[nottoc]{tocbibind} instead.

As long as no figure or table environments with \caption commands or explicit \addcontentsline{lof}{...}{...} etc. are used, the LoF and LoT are empty of course.

\documentclass[12pt]{llncs}
\usepackage[table]{xcolor}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage{bm}
\usepackage{graphicx}
\usepackage{float}
\usepackage{bbm}
\graphicspath{{images/}}
\usepackage{exscale}
\usepackage{epic}
\usepackage{setspace}
\onehalfspacing
\usepackage[flushmargin]{footmisc}
\usepackage[ngerman, english]{babel}
\usepackage[small]{caption}
\usepackage{graphpap}
\usepackage{rotating}
\usepackage{wasysym}
\usepackage[dvips]{epsfig}
\usepackage{multirow}
\usepackage{acronym}
\usepackage{array}
\newcolumntype{P}[1]{>{\centering\arraybackslash}p{#1}}
\renewcommand{\baselinestretch}{1.5}
\usepackage[a4paper, lmargin=6cm, rmargin = 2cm, tmargin = 3cm, bmargin = 3cm]{geometry}
\usepackage{mathptmx}
\setcounter{secnumdepth}{4}
% 
\setcounter{tocdepth}{1}

\usepackage{fancyref}

\usepackage{tocbibind}

\begin{document}

\begin{titlepage}           
\end{titlepage}

\tableofcontents

\clearpage
\pagenumbering{Roman}
%\setcounter{page}{1}% Pagenumbering sets the page counter always to 1

%\addcontentsline{toc}{section}{List of Figures\vspace{0pt}}
\listoffigures

%\addcontentsline{toc}{section}{List of Tables\vspace{0pt}}
\listoftables

\clearpage
\section{Table of Abbreviations}   
\section{Table of Symbols} 

\end{document}

enter image description here

4
  • 1
    The LoF and LoT are empty because there are no figures nor tables with \caption commands in your code
    – user31729
    Commented Aug 5, 2017 at 19:02
  • you are correct!! Thank you so much. But how do I get deeper levels after section shown in the table of content??
    – Gwen Yang
    Commented Aug 5, 2017 at 19:13
  • 2
    \setcounter{tocdepth}{4} gives you all down to \paragraph ... the higher the tocdepth value, the deeper the structure level show up in the ToC
    – user31729
    Commented Aug 5, 2017 at 19:14
  • It's working perfectly!! Thank you angel :)
    – Gwen Yang
    Commented Aug 5, 2017 at 19:17
1

You should be using \section not \section* to get them in toc. If you don't want numbering on some particular sections then you can use something like \setcounter{secnumdepth}{0} for those. Working example (Edit: Turns out llncs class has some weird behavior, I added \setcounter{tocdepth}{3} to preamble and it worked.)

\documentclass{llncs}
\setcounter{tocdepth}{3}

\begin{document}    
    \tableofcontents
    \newpage

    % this section doesn't have numbering
    %\setcounter{secnumdepth}{0}
    \section{Table of Abbreviations} 

    % this section has numbering
    %\setcounter{secnumdepth}{1}
    \section{Table of Symbols} 
\end{document}

enter image description here

6
  • hello thank you for the answer. But I have more content in the document that i didn't show. There are \section{}. And I've tried \setcounter{secnumdepth}{1} just now and still empty. Also the list of tables and list of figures are empty. why???
    – Gwen Yang
    Commented Aug 5, 2017 at 18:35
  • I tried the example that you provided and it works with my fix (\setcounter{secnumdepth}{1} is an example, you can increase it if you want). If you are still facing the issue then could you construct a simple example (remove unnecessary packages and formatting as Mico suggested). I will check if I missed anything.
    – Adarsh
    Commented Aug 5, 2017 at 18:42
  • Edited. The behavior was peculiar to llncs class which I missed before.
    – Adarsh
    Commented Aug 5, 2017 at 19:07
  • thank you. I've removed unnecessary packages. Now after adding the packages suggested above it's working.
    – Gwen Yang
    Commented Aug 5, 2017 at 19:15
  • Also, reiterating an important point which Christian Hupfer has mentioned in comments. If you are submitting your work to a place which requires you to stick to a specific template then you should check with them before making any changes.
    – Adarsh
    Commented Aug 5, 2017 at 19:59

You must log in to answer this question.

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