zepinglee / citeproc-lua

A Lua implementation of the Citation Style Language (CSL)
MIT License
62 stars 7 forks source link

DOI only converted to URL for first reference when also using package hyperref #28

Closed jpjoines closed 1 year ago

jpjoines commented 1 year ago

I'm using APA style, with citation-style-language {2022-09-23} {v0.2.2} in TexLive 2022, and compiling with LuaLatex. DOIs should be converted to URLs in the reference list by prepending https://doi.org/ to the DOI. However, when package hyperref is also used, only the first reference in the list has https://doi.org/ prepended to the DOI. Here's a MRE:

\documentclass{article}

\begin{filecontents}[overwrite, noheader]{mwe-csl.bib}
@article{edge-garza.etal-2014-Mol.Breed.,
  title = {A high-throughput and cost-efficient {{DNA}} extraction protocol for the tree fruit crops of apple, sweet cherry, and peach relying on silica beads during tissue sampling},
  author = {Edge-Garza, Daniel A. and Rowland, Terrence V. and Haendiges, Stacey and Peace, Cameron},
  date = {2014-12-01},
  journaltitle = {Molecular Breeding},
  volume = {34},
  number = {4},
  pages = {2225--2228},
  issn = {1380-3743, 1572-9788},
  doi = {10.1007/s11032-014-0160-x},
}

@article{paris.etal-2017-MethodsEcolEvola,
  title = {Lost in parameter space: {{A}} road map for {{Stacks}}},
  shorttitle = {Lost in parameter space},
  author = {Paris, Josephine R and Stevens, Jamie R and Catchen, Julian M},
  date = {2017-03-01},
  journaltitle = {Methods in Ecology and Evolution},
  shortjournal = {Methods Ecol Evol},
  volume = {8},
  pages = {1360--1373},
  issn = {2041-210X},
  doi = {10.1111/2041-210X.12775},
}

@article{peterson.etal-2012-PLoSONE,
  title = {Double digest {{RADseq}}: an inexpensive method for de novo {{SNP}} discovery and genotyping in model and non-model species},
  shorttitle = {Double {{Digest RADseq}}},
  author = {Peterson, Brant K. and Weber, Jesse N. and Kay, Emily H. and Fisher, Heidi S. and Hoekstra, Hopi E.},
  date = {2012-05-31},
  journaltitle = {PLoS ONE},
  volume = {7},
  number = {5},
  pages = {e37135},
  issn = {1932-6203},
  doi = {10.1371/journal.pone.0037135},
}
\end{filecontents}

\usepackage{citation-style-language}
\cslsetup{style = apa}
\addbibresource{mwe-csl.bib}

\usepackage{hyperref}

\begin{document}

        First citation \cite{edge-garza.etal-2014-Mol.Breed.}.

        Second citation \cite{peterson.etal-2012-PLoSONE}.

        Third citation \cite{paris.etal-2017-MethodsEcolEvola}.

        \printbibliography

\end{document}
zepinglee commented 1 year ago

Thanks for your feedback and I can reproduce this bug.

zepinglee commented 1 year ago

It should be fixed in 83caeb9.

Screen Shot 2022-11-17 at 11 25 16
jpjoines commented 1 year ago

Thanks! That fixed the issue and your work makes mine much easier.