I have redefined the chapter command to autolabel all chapters:
\renewcommand\chapter[1]{
\capitalizewords[q]{#1}
\noblanks[q]{\thestring}
\origchapter{#1}\label{chap:\thestring}}
This works great, except I find that it causes a bibliography, created with biblatex and the \bibliography
command, to be rendered incorrectly as a chapter rather than as the bibliography. The bibliography title page is messed up (says "Chapter WHATEVERCHAPTERNUMBER: *") and the table of contents lists "*" as a chapter. Otherwise the bibliography is rendered correctly. Anyone know what is causing this? I will be happy with a hacky solution, like an if statement in the renewcommand
block that prevents just calls the original chapter command when it's handling the bibliography.
Minimal Working Example
The bibliography is being generated with a template. I have extracted the following code from the template file to create a minimal working example. Compiling the code below won't produce a table of contents, but it does produce the Bibliography as a Chapter named "*":
\documentclass[11pt]{report}
\usepackage{amsmath}
\usepackage{stringstrings}
\usepackage[noadjust,verbose,sort]{cite} % arranges reference citations neatly
\begin{document}
\newcommand{\ls}[1]
{\dimen0=\fontdimen6\the\font
\lineskip=#1\dimen0
\advance\lineskip.5\fontdimen5\the\font
\advance\lineskip-\dimen0
\lineskiplimit=.9\lineskip
\baselineskip=\lineskip
\advance\baselineskip\dimen0
\normallineskip\lineskip
\normallineskiplimit\lineskiplimit
\normalbaselineskip\baselineskip
\ignorespaces
}
\def\thebibliography#1{
\ls{1}
\chapter*{Bibliography\@mkboth
{BIBLIOGRAPHY}{BIBLIOGRAPHY}}
\markright{}
%\thispagestyle{myheadings} % commented out to force page numbers to bottom center (8/11/07 change by C. St. Jean)
%\thispagestyle{empty}
\pagebreak
\vskip 50pt
\vspace*{0.61 in}%{0.75in}
\centerline{\Large \bf Bibliography}\par \nobreak
%\vskip 40pt
\vskip 55pt
\list
{[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
\advance\leftmargin\labelsep
\usecounter{enumi}}
\def\newblock{\hskip .11em plus .33em minus .07em}
\sloppy\clubpenalty4000\widowpenalty4000
\sfcode`\.=1000\relax}
\let\origchapter=\chapter
\renewcommand\chapter[1]{
\capitalizewords[q]{#1}
\noblanks[q]{\thestring}
\origchapter{#1}\label{chap:\thestring}}
% \tableofcontents
\chapter{The Story of Life}
Let there be light! \cite{Amaral:2007ua}
\bibliographystyle{plain}
\bibliography{testbib}
\end{document}
You'll also need to put this in a bibtex file testbib.bib
@article{Amaral:2007ua,
author = {Amaral, DG and Lavenex, P.},
title = {{Hippocampal neuroanatomy}},
journal = {The Hippocampus Book},
year = {2007},
volume = {1},
number = {3},
pages = {37--114}
}
\printbibliography
rather than\bibliography
to make LaTeX insert the formatted bibliography (including sectioning header).\documentclass{...}
and ending with\end{document}
.\chapter*
(just a chapter heading but noChapter X
title)?