zepinglee / citeproc-lua

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

Can't use mathematics notation in prefixes #49

Closed kotobuki closed 4 months ago

kotobuki commented 7 months ago

First of all, thank you very much for creating and maintaining such a helpful tool. I would like to report a bug as follows.

Describe the bug It's not possible to use mathematics notation in prefixes.

Additional information

To Reproduce

\documentclass{article}

\begin{filecontents}[overwrite, noheader]{\jobname.json}
[
    {
        "id": "ITEM-1",
        "type": "book",
        "author": [
            {
                "family": "D’Arcus",
                "given": "Bruce"
            }
        ],
        "issued": {
            "date-parts": [
                [
                    2005
                ]
            ]
        },
        "publisher": "Routledge",
        "title": "Boundaries of dissent: Protest and state power in the media age"
    }
]
\end{filecontents}

\usepackage[style = apa]{citation-style-language}
\addbibresource{\jobname.json}
\usepackage{hyperref}

\begin{document}
\cite[prefix = {That typically happens in 10$^{-15}$ seconds. See }]{ITEM-1}

\printbibliography
\end{document}
...exmf/scripts/citation-style-language/citeproc-output.lua:1981: bad argument #1 to 'gsub' (string expected, got table)
zepinglee commented 4 months ago

Thanks for your report and this is fixed in 7f295a5.