-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using custom labelprefixes and \printbibtabular
return [0] for all citations in text
#21
Comments
Thank you very much for reporting this issue. I'm not quite sure yet how to fix this at the The problem here is that we need to set the 'default For now a workaround for your document is to manually initiate setting the default \documentclass{article}
\usepackage[style=numeric, backend=biber, date=short, defernumbers=true]{biblatex}
\usepackage{biblatex-ext-tabular}
\usepackage{longtable}
\addbibresource{biblatex-examples.bib}
\makeatletter
\def\fixextblx@setrefcontext{%
\expandafter\blx@setdefaultrefcontext\expandafter{\abx@field@entrykey}}
\defbibtabular{bibtabular}
{\begin{center}
\setlength\LTleft{0pt}
\setlength\LTright{0pt}
\begin{longtable}{@{\extracolsep{\fill}}|c|p{0.7\linewidth}|c|@{}}
\hline \textbf{RD Nr} & \textbf{Document Title} & \textbf{Date}\endhead
\hline}
{ \hline
\end{longtable}
\end{center}}
{ \anchorlang{%
\fixextblx@setrefcontext
\printtext[labelnumberwidth]{%
\printfield{labelprefix}%
\printfield{labelnumber}}}
& \plainlang{%
\usebibmacro{title}%
\newunit
\usebibmacro{author}}
& \plainlang{\printdate}\\ \hline}
\makeatother
\begin{document}
\cite{worman,geer,nussbaum,companion}
\newrefcontext[labelprefix=RD]
\printbibtabular
\end{document} |
This bug should be fixed with 06dd359, where we make sure to always set the default |
Thanks for the quick response! Your workaround did indeed fix the problem. |
Version 0.12b with the fix is available in both MikTeX and TeX Live now. The MWE from the first post now produces the expected output. Overleaf don't update their systems continuously, so you will need the workaround proposed on Overleaf until they offer TeX Live 2021 or later with updates from today or later (and you switch your document to that new system). |
Describe the bug
Using
\printbibtabular
with custom label prefixes return [0] when cited in the text. Replacing\printbibtabular
by\printbibliography
solves the citation issue, but obviously removes the reference table.To Reproduce
Below a minimal example that reproduces the behavior:
Expected behaviour
I would expect that the reference labels follow the prefixes that I defined. For example,
\cite{worman}
should print "[RD4]".Output

PDF output using
\printbibtabular
:Replacing

\printbibtabular
by\printbibliography
gives the proper citation labels, but removes the tabular bibliography:Additional context
I'm trying to create a template for some technical documentation. In this template is a requirement for two types of bibliographies (Applicable Documents and Reference Documents), both in tabular format. I'm using
\printbibtabular
to print these in a tabular format, both with different label prefixes. The tables look fine. However, when citing in the document text, instead of returning the proper label (e.g. [RD1], [AD3], etc.) it returns [0] each time.I'm not sure that it matters, but I'm using Overleaf to write my LaTeX documentation.
Things I've tried
\printbibtabular
by\printbibliography
solves the citation issue, but removes the reference table and replaces it with the normal reference list.defernumbers=false
in the biblatex arguments removes the custom prefixes when citing in the text. The label prefixes are still added in the table. This is not ideal. The numeric citations work fine in this case, except that they do not reset when defining a second type of references.The text was updated successfully, but these errors were encountered: