2

I would like to different chapters, each with its own reference list. I partially managed to realize this, but I don't get the numbering of the second chapter correct. References that I used in chapter one, keep the same number in chapter two. I almost stared blind at this issue, so I really hope someone can help me out.

\documentclass[paper=A4,    
twoside=true,   
11pt,           
headings=normal     
]{scrreprt}

\usepackage[        
backend= bibtex,        
bibencoding=utf8,
style=nature,   
sorting=none,
defernumbers=true,
refsegment=chapter,
natbib=true,
backref = false
]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
    @misc{A01,
        author = {Author, A.},
        year = {2001},
        title = {Alpha},
    }
    @misc{B02,
        author = {Buthor, B.},
        year = {2002},
        title = {Bravo},
    }
    @misc{C03,
        author = {Cuthor, C.},
        year = {2003},
        title = {Charlie},
    }
    @misc{D04,
        author = {Duthor, C.},
        year = {2003},
        title = {Delta},
    }
    @misc{E05,
        author = {Euthor, C.},
        year = {2003},
        title = {Ecko},
    }
    @misc{F06,
        author = {Futhor, C.},
        year = {2003},
        title = {Foxtrot},
    }   
\end{filecontents}
\addglobalbib{\jobname.bib}

\begin{document}
\chapter{intro}
test \cite{A01} test \cite{B02} test \cite{C03} test \cite{D04}.
\printbibliography[segment=\therefsegment,resetnumbers=true,heading=subbibliography]

\chapter{chap2}
test \cite{E05} test \cite{B02} test \cite{A01} test \cite{F06}
\printbibliography[segment=\therefsegment,resetnumbers=true,heading=subbibliography]

\end{document}

enter image description here enter image description here

  • You can use chapterbib package to have one cite section per chapter. – Romain Picot Mar 25 '16 at 13:56
  • Is there a reason why you use \RequirePackage instead of the standard \usepackage? – Dr. Manuel Kuehner Mar 25 '16 at 13:59
  • I did not have a specific reason to use requirepackage instead of usepackage... I've changed that. – ArjenB Mar 25 '16 at 14:53
  • I have tried to implement the chapterbib package, but I dont know how to print only the references of the particular chapter, instead of the whole bibliography. How can I realize that with chapterbib? – ArjenB Mar 25 '16 at 14:56
  • A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). – Thorsten Mar 25 '16 at 17:47
3

In order to have independent numbers for each chapter, you need to use a refsection instead of a refsegment (cf. the biblatex manual, § 3.6.6):

The difference between a refsection and a refsegment environment is that the former creates labels which are local to the environment whereas the latter provides a target for the segment filter of \printbibliography without affecting the labels. They will be unique across the entire document.

So just change refsegment=chapter to refsection=chapter in your example to achieve the desired output.

Please note that when using BibTeX as a backend for biblatex, this approach creates multiple auxiliary files, one for each refsection, that need to be processed separately. So if your document is called document.tex, instead of bibtex document you need to execute bibtex document1-blx, bibtex document2-blx, ... (the log file includes a hint which commands you need to run). With the alternative backend Biber, this is not necessary.

page 1 of the example document

page 2 of the example document

  • thanks for your reply. When I change to refsections, I lose unfortunately the reference lists. In the text appears: test [A01] test [B02] test [C03] test [D04].I've updated the code above, to include also some sample references. Do you have a clue what I do wrong? – ArjenB Mar 25 '16 at 17:40
  • @ArjenB Ah sorry, I forgot to mention that you need to change the way you call BibTeX for this approach: you need to run a separate bibtex command for each refsection. I updated my answer accordingly, I hope this will make it work for you. – diabonas Mar 25 '16 at 17:46
0

You might want to have a look at Chapterbib

You will have to create a main file in which you \include{} your other .tex files, then place a bibliography in each included file:

\documentclass[
paper=A4,                   
twoside=true,               
11pt,
headings=normal
]{scrreprt}

\usepackage{chapterbib}

\begin{document}
\include{chapter_one}
\end{document}

Then in chapter_one.tex:

% Content of document
\bibliographystyle{style}
\bibliography{Mybibliography}
  • thanks for your comment. unfortunately, i did not came a step further with the chapterbib approach... – ArjenB Mar 25 '16 at 17:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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