zepinglee / citeproc-lua

A Lua implementation of the Citation Style Language (CSL) for use with LaTeX
MIT License
65 stars 8 forks source link

(In-)compatibility with babel package #9

Closed ThiloteE closed 2 years ago

ThiloteE commented 2 years ago

Hello, am just a user here. Not too deeply involved into any packages. Still, a BIG THANK YOU for this package! đź‘Ť My utmost gratitude!

The problem:

There seems to be a compatibility issue with the babel package (unless i configured it wrongly).

Minimal non-working example:

\documentclass[12pt,a4paper]{article}

      \usepackage{citation-style-language}
       \cslsetup{
                style = apa,
                }

      \usepackage[english]{babel}

      \addbibresource{bibliography.bib} 

\begin{document}

      test \cite{Glass20210607PGP} test. 

      \printbibliography

\end{document}

Here the bibliographic data:

@Article{Glass20210607PGP,
  author    = {Glass, Nicola},
  date      = {2021-06-07},
  title     = {Proteste Gegen Putschisten – Widerstand in Den Nachbarländern Myanmar Und Thailand},
  doi       = {10.11588/XAREP.00004477},
  url       = {http://crossasia-repository.ub.uni-heidelberg.de/4477/},
  urldate   = {2021-09-08},
  file      = {:Glass (2021) Proteste gegen Putschisten - Widerstand in Maynmar und Thailand.pdf:PDF},
  keywords  = {Political science, FOS: Political science, Military science},
  publisher = {Heidelberg University Library},
  urn       = {urn:nbn:de:bsz:16-crossasiarep-44775},
}

Removing the line \usepackage[english]{babel} leads to a successful compilation within seconds.

Additional info:

I used the version of the citation-style-language package from MiKTeX, which was packaged on 24.01.2022.

zepinglee commented 2 years ago

Thanks for your feedback! I can reproduce the bug.

The citation-style-language redefines several internal commands like \bibcite and \bibstyle for use in the .aux file. babel patches those commands as well, which causes the possible infinite loop error. I'll dig into it later.

zepinglee commented 2 years ago

Fixed in 2caad3b. In general the babel package is supposed to be loaded before citation-style-language.

ThiloteE commented 2 years ago

❤