Page LayoutReferences Heading in ToC

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Nolin
Posts: 4
Joined: Thu Sep 27, 2012 2:29 pm

References Heading in ToC

Post by Nolin »

Hi!

I'm using \section headings and get new entries in my ToC. They look in style like other headings. I wanted the References heading to appear there and before my Appendix. But the problem is I'm using this code to implement my Reference:

Code: Select all

\newpage
\section{References}
\bibliographystyle{unsrt}
\bibliography{mybib}
This gives me References in the ToC but at the page where the Reference are I get two headers. One from \section{References} and one from \bibliography. How do I fix this? I want one header, but also the information in the ToC.

Thanks in advance, and sorry for some bad English.
Last edited by localghost on Thu Sep 27, 2012 5:11 pm, edited 2 times 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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

References Heading in ToC

Post by localghost »

You don't explicitly need a new heading. Use the tocbibind package to get the references into the ToC (see below code).

Code: Select all

\begin{filecontents*}{\jobname.bib}
@book{knuth84,
  author = {Knuth, Donald Ervin},
  publisher = {Addison-Wesley},
  title = {{The \TeX book}},
  year = {1984}
}

@book{lamport94,
  author = {Lamport, Leslie},
  edition = {Second},
  note = {User's Guide and Reference Manual},
  publisher = {Addison-Wesley},
  title = {{\LaTeX\ -- A Document Preparation System}},
  year = {1994}
}

@book{mitgoo04,
  author = {Mittelbach, Frank and Goossens, Michel},
  edition = {Second},
  publisher = {Addison-Wesley},
  title = {{The \LaTeX\ Companion}},
  year = {2004}
}

@book{goomit07,
  author = {Goossens, Michel and Mittelbach, Frank and Rahtz, Sebastian and Roegel, Denis and Voss, Herbert},
  edition = {Second},
  publisher = {Addison-Wesley},
  title = {{The \LaTeX\ Graphics Companion}},
  year = {2007}
}
\end{filecontents*}
\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[nottoc]{tocbibind}

\bibliographystyle{unsrt}

\begin{document}
  \tableofcontents
  \newpage

  \nocite{*}
  \bibliography{\jobname}
\end{document}

Best regards and welcome to the board
Thorsten
Nolin
Posts: 4
Joined: Thu Sep 27, 2012 2:29 pm

References Heading in ToC

Post by Nolin »

Thanks for the welcome!
By adding that \usepackage[numbib]{tocbibind} i got the number as well.
Thanks for the support!
Last edited by cgnieder on Fri Sep 28, 2012 11:26 am, edited 1 time in total.
Post Reply