moewew / biblatex-trad

traditional bibliography styles with biblatex
LaTeX Project Public License v1.3c
31 stars 7 forks source link

Incompatibility with the biblatex "related entries" system? #24

Closed russella closed 8 years ago

russella commented 9 years ago

Dear Marco,

Thanks again for all your work on the trad-* system. I've used it for several articles now.

I would like to to deploy trad-plain for all articles in the Journal "Theory of Computing," but I have run in to a snag. I would be really grateful for some advice. For Theory of Computing, I'll need to use the "related entries" system in order to refer to previous versions of an article. Consider the minimal example posted below.

  1. If you typeset it as written, it works fine, showing the related entries for both articles.
  2. If you comment out the \usepackage[*]{biblatex} line, and uncomment the following one, you will see that the system only shows the related entries for the /first/ entry.

What's going wrong?

Any help very, very appreciated!

Best, Alex

---------EXAMPLE CODE BELOW--------- \documentclass{article} \usepackage[american]{babel} \usepackage{csquotes}

%%%%% Try with each of the following lines uncommented! \usepackage[backend=biber]{biblatex} %\usepackage[backend=biber,bibstyle=trad-plain]{biblatex} %%%%% End part to edit

\usepackage[colorlinks]{hyperref}

\renewcommand{\relatedpunct}{\addcolon\space} \renewcommand{\relateddelim}{\addcomma\space}

\newbibmacro{related:prelim}[1]{% \renewcommand{\newunitpunct}{\addcomma\space}% \entrydata{#1}{\usebibmacro{doi+eprint+url}}}

\NewBibliographyString{prelim,prelims} \DefineBibliographyStrings{american}{% prelim = {Preliminary version}, prelims = {Preliminary versions}}

\begin{filecontents}{\jobname.bib} @article{v008a021, author = {Roy Kasher and Julia Kempe}, title = {Two-Source Extractors Secure Against Quantum Adversaries}, year = {2012}, pages = {461-486}, doi = {10.4086/toc.2012.v008a021}, journal = {Theory of Computing}, volume = {8}, related = {kasher/arxiv,kasher/approx}, relatedtype = {prelim}} @article{v008a021alt, author = {Roy Lasher and Julia Lempe}, title = {Two-Source Extractors Secure Against Quantum Adversaries}, year = {2012}, pages = {461-486}, doi = {10.4086/toc.2012.v008a021}, journal = {Theory of Computing}, volume = {8}, related = {lasher/arxiv,lasher/approx}, relatedtype = {prelim}} @online{kasher/arxiv, author = {Kasher, Roy and Kempe, Julia}, title = {Two-Source Extractors Secure Against Quantum Adversaries}, eprinttype = {arxiv}, eprintclass = {quant-ph}, eprint = {1005.0512}, month = may, year = {2010}} @inproceedings{kasher/approx, author = {Kasher, Roy and Kempe, Julia}, title = {Two-source extractors secure against quantum adversaries}, booktitle = {Proceedings of the 13th international conference on Approximation, and the 14th International conference on Randomization, and combinatorial optimization: algorithms and techniques}, series = {APPROX/RANDOM'10}, year = {2010}, pages = {656--669}, url = {http://dl.acm.org/citation.cfm?id=1886521.1886572}, publisher = {Springer-Verlag}, location = {Berlin, Heidelberg}} @online{lasher/arxiv, author = {Lasher, Roy and Lempe, Julia}, title = {Two-Source Extractors Secure Against Quantum Adversaries}, eprinttype = {arxiv}, eprintclass = {quant-ph}, eprint = {1005.0512.LA}, month = may, year = {2010}} @inproceedings{lasher/approx, author = {Lasher, Roy and Lempe, Julia}, title = {Two-source extractors secure against quantum adversaries}, booktitle = {Proceedings of the 13th international conference on Approximation, and the 14th International conference on Randomization, and combinatorial optimization: algorithms and techniques}, series = {APPROX/RANDOM'10}, year = {2010}, pages = {656--669}, url = {http://dl.acm.org/citation.cfm?id=LA1886521.1886572}, publisher = {Springer-Verlag}, location = {Berlin, Heidelberg}} \end{filecontents}

\addbibresource{\jobname.bib} \begin{document} \cite{v008a021,v008a021alt} \printbibliography \end{document}

moewew commented 9 years ago

It seems to me that a call to \usebibmacro{related:init}% is missing just before \usebibmacro{related}% in the drivers. It might not be a bad idea to also allow for the related feature to be toggled on and off as in standard.bbx:

  \iftoggle{bbx:related}
    {\usebibmacro{related:init}%
     \usebibmacro{related}}
    {}%
moewew commented 8 years ago

I have merged the pull request. If you could confirm that the issue is solved, we can close this issue.

russella commented 8 years ago

Yes, this solves the issue!

moewew commented 8 years ago

Brilliant!