Skip to content

Commit

Permalink
Citeproc: allow notes-after-punctuation to work...
Browse files Browse the repository at this point in the history
with numerical styles that use superscripts (e.g.
american-medical-association.csl), as well as with
note styles. The default setting of `notes-after-punctuation`
is true for note styles and false otherwise.

This restores a behavior of pandoc-citeproc that wasn't properly
carried over to Citeproc.

Closes #7826.
See also jgm/pandoc-citeproc#384.
  • Loading branch information
jgm committed Jan 13, 2022
1 parent fcbd016 commit 4fdbb30
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions MANUAL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5727,13 +5727,16 @@ A few other metadata fields affect bibliography formatting:
before lower (default is lower before upper).

`notes-after-punctuation`
: If true (the default), pandoc will put footnote citations
: If true (the default for note styles), pandoc will put
footnote references or superscripted numerical citations
after following punctuation. For example, if the source
contains `blah blah [@jones99].`, the result will look like
`blah blah.[^1]`, with the note moved after the period and
the space collapsed. If false, the space will still be
collapsed, but the footnote will not be moved after the
punctuation.
punctuation. The option may also be used in numerical styles
that use superscripts for citation numbers (but for these
styles the default is not to move the citation).


# Slide shows
Expand Down
4 changes: 2 additions & 2 deletions src/Text/Pandoc/Citeproc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ processCitations (Pandoc meta bs) = do
B.divWith ("ref-" <> ident,["csl-entry"],[]) . B.para .
insertSpace $ out)
(resultBibliography result)
let moveNotes = styleIsNoteStyle sopts &&
maybe True truish (lookupMeta "notes-after-punctuation" meta)
let moveNotes = maybe (styleIsNoteStyle sopts) truish
(lookupMeta "notes-after-punctuation" meta)
let cits = resultCitations result

let metanocites = lookupMeta "nocite" meta
Expand Down

0 comments on commit 4fdbb30

Please sign in to comment.