GeneralProblems With References and Contents page

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
tomwj
Posts: 2
Joined: Sat Jan 09, 2010 5:18 pm

Problems With References and Contents page

Post by tomwj »

Hi,
I am writing a report that requires the References to be listed in the table of contents as a numbered section. I'm looking for a way to either suppress the heading in the second example so that I don't have 2 Reference References or a way to number and include thebibliography in the table of contents.

I have tried searching the forum to no avail. I hope this post is in the right section and not something really obvious. I have tried a few things such as creating an empty section \section{} which sort of worked but the section number was above reference and nesting \section{\begin{thebibliography}} which just created an error.

Any Help would be greatly appreciated
Thanks

Code: Select all

\documentclass[a4paper,12pt]{article}

\begin{document}

\tableofcontents

\section{Introduction}
Intro

\begin{thebibliography}{9}
\bibitem{test}
  Mr Blah,
  \emph{The Blah of Bladdy Blah}.
  Blah Publications,
  3000
\end{thebibliography}
\end{document}

Code: Select all

\documentclass[a4paper,12pt]{article}

\begin{document}

\tableofcontents

\section{Introduction}
Intro

\section{References}
\begin{thebibliography}{9}
\bibitem{test}
  Mr Blah,
  \emph{The Blah of Bladdy Blah}.
  Blah Publications,
  3000
\end{thebibliography}
\end{document}

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Problems With References and Contents page

Post by Stefan Kottwitz »

Hi tomwj,

welcome to the board!
Here you can find a workaround: change starred command into unstarred.

Stefan
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Problems With References and Contents page

Post by localghost »

For standard classes just use the tocbibind package.

Code: Select all

\usepackage[numbib]{tocbibind}
Other classes may have built-in features.


Best regards and welcome to the board
Thorsten
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Problems With References and Contents page

Post by gmedina »

Yet another option would be to redefine the thebibliography environment (as defined in article.cls) to use \section instead of \section*, as the following example suggests:

Code: Select all

\documentclass[a4paper,12pt]{article}

\makeatletter
\renewenvironment{thebibliography}[1]
     {\section{\refname}%
      \@mkboth{\MakeUppercase\refname}{\MakeUppercase\refname}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}
\makeatother

\begin{document}

\tableofcontents

\section{Introduction}
Intro

\begin{thebibliography}{9}
\bibitem{test}
  Mr Blah,
  \emph{The Blah of Bladdy Blah}.
  Blah Publications,
  3000
\end{thebibliography}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
tomwj
Posts: 2
Joined: Sat Jan 09, 2010 5:18 pm

Problems With References and Contents page

Post by tomwj »

Thanks Everyone for such a fast response.

I used Thorsten's suggestion
\usepackage[numbib]{tocbibind}
It worked perfectly and exactly as I wanted also it seemed to be the neatest way to do it, Given that I use latex on various computers/platforms.
Post Reply