plk / biblatex-apa

APA style for BibLaTeX
88 stars 48 forks source link

Legislation type does not display suffix after year #205

Open rolandog opened 1 year ago

rolandog commented 1 year ago

In the process of updating a Stack Exchange answer, I noticed that the legislation type didn't show a suffix for the second reference (the one using the legislation type), as can be seen that 2016b is not present in the citation:

Comparison of the citation and legislation types in the APA citation style.

Here's the code I used: ```latex % gdpr.bib file \begin{filecontents}[overwrite]{gdpr.bib} @online{GDPR2016a, date = {2016-05-04}, location = {OJ L 119, 4.5.2016, p. 1--88}, title = {Regulation ({EU}) 2016/679 of the {European} {Parliament} and of the {Council}}, url = {https://data.europa.eu/eli/reg/2016/679/oj}, titleaddon = {of 27 {April} 2016 on the protection of natural persons with regard to the processing of personal data and on the free movement of such data, and repealing {Directive} 95/46/{EC} ({General} {Data} {Protection} {Regulation})}, abstract = {The General Data Protection Regulation (2016/679, GDPR) is a Regulation in European Union (EU) law on data protection and privacy in the EU and the European Economic Area (EEA).}, author = {{European Parliament} and {Council of the European Union}}, keywords = {access consumer data data-processing freedom gdpr information justice law personal privacy protection security verification}, urldate = {2023-04-13}, } @Legislation{EuropeanParliament2016a, date = {2016-05-04}, location = {OJ L 119, 4.5.2016, p. 1--88}, title = {Regulation ({EU}) 2016/679 of the {European} {Parliament} and of the {Council}}, url = {https://data.europa.eu/eli/reg/2016/679/oj}, titleaddon = {of 27 {April} 2016 on the protection of natural persons with regard to the processing of personal data and on the free movement of such data, and repealing {Directive} 95/46/{EC} ({General} {Data} {Protection} {Regulation})}, abstract = {The General Data Protection Regulation (2016/679, GDPR) is a Regulation in European Union (EU) law on data protection and privacy in the EU and the European Economic Area (EEA).}, author = {{European Parliament} and {Council of the European Union}}, keywords = {access consumer data data-processing freedom gdpr information justice law personal privacy protection security verification}, urldate = {2023-04-13}, } \end{filecontents} % preamble \documentclass[a4paper,10pt]{article} % utf8 \usepackage[utf8]{inputenc} % hyperref \usepackage[x11names]{xcolor} \usepackage{hyperref} \hypersetup{citecolor=DodgerBlue3, urlcolor=Blue1, colorlinks=true} % bibliography \usepackage[backend=biber,style=apa]{biblatex} \addbibresource{gdpr.bib} % document info \title{Citing the GDPR} \author{Aldaoudeyeh, Al-Motasem and Garza, Rolando} \date{\today} \begin{document} \maketitle One could cite as \texttt{online} \parencite{GDPR2016a}, or as \texttt{Legislation} \parencite{EuropeanParliament2016a}; however, the latter would only be available if the chosen citation style has a driver for the \texttt{Legislation} type. \printbibliography \end{document} ```
plk commented 1 year ago

Fixed in next release, thanks for reporting. To fix now, replace:

\newbibmacro*{statdate}{%
  \iffieldundef{origyear}
    {\printtext[parens]{\printlabeldate}}
    {\printtext[parens]{\printorigdate%
                        \addspace\&\addspace rev\adddot\addspace\printlabeldate}}}

with

\newbibmacro*{statdate}{%
  \iffieldundef{origyear}
    {\printtext[parens]{\printlabeldateextra}}
    {\printtext[parens]{\printorigdate%
                        \addspace\&\addspace rev\adddot\addspace\printlabeldateextra}}}

in apa.bbx.