31

I'm really new in using biblatex, compile the sample placed in Multiple bibliographies and one global bibliography - all with global labels, but what I get is

  1.1 Foo

  Some text [B02x ].

  1.2 Bar

  Some text [B02y ].

Do not get the bibliography by chapters, or the global references.

Really not remains to be done

 \documentclass{report}
 \usepackage[style=alphabetic]{biblatex}
 \addbibresource{references.bib}
 \begin{document}
 \chapter{First chapter}
 \section{Foo}
 Some text \cite{childs_temperature}.
 \printbibliography
 \chapter{Second chapter}
 \section{Bar}
 Some text \cite{hashemian}.
 \printbibliography
 \newpage
 \printbibliography
 \end{document}

And the references.bib

  @BOOK{childs_temperature,
  title = {Practical Temperature Measurement},
  publisher = {Butterworth - Heinemann},
  year = {2001},
  author = {Childs, Peter R N},
  address = {Great Britain},
  edition = {1},
  isbn = {0 7506 5080 X}
  }

  @PHDTHESIS{hashemian,
  author = {Hashemian, Hashem Mehrdad},
  title = {Measurements of dynamic temperatures and pressures in nuclear power plants},
  school = {{The University of Western Ontario}},
  year = {2011},
  type = {PhD {T}hesis}
  }

I need to obtain references by chapter and global cited references, but i don't know how compile.

5
  • The outut contains the bibtex labels of the .bib file. This looks like you didn't call bibtex to process your cited references. Did you call latex bibtex latex? Dec 17, 2012 at 22:10
  • 1
    Depending on the set up in your file, you may want biber rather than bibtex: we'll need an example to provide more help.
    – Joseph Wright
    Dec 17, 2012 at 22:20
  • @JosephWright I think the example is the one he linked in the question...
    – Vivi
    Dec 17, 2012 at 23:01
  • 1
    Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you.
    – Guido
    Dec 18, 2012 at 2:47
  • I understand... Dec 18, 2012 at 14:14

2 Answers 2

32

It sounds like you want the refsection environment, detailed in Section 3.11.3 of biblatex

\begin{filecontents*}{references.bib}
@BOOK{childs_temperature,
  title = {Practical Temperature Measurement},
  publisher = {Butterworth - Heinemann},
  year = {2001},
  author = {Childs, Peter R N},
  address = {Great Britain},
  edition = {1},
  isbn = {0 7506 5080 X}
  }

  @PHDTHESIS{hashemian,
  author = {Hashemian, Hashem Mehrdad},
  title = {Measurements of dynamic temperatures and pressures in nuclear power plants},
  school = {{The University of Western Ontario}},
  year = {2011},
  type = {PhD {T}hesis}
  }
\end{filecontents*}

\documentclass{report}
 \usepackage[style=alphabetic]{biblatex}
 \addbibresource{references.bib}

 \begin{document}
 \begin{refsection}
 \chapter{First chapter}
 \section{Foo}
 Some text \cite{childs_temperature}.
 \printbibliography
 \end{refsection}

 \begin{refsection}
 \chapter{Second chapter}
 \section{Bar}
 Some text \cite{hashemian}.
 \printbibliography[heading=subbibliography]
 \end{refsection}

 \nocite{*}
 \printbibliography
 \end{document}

Just to clarify, the compilation sequence is

pdflatex myfile.tex
biber myfile.bcf
pdflatex myfile.tex
pdflatex myfile.tex

You don't have to use the file extensions if you'd prefer not to :)

If you'd prefer to use bibtex then use

\usepackage[style=alphabetic,backend=bibtex]{biblatex}

and then run

pdflatex myfile.tex
bibtex myfile1-blx.aux
bibtex myfile2-blx.aux
bibtex myfile.aux
pdflatex myfile.tex
pdflatex myfile.tex

without the extensions if you wish. animation

5
  • 16
    I don't know since which version, but now you use the refsection option of biblatex (i.e. \usepackage[refsection=chapter]{biblatex}) and you would not need to manually put the refsections in each chapter Jul 3, 2013 at 14:59
  • @YuppieNetworking that's good to know, thanks!
    – cmhughes
    Jul 3, 2013 at 15:16
  • 6
    How can we add global or combined references at the end ? \nocite{*} will add all entries in bibfile. Instead, how to combine the all references in the subbibliographies in one list at the end? –
    – Anusha
    Apr 21, 2014 at 15:36
  • @Anusha Did you get an answer in anyway? Dec 2, 2016 at 6:23
  • Didn't know this resource, many thanks, worked like a charm!
    – ulilaka
    Dec 6, 2021 at 21:05
0

I'm not sure how this affects what YuppieNetworking said, but to extend upon cmhughes's answer above, refsection prevents using \ref (or \cref) to reference tables or sections in different chapters (or refsections).

To fix this issue, we can use refsegment and then use \printbibliography[segment=\therefsegment] (inspired by referencing to citation in a refsection).

Edit: Please ignore this comment – I can't seem to replicate this issue in a small example or in my own working documents.

Edit 2: this has come up again in my working documents, but that's more likely an error of my template rather than a generic error. I'm back to using the ref segment method.

There's additionally another reason to prefer this method over \refsection, but it's probably only relevant to people like me – I use a single .bib file, exported by my reference manager (Mendeley), for my local LaTeX work. In my overall bibliography, if I use \nocite{*}, that includes every citation I have. If there's a better way to handle this situation, please let me know! I'm sure it's a small issue.

6
  • Could you give a complete working example ?
    – R. N
    Jan 9, 2020 at 21:56
  • It absolutely should not do that and indeed in a short document I just tested I could not reproduce this behaviour. Can you show us an example that reproduces the undesirable behaviour you describe? That would be a bug and should be fixed. Note that refsegments are not kept separated in the same way refsections are (essentially refsegments just tell you where an entry was cited, but refsections keep all sections completely separate). So switching from one to the other can have other implications as well.
    – moewe
    Jan 10, 2020 at 6:21
  • I've now tried to replicate the issue on a small, complete working example and on my own larger project. The issue doesn't arise in either case anymore, which is a little troubling. In any case, would it be better etiquette here to delete my post or edit it to clearly mark that it is not true? Jan 16, 2020 at 18:01
  • If you delete your post it will be hidden for anonymous visitors and users below a certain reputation threshold. Given that the problem is not reproducible I think it would be a good idea to hide the post from sight by deleting it (of course the note is additionally very welcome).
    – moewe
    Jan 16, 2020 at 18:41
  • This issue has come up again in my working documents, so I've added another edit. Once I get a chance, I'll try to set this up in a working example again. It's likely due to my template or some other small bug. Jan 29, 2020 at 19:59

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.