The subfiles need to have a \nobibliography*
command included so that \bibentry
works. In addition, you should really put the \bibliographystyle
of the main file before any file inclusions. In your case it is not too important, but if you had different styles in the subfiles it would give a problem - each of the aux files for of the included files is read by bibtex
and so it meets multiple \bibstyle
commands, only the first one takes effect, hence the need of ordering the main file correctly.
This all works fine for the standard book class, however with scrbook
you can not use the sectionbib
option of chapterbib
. EDTI See below for how to work around this
book.cls
Main part
Included chapter
\begin{filecontents}{mytestbib.bib}
@Article{einstein1911,
author = "Albert Einstein",
title = "On The influence of gravitation on the propagation of light",
journal = "Annalen Phys.",
volume = "35",
pages = "898-908",
year = "1911"}
\end{filecontents}
\begin{filecontents}{testchap.tex}
\nobibliography*
\chapter{Light}
A full in-text cite of \bibentry{einstein1911}.\\
A regular citation: \citep{einstein1911}.
\bibliographystyle{apalike}
\bibliography{mytestbib}
\end{filecontents}
\documentclass{book}
\usepackage{filecontents}
\usepackage{bibentry}
\usepackage{natbib}
\usepackage[sectionbib]{chapterbib}
\nobibliography*
\begin{document}
\bibliographystyle{apalike}
A full in-text cite of \bibentry{einstein1911}.\\
A regular citation: \citep{einstein1911}.
\include{testchap}
\bibliography{mytestbib}
\end{document}
scrbook.cls
For scrbook
class the above will work fine, unless you pass the sectionbib
option to chapterbib
. This is because the sectionbib
option attempts to patch the definition of thebibliography
, but scrbook
changes the standard definition. However, the effect of the sectionbib
option may be optianed by issuing
\KOMAoption{bibliography}{leveldown}
in the preamble, which switches bibliogrpahies to be sections, and then \bib@leveldownfalse
, appropriately escaped, before the main bibliography to make this a chapter.
\begin{filecontents}{mytestbib.bib}
@Article{einstein1911,
author = "Albert Einstein",
title = "On The influence of gravitation on the propagation of light",
journal = "Annalen Phys.",
volume = "35",
pages = "898-908",
year = "1911"}
\end{filecontents}
\begin{filecontents}{testchap.tex}
\nobibliography*
\chapter{Light}
A full in-text cite of \bibentry{einstein1911}.\\
A regular citation: \citep{einstein1911}.
\bibliographystyle{apalike}
\bibliography{mytestbib}
\end{filecontents}
\documentclass{scrbook}
\usepackage{filecontents}
\usepackage{bibentry}
\usepackage{natbib}
\usepackage{chapterbib}
\nobibliography*
\KOMAoption{bibliography}{leveldown}
\begin{document}
\bibliographystyle{apalike}
A full in-text cite of \bibentry{einstein1911}.\\
A regular citation: \citep{einstein1911}.
\include{testchap}
\makeatletter
\bib@leveldownfalse
\makeatother
\bibliography{mytestbib}
\end{document}
Best Answer
The manual says:
So you should do something like this: