File: oc-csl.el.html
This library registers the csl citation processor, which provides
the "export" capability for citations.
The processor relies on the external Citeproc Emacs library, which must be available prior to loading this library.
By default, citations are rendered in Chicago author-date CSL style. You can
use another style file by specifying it in org-cite-export-processors or
from within the document by adding the file name to "cite_export" keyword
#+cite_export: csl /path/to/style-file.csl
#+cite_export: csl "/path/to/style-file.csl"
With the variable org-cite-csl-styles-dir set appropriately, the
above can even be shortened to
#+cite_export: csl style-file.csl
Styles can be downloaded, for instance, from the Zotero Style Repository
(<https://www.zotero.org/styles>). Dependent styles (which are not "unique"
in the Zotero Style Repository terminology) are not supported.
The processor uses the "en-US" CSL locale file shipped with Org for rendering
localized dates and terms in the references, independently of the language
settings of the Org document. Additional CSL locales can be made available
by setting org-cite-csl-locales-dir to a directory containing the locale
files in question (see <https://github.com/citation-style-language/locales>
for such files).
Bibliography is defined with the "bibliography" keyword. It supports files with ".bib", ".bibtex", and ".json" extensions. References are exported using the "print_bibliography" keyword.
The library supports the following citation styles:
- author (a), including bare (b), caps (c), bare-caps (bc), full (f),
caps-full (cf), and bare-caps-full (bcf) variants,
- noauthor (na), including bare (b), caps (c) and bare-caps (bc) variants,
- nocite (n),
- year (y), including a bare (b) variant,
- text (t), including caps (c), full (f), and caps-full (cf) variants,
- title (ti), including a bare (b) variant,
- locators (l), including a bare (b) variant,
- bibentry (b), including a bare (b) variant,
- default style, including bare (b), caps (c) and bare-caps (bc) variants.
Using "*" as a key in a nocite citation includes all available items in the printed bibliography. The "bibentry" citation style, similarly to biblatex's \fullcite, creates a citation which is similar to the bibliography entry.
CSL styles recognize "locator" in citation references' suffix. For example, in the citation
[cite:see @Tarski-1965 chapter 1, for an example]
"chapter 1" is the locator. The whole citation is rendered as
(see Tarski 1965, chap. 1 for an example)
in the default CSL style.
The locator starts with a locator term, among "bk.", "bks.", "book", "chap.",
"chaps.", "chapter", "col.", "cols.", "column", "figure", "fig.", "figs.",
"folio", "fol.", "fols.", "number", "no.", "nos.", "line", "l.", "ll.",
"note", "n.", "nn.", "opus", "op.", "opp.", "page", "p.", "pp.", "paragraph",
"para.", "paras.", "¶", "¶¶", "§", "§§", "part", "pt.", "pts.", "section",
"sec.", "secs.", "sub verbo", "s.v.", "s.vv.", "verse", "v.", "vv.",
"volume", "vol.", and "vols.". It ends with the last comma or digit in the
suffix, whichever comes last, or runs till the end of the suffix.
The part of the suffix before the locator is appended to reference's prefix. If no locator term is used, but a number is present, then "page" is assumed.
Filtered sub-bibliographies can be printed by passing filtering options to the "print_bibliography" keywords. E.g.,
#+print_bibliography: :type book keyword: emacs
If you need to use a key multiple times, you can separate its values with commas, but without any space in-between:
#+print_bibliography: :keyword abc,xyz :type article
This library was heavily inspired by and borrows from András Simonyi's Citeproc Org (<https://github.com/andras-simonyi/citeproc-org>) library. Many thanks to him!
Defined variables (15)
org-cite-csl--etc-dir | Directory containing CSL-related data files. |
org-cite-csl--fallback-locales-dir | Fallback CSL locale files directory. |
org-cite-csl--fallback-style-file | Default CSL style file, or nil. |
org-cite-csl--label-alist | Alist mapping locator names to locators. |
org-cite-csl--label-regexp | Regexp matching a label in a citation reference suffix. |
org-cite-csl-html-hanging-indent | Size of hanging-indent for HTML output in valid CSS units. |
org-cite-csl-html-label-width-per-char | Character width in CSS units for calculating entry label widths. |
org-cite-csl-latex-hanging-indent | Size of hanging-indent for LaTeX output in valid LaTeX units. |
org-cite-csl-latex-label-separator | Distance between citation label and bibliography item for LaTeX output. |
org-cite-csl-latex-label-width-per-char | Character width in LaTeX units for calculating entry label widths. |
org-cite-csl-latex-preamble | LaTeX preamble content inserted by the ‘csl’ citation processor. |
org-cite-csl-link-cites | When non-nil, link cites to references. |
org-cite-csl-locales-dir | Directory of CSL locale files. |
org-cite-csl-no-citelinks-backends | List of export backends for which cite linking is disabled. |
org-cite-csl-styles-dir | Directory of CSL style files. |
Defined functions (18)
org-cite-csl--bibliography-filter | (BIB-PROPS) |
org-cite-csl--create-structure | (CITATION INFO) |
org-cite-csl--create-structure-params | (CITATION INFO) |
org-cite-csl--generate-latex-preamble | (INFO) |
org-cite-csl--locale-getter | () |
org-cite-csl--no-citelinks-p | (INFO) |
org-cite-csl--nocite-p | (CITATION INFO) |
org-cite-csl--note-style-p | (INFO) |
org-cite-csl--output-format | (INFO) |
org-cite-csl--parse-reference | (REFERENCE INFO) |
org-cite-csl--processor | (INFO) |
org-cite-csl--rendered-bibliographies | (INFO) |
org-cite-csl--rendered-citations | (INFO) |
org-cite-csl--style-cite-superscript-p | (INFO) |
org-cite-csl--style-file | (INFO) |
org-cite-csl-finalizer | (OUTPUT KEYS FILES STYLE BACKEND INFO) |
org-cite-csl-render-bibliography | (KEYS FILES STYLE PROPS BACKEND INFO) |
org-cite-csl-render-citation | (CITATION STYLE BACKEND INFO) |