Text FormattingTOC page number

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
User avatar
Kaspars
Posts: 37
Joined: Mon Feb 14, 2011 11:51 am

TOC page number

Post by Kaspars »

Hello,

I have small problem with page numbering in TOC. Everything works just fine in sections and subsections ect, but when I use:

Code: Select all

\bibliographystyle{unsrt}
\bibliography{Master_paper}
\addcontentsline{toc}{section}{Literature}
in TOC I get last page number of literature. I mean, I have 3 pages of literature, for example, it starts ar 98 and ends at 100. Why in TOC is showing:
Literature ............................. 100

But I want, that it show:

Literature ............................. 98

Please help me :)
Last edited by Kaspars on Tue May 31, 2011 7:48 am, edited 1 time in total.

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

TOC page number

Post by frabjous »

Because you're putting the code to add it to the contents after the bibliography. Put it before instead.

Code: Select all

\bibliographystyle{unsrt}
\addcontentsline{toc}{section}{Literature}
\bibliography{Master_paper}
You might need to put in a \clearpage or \cleardoublepage beforehand depending on your setup.
User avatar
Kaspars
Posts: 37
Joined: Mon Feb 14, 2011 11:51 am

Re: TOC page number

Post by Kaspars »

Thanks, for help! It works ;)
Post Reply