.\"t .\" Automatically generated by Pandoc 2.7.1 .\" .TH "pandoc-citeproc" "1" "2019-03-26" "pandoc-citeproc 0.16.1.3" "" .hy .SH NAME .PP pandoc-citeproc - filter to resolve citations in a pandoc document. .SH SYNOPSIS .PP pandoc-citeproc options [file..] .SH DESCRIPTION .PP The \f[C]pandoc-citeproc\f[R] executable has two modes, filter mode and convert mode. .SS Filter mode .PP Run without options, it acts as a filter that takes a JSON-encoded Pandoc document, formats citations and adds a bibliography, and returns a JSON-encoded pandoc document. Citations will be resolved, and, assuming there are bibliography entries, a bibliography will be inserted into a Div element with id \f[C]refs\f[R]. If no such Div exists, one will be created and appended to the end of the document (unless the \f[C]suppress-bibliography\f[R] metadata field is set to a true value). If you wish the bibliography to have a section header, put the section header at the end of your document. (See the \f[C]pandoc\f[R] (1) man page under \[lq]Citations\[rq] for details on how to encode citations in pandoc\[cq]s markdown.) .PP To process citations with pandoc, call pandoc-citeproc as a filter: .IP .nf \f[C] pandoc --filter pandoc-citeproc input.md -s -o output.html \f[R] .fi .PP pandoc-citeproc will look for the following metadata fields in the input. (For details on how to set metadata fields in pandoc\[cq]s markdown, see the \f[C]pandoc\f[R] (1) man page under \f[C]--metadata\f[R], \f[C]--metadata-file\f[R], and \f[C]Extension: yaml_metadata_block\f[R].) .TP .B \f[C]bibliography\f[R] A path, or YAML list of paths, of bibliography files to use. These may be in any of the formats supported by bibutils. .RS .PP .TS tab(@); l l. T{ Format T}@T{ File extension T} _ T{ BibLaTeX T}@T{ \&.bib T} T{ BibTeX T}@T{ \&.bibtex T} T{ Copac T}@T{ \&.copac T} T{ CSL JSON T}@T{ \&.json T} T{ CSL YAML T}@T{ \&.yaml T} T{ EndNote T}@T{ \&.enl T} T{ EndNote XML T}@T{ \&.xml T} T{ ISI T}@T{ \&.wos T} T{ MEDLINE T}@T{ \&.medline T} T{ MODS T}@T{ \&.mods T} T{ NBIB T}@T{ \&.nbib T} T{ RIS T}@T{ \&.ris T} .TE .PP Note that \f[C].bib\f[R] can generally be used with both BibTeX and BibLaTeX files, but you can use \f[C].bibtex\f[R] to force BibTeX. .RE .TP .B \f[C]references\f[R] A YAML list of references. Each reference is a YAML object. The format is essentially CSL JSON format. Here is an example: .RS .IP .nf \f[C] - id: doe2006 author: family: Doe given: [John, F.] title: Article page: 33-34 issued: year: 2006 type: article-journal volume: 6 container-title: Journal of Generic Studies \f[R] .fi .PP The contents of fields will be interpreted as markdown when appropriate: so, for example, emphasis and strong emphasis can be used in title fields. Simple tex math will also be parsed and rendered appropriately. .RE .TP .B \f[C]csl\f[R] or \f[C]citation-style\f[R] Path or URL of a CSL style file. If the file is not found relative to the working directory, pandoc-citeproc will look in the \f[C]$HOME/.csl\f[R] directory (or \f[C]C:\[rs]Users\[rs]USERNAME\[rs]AppData\[rs]Roaming\[rs]csl\f[R] in Windows 7). If this is left off, pandoc-citeproc will look for \f[C]$HOME/.pandoc/default.csl\f[R], and if this is not present, it will use \f[C]chicago-author-date.csl\f[R], looking first in \f[C]$HOME/.csl\f[R] and then in its own data files. .TP .B \f[C]link-citations\f[R] If this has a true value, citations in author-date and numerical styles will be hyperlinked to their corresponding bibliography entries. The default is not to add hyperlinks. .TP .B \f[C]citation-abbreviations\f[R] Path to a CSL abbreviations JSON file. If the file is not found relative to the working directory, pandoc-citeproc will look in the \f[C]$HOME/.csl\f[R] directory (or \f[C]C:\[rs]Users\[rs]USERNAME\[rs]AppData\[rs]Roaming\[rs]csl\f[R] in Windows 7). The format is described here (http://citationstylist.org/2011/10/19/abbreviations-for-zotero-test-release). Abbreviations are only output if, in the \f[C].csl\f[R] file, \f[C]form=\[dq]short\[dq]\f[R] is set on the element that renders the variable. .RS .PP Here is a short example: .IP .nf \f[C] { \[dq]default\[dq]: { \[dq]container-title\[dq]: { \[dq]Lloyd\[aq]s Law Reports\[dq]: \[dq]Lloyd\[aq]s Rep\[dq], \[dq]Estates Gazette\[dq]: \[dq]EG\[dq], \[dq]Scots Law Times\[dq]: \[dq]SLT\[dq] } } } \f[R] .fi .RE .TP .B \f[C]lang\f[R] Locale to use in formatting citations. If this is not set, the locale is taken from the \f[C]default-locale\f[R] attribute of the CSL file. \f[C]en-US\f[R] is used if a locale is not specified in either the metadata or the CSL file. (For backwards compatibility, the field \f[C]locale\f[R] can be used instead of \f[C]lang\f[R], but this \f[C]lang\f[R] should be used going forward.) .TP .B \f[C]suppress-bibliography\f[R] If this has a true value, the bibliography will be left off. Otherwise a bibliography will be inserted into each Div element with id \f[C]refs\f[R]. If there is no such Div, one will be created at the end of the document. .TP .B \f[C]reference-section-title\f[R] If this has a value, a section header with this title will be added before the bibliography. If \f[C]reference-section-title\f[R] is not specified and the document ends with a section header, this final header will be treated as the bibliography header. .TP .B \f[C]notes-after-punctuation\f[R] If true (the default), pandoc will put footnote citations after following punctuation. For example, if the source contains \f[C]blah blah [\[at]jones99].\f[R], the result will look like \f[C]blah blah.[\[ha]1]\f[R], 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. .PP The metadata must contain either \f[C]references\f[R] or \f[C]bibliography\f[R] or both as a source of references. \f[C]csl\f[R] and \f[C]citation-abbreviations\f[R] are optional. If \f[C]csl\f[R] is not provided, a default stylesheet will be used (either \f[C]\[ti]/.pandoc/default.csl\f[R] or a version of \f[C]chicago-author-date.csl\f[R]). .SS Convert mode .PP If the option \f[C]--bib2yaml\f[R] or \f[C]--bib2json\f[R] is used, \f[C]pandoc-citeproc\f[R] will not process citations; instead, it will treat its input (from stdin or files) as a bibliography and convert it either to a pandoc YAML metadata section, suitable for inclusion in a pandoc document (\f[C]--bib2yaml\f[R]), or as a CSL JSON bibliography, suitable for import to zotero (\f[C]--bib2json\f[R]). .PP The \f[C]--format\f[R] option can be used to specify the bibliography format, though when files are used, \f[C]pandoc-citeproc\f[R] can generally guess this from the extension. .PP This mode supersedes the old \f[C]biblio2yaml\f[R] program. .SS Raw content (pandoc-citeproc only) .PP To include raw content in a prefix, suffix, delimiter, or term, surround it with these tags indicating the format: .IP .nf \f[C] {{jats}}<ref>{{/jats}} \f[R] .fi .PP Without the tags, the string will be interpreted as a string and escaped in the output, rather than being passed through raw. .PP This feature allows stylesheets to be customized to give different output for different output formats. However, stylesheets customized in this way will not be useable by other CSL implementations. .SH OPTIONS .TP .B \f[C]-y, --bib2yaml\f[R] Convert bibliography to YAML suitable for inclusion in pandoc metadata. .TP .B \f[C]-j, --bib2json\f[R] Convert bibliography to CSL JSON suitable for import into Zotero. .TP .B \f[C]-f\f[R] \f[I]FORMAT\f[R], \f[C]--format=\f[R]\f[I]FORMAT\f[R] Specify format of bibliography to be converted. Legal values are \f[C]biblatex\f[R], \f[C]bibtex\f[R], \f[C]ris\f[R], \f[C]endnote\f[R], \f[C]endnotexml\f[R], \f[C]isi\f[R], \f[C]medline\f[R], \f[C]copac\f[R], \f[C]mods\f[R], \f[C]nbib\f[R], and \f[C]json\f[R]. .TP .B \f[C]-c\f[R] \f[I]NUMBER\f[R], \f[C]--columns=\f[R]\f[I]NUMBER\f[R] Specify column to which to wrap YAML output produced using \f[C]--bib2yaml\f[R]. Default is 80. To disable wrapping, set 0. .TP .B \f[C]-h, --help\f[R] Print usage information. .TP .B \f[C]--man\f[R] Print the man page in groff man format. To get a plain text version, \f[C]pandoc-citeproc --man | groff -mman -Tutf8\f[R]. To get an HTML version, \f[C]pandoc-citeproc --man | groff -mman -Thtml\f[R]. .TP .B \f[C]--license\f[R] Print the license. .TP .B \f[C]-q, --quiet\f[R] Silence all warnings. .TP .B \f[C]-V, --version\f[R] Print version. .SH NOTES .SS General .PP If you use a biblatex database, closely follow the specifications in the \[lq]Database Guide\[rq] section of the biblatex manual (currently 2.8a). .PP If you use a CSL-YAML or CSL-JSON database, or a CSL-YAML metadata section in your markdown document, follow the \[lq]Citation Style Language 1.0.1 Language Specification\[rq] (). Particularly relevant are (which neither comments on usage nor specifies required and optional fields) and (which does contain comments). .SS Titles: Title vs.\ Sentence Case .PP If you are using a bibtex or biblatex bibliography, then observe the following rules: .IP \[bu] 2 English titles should be in title case. Non-English titles should be in sentence case, and the \f[C]langid\f[R] field in biblatex should be set to the relevant language. (The following values are treated as English: \f[C]american\f[R], \f[C]british\f[R], \f[C]canadian\f[R], \f[C]english\f[R], \f[C]australian\f[R], \f[C]newzealand\f[R], \f[C]USenglish\f[R], or \f[C]UKenglish\f[R].) .IP \[bu] 2 As is standard with bibtex/biblatex, proper names should be protected with curly braces so that they won\[cq]t be lowercased in styles that call for sentence case. For example: .RS 2 .IP .nf \f[C] title = {My Dinner with {Andre}} \f[R] .fi .RE .IP \[bu] 2 In addition, words that should remain lowercase (or camelCase) should be protected: .RS 2 .IP .nf \f[C] title = {Spin Wave Dispersion on the {nm} Scale} \f[R] .fi .PP Though this is not necessary in bibtex/biblatex, it is necessary with citeproc, which stores titles internally in sentence case, and converts to title case in styles that require it. Here we protect \[lq]nm\[rq] so that it doesn\[cq]t get converted to \[lq]Nm\[rq] at this stage. .RE .PP If you are using a CSL bibliography (either JSON or YAML), then observe the following rules: .IP \[bu] 2 All titles should be in sentence case. .IP \[bu] 2 Use the \f[C]language\f[R] field for non-English titles to prevent their conversion to title case in styles that call for this. (Conversion happens only if \f[C]language\f[R] begins with \f[C]en\f[R] or is left empty.) .IP \[bu] 2 Protect words that should not be converted to title case using this syntax: .RS 2 .IP .nf \f[C] Spin wave dispersion on the nm scale \f[R] .fi .RE .SS Conference Papers, Published vs.\ Unpublished .PP For a formally published conference paper, use the biblatex entry type \f[C]inproceedings\f[R] (which will be mapped to CSL \f[C]paper-conference\f[R]). .PP For an unpublished manuscript, use the biblatex entry type \f[C]unpublished\f[R] without an \f[C]eventtitle\f[R] field (this entry type will be mapped to CSL \f[C]manuscript\f[R]). .PP For a talk, an unpublished conference paper, or a poster presentation, use the biblatex entry type \f[C]unpublished\f[R] with an \f[C]eventtitle\f[R] field (this entry type will be mapped to CSL \f[C]speech\f[R]). Use the biblatex \f[C]type\f[R] field to indicate the type, e.g.\ \[lq]Paper\[rq], or \[lq]Poster\[rq]. \f[C]venue\f[R] and \f[C]eventdate\f[R] may be useful too, though \f[C]eventdate\f[R] will not be rendered by most CSL styles. Note that \f[C]venue\f[R] is for the event\[cq]s venue, unlike \f[C]location\f[R] which describes the publisher\[cq]s location; do not use the latter for an unpublished conference paper. .SH AUTHORS .PP Andrea Rossato and John MacFarlane. .SH SEE ALSO .PP \f[C]pandoc\f[R] (1). .PP The pandoc-citeproc source code and all documentation may be downloaded from .