GeneralBibunits and table of contents

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Malerun
Posts: 2
Joined: Sun Feb 20, 2011 10:50 am

Bibunits and table of contents

Post by Malerun »

Hi

I have bibliographies in some chapters and a final bibliography. That is working using bibunits.

But in the the ToC the chapter bibliographies shows up as unnumbered chapters instead of numbered sections. This is what I get:

Code: Select all

Contents       1
1 First        3
Bibliography   3
What I wanted was:

Code: Select all

Contents         1
1 First          3
1.1 Bibliography 3
Secondly I also would like to have the 1.1 before Bibliography in the chapters and the final Bibliography numbered as a chapter, both in ToC and in appearance. The best solution would be to turn off Bibliography headings, replacing them with section/chapter, but "\renewcommand*{\bibname}{}" just removes the Bibliography text in the ToC, while the page number remains in the ToC. Trying "\renewcommand*{\bibname}{\section{Bibliography}}" gives the error: "ERROR: Incomplete \iffalse; all text was ignored after line 1."

I have searched the net, that was how I found the site, and I am pretty convinced it can't be done using options to packages.

Furthermore it looks like the heading of the final bibliography is dependent on whether I invoke the sectionbib or subsectionbib option to bibunits, is that WAD?

MWE:

Code: Select all

\documentclass[a4paper,numbib]{memoir}
\usepackage[sectionbib, globalcitecopy]{bibunits}
\usepackage{natbib}

\begin{document}
\tableofcontents

\begin{bibunit}[plainnat]
\chapter{First}
I looked in \citep{lshort}
\putbib[testbib]
\end{bibunit}

\chapter{Then}
\begin{bibunit}[plainnat]
I reexamined \citep{lshort}
\putbib[testbib]
\end{bibunit}

\newpage
 \bibliography{testbib}
\end{document}
With the testbib.bib containing:

Code: Select all

@manual{lshort,
    author = {Oetiket, T. and Partl, H. and Hyna and Schlegl, E.},
    title = {The not-so-short introduction to Latex},
    url = {http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf}
}

Recommended reading 2024:

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

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

Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

Bibunits and table of contents

Post by Frits »

I'm not familiar with bibunits, but you can always control what to show in your ToC. I wrote something about that here. Unfortunately, I haven't got time to solve your question particularly but it might work.
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
Malerun
Posts: 2
Joined: Sun Feb 20, 2011 10:50 am

Bibunits and table of contents

Post by Malerun »

Putting it in a command like

Code: Select all

\newcommand{\putbibtwo}[2][References]{\section{#1}
\renewcommand{\bibname}{}
\vspace{-1cm} % eyeballed, but a little too much
\addtocontents{toc}{\protect\setcounter{tocdepth}{-1}}
\putbib[#2]
\addtocontents{toc}{\protect\setcounter{tocdepth}{2}}}
But I would prefer til more elegant solution of overriding \bibname with a section. Anyone?
Post Reply