Generaladdcontentsline weird behavior

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Picometer
Posts: 2
Joined: Mon Sep 01, 2008 9:53 pm

addcontentsline weird behavior

Post by Picometer »

Hi there on this great forum!

My problem is rather trivial: I need to add to contents following items
1) bibliography#1,
2) bibliography#2,
3) a list of figures
and
4) a list of tables.

These items locate at the end of my document so they should be in toc.

Came up to \addcontentsline which worked just fine, except:
1) It places specified titles at the beginning of toc,
2) It doesn't care about page numbering anyhow.

Of course, i can manually edit toc file, but it doesn't seem reasonable, for it is generated each time I compile tex file. I believe there is an automatic way to make latex to put my bibliographies and lists at the end of toc and take care about corresponding page numbering.
Please help me with this problem!

Thank You!

pm.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
Stefan Kottwitz
Site Admin
Posts: 10360
Joined: Mon Mar 10, 2008 9:44 pm

addcontentsline weird behavior

Post by Stefan Kottwitz »

Hi Picometer,

welcome to the board!
Just put \addcontentsline at the corresponding position of your document. It could look like:

Code: Select all

\cleardoublepage
%\phantomsection % uncomment this if you are using hyperref
\addcontentsline{toc}{chapter}{Bibliography}
\bibliography{...}
Similar for the list of figures and the list of tables

Stefan
LaTeX.org admin
Picometer
Posts: 2
Joined: Mon Sep 01, 2008 9:53 pm

Re: addcontentsline weird behavior

Post by Picometer »

Thank You, Stefan!

Works just great.
I knew it should be easy, however was not obvious for me (doh!)

pm.
Post Reply