latex3 / tagging-project

Issues related to the tagging project
https://latex3.github.io/tagging-project/
LaTeX Project Public License v1.3c
42 stars 15 forks source link

natbibapa option of apacite errors #677

Open mbertucci47 opened 3 months ago

mbertucci47 commented 3 months ago

The apacite package mostly looks okay but the natbibapa option errors.

\DocumentMetadata
  {
    lang=en-US,
    pdfversion=2.0,
    pdfstandard=ua-2,
    testphase={phase-III,math,title,table,firstaid}
  }
\documentclass{article}

\usepackage[natbibapa]{apacite}

\title{apacite tagging test}

\begin{document}
text
\end{document}

errors with

! Illegal parameter number in definition of hook 'cmd/@lbibitem/before'.
(hooks)             Offending label: 'latex-lab-testphase-bib'.
u-fischer commented 3 months ago

apacite redefines sometime \@lbibitem so that it no longer has arguments and the hook doesn't like that... This should work

\DocumentMetadata
  {
    lang=en-US,
    pdfversion=2.0,
    pdfstandard=ua-2,
    testphase={phase-III,math,title,table,firstaid}
  }
\documentclass{article}

\makeatletter
\AddToHook{package/apacite/after}{%
 \if@APAC@natbib@apa
  \def\@lbibitem[#1]#2{\NAT@swatrue\orig@nat@@lbibitem[#1]#2}%
 \fi}
\makeatother
\usepackage[natbibapa]{apacite}
\title{apacite tagging test}

\begin{document}
text
\end{document}
FrankMittelbach commented 2 months ago

maybe this can become partially-compatible given that there is a workaround for the option that doesn't work immediately.

mbertucci47 commented 2 months ago

It was originally listed in tagging-status.yml as partially-compatible