zepinglee / citeproc-lua

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

Wrong bibcite commands with pdflatex #6

Closed vbeffara closed 2 years ago

vbeffara commented 2 years ago

Hi, great to see that there will be robust CSL support in LaTeX because that is something that non-mathematician users have been asking for for a long time.

I have an issue when trying to compile the example with pdflatex: the .aux file looks like this,

\relax 
\bibstyle{molecular-ecology}
\bibdata{example.bib}
\citation{{}{}{ITEM-1}}
\citation{{}{}{ITEM-1,ITEM-2}}
\citation{{}{ 6}{ITEM-1}}
\citation{{prefix }{ suffix}{ITEM-1}}
\citation{{}{ suffix}{ITEM-1}}
\citation{{prefix }{}{ITEM-1}}
\bibcite{ITEM-1}{(D\OT1\textquoteright Arcus 2005)}
\bibcite{ITEM-1,ITEM-2}{(D\OT1\textquoteright Arcus 2005; Bennett 2009)}
\bibcite{ITEM-1}{(D\OT1\textquoteright Arcus 2005 p. 6)}
\bibcite{ITEM-1}{(prefix D\OT1\textquoteright Arcus 2005 suffix)}
\bibcite{ITEM-1}{(D\OT1\textquoteright Arcus 2005 suffix)}
\bibcite{ITEM-1}{(prefix D\OT1\textquoteright Arcus 2005)}
\gdef \@abspage@last{1}

with apparently encoding-related parts, and then obviously pdflatex complains about the command \OT being undefined. No issue when using lualatex though.

zepinglee commented 2 years ago

Thanks! I can reproduce this bug with TeX Live 2021. I'll fix it later.

zepinglee commented 2 years ago

It should work fine now. The latex2e code \immediate\write\@auxout is replaced with latex3 \iow_now:Nn \@auxout so that the \OT1\textquoteright can be avoided.

vbeffara commented 2 years ago

Works for me, thanks!