jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.8k stars 3.39k forks source link

-@citkey syntax encloses citations in extended footnotes in parentheses #10173

Open dstark opened 2 months ago

dstark commented 2 months ago

Explain the problem. When using [-@citekey] or [-@citekey locator] in a footnote style, Pandoc properly omits the author name and renders the balance of the citation. However, when footnotes include multiple citations, perhaps with other discussion as well, Pandoc adds parentheses around the whole citation, while still omitting the author's name. Per common conventions (e.g., Chicago), these outside parentheses shouldn't be included in this scenario.

For more discussion, see this issue and this discussion on a prior commit intended to address this behavior.

If I can provide any further details, please feel free to ask. Thanks so much for your help with this issue!

Pandoc version? Pandoc 3.4, Windows 10 and 11

jgm commented 2 months ago

Can you give a small example with everything needed to reproduce this?

dstark commented 2 months ago

Can you give a small example with everything needed to reproduce this?

Sure. I think the example below should do the trick. If you need anything further, please feel free to ask. Thanks so much!

---
csl: https://www.zotero.org/styles/chicago-fullnote-bibliography
title: Test Document
---

<!-- Here's the JSON for the sample citation:

[
  {"id":"Thiseltonhermeneuticsdoctrine2007","author":[{"family":"Thiselton","given":"Anthony C."}],"citation-key":"Thiseltonhermeneuticsdoctrine2007","event-place":"Grand Rapids","ISBN":"978-0-8028-7422-1","issued":{"date-parts":[["2007"]]},"publisher":"Eerdmans","publisher-place":"Grand Rapids","source":"Open WorldCat","title":"The hermeneutics of doctrine","title-short":"Hermeneutics of doctrine","type":"book"}
]

-->

This is a test document.^[This is a test citation that mentions Anthony Thiselton and tries to create a citation that omits his name. -@Thiseltonhermeneuticsdoctrine2007. Here's another sentence that mentions Thiselton with a locator. -@Thiseltonhermeneuticsdoctrine2007 [p. 39]. In both cases, parentheses are added, contrary to the style's preference. This footnote, however, follows up with another sentence citing the same author where his name isn't mentioned but included in the citation. @Thiseltonhermeneuticsdoctrine2007]

image

jgm commented 2 months ago

OK, I see the issue. We have

           , Cite
                [ Citation
                    { citationId = "Thiseltonhermeneuticsdoctrine2007"
                    , citationPrefix = []
                    , citationSuffix = []
                    , citationMode = SuppressAuthor
                    , citationNoteNum = 1
                    , citationHash = 0
                    }
                ]
                [ Space
                , Str "("
                , Emph
                    [ Str "The"
                    , Space
                    , Str "Hermeneutics"
                    , Space
                    , Str "of"
                    , Space
                    , Str "Doctrine"
                    ]

and because citation mode is SuppressAuthor, not AuthorInText, the parentheses are added. Note that both the [-@foo] and the -@foo form will be parsed as SuppressAuthor, so they can't be distinguished.

jgm commented 2 months ago

We also can't modify the Markdown reader to treat -@foo as AuthorInText, because then citeproc will add the author instead of suppressing it.

So I don't really see a good solution at the moment. Long term, we could maybe consider adding something like SuppressAuthorInText, though that is inelegant.

dstark commented 2 months ago

We also can't modify the Markdown reader to treat -@foo as AuthorInText, because then citeproc will add the author instead of suppressing it.

So I don't really see a good solution at the moment. Long term, we could maybe consider adding something like SuppressAuthorInText, though that is inelegant.

Got it. Just as a thought—Is the lack of added parentheses perhaps something that could be triggered by reading from the CSL for whenever it has <category citation-format="note"/>?

jgm commented 2 months ago

The parentheses are added only when you're using a note style. (Because in a note style, citations turn into notes, and we need to avoid having notes inside other notes...)

dstark commented 2 months ago

Because in a note style, citations turn into notes, and we need to avoid having notes inside other notes...

Duly noted and appreciated. :-) Would syntax like [-]@foo be worth considering, perhaps not unlike the use of square brackets to associate locators with citations in this context (e.g., the [p. 39] in the example above)?

jgm commented 2 months ago

It's not a question of syntax. We'd need some deeper underlying changes in the types.

dstark commented 2 months ago

It's not a question of syntax. We'd need some deeper underlying changes in the types.

Got it. Thanks so much for giving it some thought.