3

I am trying to split my bibliography into two parts. The first part is local to a special section of the document, the other takes care of the rest of the citations. The two bibliographies may have citations in common, in which case I would like to have the entry repeated. The problem is that I also would like the global bibliography (which comes after the local one) to be numbered starting from the last number used in the local bibliography.

An MWE that shows an approach to do this is as follows:

\documentclass{scrartcl}

\usepackage[
    backend=biber,
    bibencoding=utf8,
    style=numeric, 
    firstinits=true,
    isbn=false,
    doi=true,
    url=false,
    clearlang=true,
    defernumbers=true,
]{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, D.},
  year = {2004},
  title = {Delta},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

\section{First}

\begin{refsection}
Some  text \autocite{A01,C03,D04}.

\printbibliography[heading=subbibliography]
\end{refsection}


\section{Second}

Some  text \autocite{A01,B02}.

\printbibliography[resetnumbers=4,heading=subbibliography]

\end{document}

The behaviour is the one I would like to have but the price is that I have to manually set the resetnumbers option to whichever number happens to be the last of the local bibliography, plus one.

Question: is there a way to avoid setting the restart number manually?

Ideally, I would like to see a solution which uses Biblatex's options as they are intended, instead of fetching the value of the counter for the last reference in the local bibliography and stick it into the resetnumbers option.

EDIT: I would accept any of these two ways to deal with duplicate entries in the two bibliographies (like A01 in the MWE):

  1. The entry is shown in both bibliographies but with different numberings, as dictated by the sequence in each bbliography. Or,
  2. The entry is only shown in the first bibliography and the relevant number is used for all subsequent citations.
  • 1
    It does work for me without the resetnumbers. That is what defernumbers=true does. If I set it to false, it starts over with 1. – Andy Apr 27 '16 at 15:38
  • @Andy are you sure you get it without resetnumbers? I do not. I do get it if I remove resetnumbers after compiling it with the resetnumbers=4, but then if I chang the document the build system properly recompiles everything and I get 1,2,3 and 1,2,3 – Bordaigorl Apr 28 '16 at 8:21
  • You are right. It it even written in the biblatex manual: "An important thing to note is that if you change the value of this option in your document (or the value of options which depend on this like some of the options to the \printbibliography macro, see § 3.6.2), then it is likely that you will need to delete your current aux file and re-run LaTeX to obtain the correct numbering." – Andy Apr 28 '16 at 9:15
  • @Andy yes I was puzzled at first as well by this behaviour as I was using latexmk and just assumed any change would be picked up. – Bordaigorl Apr 28 '16 at 10:22
1

This is not exactly the desired behavior, but it might be preferable to assign the same numbering to the same paper? Either way, it is a good starting point and too long for a comment.

\documentclass{scrartcl}

\usepackage[
    backend=biber,
    style=numeric,
    defernumbers=true
]{biblatex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{D04,
  author = {Duthor, D.},
  year = {2004},
  title = {Delta},
}
@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},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}

\section{First}

\begin{refsegment}
Some  text \cite{A01,C03,D04}.

\printbibliography[segment=1]
\end{refsegment}

\begin{refsegment}
\section{Second}

Some  text \cite{A01,B02}.

\printbibliography[segment=2]
\end{refsegment}
\end{document}

It uses refsegments instead of refsections.

  • Thanks for this suggestion. I indeed tried to use segments but by using segment=0 for the second \printbibliography. However I would prefer to have different numberings for the same entry if it is repeated, or to have it omitted in the second bibliography if it is already listed in the first one – Bordaigorl Apr 28 '16 at 10:29

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.