I have a document which I need multiple bibliographies for: one for my own publications in chronological order and with numeric citations and one for the other publications with alphabetic citations ordered by authors' names.
It seems to be a typical scenario for biblatex, so I tried using multiple categories and multiple refcontexts:
% !TeX TS-program = pdflatex
% !TeX encoding = UTF-8
% !TeX spellcheck = en_US
% !TeX TXS-program:bibliography = txs:///biber
% !BIB program = biber
\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage[backend=biber, safeinputenc=true, style=alphabetic, labelnumber=true, defernumbers=true, maxbibnames=99]{biblatex}
\addbibresource{references.bib}
% Filter categories by author
% https://tex.stackexchange.com/questions/28509/biblatex-filter-out-publications-from-a-specific-author-in-the-references-dynam
\DeclareBibliographyCategory{mine}
\DeclareIndexNameFormat{mine}{%
\nameparts{#1}%
\ifdefstring{\namepartfamily}{\"{A}}{%
\addtocategory{mine}{\thefield{entrykey}}}{}
}
\AtDataInput{%
\indexnames[mine]{author}}
% Different citation styles for own and other publictions
% https://tex.stackexchange.com/questions/299064/biblatex-two-bibliographies-with-different-styles-and-sortings
\renewbibmacro*{cite}{%
\printtext[bibhyperref]{%
\printfield{labelprefix}%
\ifcategory{mine}
{\printfield{labelnumber}}
{\printfield{labelalpha}%
\printfield{extraalpha}}}}
\DeclareFieldFormat{labelnumberwidth}{\mkbibbrackets{#1}}
\defbibenvironment{mineenv}
{\list
{\printtext[labelnumberwidth]{%
\printfield{prefixnumber}%
\printfield{labelnumber}}}
{\setlength{\labelwidth}{\labelnumberwidth}%
\setlength{\leftmargin}{\labelwidth}%
\setlength{\labelsep}{\biblabelsep}%
\addtolength{\leftmargin}{\labelsep}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}%
\renewcommand*{\makelabel}[1]{\hss##1}}
{\endlist}
{\item}
\usepackage{hyperref}
\begin{document}
\cite{othersZ}
\cite[8]{mineB}
\cite{othersY}
\cite{mineA, mineAErratum}
\cite{othersX}
\printbibheading
\newrefcontext[sorting=ynt]
\printbibliography[category=mine, heading=subbibliography, env=mineenv, title={My Publications (chronologically)}]
\newrefcontext[sorting=nty]
\printbibliography[notcategory=mine, heading=subbibliography, title={Other References (alphabetically)}]
\end{document}
Bibliography file references.bib:
@article{mineA,
title={A},
author={Guy, Some Other and Ä, Myself},
journal={Some Journal},
date={2020-02-12},
addendum={Corrected in \cite{mineAErratum}},
}
@article{mineAErratum,
title={Erratum to \enquote{A}},
author={Guy, Some Other and Ä, Myself},
journal={Unpublished},
year={2020},
addendum={Erratum to \cite{mineA}},
}
@article{mineB,
title={B},
author={Else, Someone and Ä, Myself},
journal={Another Journal},
date={2020-02-24},
volume={123},
}
@article{mineC,
title={C},
author={Again, Someone and Ä, Myself},
journal={YAJ},
year={2018},
}
@article{othersX,
author="A, B and X, y",
title="Important work",
year="2018",
journal="Important Journal",
}
@article{othersY,
author="Zz, Aa",
title="Also Important work",
year="1998",
journal="Also Important Journal",
}
@article{othersZ,
author="A, B and Zz, Aa",
title="Not so important work",
year="2000",
journal="Not So Important Journal",
}
The problem is that all numeric references appear as [0], except those within the bibliography. I think that the problem is that the second refcontext is overwriting the numbers assigned by the first refcontext.
This problem exists with biblatex 2016/03/03 v3.3 (TeX Live 2015)
Update: It was pointed out in the comments (by moewe) that this behavior is fixed in newer version of TeX Live.
Originally, I thought Ubuntu 16.04 LTS was running TeX Live 2016. However, it turns out that it actually uses TeX Live 2015. When I run the above example with TeX Live 2016, it works just fine. So I hope it will also work on the arXiv eventually.
I am leaving this question open because somebody might have insights into how to mitigate the problem in TeX Live 2015 and, maybe, somebody comes across the same problem.
biblatex/Biber if the document is compiled with LaTeX, Biber, LaTeX, LaTeX. I will check back later if this is an issue that can be reproduced with an older version ofbiblatex. For arXiv submissions note thatbiblatex3.3 is not thebiblatexversion on the arXiv. See https://tex.stackexchange.com/q/415703/ – moewe Apr 08 '20 at 16:09p.~in\cite[p.~8]{mineB}:\cite[8]{mineB}will automatically add "p."/"pp." as appropriate. – moewe Apr 08 '20 at 16:10biblatexbug, it may be possible to come up with a solution, but it may be really messy. In any casebiblatexsubmissions to the arXiv are going to be tricky (see the link in my first comment and the links in the answer there), so have you thought about an alternative? (As I said above, I doubt you can upload a.bblgenerated forbiblatex3.3 to the arXiv anyway.) – moewe Apr 09 '20 at 07:47.logfile when you run the MWE on your oldbiblatexversion? – moewe Apr 09 '20 at 07:49.logwith the old version: https://gist.github.com/waechtjn/a566e1f9bfeff9e1976b5ce561de342a I cannot see any errors. – JPW Apr 09 '20 at 07:56