Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…stock into dhimmel-pandoc-2.13
  • Loading branch information
vincerubinetti committed Jun 2, 2021
2 parents 95bf5b2 + fe18096 commit d3947c3
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 19 deletions.
25 changes: 17 additions & 8 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,23 @@ Note that multiple citations must be semicolon separated.
Be careful not to cite the same study using identifiers from multiple sources.
For example, the following citations all refer to the same study, but will be treated as separate references: `[@doi:10.7717/peerj.705; @pmc:PMC4304851; @pubmed:25648772]`.

Citation keys must adhere to the syntax described in the [Pandoc manual](https://pandoc.org/MANUAL.html#citations):

> The citation key must begin with a letter, digit, or `_`, and may contain alphanumerics, `_`, and internal punctuation characters (`:.#$%&-+?<>~/`).
To evaluate whether a citation key fully matches this syntax, try [this online regex](https://regex101.com/r/mXZyY2/latest).
If the citation key is not valid, use the [citation aliases](#citation-aliases) workaround below.
This is required for citation keys that contain forbidden characters such as `;` or `=` or end with a non-alphanumeric character such as `/`.
<!-- See [jgm/pandoc#6026](https://github.com/jgm/pandoc/issues/6026) for progress on a more flexible Markdown citation key syntax. -->
The citation key syntax is described in the [Pandoc manual](https://pandoc.org/MANUAL.html#citations):

> Unless a citation key start with a letter, digit, or `_`,
> and contains only alphanumerics and internal punctuation characters (`:.#$%&-+?<>~/`),
> it must be surrounded by curly braces,
> which are not considered part of the key.
> In `@Foo_bar.baz.`, the key is `Foo_bar.baz`.
> The final period is not *internal* punctuation,
> so it is not included in the key.
> In `@{Foo_bar.baz.}`, the key is `Foo_bar.baz.`, including the final period.
> The curly braces are recommended if you use URLs as keys:
> `[@{https://example.com/bib?name=foobar&date=2000}, p. 33]`.
If a citation key does not fully match [this online regex](https://regex101.com/r/mXZyY2/latest)
(for example, contains characters such as `;` or `=` or end with a non-alphanumeric character such as `/`),
make sure to surround it with curly braces or use the [citation aliases](#citation-aliases) workaround below.
<!-- See [jgm/pandoc#6026](https://github.com/jgm/pandoc/issues/6026) on the curly-brace syntax for Markdown citation keys, which was introduced in Pandoc 2.14. -->

Prior to Rootstock commit [`6636b91`](https://github.com/manubot/rootstock/commit/6636b912c6b41593acd2041d34cd4158c1b317fb) on 2020-01-14, Manubot processed citations separately from Pandoc.
Switching to a Pandoc filter improved reliability on complex documents, but restricted the syntax of citation keys slightly.
Expand Down
2 changes: 1 addition & 1 deletion build/assets/style.csl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<text variable="citation-number"/>
</layout>
</citation>
<bibliography hanging-indent="true" second-field-align="flush">
<bibliography second-field-align="flush">
<layout>
<text variable="citation-number" suffix=". "/>
<group delimiter=" ">
Expand Down
16 changes: 8 additions & 8 deletions build/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ dependencies:
- cairo=1.14.12
- cairocffi=0.8.0
- cffi=1.12.3
- ghp-import=0.5.5
- ghp-import=1.0.0
- jinja2=2.11.2
- jsonschema=3.2.0
- pandoc=2.9.2
- panflute=1.12.5
- pandoc=2.14
- pango=1.40.14
- pip=20.2
- psutil=5.7.3
Expand All @@ -21,14 +20,15 @@ dependencies:
- yamllint=1.25.0
- pip:
- errorhandler==2.0.1
- git+https://github.com/manubot/manubot@553090a16ac24a9fdc3f8df241a91b790c140865
- git+https://github.com/manubot/manubot@2c028a7a87be24a76e2dec3ac7db6e8754ae6d4a
- isbnlib==3.10.3
- opentimestamps-client==0.7.0
- opentimestamps==0.4.1
- pandoc-eqnos==2.3.0
- pandoc-fignos==2.3.1
- pandoc-tablenos==2.2.2
- pandoc-xnos==2.4.3
- pandoc-eqnos==2.5.0
- pandoc-fignos==2.4.0
- pandoc-tablenos==2.3.0
- pandoc-xnos==2.5.0
- panflute==2.1.0
- pybase62==0.4.3
- pysha3==1.0.2
- python-bitcoinlib==0.10.2
Expand Down
2 changes: 1 addition & 1 deletion build/pandoc/defaults/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ filters:
- pandoc-eqnos
- pandoc-tablenos
- pandoc-manubot-cite
- pandoc-citeproc
- citeproc
wrap: preserve
metadata:
csl: build/assets/style.csl
Expand Down
1 change: 1 addition & 0 deletions build/pandoc/defaults/html.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ include-after-body:
- build/plugins/mathjax.html
#- build/plugins/scite.html
variables:
document-css: false
math: ""
html-math-method:
method: mathjax
2 changes: 1 addition & 1 deletion content/02.delete-me.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Citation by Wikidata ID [@wikidata:Q56458321].

Citation by ISBN [@isbn:9780262517638].

Citation by URL [@https://greenelab.github.io/meta-review/].
Citation by URL [@{https://greenelab.github.io/meta-review/}].

Citation by alias [@deep-review].

Expand Down

0 comments on commit d3947c3

Please sign in to comment.