LaTex: Problem with ToC in article class

  • Context: LaTeX 
  • Thread starter Thread starter Chaoticus
  • Start date Start date
  • Tags Tags
    article Class Latex
Click For Summary

Discussion Overview

The discussion revolves around an issue with the table of contents (ToC) in the LaTeX article class, specifically regarding the formatting of the List of Figures, List of Tables, and Bibliography entries. Participants explore how to properly include these elements in the ToC with appropriate formatting.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Homework-related

Main Points Raised

  • One participant notes that the List of Figures, List of Tables, and Bibliography appear in the ToC without points between the names and the page numbers.
  • Another participant explains that these lists generate starred sections, which do not automatically include entries in the ToC unless explicitly added using specific macros.
  • Suggestions are made to use the \addcontentsline command to properly include the lists in the ToC, with examples provided for implementation.
  • A later reply identifies a mistake in using {chapter} instead of {section} when adding the contents line, which is acknowledged as the source of the issue.

Areas of Agreement / Disagreement

Participants generally agree on the need to use the correct macros to include the lists in the ToC, but there is no consensus on the initial approach taken by the original poster.

Contextual Notes

The discussion highlights the importance of using the correct sectioning commands in LaTeX, and the implications of using starred sections on ToC entries. There may be limitations based on the specific template and commands used by the original poster.

Chaoticus
Messages
3
Reaction score
0
Hello,

I'm using the article class with a table of contents. Everything works fine, except one point:

The List of Figures, List of Tables and the Bibliography appars in the Contens with no points between the Name and the Page where they are.

For example:

Contents
1 Section 1
1.2 Subsection 1........ 2

2 Section 2
2.1 Subsection 2....... ..3

List of Figures4 List of Tables5


It works fine if I use the report class, but I'd prefer to use the article class. (Don't need chapters)

I tried to search the Net for a solution, but with no sucsess. Does anybody know what's wrong?
 
Physics news on Phys.org
The list of figures, list of tables, and bibliography generate starred sections (i.e., section*). That means these things are not numbered and by default they do not get an entry in the table of contents. The only way for these items to get into the table of contents is if you explicitly invoking some macro to add them to the table of contents.

Which means you are doing something wrong in adding them to the toc. Perhaps a \contentsline instead of an \addcontentsline, etc.

Try the following:
Code:
% Add a \newpage if the list of figures is to be on its own page
\addcontentsline{toc}{section}{List of Figures}
\listoffigures

% Add a \newpage if the list of tables is to be on its own page
\addcontentsline{toc}{section}{List of Tables}
\listoftables

Do something similar for the bibliography after the main body.
 
Thanks for your fast reply.

Actually, I'm using TecNic Center and a template provided there, so I'm using these commands you mentioned. Sorry, I forgot to write this in my first post.

This is the main Doc:

\begin{document}

\pagestyle{empty}

\title{Title}
\author{Autor}
%\date{}

\maketitle\tableofcontents
\cleardoublepage

\pagestyle{plain} %% Chapters %%%%%%%%%%%%%%%%%%%%%%%%
\input{Chapter1.tex}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% BIBLIOGRAPHY AND OTHER LISTS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\addtocontents{toc}{\protect\vspace*{\baselineskip}}\clearpage
\addcontentsline{toc}{chapter}{Bibliography} %'Bibliography' into toc
\bibliographystyle{chicago}
\bibliography{literature}

%% The List of Figures
\clearpage
\addcontentsline{toc}{chapter}{List of Figures}
\listoffigures

%% The List of Tables
\clearpage
\addcontentsline{toc}{chapter}{List of Tables}
\listoftables
 
Ah, I see the error.

I used {chapter} not {section} when adding the contents line.

Thanks for your help.
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 11 ·
Replies
11
Views
9K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 8 ·
Replies
8
Views
13K
  • · Replies 7 ·
Replies
7
Views
20K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
7K