Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phantom parentheses appear in non-parenthetical (text-style) citations when converting from org-mode (org-cite) #8509

Open
JonathanReeve opened this issue Dec 29, 2022 · 4 comments · May be fixed by #8510

Comments

@JonathanReeve
Copy link

Explain the problem.

When using org-mode citations, with the org-cite syntax and the cite/t style, parentheses are correctly removed, but from the first author only. Subsequent authors, and the associated dates of publications, are still in parentheses.

Normal cite:@... parenthetical styles still work. Single-author and no-date cite/t styles work. It's just multiple-author cite/t styles that are broken.

Inputs:

refs.bib:

@article{dominici2014overview,
  title={An overview of Pandoc},
  author={Dominici, Massimiliano},
  journal={TUGboat},
  volume={35},
  number={1},
  pages={44--50},
  year={2014}
}
@article{krewinkel2017formatting,
  title={Formatting Open Science: agilely creating multiple document formats for academic manuscripts with Pandoc Scholar},
  author={Krewinkel, Albert and Winkler, Robert},
  journal={PeerJ computer science},
  volume={3},
  pages={e112},
  year={2017},
  publisher={PeerJ Inc.}
}
@article{macfarlanejgm,
  title={jgm/pandoc: pandoc 2.7. 3},
  author={MacFarlane, John and Rosenthal, Jesse and Krewinkel, Albert and Pickering, Matthew and Bieg, Mauro and Dunning, Andrew and Yakimov, Nikolay and Cheung, Kolen and Pashkovsky, Yan and Haisman, V{\'a}clav and others},
  journal={Zenodo}
}

Command:

echo "[cite/t:@dominici2014overview;@krewinkel2017formatting; and @macfarlanejgm]" | pandoc -f org -t html --citeproc --bibliography=refs.bib 

Output:

Dominici (2014; Krewinkel and Winkler 2017; and MacFarlane et al., n.d.)

Expected Output:

Dominici 2014; Krewinkel and Winkler 2017; and MacFarlane et al., n.d.

I.e., no parentheses.

Currently I'm working around this by just adding individual cite/t declarations around each one, like this: [cite/t:@dominici2014overview] [cite/t:@krewinkel2017formatting] and [cite/t:@macfarlanejgm] but that's not ideal.

Pandoc version?
What version of pandoc are you using, on what OS? (If it's not the latest release, please try with the latest release before reporting the issue.)

2.19.2 on NixOS. But I also tried this in Try Pandoc, with the same results.

@JonathanReeve
Copy link
Author

This is probably related to the implementation in #7329, so paging @Carlos-M-D, @jgm, and @bdarcus, in case any of you have any ideas.

@JonathanReeve
Copy link
Author

I just ran the command again with -t native, and I'm starting to see what may be causing this issue. Only the first citation is labeled as citationMode = AuthorInText. All the others are citationMode = NormalCitation:

[ Citation
    { citationId = "dominici2014overview"
    , citationPrefix = []
    , citationSuffix = []
    , citationMode = AuthorInText
    , citationNoteNum = 0
    , citationHash = 0
    }
, Citation
    { citationId = "krewinkel2017formatting"
    , citationPrefix = []
    , citationSuffix = []
    , citationMode = NormalCitation
    , citationNoteNum = 0
    , citationHash = 0
    }
, Citation
    { citationId = "macfarlanejgm"
    , citationPrefix = [ Str "and" ]
    , citationSuffix = []
    , citationMode = NormalCitation
    , citationNoteNum = 0
    , citationHash = 0
    }
]

@JonathanReeve
Copy link
Author

Looks like the problem is here, if I'm not mistaken. The citationMode change is only being applied to the first item, and not the rest of them.

JonathanReeve added a commit to JonathanReeve/pandoc that referenced this issue Dec 29, 2022
(That is, not just the first author. Fixes jgm#8509.)
JonathanReeve added a commit to JonathanReeve/pandoc that referenced this issue Dec 29, 2022
@JonathanReeve
Copy link
Author

Pull request submitted! I hope I did that right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants