Use of refsegment
will continue label numbering for you. To print a reference in just one sub-bibliography (and completely frustrate most readers), you can track the continuation number for each refsegment
and skip any items whose label is less than that number.
In the example below the default sorting scheme is used, but it could be changed. To get the label numbers right, this approach will require a couple additional passes with latex
. biblatex
gives you a message whenever another pass is needed.
\documentclass{report}
\usepackage[sorting=none,style=numeric,refsegment=chapter,defernumbers=true]{biblatex}
\usepackage{filecontents}
\defbibheading{subbibliography}{%
\section*{Bibliography}}
\makeatletter
% Overall entry counter
\csnumgdef{blx@entrycount}{0}
\AtEveryBibitem{%
\csnumgdef{blx@entrycount}{\csuse{blx@entrycount}+1}}
% Continued from this label number
\appto{\newrefsegment}{%
\csnumgdef{blx@entrycount@\the\c@refsegment}{\csuse{blx@entrycount}+1}}
% Skip entries with label numbers less than the continued number
\defbibcheck{onlynew}{%
\ifnumless{\thefield{labelnumber}}{\csuse{blx@entrycount@\the\c@refsegment}}
{\skipentry}
{}}
\makeatother
\begin{filecontents}{\jobname.bib}
@Book{companion,
author = {Goossens, Michel and Mittelbach, Frank and Samarin, Alexander},
title = {The LaTeX Companion},
edition = {1},
publisher = {Addison-Wesley},
location = {Reading, Mass.},
date = {1994}}
@Article{gillies,
author = {Gillies, Alexander},
title = {Herder and the Preparation of Goethe's Idea of World Literature},
journaltitle = {Publications of the English Goethe Society},
volume = {9},
date = {1933},
pages = {46--67}}
@Article{bertram,
author = {Bertram, Aaron and Wentworth, Richard},
title = {Gromov invariants for holomorphic maps on Riemann surfaces},
journaltitle = {J.~Amer. Math. Soc.},
volume = {9},
number = {2},
date = {1996},
pages = {529--571}}
@Book{poetics,
author = {Aristotle},
editor = {Lucas, D. W.},
title = {Poetics},
series = {Clarendon Aristotle},
publisher = {Clarendon Press},
location = {Oxford},
date = {1968}}
@Book{rhetoric,
author = {Aristotle},
editor = {Cope, Edward Meredith},
commentator = {Cope, Edward Meredith},
title = {The Rhetoric of Aristotle with a commentary by the late Edward Meredith Cope},
volumes = {3},
publisher = {Cambridge University Press},
date = {1877}}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\chapter{First}
\cites{companion}{rhetoric}
\printbibliography[segment=\therefsegment,check=onlynew,heading=subbibliography]
\chapter{Second}
\cites{companion}{bertram}{poetics}
\printbibliography[segment=\therefsegment,check=onlynew,heading=subbibliography]
\chapter{Third}
\cites{companion}{bertram}{gillies}{rhetoric}
\printbibliography[segment=\therefsegment,check=onlynew,heading=subbibliography]
\end{document}
Results for the first chapter:
And the second:
And the third:
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.
Best Answer
The problem here is that you're mixing old and new commands. My original answer that you linked to is several years old and uses commands that are now deprecated, such as
\glossarystyle
and\glossaryentryfield
. Your MWE has changed the deprecated\glossarystyle
to\setglossarystyle
but hasn't changed the deprecated\glossaryentryfield
. By using the new\setglossarystyle
, the backward-compatibility is removed and\glossaryentryfield
isn't used.To fix it, just replace
\glossaryentryfield
with the newer\glossentry
:Complete MWE:
First chapter:
Second chapter: