I want to generate the bibliography for each section, and have it at the end of the section. When I do this at the moment it generates the full bibliography and places it after each section.
Is there a way that this can be done?
The advice here says
"The chapterbib package provides an option sectionbib that puts the bibliography in a \section* instead of \chapter*, something that makes sense if there is a bibliography in each chapter. This option will not work when natbib is also loaded; instead, add the option to natbib. "
I don't understand what this means, and I've tried experimenting with what I thought the options are. Specifically, what does "add the option to natbib" mean?
My subsequent question (which evolved after my first one was solved) is to not have pagebreaks between the references, and the next section.
Thank you for your help.
If you are using Biblatex, as for citing article titles, you can use it to produce bibliographies at the end of sections or chapters, or even have a combined bibliography where they are separated by chapter/section. As a package, it is intended to replace "babelbib, bibtopic, bibunits, chapterbib, cite, inlinebib, mlbib, multibib, splitbib."
You can put a bibliography after each section, in one of three ways. First, wrap the text of your section in a
\begin{refsection}
/\end{refsection}
pair, as suchSecond, after each
\section
statement you put a\newrefsection
statement which ends the previous section and begins the new one. And, you precede the next\section
with a\printbibliography
statement, again. Finally, there is arefsection
package option that takes eithernone
,part
,chapter
,section
, orsubsection
as an argument. To group your bibliographic entries per section in a global bibliography you userefsegment
instead, using\bibbysegment
to print all the segments in order. (\bibbysection
can be used in the same manner for ref-sections, too.)I don't know how much you'll have to split up your text, as per @Norman's answer, but with a little experimentation you can figure it out.
In addition to
You will have to put each section in a separate .tex file which you then
\include
. You will have to runbibtex
on each .tex file separately.N.B. Using
\input
rather than\include
avoids unwanted page breaks, but it will not create the .aux file that BibTeX needs to do its work. I looked at the definition of\include
, and I don't see how to disable the page-breaking function except by disabling\clearpage
entirely. You could tryright after your
\begin{document}
, but you may have to put some\originalclearpage
in by hand.I haven't tried it but as I read that it suggests:
though I'm only guessing at the correct order of those lines.
@celenius - if you really want to get rid of that pagebreak, here's a very dirty trick to do it...
Basically we perform surgery on the
\include
macro to get rid of all the\clearpage
instances, but the cleanest way to do this, as you can see, is still really dirty. This is horribly brittle and will likely only work for thearticle
class, so if you're using a different\documentclass
, you're out of luck. I basically derived this by enabling\tracingcommands=1
and\tracingmacros=1
and grepping the.log
file for\clearpage
so that I could hack whatever gets called before it to insert a\@noclearpage
.I don't recommend this solution - it would be much better to look into how
chapterbib
works and fix it the right way, without depending on\include
and the separate.aux
files it generates... but I'm positive that would be a pretty difficult task. I guess another workaround would be to write a command to emulate\include
's breaking up of.aux
files, without actually doing the includes...EDIT: okay, here's a quickie
Then you can just insert
\begin{auxfile}{foo}...\end{auxfile}
and it will usefoo.aux
instead of the normal.aux
file. This is fully compatible withchapterbib
. I don't think CTAN has anything like this, so maybe I'll submit it as a mini-package.