jgm / pandoc

Universal markup converter
https://pandoc.org
Other
33.74k stars 3.33k forks source link

Raise error if `--citeproc` used with `--natbib` or `--biblatex` #9962

Open wenkokke opened 1 month ago

wenkokke commented 1 month ago

Related to #9640.

Explain the problem. Assume the following documents:

To illustrate the issue, let us run Pandoc with three different configurations:

  1. harvard.yaml

    input-files: [sample.md]
    output-file: harvard.pdf
    citeproc: true
    csl: harvard.csl
    bibliography: sample.bib

    yields

    harvard

  2. natbib.yaml

    input-files: [sample.md]
    output-file: natbib.pdf
    standalone: true
    citeproc: true
    cite-method: natbib
    resource-path: ["."]
    metadata:
      bibliography: sample.bib
    pdf-engine: "latexmk"

    yields

    natbib

  3. natbib-harvard.yaml

    input-files: [sample.md]
    output-file: natbib-harvard.pdf
    standalone: true
    citeproc: true
    csl: harvard.csl
    cite-method: natbib
    resource-path: ["."]
    metadata:
      bibliography: sample.bib
    pdf-engine: "latexmk"

    also yields

    natbib

In (1), Pandoc typesets the page reference according to Harvard citation style. In (2), Pandoc typesets the page reference according to Chicago citation style, which is the default style. In (3), Pandoc typesets the page reference according to Chicago citation style, even though Harvard citation style is specified.

The expected behaviour would be for Pandoc to typeset the references according to the given citation style. I understand that technically I am giving Pandoc conflicting instructions. Render citations according to Harvard style and delegate to the natbib package. However, there is no option not to typeset the citation notes according to the default Chicago style, even though I am asking Pandoc to delegate to natbib. Therefore, I would argue that Pandoc's behaviour is definitely incorrect in (3), but that it is unclear whether Pandoc should (a) pass any notes through to natbib unchanged, or (b) attempt to typeset the notes using whatever citation style is provided.

Pandoc version? Running Pandoc 3.2.1 on macOS 13.

pandoc 3.2.1
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /Users/keri/.local/share/pandoc
Copyright (C) 2006-2024 John MacFarlane. Web: https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.
jgm commented 1 month ago

Please read the manual entry for --natbib: it is not to be used together with --citeproc.

wenkokke commented 1 month ago

Shouldn't that raise a warning or error?

jgm commented 1 month ago

Yes, it would make sense for us to raise an error if --natbib or --biblatex is used with --citeproc.