Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

LaTex: Problem with ToC in article class

  1. Jul 7, 2011 #1

    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:

    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 whats wrong?
  2. jcsd
  3. Jul 7, 2011 #2

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    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 (Text):

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

    % Add a \newpage if the list of tables is to be on its own page
    \addcontentsline{toc}{section}{List of Tables}
    Do something similar for the bibliography after the main body.
  4. Jul 8, 2011 #3
    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:







    %% Chapters %%%%%%%%%%%%%%%%%%%%%%%%



    \addcontentsline{toc}{chapter}{Bibliography} %'Bibliography' into toc

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

    %% The List of Tables
    \addcontentsline{toc}{chapter}{List of Tables}
  5. Jul 8, 2011 #4
    Ah, I see the error.

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

    Thanks for your help.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook