Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am compiling my thesis in LaTeX and I am using the chapterbib package to put separate bibliography lists in each chapter. I would like each bibliography to have its own name, indexed by the chapter number (e.g. "References for Chapter #"), but I am not aware of any way to do this, or if it is doable at all. Has anybody tried it before?

share|improve this question
    
Welcome to TeX.sx! Your question was migrated here from another stackexchange site. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. –  Marco Daniel Aug 9 '12 at 12:29
add comment

migrated from stackoverflow.com Aug 9 '12 at 12:26

This question came from our site for professional and enthusiast programmers.

2 Answers

In the documentation you can find:

You can control the titling of the final bibliographies by defining

\newcommand\FinalBibTitles
{References for Chapter \thechapter}

This works only if you use the option gather or duplicate. If you use a standard class like report you have to redefine the standard bibliography environment.

Here a suggestion using xpathch:

% arara: pdflatex
% arara: bibtex: { files :[chap1,chap2] }
% arara: pdflatex
% arara: pdflatex
\RequirePackage{filecontents}
\begin{filecontents*}{chap1.tex} 
\chapter{only article}
text \cite{article-minimal}\par
text \cite{article-full}
\bibliographystyle{plain}
\bibliography{xampl} 
\end{filecontents*} 
\begin{filecontents*}{chap2.tex} 
\chapter{only book}
text \cite{book-minimal}\par
text \cite{book-full}
\bibliographystyle{plain} 
\bibliography{xampl} 
\end{filecontents*} 
\documentclass{report}   
\usepackage[duplicate]{chapterbib}     
\usepackage{xpatch}
\xpatchcmd{\thebibliography}{\bibname}{\bibname{} for Chapter \thechapter}%
                        {\typeout{*****thebibliography patched******}}
                        {\typeout{*****thebibliography not patched******}}

\begin{document} 
\tableofcontents                           
\include{chap1} 
\include{chap2} 
\end{document}

The compilation steps are done by arara which is recommended for such projects.

share|improve this answer
    
Quicker by 47 seconds! –  Ian Thompson Aug 9 '12 at 12:38
add comment

Try

\newcommand\FinalBibTitles {References for Chapter \thechapter} 

See section 8 of the chapterbib package documentation for details.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.