zepinglee / citeproc-lua

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

Single quotes around word within title being turned into double quotes #73

Closed nickw2066 closed 1 month ago

nickw2066 commented 2 months ago

Describe the bug Single quotes around a word within a reference title are being turned into double quotes. See below.

Additional information

To Reproduce

\documentclass{article}

\begin{filecontents}[overwrite, noheader]{\jobname.json}
[
    {
        "id": "Bailey2023-Meanin",
        "type": "book",
        "author": [
            {
                "family": "Bailey",
                "given": "Nicholas A."
            }
        ],
        "title": "The Meaning of 'dummyWord': A Construction Grammar Analysis",
        "publisher-place": "Dallas, TX",
        "publisher": "SIL International",
        "issued": {
            "date-parts": [
                [
                    "2023"
                ]
            ]
        }
    }
]

\end{filecontents}

\usepackage{citation-style-language}
\cslsetup{style = turabian-fullnote-bibliography}
\addbibresource{\jobname.json}
%\addbibresource{myBib.json}

\begin{document}

test single quotes around word in title\cite{Bailey2023-Meanin}

\printbibliography

\end{document}

Screenshots Screenshot 2024-08-21 at 9 02 30 AM

CSL: turabian-fullnote-bibliography

zepinglee commented 2 months ago

Which language are you writing in?

I think it's the expected behavior. The CSL processor treats the first straight quotation mark as the outer quote. In your provided example, the ' is treated as outer quote and the opposite " is treated as inner quote. Thus the dummyWord is recognized as a quoted word in outer style. This design is because of the complicated styles of quotation marks among different languages (see https://en.wikipedia.org/wiki/Quotation_mark#Summary_table). Additionally, CSL processor uses US English as the default locale. It loads the quote terms from locales-en-US.xml and outputs the curly double quotes.

https://github.com/citation-style-language/locales/blob/195bef843f87fc917be45ab3eca60536e4ef4626/locales-en-US.xml#L175-L178

    <term name="open-quote">“</term>
    <term name="close-quote">”</term>
    <term name="open-inner-quote">‘</term>
    <term name="close-inner-quote">’</term>

If single quotation marks are expected as outer ones, you can specify UK English as the CSL processor's locale by \cslsetup{locale = en-GB} or \usepackage[british]{babel}.

Screenshot 2024-08-21 at 11 28 58
nickw2066 commented 2 months ago

Thank you