I'm using chapterbib for a long document and the creation of bibliographies for each chapter works fine.
Each chapter is in its own file that gets included.
Is there any option to split the chapter files by, e.g., section?
Using input does not work as it seems and nesting includes is forbidden.
Any known workaround? Could cbunit or cbinput solve this?
I'm not sure how they'd work here.
Thanks!
EDIT - MWE:
./main.txt
\documentclass[a4paper,10pt,twoside,onecolumn,openright,final,titlepage]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tocbibind}
%\usepackage[rootbib]{chapterbib}
\usepackage[sectionbib]{chapterbib}
\bibliographystyle{plain}
\usepackage[english]{babel}
\usepackage[pagebackref=true]{hyperref}
\usepackage{blindtext}
\renewcommand{\backref}[1]{} % Internally redefine backref in order to display
\renewcommand{\backrefalt}[4]{[{\small% the pages a reference was cited
\ifcase #1 Not cited.%
\or Cited on page~#2.%
\else Cited on pages #2.%
\fi%
}]}
\begin{document}
\tableofcontents
\include{chapters/chpt_1}
\include{chapters/chpt_2}
\chapter{Bibliography}
%Don't add a section to the toc
\renewcommand{\addcontentsline}[3]{}
%Don't add a title to the bibliography
\renewcommand{\bibname}{}
\bibliography{mybib}
\end{document}
./chapters/chpt_1.tex:
\chapter{Test}
\section{First}
\blindtext[10]
\cite{mathworld:AssociatedLaguerrePolynomial}
\section{Second}
\blindtext[8]
\cite{mathworld:AssociatedLegendreDifferentialEquation,mathworld:AssociatedLaguerrePolynomial}
\bibliographystyle{plain}
\bibliography{../mybib}
./chapters/chpt_2.tex
\chapter{Test}
\section{First}
\blindtext[10]
\cite{Weisstein}
\section{Second}
\blindtext[8]
\cite{Weissteina}
\section{Third}
\blindtext[6]
\cite{Weissteinb}
\bibliographystyle{plain}
\bibliography{../mybib}
mybib.bib
% Encoding: UTF-8
@Misc{mathworld:AssociatedLaguerrePolynomial,
Title = {{Associated Laguerre Polynomial. From MathWorld---A Wolfram Web Resource \url{http://mathworld.wolfram.com/AssociatedLaguerrePolynomial.html}}},
Author = {Weisstein, Eric W.},
Note = {Last visited on 16/03/2016}
}
@Misc{mathworld:AssociatedLegendreDifferentialEquation,
Title = {{Associated Legendre Differential Equation. From MathWorld---A Wolfram Web Resource \url{http://mathworld.wolfram.com/AssociatedLegendreDifferentialEquation.html}}},
Author = {Weisstein, Eric W.},
Note = {Last visited on 16/03/2016}
}
@Misc{Weisstein,
author = {Weisstein, Eric W.},
note = {Last visited on 16/03/2016},
title = {{Wigner 3j-Symbol. From MathWorld---A Wolfram Web Resource \url{http://mathworld.wolfram.com/Wigner3j-Symbol.html}}},
}
@Misc{Weissteina,
author = {Weisstein, Eric W.},
note = {Last visited on 16/03/2016},
title = {{Wigner 6j-Symbol. From MathWorld---A Wolfram Web Resource \url{http://mathworld.wolfram.com/Wigner6j-Symbol.html}}},
}
@Misc{Weissteinb,
author = {Weisstein, Eric W.},
note = {Last visited on 16/03/2016},
title = {{Wigner 9j-Symbol. From MathWorld---A Wolfram Web Resource \url{http://mathworld.wolfram.com/Wigner9j-Symbol.html}}},
}
To compile:
pdflatex main.texgenerates the chapterauxfilescd chapters; bibtex chpt_1.aux; bibtex chpt_2.aux; cd -- comment out
sectionbib; uncommentrootbib pdflatex main.tex; bibtex main.aux; pdflatex main.tex; pdflatex main.tex
This get's us a two entry bibliograpgy in chapter 1, a three entry bibliograpgy in chapter 2, and a five entry bibliograpgy at the end. For ease of writing - and versioning - I'd like to have each section of each chapter in its own tex-file - if that makes sense.
