diff --git a/AUTHORS.md b/AUTHORS.md
--- a/AUTHORS.md
+++ b/AUTHORS.md
@@ -31,6 +31,7 @@
 - Beni Cherniavsky-Paskin
 - Benoit Schweblin
 - Bjorn Buckwalter
+- Blake Eryx
 - Bradley Kuhn
 - Brent Yorgey
 - Brian Leung
@@ -62,7 +63,9 @@
 - Denis Laxalde
 - Denis Maier
 - Derek Chen-Becker
+- Diego Balseiro
 - Dmitry Pogodin
+- Dmitry Volodin
 - Douglas Calvert
 - Eigil Rischel
 - Emanuel Evans
@@ -150,6 +153,7 @@
 - Lars-Dominik Braun
 - Laurent P. René de Cotret
 - Leif Metcalf
+- Leonard Rosenthol
 - Lila
 - Lucas Escot
 - Luke Plant
@@ -173,6 +177,7 @@
 - Merijn Verstraaten
 - Michael Beaumont
 - Michael Chladek
+- Michael Hoffmann
 - Michael Peyton Jones
 - Michael Reed
 - Michael Snoyman
@@ -257,7 +262,9 @@
 - Yoan Blanc
 - Yuchen Pei
 - Zihang Chen
+- a-vrma
 - andrebauer
+- argent0
 - blmage
 - bucklereed
 - bumper314
@@ -285,6 +292,7 @@
 - shreevatsa.public
 - takahashim
 - tgkokk
+- the-solipsist
 - thsutton
 - vijayphoenix
 - wiefling
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -10,7 +10,7 @@
 Found a bug?
 ------------
 
-Bug reports are welcome!  Please report all bugs on pandoc's github
+Bug reports are welcome!  Please report all bugs on pandoc's GitHub
 [issue tracker].
 
 Before you submit a bug report, search the [open issues] *and* [closed issues]
@@ -21,7 +21,7 @@
 version] of pandoc---or, even better, the development version,
 since the bug may have been fixed since the last release.
 [Nightly builds] are available, so you don't need to compile
-from source to test againt the development version.
+from source to test against the development version.
 (To fetch a nightly, visit the link, click the topmost "Nightly"
 in the table, then choose your platform under "Artifacts."  Note
 that you must be logged in with a GitHub account.)
@@ -152,7 +152,7 @@
 
 10. We aim for compatibility with ghc versions from 8.0 to the
     latest release.  All pull requests and commits are tested
-    automatically on CircleCI.
+    automatically on GitHub Actions.
 
 Tests
 -----
@@ -280,7 +280,7 @@
 --------
 
 Pandoc has a publicly accessible git repository on
-github: <http://github.com/jgm/pandoc>.  To get a local copy of the source:
+GitHub: <http://github.com/jgm/pandoc>.  To get a local copy of the source:
 
     git clone https://github.com/jgm/pandoc.git
 
@@ -374,4 +374,3 @@
 [status:more-discussion-needed]: https://github.com/jgm/pandoc/labels/status:more-discussion-needed
 [status:more-info-needed]: https://github.com/jgm/pandoc/labels/status:more-info-needed
 [stack]: https://github.com/commercialhaskell/stack
-
diff --git a/MANUAL.txt b/MANUAL.txt
--- a/MANUAL.txt
+++ b/MANUAL.txt
@@ -143,15 +143,15 @@
 [`ulem`], [`geometry`] (with the `geometry` variable set),
 [`setspace`] (with `linestretch`), and
 [`babel`] (with `lang`).  The use of `xelatex` or `lualatex` as
-the PDF engine requires [`fontspec`].  `xelatex` uses
-[`polyglossia`] (with `lang`), [`xecjk`], and [`bidi`] (with the
-`dir` variable set). If the `mathspec` variable is set,
-`xelatex` will use [`mathspec`] instead of [`unicode-math`].
-The [`upquote`] and [`microtype`] packages are used if
-available, and [`csquotes`] will be used for [typography]
-if the `csquotes` variable or metadata field is set to a
-true value.  The [`natbib`], [`biblatex`], [`bibtex`], and
-[`biber`] packages can optionally be used for [citation
+the PDF engine requires [`fontspec`].  `lualatex` uses
+[`selnolig`]. `xelatex` uses [`polyglossia`] (with `lang`),
+[`xecjk`], and [`bidi`] (with the `dir` variable set). If the
+`mathspec` variable is set, `xelatex` will use [`mathspec`]
+instead of [`unicode-math`].  The [`upquote`] and [`microtype`]
+packages are used if available, and [`csquotes`] will be used
+for [typography] if the `csquotes` variable or metadata field is
+set to a true value.  The [`natbib`], [`biblatex`], [`bibtex`],
+and [`biber`] packages can optionally be used for [citation
 rendering].  The following packages will be used to improve
 output quality if present, but pandoc does not require them to
 be present: [`upquote`] (for straight quotes in verbatim
@@ -200,6 +200,7 @@
 [`xcolor`]: https://ctan.org/pkg/xcolor
 [`xecjk`]: https://ctan.org/pkg/xecjk
 [`xurl`]: https://ctan.org/pkg/xurl
+[`selnolig`]: https://ctan.org/pkg/selnolig
 
 
 
@@ -225,9 +226,12 @@
 :   Specify input format.  *FORMAT* can be:
 
     ::: {#input-formats}
+    - `bibtex` ([BibTeX] bibliography)
+    - `biblatex` ([BibLaTeX] bibliography)
     - `commonmark` ([CommonMark] Markdown)
     - `commonmark_x` ([CommonMark] Markdown with extensions)
     - `creole` ([Creole 1.0])
+    - `csljson` ([CSL JSON] bibliography)
     - `csv` ([CSV] table)
     - `docbook` ([DocBook])
     - `docx` ([Word docx])
@@ -280,6 +284,7 @@
     - `commonmark` ([CommonMark] Markdown)
     - `commonmark_x` ([CommonMark] Markdown with extensions)
     - `context` ([ConTeXt])
+    - `csljson` ([CSL JSON] bibliography)
     - `docbook` or `docbook4` ([DocBook] 4)
     - `docbook5` (DocBook 5)
     - `docx` ([Word docx])
@@ -491,6 +496,9 @@
 [Muse]: https://amusewiki.org/library/manual
 [PowerPoint]: https://en.wikipedia.org/wiki/Microsoft_PowerPoint
 [Vimwiki]: https://vimwiki.github.io
+[CSL JSON]: https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html
+[BibTeX]: https://ctan.org/pkg/bibtex
+[BibLaTeX]: https://ctan.org/pkg/biblatex
 
 ## Reader options {.options}
 
@@ -1292,41 +1300,62 @@
 
 ## Citation rendering {.options}
 
+`-C`, `--citeproc`
+
+:   Process the citations in the file, replacing them with
+    rendered citations and adding a bibliography.
+    Citation processing will not take place unless bibliographic
+    data is supplied, either through an external file specified
+    using the `--bibliography` option or the `bibliography`
+    field in metadata, or via a `references` section in metadata
+    containing a list of citations in CSL YAML format with
+    Markdown formatting.  The style is controlled by a [CSL]
+    stylesheet specified using the `--csl` option or the `csl`
+    field in metadata. (If no stylesheet is specified,
+    the `chicago-author-date` style will be used by default.)
+    The citation processing transformation may be applied before
+    or after filters or Lua filters (see `--filter`,
+    `--lua-filter`): these transformations are applied in the
+    order they appear on the command line.  For more
+    information, see the section on [Citations].
+
 `--bibliography=`*FILE*
 
 :   Set the `bibliography` field in the document's metadata to *FILE*,
-    overriding any value set in the metadata, and process citations
-    using `pandoc-citeproc`. (This is equivalent to
-    `--metadata bibliography=FILE --filter pandoc-citeproc`.)
-    If `--natbib` or `--biblatex` is also supplied, `pandoc-citeproc` is not
-    used, making this equivalent to `--metadata bibliography=FILE`.
-    If you supply this argument multiple times, each *FILE* will be added
-    to bibliography.
+    overriding any value set in the metadata.  If you supply
+    this argument multiple times, each *FILE* will be added to
+    bibliography.
 
 `--csl=`*FILE*
 
 :   Set the `csl` field in the document's metadata to *FILE*,
     overriding any value set in the metadata.  (This is equivalent to
-    `--metadata csl=FILE`.)
-    This option is only relevant with `pandoc-citeproc`.
+    `--metadata csl=FILE`.)  If *FILE* is a URL, it will be
+    fetched via HTTP.  If *FILE* is not found relative to the
+    working directory, it will be sought in the resource path
+    and finally in the `csl` subdirectory of the
+    pandoc user data directory.
 
 `--citation-abbreviations=`*FILE*
 
 :   Set the `citation-abbreviations` field in the document's metadata to
     *FILE*, overriding any value set in the metadata.  (This is equivalent to
     `--metadata citation-abbreviations=FILE`.)
-    This option is only relevant with `pandoc-citeproc`.
+    If *FILE* is a URL, it will be fetched via HTTP.  If *FILE* is not
+    found relative to the working directory, it will be sought
+    in the resource path and finally in the `csl` subdirectory
+    of the pandoc user data directory.
 
 `--natbib`
 
 :   Use [`natbib`] for citations in LaTeX output.  This option is not for use
-    with the `pandoc-citeproc` filter or with PDF output.  It is intended for
+    with the `--citeproc` option or with PDF output.  It is intended for
     use in producing a LaTeX file that can be processed with [`bibtex`].
 
 `--biblatex`
 
 :   Use [`biblatex`] for citations in LaTeX output.  This option is not for use
-    with the `pandoc-citeproc` filter or with PDF output. It is intended for
+    with the `--citeproc` option or with PDF output. It is intended for
     use in producing a LaTeX file that can be processed with [`bibtex`] or [`biber`].
 
 ## Math rendering in HTML {.options}
@@ -1427,6 +1456,7 @@
    21 PandocUnknownReaderError
    22 PandocUnknownWriterError
    23 PandocUnsupportedExtensionError
+   24 PandocCiteprocError
    31 PandocEpubSubdirectoryError
    43 PandocPDFError
    47 PandocPDFProgramNotFoundError
@@ -1492,11 +1522,23 @@
 include-in-header: []
 resource-path: ["."]
 
-# filters will be assumed to be Lua filters if they have
+# turn on built-in citation processing.  Note that if you need
+# control over when the citeproc processing is done relative
+# to other filters, you should instead use `citeproc` in the
+# list of `filters` (see below).
+citeproc: true
+csl: ieee
+bibliography:
+- foobar.bib
+- barbaz.json
+
+# Filters will be assumed to be Lua filters if they have
 # the .lua extension, and json filters otherwise.  But
-# the filter type can also be specified explicitly, as shown:
+# the filter type can also be specified explicitly, as shown.
+# Filters are run in the order specified.
+# To include the built-in citeproc filter, use either `citeproc`
+# or `{type: citeproc}`.
 filters:
-- pandoc-citeproc
 - wordcount.lua
 - type: json
   path: foo.lua
@@ -2142,6 +2184,43 @@
 [Unicode Bidirectional Algorithm]: https://www.w3.org/International/articles/inline-bidi-markup/uba-basics
 [Language subtag lookup]: https://r12a.github.io/app-subtags/
 
+### Variables for HTML
+
+`document-css`
+:   Enables inclusion of most of the CSS in the `styles.html`
+    [partial](#partials) (have a look with
+    `pandoc --print-default-data-file=templates/styles.html`).
+    Unless you use [`--css`](#option--css), this variable
+    is set to `true` by default. You can disable it with
+    e.g. `pandoc -M document-css=false`.
+
+`mainfont`
+:   sets the CSS `font-family` property on the `html` element.
+
+`fontsize`
+:   sets the base CSS `font-size`, which you'd usually set
+    to e.g. `20px`, but it also accepts `pt`
+    (12pt = 16px in most browsers).
+
+`fontcolor`
+:   sets the CSS `color` property on the `html` element.
+
+`linkcolor`
+:   sets the CSS `color` property on all links.
+
+`monofont`
+:   sets the CSS `font-family` property on `code` elements.
+
+`linestretch`
+:   sets the CSS `line-height` property on the `html` element,
+    which is preferred to be unitless.
+
+`backgroundcolor`
+:   sets the CSS `background-color` property on the `html` element.
+
+`margin-left`, `margin-right`, `margin-top`, `margin-bottom`
+:   sets the corresponding CSS `padding` properties on the `body` element.
+
 ### Variables for HTML math
 
 `classoption`
@@ -2894,7 +2973,7 @@
 output formats
 :  `odt`, `opendocument`
 
-#### Extension: `styles` {#ext-styles} ####
+#### Extension: `styles` #### {#ext-styles}
 
 When converting from docx, read all docx styles as divs (for
 paragraph styles) and spans (for character styles) regardless
@@ -3565,31 +3644,7 @@
 labels tend to be long, and indenting content to the
 first non-space character after the label would be awkward.
 
-### Compact and loose lists ###
 
-Pandoc behaves differently from `Markdown.pl` on some "edge
-cases" involving lists.  Consider this source:
-
-    +   First
-    +   Second:
-        -   Fee
-        -   Fie
-        -   Foe
-
-    +   Third
-
-Pandoc transforms this into a "compact list" (with no `<p>` tags around
-"First", "Second", or "Third"), while Markdown puts `<p>` tags around
-"Second" and "Third" (but not "First"), because of the blank space
-around "Third". Pandoc follows a simple rule: if the text is followed by
-a blank line, it is treated as a paragraph. Since "Second" is followed
-by a list, and not a blank line, it isn't treated as a paragraph. The
-fact that the list is followed by a blank line is irrelevant. (Note:
-Pandoc works this way even when the `markdown_strict` format is specified. This
-behavior is consistent with the official Markdown syntax description,
-even though it is different from that of `Markdown.pl`.)
-
-
 ### Ending a list ###
 
 What if you want to put an indented code block after a list?
@@ -4725,118 +4780,17 @@
 
 Inline and regular footnotes may be mixed freely.
 
-## Citations
+## Citation syntax
 
 #### Extension: `citations` ####
 
-Using an external filter, `pandoc-citeproc`, pandoc can automatically generate
-citations and a bibliography in a number of styles.  Basic usage is
-
-    pandoc --filter pandoc-citeproc myinput.txt
-
-In order to use this feature, you will need to specify a bibliography file
-using the `bibliography` metadata field in a YAML metadata section, or
-`--bibliography` command line argument. You can supply multiple `--bibliography`
-arguments or set `bibliography` metadata field to YAML array, if you want to
-use multiple bibliography files.  The bibliography may have any of these
-formats:
-
-  Format            File extension
-  ------------      --------------
-  BibLaTeX          .bib
-  BibTeX            .bibtex
-  Copac             .copac
-  CSL JSON          .json
-  CSL YAML          .yaml
-  EndNote           .enl
-  EndNote XML       .xml
-  ISI               .wos
-  MEDLINE           .medline
-  MODS              .mods
-  RIS               .ris
-
-Note that `.bib` can be used with both BibTeX and BibLaTeX files;
-use `.bibtex` to force BibTeX.
-
-Note that `pandoc-citeproc --bib2json` and `pandoc-citeproc --bib2yaml`
-can produce `.json` and `.yaml` files from any of the supported formats.
-
-In-field markup: In BibTeX and BibLaTeX databases,
-pandoc-citeproc parses a subset of LaTeX markup; in CSL YAML
-databases, pandoc Markdown; and in CSL JSON databases, an
-[HTML-like markup][CSL markup specs]:
-
-`<i>...</i>`
-:   italics
-
-`<b>...</b>`
-:   bold
-
-`<span style="font-variant:small-caps;">...</span>` or `<sc>...</sc>`
-:   small capitals
-
-`<sub>...</sub>`
-:   subscript
-
-`<sup>...</sup>`
-:   superscript
-
-`<span class="nocase">...</span>`
-:   prevent a phrase from being capitalized as title case
-
-`pandoc-citeproc -j` and `-y` interconvert the CSL JSON
-and CSL YAML formats as far as possible.
-
-As an alternative to specifying a bibliography file using `--bibliography`
-or the YAML metadata field `bibliography`, you can include
-the citation data directly in the `references` field of the
-document's YAML metadata. The field should contain an array of
-YAML-encoded references, for example:
-
-    ---
-    references:
-    - type: article-journal
-      id: WatsonCrick1953
-      author:
-      - family: Watson
-        given: J. D.
-      - family: Crick
-        given: F. H. C.
-      issued:
-        date-parts:
-        - - 1953
-          - 4
-          - 25
-      title: 'Molecular structure of nucleic acids: a structure for deoxyribose
-        nucleic acid'
-      title-short: Molecular structure of nucleic acids
-      container-title: Nature
-      volume: 171
-      issue: 4356
-      page: 737-738
-      DOI: 10.1038/171737a0
-      URL: https://www.nature.com/articles/171737a0
-      language: en-GB
-    ...
-
-(`pandoc-citeproc --bib2yaml` can produce these from a bibliography file in one
-of the supported formats.)
-
-Citations and references can be formatted using any style supported by the
-[Citation Style Language], listed in the [Zotero Style Repository].
-These files are specified using the `--csl` option or the `csl` metadata field.
-By default, `pandoc-citeproc` will use the [Chicago Manual of Style] author-date
-format.  The CSL project provides further information on [finding and editing styles].
-
-To make your citations hyperlinks to the corresponding bibliography
-entries, add `link-citations: true` to your YAML metadata.
-
-Citations go inside square brackets and are separated by semicolons.
-Each citation must have a key, composed of '@' + the citation
-identifier from the database, and may optionally have a prefix,
-a locator, and a suffix.  The citation key must begin with a letter, digit,
-or `_`, and may contain alphanumerics, `_`, and internal punctuation
-characters (`:.#$%&-+?<>~/`).  Here are some examples:
+Markdown citations go inside square brackets and are separated
+by semicolons.  Each citation must have a key, composed of '@' +
+the citation identifier from the database, and may optionally
+have a prefix, a locator, and a suffix.  The citation key must
+begin with a letter, digit, or `_`, and may contain
+alphanumerics, `_`, and internal punctuation characters
+(`:.#$%&-+?<>~/`).  Here are some examples:
 
     Blah blah [see @doe99, pp. 33-35; also @smith04, chap. 1].
 
@@ -4844,7 +4798,7 @@
 
     Blah blah [@smith04; @doe99].
 
-`pandoc-citeproc` detects locator terms in the [CSL locale files].
+`pandoc` detects locator terms in the [CSL locale files].
 Either abbreviated or unabbreviated forms are accepted. In the `en-US`
 locale, locator terms can be written in either singular or plural forms,
 as `book`, `bk.`/`bks.`; `chapter`, `chap.`/`chaps.`; `column`,
@@ -4855,9 +4809,9 @@
 `verse`, `v.`/`vv.`; `volume`, `vol.`/`vols.`; `¶`/`¶¶`; `§`/`§§`. If no
 locator term is used, "page" is assumed.
 
-`pandoc-citeproc` will use heuristics to distinguish the locator
+`pandoc` will use heuristics to distinguish the locator
 from the suffix. In complex cases, the locator can be enclosed
-in curly braces (using `pandoc-citeproc` 0.15 and higher only):
+in curly braces:
 
     [@smith{ii, A, D-Z}, with a suffix]
     [@smith, {pp. iv, vi-xi, (xv)-(xvii)} with suffix here]
@@ -4874,68 +4828,14 @@
 
     @smith04 [p. 33] says blah.
 
-If the style calls for a list of works cited, it will be placed
-in a div with id `refs`, if one exists:
 
-    ::: {#refs}
-    :::
-
-Otherwise, it will be placed at the end of the document.
-Generation of the bibliography can be suppressed by setting
-`suppress-bibliography: true` in the YAML metadata.
-
-If you wish the bibliography to have a section heading, you can
-set `reference-section-title` in the metadata, or put the heading
-at the beginning of the div with id `refs` (if you are using it)
-or at the end of your document:
-
-    last paragraph...
-
-    # References
-
-The bibliography will be inserted after this heading.  Note that
-the `unnumbered` class will be added to this heading, so that the
-section will not be numbered.
-
-If you want to include items in the bibliography without actually
-citing them in the body text, you can define a dummy `nocite` metadata
-field and put the citations there:
-
-    ---
-    nocite: |
-      @item1, @item2
-    ...
-
-    @item3
-
-In this example, the document will contain a citation for `item3`
-only, but the bibliography will contain entries for `item1`, `item2`, and
-`item3`.
-
-It is possible to create a bibliography with all the citations,
-whether or not they appear in the document, by using a wildcard:
-
-    ---
-    nocite: |
-      @*
-    ...
-
-For LaTeX output, you can also use [`natbib`] or [`biblatex`] to
-render the bibliography. In order to do so, specify bibliography
-files as outlined above, and add `--natbib` or `--biblatex`
-argument to `pandoc` invocation. Bear in mind that bibliography
-files have to be in respective format (either BibTeX or
-BibLaTeX).
-
-For more information, see the [pandoc-citeproc man page].
-
+[CSL]: https://docs.citationstyles.org/en/stable/specification.html
 [CSL markup specs]: https://docs.citationstyles.org/en/1.0/release-notes.html#rich-text-markup-within-fields
 [Chicago Manual of Style]: https://chicagomanualofstyle.org
 [Citation Style Language]: https://citationstyles.org
 [Zotero Style Repository]: https://www.zotero.org/styles
 [finding and editing styles]: https://citationstyles.org/authors/
 [CSL locale files]: https://github.com/citation-style-language/locales
-[pandoc-citeproc man page]: https://github.com/jgm/pandoc-citeproc/blob/master/man/pandoc-citeproc.1.md
 
 ## Non-pandoc extensions
 
@@ -5135,55 +5035,332 @@
 In addition to pandoc's extended Markdown, the following Markdown
 variants are supported:
 
-`markdown_phpextra` (PHP Markdown Extra)
-:   `footnotes`, `pipe_tables`, `raw_html`, `markdown_attribute`,
-    `fenced_code_blocks`, `definition_lists`, `intraword_underscores`,
-    `header_attributes`, `link_attributes`, `abbreviations`,
-    `shortcut_reference_links`, `spaced_reference_links`.
+- `markdown_phpextra` (PHP Markdown Extra)
+- `markdown_github` (deprecated GitHub-Flavored Markdown)
+- `markdown_mmd` (MultiMarkdown)
+- `markdown_strict` (Markdown.pl)
+- `commonmark` (CommonMark)
+- `gfm` (Github-Flavored Markdown)
+- `commonmark_x` (CommonMark with many pandoc extensions)
 
-`markdown_github` (deprecated GitHub-Flavored Markdown)
-:   `pipe_tables`, `raw_html`, `fenced_code_blocks`, `auto_identifiers`,
-    `gfm_auto_identifiers`, `backtick_code_blocks`,
-    `autolink_bare_uris`, `space_in_atx_header`,
-    `intraword_underscores`, `strikeout`, `task_lists`, `emoji`,
-    `shortcut_reference_links`, `angle_brackets_escapable`,
-    `lists_without_preceding_blankline`.
+To see which extensions are supported for a given format,
+and which are enabled by default, you can use the command
 
-`markdown_mmd` (MultiMarkdown)
-:   `pipe_tables`, `raw_html`, `markdown_attribute`, `mmd_link_attributes`,
-    `tex_math_double_backslash`, `intraword_underscores`,
-    `mmd_title_block`, `footnotes`, `definition_lists`,
-    `all_symbols_escapable`, `implicit_header_references`,
-    `auto_identifiers`, `mmd_header_identifiers`,
-    `shortcut_reference_links`, `implicit_figures`,
-    `superscript`, `subscript`, `backtick_code_blocks`,
-    `spaced_reference_links`, `raw_attribute`.
+    pandoc --list-extensions=FORMAT
 
-`markdown_strict` (Markdown.pl)
-:   `raw_html`, `shortcut_reference_links`,
-    `spaced_reference_links`.
+where `FORMAT` is replaced with the name of the format.
 
-We also support `commonmark` and `gfm` (GitHub-Flavored Markdown,
-which is implemented as a set of extensions on `commonmark`).
+Note that the list of extensions for `commonmark`,
+`gfm`, and `commonmark_x` are defined relative to default
+commonmark.  So, for example, `backtick_code_blocks`
+does not appear as an extension, since it is enabled by
+default and cannot be disabled.
 
-Note, however, that `commonmark` and `gfm` have limited support
-for extensions. Only those  listed below (and `smart`,
-`raw_tex`, and `hard_line_breaks`) will work. The extensions
-can, however, all be individually disabled.  Also, `raw_tex`
-only affects `gfm` output, not input.
+# Citations
 
-`gfm` (GitHub-Flavored Markdown)
-:   `pipe_tables`, `raw_html`, `native_divs`,
-    `fenced_code_blocks`, `auto_identifiers`,
-    `gfm_auto_identifiers`, `backtick_code_blocks`,
-    `autolink_bare_uris`, `space_in_atx_header`,
-    `intraword_underscores`, `strikeout`, `task_lists`, `emoji`,
-    `shortcut_reference_links`, `angle_brackets_escapable`,
-    `lists_without_preceding_blankline`.
+When the `--citeproc` option is used, pandoc can automatically generate
+citations and a bibliography in a number of styles.  Basic usage is
 
+    pandoc --citeproc myinput.txt
 
-# Producing slide shows with pandoc
+To use this feature, you will need to have
 
+- a document containing citations (see [Extension: `citations`]);
+- a source of bibliographic data: either an external bibliography
+  file or a list of `references` in the document's YAML metadata
+- optionally, a [CSL] citation style.
+
+## Specifying bibliographic data
+
+You can specify an external bibliography using the
+`bibliography` metadata field in a YAML metadata section or the
+`--bibliography` command line argument. If you want to use
+multiple bibliography files, you can supply multiple
+`--bibliography` arguments or set `bibliography` metadata field
+to YAML array.  A bibliography may have any of these formats:
+
+  Format            File extension
+  ------------      --------------
+  BibLaTeX          .bib
+  BibTeX            .bibtex
+  CSL JSON          .json
+  CSL YAML          .yaml
+
+Note that `.bib` can be used with both BibTeX and BibLaTeX files;
+use the extension `.bibtex` to force interpretation as BibTeX.
+
+In BibTeX and BibLaTeX databases, pandoc parses LaTeX markup
+inside fields such as `title`; in CSL YAML databases, pandoc
+Markdown; and in CSL JSON databases, an [HTML-like markup][CSL
+markup specs]:
+
+`<i>...</i>`
+:   italics
+
+`<b>...</b>`
+:   bold
+
+`<span style="font-variant:small-caps;">...</span>` or `<sc>...</sc>`
+:   small capitals
+
+`<sub>...</sub>`
+:   subscript
+
+`<sup>...</sup>`
+:   superscript
+
+`<span class="nocase">...</span>`
+:   prevent a phrase from being capitalized as title case
+
+As an alternative to specifying a bibliography file using
+`--bibliography` or the YAML metadata field `bibliography`, you
+can include the citation data directly in the `references` field
+of the document's YAML metadata. The field should contain an
+array of YAML-encoded references, for example:
+
+    ---
+    references:
+    - type: article-journal
+      id: WatsonCrick1953
+      author:
+      - family: Watson
+        given: J. D.
+      - family: Crick
+        given: F. H. C.
+      issued:
+        date-parts:
+        - - 1953
+          - 4
+          - 25
+      title: 'Molecular structure of nucleic acids: a structure for
+        deoxyribose nucleic acid'
+      title-short: Molecular structure of nucleic acids
+      container-title: Nature
+      volume: 171
+      issue: 4356
+      page: 737-738
+      DOI: 10.1038/171737a0
+      URL: https://www.nature.com/articles/171737a0
+      language: en-GB
+    ...
+
+Note that `pandoc` can be used to produce such a YAML metadata
+section from a BibTeX, BibLaTeX, or CSL JSON bibliography:
+
+    pandoc chem.bib -s -t markdown
+    pandoc chem.json -s -t markdown
+
+`pandoc` can also be used to produce CSL JSON bibliography
+from BibTeX, BibLaTeX, or markdown YAML:
+
+    pandoc chem.bib -s -t csljson
+    pandoc chem.yaml -s -t csljson
+
+Running pandoc on a bibliography file with the `--citeproc`
+option will create a formatted bibliography in the format
+of your choice:
+
+    pandoc chem.bib -s --citeproc -o chem.html
+    pandoc chem.bib -s --citeproc -o chem.pdf
+
+### Capitalization in titles
+
+If you are using a bibtex or biblatex bibliography, then observe
+the following rules:
+
+  - English titles should be in title case.  Non-English titles should
+    be in sentence case, and the `langid` field in biblatex should be
+    set to the relevant language.  (The following values are treated
+    as English:  `american`, `british`, `canadian`, `english`,
+    `australian`, `newzealand`, `USenglish`, or `UKenglish`.)
+
+  - As is standard with bibtex/biblatex, proper names should be
+    protected with curly braces so that they won't be lowercased
+    in styles that call for sentence case.  For example:
+
+        title = {My Dinner with {Andre}}
+
+  - In addition, words that should remain lowercase (or camelCase)
+    should be protected:
+
+        title = {Spin Wave Dispersion on the {nm} Scale}
+
+    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 "nm" so that it doesn't get converted to "Nm" at this stage.
+
+If you are using a CSL bibliography (either JSON or YAML), then observe
+the following rules:
+
+  - All titles should be in sentence case.
+
+  - Use the `language` field for non-English titles to prevent their
+    conversion to title case in styles that call for this. (Conversion
+    happens only if `language` begins with `en` or is left empty.)
+
+  - Protect words that should not be converted to title case using
+    this syntax:
+
+        Spin wave dispersion on the <span class="nocase">nm</span> scale
+
+### Conference Papers, Published vs. Unpublished
+
+For a formally published conference paper, use the biblatex entry type
+`inproceedings` (which will be mapped to CSL `paper-conference`).
+
+For an unpublished manuscript, use the biblatex entry type
+`unpublished` without an `eventtitle` field (this entry type
+will be mapped to CSL `manuscript`).
+
+For a talk, an unpublished conference paper, or a poster
+presentation, use the biblatex entry type `unpublished` with an
+`eventtitle` field (this entry type will be mapped to CSL
+`speech`). Use the biblatex `type` field to indicate the type,
+e.g. "Paper", or "Poster". `venue` and `eventdate` may be useful
+too, though `eventdate` will not be rendered by most CSL styles.
+Note that `venue` is for the event's venue, unlike `location`
+which describes the publisher's location; do not use the latter
+for an unpublished conference paper.
+
+
+## Specifying a citation style
+
+Citations and references can be formatted using any style supported by the
+[Citation Style Language], listed in the [Zotero Style Repository].
+These files are specified using the `--csl` option or the `csl`
+(or `citation-style`) metadata field.  By default, pandoc will
+use the [Chicago Manual of Style] author-date format.  (You can
+override this default by copying a CSL style of your choice
+to `default.csl` in your user data directory.)
+The CSL project provides further information on [finding and
+editing styles].
+
+The `--citation-abbreviations` option (or the
+`citation-abbreviations` metadata field) may be used to
+specify a JSON file containing abbreviations of journals
+that should be used in formatted bibliographies when
+`form="short"` is specified.  The format of the file
+can be illustrated with an example:
+
+
+    { "default": {
+        "container-title": {
+                "Lloyd's Law Reports": "Lloyd's Rep",
+                "Estates Gazette": "EG",
+                "Scots Law Times": "SLT"
+        }
+      }
+    }
+
+## Raw content in a style
+
+To include raw content in a prefix, suffix, delimiter, or term,
+surround it with these tags indicating the format:
+
+    {{jats}}&lt;ref&gt;{{/jats}}
+
+Without the tags, the string will be interpreted as a string
+and escaped in the output, rather than being passed through raw.
+
+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.
+
+
+
+## Placement of the bibliography
+
+If the style calls for a list of works cited, it will be placed
+in a div with id `refs`, if one exists:
+
+    ::: {#refs}
+    :::
+
+Otherwise, it will be placed at the end of the document.
+Generation of the bibliography can be suppressed by setting
+`suppress-bibliography: true` in the YAML metadata.
+
+If you wish the bibliography to have a section heading, you can
+set `reference-section-title` in the metadata, or put the heading
+at the beginning of the div with id `refs` (if you are using it)
+or at the end of your document:
+
+    last paragraph...
+
+    # References
+
+The bibliography will be inserted after this heading.  Note that
+the `unnumbered` class will be added to this heading, so that the
+section will not be numbered.
+
+## Including uncited items in the bibliography
+
+If you want to include items in the bibliography without actually
+citing them in the body text, you can define a dummy `nocite` metadata
+field and put the citations there:
+
+    ---
+    nocite: |
+      @item1, @item2
+    ...
+
+    @item3
+
+In this example, the document will contain a citation for `item3`
+only, but the bibliography will contain entries for `item1`, `item2`, and
+`item3`.
+
+It is possible to create a bibliography with all the citations,
+whether or not they appear in the document, by using a wildcard:
+
+    ---
+    nocite: |
+      @*
+    ...
+
+For LaTeX output, you can also use [`natbib`] or [`biblatex`] to
+render the bibliography. In order to do so, specify bibliography
+files as outlined above, and add `--natbib` or `--biblatex`
+argument to `pandoc` invocation. Bear in mind that bibliography
+files have to be in either BibTeX (for `--natbib`)
+or BibLaTeX (for `--biblatex`) format.
+
+## Other relevant metadata fields
+
+A few other metadata fields affect bibliography formatting:
+
+`link-citation`
+:   If true, citations will be
+    hyperlinked to the corresponding bibliography entries
+    (for author-date and numerical styles only).
+
+`lang`
+:   The `lang` field will affect how the style is localized,
+    for example in the translation of labels and the use
+    of quotation marks.  (For backwards compatibility,
+    `locale` may be used instead of `lang`, but this use
+    is deprecated.)
+
+`notes-after-punctuation`
+:    If true (the default), pandoc will put footnote 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.
+
+
+
+
+
+
+
+
+# Slide shows
+
 You can use pandoc to produce an HTML + JavaScript slide presentation
 that can be viewed via a web browser.  There are five ways to do this,
 using [S5], [DZSlides], [Slidy], [Slideous], or [reveal.js].
@@ -5524,7 +5701,7 @@
 Slide 2 has a special image for its background, even though the heading has no content.
 ```
 
-# Creating EPUBs with pandoc
+# EPUBs
 
 ## EPUB Metadata
 
@@ -5665,7 +5842,6 @@
 seriespage                        frontmatter
 foreword                          frontmatter
 preface                           frontmatter
-seriespage                        frontmatter
 appendix                          backmatter
 colophon                          backmatter
 bibliography                      backmatter
@@ -5688,7 +5864,7 @@
       </source>
     </audio>
 
-# Creating Jupyter notebooks with pandoc
+# Jupyter notebooks
 
 When creating a [Jupyter notebook], pandoc will try to infer the
 notebook structure.  Code blocks with the class `code` will be
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -13,7 +13,6 @@
 [![homebrew](https://img.shields.io/homebrew/v/pandoc.svg)](http://brewformulas.org/Pandoc)
 [![stackage LTS
 package](http://stackage.org/package/pandoc/badge/lts)](http://stackage.org/lts/package/pandoc)
-[![CircleCI](https://circleci.com/gh/jgm/pandoc.svg?style=svg)](https://circleci.com/gh/jgm/pandoc)
 [![CI
 tests](https://github.com/jgm/pandoc/workflows/CI%20tests/badge.svg)](https://github.com/jgm/pandoc/actions)
 [![license](https://img.shields.io/badge/license-GPLv2+-lightgray.svg)](https://www.gnu.org/licenses/gpl.html)
@@ -29,10 +28,15 @@
 
 <div id="input-formats">
 
+-   `bibtex` ([BibTeX](https://ctan.org/pkg/bibtex) bibliography)
+-   `biblatex` ([BibLaTeX](https://ctan.org/pkg/biblatex) bibliography)
 -   `commonmark` ([CommonMark](https://commonmark.org) Markdown)
 -   `commonmark_x` ([CommonMark](https://commonmark.org) Markdown with
     extensions)
 -   `creole` ([Creole 1.0](http://www.wikicreole.org/wiki/Creole1.0))
+-   `csljson` ([CSL
+    JSON](https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html)
+    bibliography)
 -   `csv` ([CSV](https://tools.ietf.org/html/rfc4180) table)
 -   `docbook` ([DocBook](https://docbook.org))
 -   `docx` ([Word docx](https://en.wikipedia.org/wiki/Office_Open_XML))
@@ -97,6 +101,9 @@
 -   `commonmark_x` ([CommonMark](https://commonmark.org) Markdown with
     extensions)
 -   `context` ([ConTeXt](https://www.contextgarden.net/))
+-   `csljson` ([CSL
+    JSON](https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html)
+    bibliography)
 -   `docbook` or `docbook4` ([DocBook](https://docbook.org) 4)
 -   `docbook5` (DocBook 5)
 -   `docx` ([Word docx](https://en.wikipedia.org/wiki/Office_Open_XML))
diff --git a/benchmark/weigh-pandoc.hs b/benchmark/weigh-pandoc.hs
--- a/benchmark/weigh-pandoc.hs
+++ b/benchmark/weigh-pandoc.hs
@@ -42,7 +42,7 @@
 weighWriter doc name writer = func (name ++ " writer") writer doc
 
 weighReader :: Pandoc -> Text -> (Text -> Pandoc) -> Weigh ()
-weighReader doc name reader = do
+weighReader doc name reader =
   case lookup name writers of
        Just (TextWriter writer) ->
          let inp = either (error . show) id $ runPure $ writer def{ writerWrapText = WrapAuto} doc
diff --git a/cabal.project b/cabal.project
--- a/cabal.project
+++ b/cabal.project
@@ -3,17 +3,3 @@
 package pandoc
   flags: +embed_data_files -trypandoc
   ghc-options: -j +RTS -A64m -RTS
-
-package pandoc-citeproc
-  flags: +embed_data_files +bibutils -unicode_collation -test_citeproc -debug
-  ghc-options: -j +RTS -A64m -RTS
-
-source-repository-package
-    type: git
-    location: https://github.com/jgm/pandoc-citeproc
-    tag: 0.17.0.1
-
- source-repository-package
-     type: git
-     location: https://github.com/jgm/commonmark-hs
-     tag: 8d4442abc443ce0100cc87af797e7df9a72b9b9a
diff --git a/changelog.md b/changelog.md
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,393 @@
 # Revision history for pandoc
 
+## pandoc 2.11 (2020-10-11)
+
+  * Add `--citeproc` (`-C`) option to trigger built-in citation processing.
+    It is no longer necessary to use the external `pandoc-citeproc`
+    filter.  `--citeproc` behaves like a filter and can be positioned
+    relative to other filters as they appear on the command line.
+
+    The new built-in citation processing uses the citeproc library,
+    a reimplementation of CSL citation processing that fixes many
+    of the shortcomings of pandoc-citeproc.  In general, citation
+    processing should work much the same as it did with pandoc-citeproc,
+    but with greater fidelity to CSL styles and better performance.
+    (The tests from the pandoc-citeproc package have been carried
+    over to pandoc.) The following differences should be noted:
+
+    - At this point, only some of the writers (HTML, ms, LaTeX) properly
+      interpret CSL display styles.  You should get decent output in
+      all formats (at least as good as with pandoc-citeproc), but
+      indentation and block-alignment may not be right.
+
+    - pandoc-citeproc searches the `~/.csl` directory for `.csl`
+      styles.  Pandoc instead searches the `csl` subdirectory of
+      the pandoc user data directory (e.g., `~/.pandoc/csl` or
+      `~/.local/share/pandoc/csl`).  Users who already keep
+      CSL styles in `~/.csl` may find it convenient to add a
+      symlink.
+
+    - Some of the bibliography formats supported by pandoc-citeproc (via
+      hs-bibutils) are no longer supported:  Copac, EndNote,
+      ISI, MEDLINE, MODS, and RIS.  If you use one of these formats,
+      you may use the `bibutils` utility to convert to BibLaTeX.
+      We now support only BibTeX, BibLaTeX, CSL JSON,
+      and pandoc's YAML/Markdown analogue of CSL JSON.
+
+    - pandoc-citeproc would always retrieve the independent parent
+      of a dependent style by doing an HTTP request.  pandoc will
+      now first seek the independent parent locally (in the resource
+      path or in the `csl` subdirectory of the pandoc user data
+      directory) before resorting to HTTP.  In addition, you may
+      omit the `.csl` extension, e.g. `--csl zoology`.
+
+    - Using the `--bibliography` option (or including
+      `bibliography` in YAML metadata) no longer triggers
+      citation processing implicitly: one must always use the
+      `--citeproc` option if citation processing is wanted.
+
+  * Add `csljson` as and input and output format. This allows pandoc
+    to convert between `csljson` and other bibliography formats
+    (e.g. `-f csljson -t markdown -s` or `-f bibtex -t csljson`),
+    and to generate formatted versions of CSL JSON bibliographies
+    (e.g., `pandoc -f csljson --citeproc pl.json -o pl.pdf`).
+
+  * Added `bibtex`, `biblatex` as input formats.  This allows pandoc
+    to convert between BibLaTeX and BibTeX and other bibliography formats,
+    and to generated formatted versions of BibTeX/BibLaTeX bibliographies
+    (e.g., `pandoc -f biblatex --citeproc pl.bib -o pl.pdf`).
+
+  * Raise informative errors when YAML metadata parsing fails (#6730).
+    Previously the command would succeed, returning empty metadata,
+    with no errors or warnings.
+
+  * Sort languages in `--list-highlight-languages` output (#6718,
+    Albert Krewinkel).  Languages were previously sorted by their
+    long name, which leads to unexpected results).
+
+  * Add CSS to default HTML template (#6601, Mauro Bieg).  This
+    greatly improves the default typography in pandoc's HTML
+    output.  The CSS is sensitive to a number of variables
+    (e.g. `mainfont`, `fontsize`, `linestretch`): see the manual for
+    details. To restore the earlier, more spartan output, you can
+    disable this with `-M document-css=false`.
+
+  * Support `--toc-depth` option for ODT writer (#6696, niszet).
+
+  * Fix issues with Windows UNC paths with some options (#5127).
+
+  * Remove `fenced_code_blocks` and `backtick_code_blocks` from allowed
+    `commonmark` and `gfm` extensions.  These shouldn't really be counted
+    as extensions, because they can't be disabled in commonmark.
+    Adjust markdown writer to check for the commonmark variant in addition
+    to extensions.
+
+  * Add these extensions to `gfm` and `commonmark`:
+    `fenced_code_blocks`, `backtick_code_blocks`, `fenced_code_attributes`.
+    These can't really be disabled in the reader, but they need to be enabled
+    in the writer or we just get indented code.
+
+  * Make sure proper set of extensions is recognized for `commonmark_x`.
+
+  * Allow `gfm_auto_identifiers`, `ascii_identifiers` extensions for `docx`.
+
+  * Markdown reader:
+
+    + Add `Maybe FilePath` parameter to `yamlToMeta` [API change].
+    + Export `yamlToRefs` [API change], a version of `yamlToMeta`
+      specialized to references.
+    + Set `citationNoteNum` accurately in citations.
+    + Revise abbreviation support.  Don't insert a nonbreaking space after a
+      potential abbreviation if it comes right before a note or citation.
+      This causes problems for citeproc's moving of note citations.
+
+  * LaTeX reader:
+
+    + Support missing siunitx commands (#6658).
+    + Support `squared`, `cubed`, `tothe` in siunitx (#6657).
+    + Improved uncertainty handling in slunitx.
+    + Factored out siunitx stuff into separate unexposed module.
+    + Fix improper empty cell filtering (#6689, Christian Despres).
+    + Fix parsing of "show name" in `\newtheorem` (#6734).
+      Previously we were just treating it as a string and
+      ignoring  accents and formatting.
+    + Prevent wrong nesting of `\multirow` and `\multicolumn` table
+      cells (#6603, Laurent P. René de Cotret).
+    + Table cell parser not consuming spaces correctly (#6596,
+      Laurent P. René de Cotret).
+    + Change `SIRange` to `SIrange` (#6617, Emerson Harkin).
+    + Allow blank lines inside `\author` (#6324).
+
+  * DocBook reader:
+
+    + Don't squelch space at end of emphasis and other inline elements;
+      instead, move it outside the element (#6719).
+    + Implement table cell alignment (#6698, Nils Carlson).
+    + Implement column span support for tables (#6492, Nils Carlson).
+    + Update list of block level tags (#6610).
+
+
+  * JATS reader:
+
+    + Don't squelch space at end of emphasis and other inline elements;
+      instead, move it outside the element (#6719).
+
+  * RST reader:
+
+    + Apply `.. class::` directly to following Header rather than creating
+      a surrounding Div (#6699).
+
+  * Docx reader:
+
+    + Allow empty dates in comments and tracked changes (#6726, Diego
+      Balseiro).
+
+  * Markdown writer:
+
+    + Be less aggressive about using quotes for YAML values,
+      allowing e.g. a quotation mark or bracket as long as it's not at the
+      beginning of the line.
+    + Use double quotes for YAML metadata (#6727).
+    + Sort YAML metadata keys in Markdown output case-insensitive.
+
+
+  * Asciidoc writer:
+
+    + Support asciidoctor's block figures (#6538, argent0).
+
+  * LaTeX writer:
+
+    + Fix spacing issue with list in definition list.
+      When a list occurs at the beginning of a definition list definition,
+      it can start on the same line as the label, which looks bad.
+      Fix that by starting such lists with an `\item[]`.
+
+  * HTML writer:
+
+    + Support intermediate table headers (#5314, Albert Krewinkel).
+    + Support attributes on all table elements (Albert Krewinkel).
+    + Render table footers if present (#6314, Albert Krewinkel).
+    + Fix addition of `doc-biblioentry` role.
+    + Support colspans and rowspans in HTML tables (#6312, Albert Krewinkel).
+
+  * ICML writer:
+
+    + Support internal document links (#5541, Leonard Rosenthol).
+    + Changed default link state to invisible (#6676, Leonard Rosenthol).
+
+  * Docx writer:
+
+    + Better handle list items whose contents are lists (#5948, Michael
+      Hoffmann).  If the first element of a bulleted or ordered list is
+      another list, then that first item would previously disappear if the
+      target format is docx.
+    + Separate adjacent tables (#4315).  Word combines adjacent tables,
+      so to prevent this we insert an empty paragraph between two
+      adjacent tables.
+
+  * Org writer:
+
+    + Don't force blank line after headings (#6554).
+
+  * OpenDocument writer:
+
+    + Implement table cell alignment (#6700 Nils Carson, Mauro Bieg).
+    + New table cell support with row and column spans (#6682, Nils Carson).
+    + Syntax highlighting for inline code (#6711, niszet).
+
+  * Add Text.Pandoc.Citeproc module, exporting `processCitations`
+    [API change].  This depends on several other, unexported
+    modules under Text.Pandoc.Citeproc.
+
+  * Add module Text.Pandoc.Writers.CslJson, exporting `writeCslJson`.
+    [API change]
+
+  * Add module Text.Pandoc.Readers.CslJson, exporting `readCslJson`.
+    [API change]
+
+  * Add module Text.Pandoc.Readers.BibTeX, exporting `readBibTeX` and
+    `readBibLaTeX`. [API change]
+
+  * Text.Pandoc.Filter: Add `CiteprocFilter` constructor to Filter.
+    [API change] This runs the processCitations transformation.
+    We need to treat it like a filter so it can be placed
+    in the sequence of filter runs (after some, before others).
+    In FromYAML, this is parsed from `citeproc` or `{type: citeproc}`,
+    so this special filter may be specified either way in a defaults file
+    (or by `citeproc: true`, though this gives no control of positioning
+    relative to other filters).
+
+  * Add new exported module Text.Pandoc.Writers.AnnotatedTable [API change]
+    (#6655, Christian Despres).  This module (which should generally
+    be imported qualified to avoid name conflicts) provides a
+    `Table` type that mirrors the structure of a pandoc `Table`,
+    but with added inferred information so that the writers do not have to
+    lay out tables themselves. The `toTable` and `fromTable` functions convert
+    between an annotated `Table` and a regular pandoc `Table`. In addition to
+    producing a `Table` with coherent and well-formed annotations, the
+    `toTable` function also normalizes its input table like the table
+    builder does.  Tests ensure that `toTable` normalizes tables exactly
+    like the table builder, and that its annotations are coherent.
+
+  * Text.Pandoc.Logging:
+
+    + Remove unused `CouldNotParseYamlMetadata` constructor for `LogMessage`
+      [API change].
+    + Add `CiteprocWarning` constructor to `LogMessage` [API change].
+
+  * Text.Pandoc.Readers.Metadata: export `yamlBsToRefs` [API change].
+    These allow specifying an id filter so we parse only references
+    that are used in the document.
+
+  * Text.Pandoc.Parsing:
+
+    + Export ParseError [API change].
+    + Add `stateInNote` and `stateNoteNumber` to `ParserState`
+      [API change].  These are used to populate note numbers for citation
+      processing.
+
+  * Fix apparent typos in sample.lua (#6729, William Lupton).
+    Also make the writer less aggressive in escaping quotes.
+
+  * Text.Pandoc.Options:
+
+    + `defaultMathJaxURL`: use `tex-chtml-full` instead of `tex-mml-chtml`
+      (#6599, Kolen Cheung).  This drops the MathML support (which we
+      don't need for HTML math rendering) and includes the full JavaScript,
+      which makes it possible to use `--self-contained` (though there may
+      still be issues if the required math fonts aren't available).  This
+      change should also reduce latency in pages with lots of formulas.
+    + Add `/tex-chtml-full.js` to `defaultMathJaxURL` (#6593) Previously we
+      added this in processing command line options, but not in processing
+      defaults files, which was inconsistent.
+
+  * epub.css: Fix cover page selectors and add note explaining their use
+    (#6649, a-vrma).
+
+  * Add data files needed for Text.Pandoc.Citeproc:  these include
+    `default.csl` in the data directory and a `citeproc` directory that
+    is only used at compile-time for biblatex localizations.  Note that we've
+    added `file-embed` as a mandatory rather than a conditional depedency,
+    because of the biblatex localization files.
+
+  * Lua filters:
+
+    + Add SimpleTable for backwards compatibility (#6575, Albert Krewinkel).
+      A new type `SimpleTable` is made available to Lua filters. It is
+      similar to the `Table` type in pandoc versions before 2.10;
+      conversion functions from and to the new Table type are provided.
+      Old filters using tables now require minimal changes and can use, e.g.,
+
+          if PANDOC_VERSION > {2,10,1} then
+            pandoc.Table = pandoc.SimpleTable
+          end
+
+      and
+
+          function Table (tbl)
+            tbl = pandoc.utils.to_simple_table(tbl)
+            …
+            return pandoc.utils.from_simple_table(tbl)
+          end
+
+      to work with the current pandoc version.
+
+    + Make `attr` argument optional in `Table` constructor (Albert Krewinkel).
+      This changes the Lua API. It is highly unlikely for this change to affect
+      existing filters, since the documentation for the new Table constructor
+      (and type) was incomplete and partly wrong before.  The Lua API is now
+      more consistent, as all constructors for elements with attributes now
+      take attributes as the last parameter.
+
+  * MANUAL.txt:
+
+    * Add a dedicated Citations section which consolidates the information
+      the manual used to contain about citation processing, and incorporates
+      some information formerly found in the pandoc-citeproc man page.
+    + Add note about lualatex using `selnolig`.
+    + Remove duplicate `seriespage` (#6568, Blake Eryx).
+    + Remove lists of support extensions for markdown variants (#6604).
+      Instead, offer the advice to use `--list-extensions=FORMAT`.
+    + Fix position of attributes in header (Albert Krewinkel).
+    + Delete obsolete section on compact and loose lists (#6684).
+
+
+  * doc/lua-filters.md:
+
+    + Add info on how to debug Lua filters (#6732, Ian Max Andolina).
+    + Document Underline type and constructor (Albert Krewinkel).
+    + Document `body` field (Albert Krewinkel).
+    + Add missing header attribute
+    + Add missing Link.title field (Albert Krewinkel).
+    + Make the setting-the-date example conditional (the-solipsist).
+      This makes the example a bit more realistic.
+    + Remove outdated link table example.
+
+  * doc/org.md:
+
+    + Add section on tables (Albert Krewinkel).
+    + Add section on handling of unknown directives (Albert Krewinkel).
+
+  * CONTRIBUTING.md: fix typo (#6584, Dmitry Volodin).
+
+  * Use golden test framework for command tests.  This means that
+    `--accept` can be used to update expected output.
+
+  * Use the `smart` extension when generating pandoc's man page (#6613).
+
+  * Release-candidate: don't build windows i386.
+    So far we haven't been able to figure out how to get
+    stack to use a 32-bit ghc.
+
+  * Use `null` instead of deprecated `Builder.isNull`.
+
+  * Makefile:
+
+    + Fix macospkg target to fetch target from S3 artifacts.
+    + Fix pandoc-templates target to include all partials.
+
+  * Remove duplicated dependency in pandoc.cabal (#6591, Felix Yan).
+
+  * Sort build depends in pandoc.cabal alphabetically (#6691,
+    Albert Krewinkel).
+
+  * Add .travis.yml for macos release candidate build (#6622).
+    We need to build the release candidate on Travis rather
+    than GitHub actions, because GH has macos 10.15, and
+    binaries compiled on that OS will not work with 10.13.
+    This build is only triggered on `rc/*` branches.
+
+  * Remove instructions for building pandoc-citeproc from CI and
+    release binary build instructions.  We will no longer distribute
+    pandoc-citeproc.
+
+  * Fix math rendering in trypandoc (this broke after
+    commit d8ad766d17603784b86fc5c2e1b22864125d04d1).
+
+  * Use latest versions of skylighting, commonmark (#6589),
+    comonmark-extensions, commonmark-pandoc, texmath.
+
+  * Relax version bounds for hslua, hslua-module-text, bytestring.
+
+  * Use released pandoc-types 1.22.  This changes the JSON
+    encoding slightly for the new table types introduced
+    in 1.21, so they're more consistent with the rest.
+    Developers of libraries for pandoc filters will want
+    to take note.
+
+  * Fix hlint suggestions, update hlint.yaml (#6680, Christian Despres).
+
+  * Code cleanup (#6678, Joseph C. Sible).
+
+  * Add haddocks to functions in Text.Pandoc.Writers.Shared (Albert
+    Krewinkel).
+
+  * Remove duplicate `tshow` definition.
+
+  * Linux release candidate build: use ghc-musl container.  This simplifies
+    our build process (over using a customized alpine container).
+
+
 ## pandoc 2.10.1 (2020-07-23)
 
   * Add `commonmark_x` output format. This is `commonmark` with a number
diff --git a/citeproc/biblatex-localization/UKenglish.lbx.strings b/citeproc/biblatex-localization/UKenglish.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/UKenglish.lbx.strings
diff --git a/citeproc/biblatex-localization/USenglish.lbx.strings b/citeproc/biblatex-localization/USenglish.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/USenglish.lbx.strings
diff --git a/citeproc/biblatex-localization/american.lbx.strings b/citeproc/biblatex-localization/american.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/american.lbx.strings
diff --git a/citeproc/biblatex-localization/australian.lbx.strings b/citeproc/biblatex-localization/australian.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/australian.lbx.strings
diff --git a/citeproc/biblatex-localization/austrian.lbx.strings b/citeproc/biblatex-localization/austrian.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/austrian.lbx.strings
@@ -0,0 +1,1 @@
+january|J\"anner|J\"an\adddot
diff --git a/citeproc/biblatex-localization/brazil.lbx.strings b/citeproc/biblatex-localization/brazil.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/brazil.lbx.strings
diff --git a/citeproc/biblatex-localization/brazilian.lbx.strings b/citeproc/biblatex-localization/brazilian.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/brazilian.lbx.strings
@@ -0,0 +1,233 @@
+bibliography|Bibliografia|Bibliografia
+references|Refer\^encias|Refer\^encias
+shorthands|Lista de abreviaturas|Abreviaturas
+editor|editor|ed\adddot
+editors|editores|ed\adddot
+compiler|compilador|comp\adddot
+compilers|compiladores|comp\adddot
+redactor|redator|red\adddot
+redactors|redatores|red\adddot
+reviser|revisor|rev\adddot
+revisers|revisores|rev\adddot
+founder|fundador|fund\adddot
+founders|fundadores|fund\adddot
+continuator|continuador|cont\adddot
+continuators|continuadores|cont\adddot
+collaborator|colaborador|colab\adddot
+collaborators|colaboradores|colab\adddot
+translator|tradutor|trad\adddot
+translators|tradutores|trad\adddot
+commentator|coment\'ario|coment\adddot
+commentators|coment\'ario|coment\adddot
+annotator|notas|notas
+annotators|notas|notas
+commentary|coment\'ario|coment\adddot
+annotations|notas|notas
+foreword|pref\'acio|pref\adddot
+afterword|posf\'acio|posf\adddot
+organizer|organizador|org\adddot
+organizers|organizadores|org\adddot
+byauthor|por|por
+byeditor|editado por|ed\adddotspace por
+bycompiler|compilado por|comp\adddotspace por
+byredactor|redigido por|red\adddotspace por
+byreviser|revisado por|rev\adddotspace por
+byreviewer|resenhado por|res\adddotspace por
+byfounder|fundado por|fund\adddotspace por
+bycontinuator|continuado por|cont\adddotspace por
+bytranslator|traduzido \lbx@lfromlang\ por|trad\adddot\ \lbx@sfromlang\ por
+bycommentator|comentado por|coment\adddot\ por
+byannotator|anotado por|anot\adddot\ por
+byorganizer|organizado por|org\adddotspace por
+withcommentator|com coment\'ario de|com coment\adddot\ de
+withannotator|com notas de|com notas de
+withforeword|com pref\'acio de|com pref\adddot\ de
+withafterword|com posf\'acio de|com posf\adddot\ de
+and|e|e
+andothers|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot
+andmore|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot
+volume|volume|vol\adddot
+volumes|volumes|vol\adddot
+involumes|em|em
+jourvol|volume|v\adddot
+jourser|s\'erie|s\'er\adddot
+book|livro|livro
+part|parte|parte
+issue|n\'umero|n\'um\adddot
+newseries|nova s\'erie|nova s\'er\adddot
+oldseries|s\'erie antiga|s\'er\adddot\ antiga
+reprint|reimpress\~ao|reimpr\adddot
+reprintof|reimpress\~ao de|reimpr\adddotspace de
+reprintas|reimpresso como|reimpr\adddotspace como
+reprintfrom|reimpresso de|reimpr\adddotspace de
+translationas|traduzido como|trad\adddotspace como
+translationfrom|traduzido do|trad\adddotspace do
+reviewof|resenha de|res\adddotspace de
+origpubas|originalmente publicado como|orig\adddotspace pub\adddotspace como
+origpubin|originalmente publicado em|orig\adddotspace pub\adddotspace em
+astitle|como|como
+bypublisher|por|por
+nodate|sem\space data|s\adddot d\adddot
+page|p\'agina|p\adddot
+pages|p\'aginas|pp\adddot
+column|coluna|col\adddot
+columns|colunas|col\adddot
+line|linha|l\adddot
+lines|linhas|ll\adddot
+verse|verso|v\adddot
+verses|versos|vv\adddot
+paragraph|par\'agrafo|par\adddot
+paragraphs|par\'agrafos|par\adddot
+pagetotal|p\'agina|p\adddot
+pagetotals|p\'aginas|pp\adddot
+columntotal|coluna|col\adddot
+columntotals|colunas|col\adddot
+linetotal|linha|l\adddot
+linetotals|linhas|ll\adddot
+versetotal|verso|v\adddot
+versetotals|versos|vv\adddot
+paragraphtotal|par\'agrafo|par\adddot
+paragraphtotals|par\'agrafos|par\adddot
+in|em|em
+inseries|em|em
+ofseries|de|de
+number|n\'umero|n\adddot
+chapter|cap\'\i tulo|cap\adddot
+bathesis|trabalho de conclus\~ao|trab\adddotspace de conc\adddot
+phdthesis|tese de doutorado|tese de dout\adddot
+candthesis||
+resreport|relat\'orio de pesquisa|rel\adddotspace de pesq\adddot
+techreport|relat\'orio t\'ecnico|rel\adddotspace t\'ecn\adddot
+software|software|software
+datacd|CD-ROM|CD-ROM
+audiocd|CD de \'audio|CD de \'audio
+version|vers\~ao|vers\~ao
+urlfrom|dispon\'ivel em|disp\adddotspace em
+urlseen|acesso em|acesso em
+submitted|submetido|submetido
+inpress|no prelo|no prelo
+prepublished|pr\'e-publicado|pr\'e-publicado
+citedas|doravante citado como|doravante citado como
+thiscite|especialmente|esp\adddot
+seenote|ver nota|ver nota
+quotedin|apud|apud
+idem|idem|idem
+idemsm|idem|idem
+idemsf|eadem|eadem
+idemsn|idem|idem
+idempm|eidem|eidem
+idempf|eaedem|eaedem
+idempn|eadem|eadem
+idempp|eidem|eidem
+ibidem|ibidem|ibid\adddot
+opcit|op\adddotspace cit\adddot|op\adddotspace cit\adddot
+loccit|loc\adddotspace cit\adddot|loc\adddotspace cit\adddot
+confer|cf\adddot|cf\adddot
+sequens|sq\adddot|sq\adddot
+sequentes|sqq\adddot|sqq\adddot
+passim|passim|passim
+see|ver|ver
+seealso|ver tamb\'em|ver tamb\'em
+backrefpage|ver p\'agina|ver p\adddot
+backrefpages|ver p\'aginas|ver pp\adddot
+january|janeiro|jan\adddot
+february|fevereiro|fev\adddot
+april|abril|abr\adddot
+may|maio|mai\adddot
+june|junho|jun\adddot
+july|julho|jul\adddot
+august|agosto|ago\adddot
+september|setembro|set\adddot
+october|outubro|out\adddot
+november|novembro|nov\adddot
+december|dezembro|dez\adddot
+langamerican|ingl\^es|ingl\^es
+langbulgarian|b\'ulgaro|b\'ulgaro
+langcatalan|catal\~ao|catal\~ao
+langcroatian|croata|croata
+langczech|tcheco|tcheco
+langdanish|dinamarqu\^es|dinamarqu\^es
+langenglish|ingl\^es|ingl\^es
+langfinnish|finland\^es|finland\^es
+langestonian|estoniano|estoniano
+langfrench|franc\^es|franc\^es
+langgalician|galego|galego
+langgerman|alem\~ao|alem\~ao
+langgreek|grego|grego
+langhungarian|h\'ungaro|h\'ungaro
+langitalian|italiano|italiano
+langjapanese|japon\^es|japon\^es
+langlatin|latim|latim
+langlatvian|let\~ao|let\~ao
+langlithuanian|lituano|lituano
+langnorwegian|noruegu\^es|noruegu\^es
+langpolish|polon\^es|polon\^es
+langrussian|russo|russo
+langserbian|s\'ervio|s\'ervio
+langslovak|eslovaco|eslovaco
+langslovene|esloveno|esloveno
+langspanish|espanhol|espanhol
+langswedish|sueco|sueco
+langturkish|turco|turco
+langukrainian|ucraniano|ucraniano
+fromamerican|do ingl\^es|do ingl\^es
+frombulgarian|do b\'ulgaro|do b\'ulgaro
+fromcatalan|do catal\~ao|do catal\~ao
+fromcroatian|do croata|do croata
+fromczech|do tcheco|do tcheco
+fromdanish|do dinamarqu\^es|do dinamarqu\^es
+fromenglish|do ingl\^es|do ingl\^es
+fromestonian|do estoniano|do estoniano
+fromfinnish|do finland\^es|do finland\^es
+fromfrench|do franc\^es|do franc\^es
+fromgalician|do galego|do galego
+fromgerman|do alem\~ao|do alem\~ao
+fromgreek|do grego|do grego
+fromhungarian|do h\'ungaro|do h\'ungaro
+fromitalian|do italiano|do italiano
+fromjapanese|do japon\^es|do japon\^es
+fromlatin|do latim|do latim
+fromlatvian|do let\~ao|do let\~ao
+fromlithuanian|do lituano|do lituano
+fromnorwegian|do noruegu\^es|do noruegu\^es
+frompolish|do polon\^es|do polon\^es
+fromrussian|do russo|do russo
+fromserbian|do s\'ervio|do s\'ervio
+fromslovak|do eslovaco|do eslovaco
+fromslovene|do esloveno|do esloveno
+fromspanish|do espanhol|do espanhol
+fromswedish|do sueco|do sueco
+fromturkish|do turco|do turco
+fromukrainian|do ucraniano|do ucraniano
+countryde|Alemanha|DE
+countryeu|Uni\~ao Europeia|EU
+countryep|Uni\~ao Europeia|EP
+countryuk|Reino Unido|GB
+countryus|Estados Unidos|US
+patent|patente|pat\adddot
+patentde|patente alem\~a|pat\adddot\ alem\~a
+patenteu|patente europeia|pat\adddot\ europeia
+patentfr|patente francesa|pat\adddot\ francesa
+patentuk|patente brit\^anica|pat\adddot\ brit\^anica
+patentus|patente americana|pat\adddot\ americana
+patreq|pedido de patente|ped\adddot\ de pat\adddot
+patreqde|pedido de patente alem\~a|ped\adddot\ de pat\adddot\ alem\~a
+patreqeu|pedido de patente europeia|ped\adddot\ de pat\adddot\ europeia
+patreqfr|pedido de patente francesa|ped\adddot\ de pat\adddot\ francesa
+patrequk|pedido de patente brit\^anica|ped\adddot\ de pat\adddot\ brit\^anica
+patrequs|pedido de patente americana|ped\adddot\ de pat\adddot\ americana
+file|arquivo|arquivo
+library|biblioteca|biblioteca
+abstract|resumo|resumo
+annotation|notas|notas
+commonera|Era Comum|EC
+beforecommonera|antes da Era Comum|AEC
+annodomini|depois de Cristo|d\adddot C\adddot
+beforechrist|antes de Cristo|a\adddot C\adddot
+circa|circa|ca\adddot
+spring|primavera|primavera
+summer|ver\~ao|ver\~ao
+autumn|outono|outono
+winter|inverno|inverno
+am|AM|AM
+pm|PM|PM
diff --git a/citeproc/biblatex-localization/british.lbx.strings b/citeproc/biblatex-localization/british.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/british.lbx.strings
@@ -0,0 +1,3 @@
+organizer|organiser|org\adddot
+organizers|organisers|orgs\adddot
+byorganizer|organised by|org\adddotspace by
diff --git a/citeproc/biblatex-localization/bulgarian.lbx.strings b/citeproc/biblatex-localization/bulgarian.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/bulgarian.lbx.strings
@@ -0,0 +1,28 @@
+bibliography|Библиография|Библиография
+references|Литература|Литература
+shorthands|Списък на съкращенията|Съкращения
+editor|редактор|ред\adddot
+editors|редактори|ред\adddot
+compiler|съставител|съст\adddot
+compilers|съставители|съст\adddot
+redactor|редактор|ред\adddot
+redactors|редактори|ред\adddot
+reviser|коректор|кор\adddotspace кор\adddot
+revisers|коректор|кор\adddotspace кор\adddot
+founder|основател|осн\adddot
+founders|основатели|осн\adddot
+continuator|продължител|прод\adddot
+continuators|продължител|прод\adddot
+collaborator|участник|участ\adddot
+collaborators|участници|участ\adddot
+translator|преводач|прев\adddot
+translators|преводачи|прев\adddot
+commentator|коментатор|комент\adddot
+commentators|коментатори|комент\adddot
+annotator|бележки|бел\adddot
+annotators|бележки|бел\adddot
+commentary|комментар|комент\adddot
+annotations|бележки|бел\adddot
+introduction|уводна статия|ув\adddotspace ст\adddot
+foreword|предговор|предг\adddot
+afterword|послеслов|послесл\adddot
diff --git a/citeproc/biblatex-localization/canadian.lbx.strings b/citeproc/biblatex-localization/canadian.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/canadian.lbx.strings
diff --git a/citeproc/biblatex-localization/catalan.lbx.strings b/citeproc/biblatex-localization/catalan.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/catalan.lbx.strings
@@ -0,0 +1,158 @@
+bibliography|Bibliografia|Bibliografia
+references|Refer\`encies|Refer\`encies
+shorthands|Llista d'abreviatures|Abreviatures
+editor|editor|ed\adddot
+editors|editors|ed\adddot
+compiler|compilador|comp\adddot
+compilers|compiladors|comp\adddot
+redactor|redactor|red\adddot
+redactors|redactors|red\adddot
+reviser|revisor|rev\adddot
+revisers|revisors|rev\adddot
+founder|fundador|fund\adddot
+founders|fundadors|fund\adddot
+continuator|continuador|cont\adddot
+continuators|continuadors|cont\adddot
+collaborator|co\l.laborador|co\l.l\adddot
+collaborators|co\l.laboradors|co\l.l\adddot
+translator|traductor|trad\adddot
+translators|traductors|trad\adddot
+commentator|comentarista|com\adddot
+commentators|comentaristes|com\adddot
+annotator|anotador|anot\adddot
+annotators|anotadors|anot\adddot
+commentary|comentari|com\adddot
+annotations|notes|n\adddot
+introduction|introducci\'o|intr\adddot
+foreword|pr\`oleg|pr\`ol\adddot
+editortr|editor i traductor|ed\adddotspace i trad\adddot
+editorstr|editors i traductors|ed\adddotspace i trad\adddot
+editorco|editor i comentarista|ed\adddotspace i com\adddot
+editorsco|editors i comentaristes|ed\adddotspace i com\adddot
+editoran|editor i anotador|ed\adddotspace i anot\adddot
+editorsan|editors i anotadors|ed\adddotspace i anot\adddot
+organizer|organitzador|org\adddot
+organizers|organitzadors|org\adddot
+byorganizer|organitzat per|org\adddotspace per
+byauthor|per|per
+byeditor|edici\'o a cura \smartof|ed\adddotspace\smartof
+bycompiler|compilaci\'o a cura \smartof|comp\adddotspace\smartof
+byredactor|redacci\'o a cura \smartof|red\adddotspace\smartof
+byreviser|revisi\'o a cura \smartof|rev\adddotspace\smartof
+byreviewer|ressenya a cura \smartof|ress\adddotspace\smartof
+byfounder|fundat per|fund\adddotspace per
+bycontinuator|continuat per|cont\adddotspace per
+bycollaborator|amb la co\l.laboraci\'o \smartof|amb la co\l.l\adddotspace\smartof
+bytranslator|traducci\'o \lbx@fromlang\ a cura \smartof|trad\adddotspace\lbx@fromlang\ \smartof
+bycommentator|comentari a cura \smartof|com\adddotspace\smartof
+byannotator|notes a cura \smartof|n\adddotspace\smartof
+withcommentator|amb un comentari a cura \smartof|amb un com\adddotspace\smartof
+withannotator|amb notes a cura \smartof|amb n\adddotspace\smartof
+withintroduction|amb una introducci\'o a cura \smartof|amb una intr\adddotspace\smartof
+withforeword|amb un pr\`oleg a cura \smartof|amb un pr\`ol\adddotspace\smartof
+and|i|i
+andothers|et al\adddot|et al\adddot
+andmore|i m\'es|i m\'es
+volume|volum|vol\adddot
+volumes|volums|vol\adddot
+involumes|en|en
+jourvol|volum|vol\adddot
+jourser|s\`erie|s\`er\adddot
+book|llibre|llib\adddot
+part|part|part
+issue|n\'umero|n\'um\adddot
+newseries|s\`erie nova|s\`erie nova
+oldseries|s\`erie antiga|s\`erie ant\adddot
+edition|edici\'o|ed\adddot
+reprint|reimpressi\'o|reimpr\adddot
+reprintof|reimpressi\'o \smartof|reimpr\adddotspace\smartof
+reprintas|reimpr\`es com|reimpr\adddotspace com
+reprintfrom|reimpr\`es \smartof|reimpr\adddotspace\smartof
+reviewof|ressenya \smartof|ress\adddotspace\smartof
+translationof|traducci\'o \smartof|trad\adddotspace\smartof
+origpubas|publicat origin\`ariament com|pub\adddotspace orig\adddotspace com
+origpubin|publicat origin\`ariament el|pub\adddotspace orig\adddotspace el
+astitle|com|com
+bypublisher|per|per
+page|p\`agina|p\`ag\adddot
+pages|p\`agines|p\`ag\adddot
+column|columna|col\adddot
+columns|columnes|cols\adddot
+nodate|sine data|s\adddotspace d\adddot
+verse|vers|v\adddot
+verses|versos|v\adddot
+section|apartat|\S
+sections|apartats|\S
+paragraph|par\`agraf|\P
+paragraphs|par\`agrafs|\P
+pagetotal|p\`agina|p\`ag\adddot
+pagetotals|p\`agines|p\`ag\adddot
+columntotal|columna|col\adddot
+columntotals|columnes|col\adddot
+versetotal|vers|v\adddot
+versetotals|versos|v\adddot
+sectiontotal|secci\'o|\S
+sectiontotals|seccions|\S
+paragraphtotal|par\`agrafs|\P
+paragraphtotals|par\`agrafs|\P
+in|a|a
+inseries|a|a
+ofseries|\smartof|\smartof
+number|n\'umero|n\'um\adddot
+bathesis|treball final de grau|treb\adddotspace fin\adddotspace de gr\adddot
+mathesis|treball final de m\`aster|treb\adddotspace fin\adddotspace de m\`ast\adddot
+phdthesis|tesi doctoral|tesi doct\adddot
+candthesis|tesi de candidatura|tesi de cand\adddot
+resreport|informe de recerca|inf\adddotspace de rec\adddot
+techreport|informe t\`ecnic|inf\adddotspace t\`ec\adddot
+software|programari|prog\adddot
+datacd|CD de dades|CD de dades
+audiocd|CD d'\`audio|CD d'\`audio
+version|versi\'o|vers\adddot
+urlfrom|disponible a|disp\adddotspace a
+urlseen|consultat|cons\adddot
+inpreparation|en preparaci\'o|en prep\adddot
+inpress|a impremta|a impr\adddot
+prepublished|pre-publicat|pre-publicat
+submitted|enviat a publicar|env\adddotspace a pub\adddot
+forthcoming|properament|prop\adddot
+citedas|d'ara endavant citat com|d'ara end\adddotspace cit\adddotspace com
+thiscite|concretament|concr\adddot
+seenote|vegeu la nota|v\adddotspace la n\adddot
+quotedin|citat a|cit\adddotspace a
+opcit|\`op\adddotspace cit\adddot|\`op\adddotspace cit\adddot
+loccit|loc\adddotspace cit\adddot|loc\adddotspace cit\adddot
+confer|cf\adddot|cf\adddot
+sequens|seq\adddot|seq\adddot
+sequentes|et seq\adddot|et seq\adddot
+passim|p\`assim|p\`assim
+see|vegeu|v\adddot
+seealso|vegeu tamb\'e|v\adddotspace tamb\'e
+backrefpage|vegeu la p\`agina|v\adddotspace la p\`ag\adddot
+backrefpages|vegeu les p\`agines|v\adddotspace les p\`ag\adddot
+january|gener|gen\adddot
+february|febrer|febr\adddot
+april|abril|abr\adddot
+may|maig|maig
+june|juny|juny
+july|juliol|jul\adddot
+august|agost|ag\adddot
+september|setembre|set\adddot
+october|octubre|oct\adddot
+november|novembre|nov\adddot
+december|desembre|des\adddot
+langamerican|angl\`es americ\`a|ang\adddotspace amer\adddot
+langbrazilian|portugu\`es brasiler|port\adddotspace bras\adddot
+langbulgarian|b\'ulgar|b\'ulg\adddot
+langcatalan|catal\`a|cat\adddot
+langczech|txec|txec
+langcroatian|croat|croat
+langdanish|dan\`es|dan\adddot
+langdutch|neerland\`es|neerl\adddot
+langenglish|angl\`es|ang\adddot
+langestonian|estoni\`a|eston\adddot
+langfinnish|fin\`es|fin\adddot
+langfrench|franc\`es|fr\adddot
+langgalician|gallec|gal\adddot
+langgerman|alemany|al\adddot
+langgreek|grec|grec
diff --git a/citeproc/biblatex-localization/croatian.lbx.strings b/citeproc/biblatex-localization/croatian.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/croatian.lbx.strings
@@ -0,0 +1,214 @@
+bibliography|Bibliografija|Bibliografija
+references|Literatura|Literatura
+shorthands|Popis kratica|Kratice
+editor|urednik|ur\adddot
+editors|urednici|ur\adddot
+redactor|redaktor|redaktor
+redactors|redaktori|redaktori
+reviser|korektor|korektor
+revisers|korektori|korektori
+collaborator|suradnik|sur\adddot
+collaborators|suradnici|sur\adddot
+translator|prijevod|prev\adddot
+translators|prijevod|prev\adddot
+commentator|komentator|komentator
+commentators|komentatori|komentatori
+commentary|komentar|komentar
+introduction|uvod|uvod
+foreword|predgovor|predgovor
+afterword|pogovor|pogovor
+editortr|prijevod i obrada|ur\adddotspace i prev\adddot
+editorstr|prijevod i obrada|ur\adddotspace i prev\adddot
+organizer|organizacija|organizacija
+organizers|organizacija|organizacija
+byorganizer|organizacija|organizacija
+byauthor|autor|autor
+byeditor|obrada|ur\adddot
+byredactor|redaktura|red\adddot
+byreviser|korektura|kor\adddot
+byreviewer|recenzija|recenzija
+bycontinuator|nastavio|nastavio
+bycollaborator|u suradnji s|u sur\adddotspace s
+bycommentator|komentari|komentari
+withcommentator|komentari|komentari
+withintroduction|uvod|uvod
+withforeword|predgovor|predgovor
+withafterword|pogovor|pogovor
+and|i|i
+andothers|i drugi|i dr\adddot
+andmore|i drugi|i dr\adddot
+volume|sv\adddot|sv\adddot
+volumes|sv\adddot|sv\adddot
+involumes|u|u
+jourvol|sv\adddot|sv\adddot
+jourser|serija|serija
+book|knjiga|knj\adddot
+part|dio|dio
+issue|izd\adddot|izd\adddot
+newseries|nova serija|nova serija
+oldseries|stara serija|stara serija
+edition|izdanje|izdanje
+reprint|pretisak|pretisak
+reprintof|pretisak|pretisak
+reprintas|iznova otisnuto kao|iznova otisnuto kao
+reprintfrom|iznova otisnut|iznova otisnut
+translationof|prijevod|prijevod
+translationas|prev\adddotspace kao|prev\adddotspace kao
+translationfrom|prijevod|prijevod
+reviewof|osvrt na|osvrt na
+origpubas|izvorno obj\adddotspace kao|izv\adddotspace obj\adddotspace kao
+origpubin|izvorno obj\adddot|izv\adddotspace obj\adddot
+astitle|kao|kao
+bypublisher||
+nodate|bez datuma|bez datuma
+page|stranica|str\adddot
+pages|stranice|str\adddot
+column|stupac|stupac
+columns|stupci|stupci
+line|linija|l\adddot
+lines|linije|ll\adddot
+verse|stih|stih
+verses|stihovi|stihovi
+section|odjeljak|\S
+sections|odjeljci|\S\S
+paragraph|stavak|st\adddot
+paragraphs|stavci|st\adddot
+pagetotal|str\adddot|str\adddot
+pagetotals|str\adddot|str\adddot
+columntotal|stupac|stupac
+columntotals|stupaca|stupaca
+linetotal|linija|lin\adddot
+linetotals|linija|lin\adddot
+versetotal|stih|st\adddot
+versetotals|stihova|st\adddot
+sectiontotal|odjeljak|odj\adddot
+sectiontotals|odjeljaka|odj\adddot
+paragraphtotal|stavak|st\adddot
+paragraphtotals|stavaka|st\adddot
+in||
+inseries|u seriji|u seriji
+ofseries|iz serije|iz serije
+number|broj|br\adddot
+chapter|poglavlje|pogl\adddot
+bathesis|diplomski rad|dipl\adddotspace rad
+mathesis|magistarski rad|mag\adddotspace rad
+phdthesis|doktorska disertacija|disertacija
+software|softver|softver
+datacd|CD-ROM|CD-ROM
+audiocd|audio CD|audio CD
+version|verzija|verzija
+url|adresa|adresa
+urlfrom|dostupno na|dost\adddotspace na
+urlseen|pogledano|pogledano
+inpreparation|u pripremi|u pripremi
+submitted|predan|predan
+inpress|u tisku|u tisku
+prepublished|pred objavom|pred obj\adddot
+citedas|dalje citirano kao|dalje citirano kao
+thiscite|napose|napose
+quotedin|citirano u|citirano u
+idem|idem|idem
+idemsm|idem|idem
+idemsf|eadem|eadem
+idemsn|idem|idem
+idempm|eidem|eidem
+idempf|eaedem|eaedem
+idempn|eadem|eadem
+idempp|eidem|eidem
+ibidem|ibidem|ibid\adddot
+opcit|op\adddotspace cit\adddot|op\adddotspace cit\adddot
+loccit|loc\adddotspace cit\adddot|loc\adddotspace cit\adddot
+confer|usporedi|usp\adddot
+sequens|sq\adddot|sq\adddot
+sequentes|sqq\adddot|sqq\adddot
+passim|passim|pass\adddot
+see|vidi|v\adddot
+seealso|pogledaj i|pogl\adddotspace i
+backrefpage|citirano na stranci|cit\adddotspace na str\adddot
+backrefpages|cited on pages|cit\adddotspace na str\adddot
+april|travanj|travanj
+may|svibanj|svibanj
+june|lipanj|lipanj
+july|srpanj|srpanj
+august|kolovoz|kolovoz
+september|rujan|rujan
+october|listopad|listopad
+november|studeni|studeni
+december|prosinac|prosinac
+dateapril|travnja|travnja
+datemay|svibnja|svibnja
+datejune|lipnja|lipnja
+datejuly|srpnja|srpnja
+dateaugust|kolovoza|kolovoza
+dateseptember|rujna|rujna
+dateoctober|listopada|listopada
+datenovember|studenoga|studenoga
+datedecember|prosinca|prosinca
+langamerican|engleski|engleski
+langbrazilian|portugalski|portugalski
+langbulgarian|bugarski|bugarski
+langcatalan|katalonski|katalonski
+langcroatian|hrvatski|hrvatski
+langdanish|danski|danski
+langdutch|nizozemski|nizozemski
+langenglish|engleski|engleski
+langestonian|estonski|estonski
+langfinnish|finski|finski
+langfrench|francuski|francuski
+langgalician|galicijski|galicijski
+langhungarian|ma\dj arski|ma\dj arski
+langitalian|talijanski|talijanski
+langjapanese|japanski|japanski
+langlatin|latinski|latinski
+langlatvian|letonski|letonski
+langpolish|poljski|poljski
+langportuguese|portugalski|portugalski
+langrussian|ruski|ruski
+langslovene|slovenski|slovenski
+langukrainian|ukrajinski|ukrajinski
+fromamerican|s engleskog|s engleskog
+frombrazilian|s portugalskog|s portugalskog
+frombulgarian|s bugarskog|s bugarskog
+fromcatalan|s katalonskog|s katalonskog
+fromcroatian|s hrvatskog|s hrvatskog
+fromdanish|s danskog|s danskog
+fromdutch|s nizozemskog|s nizozemskog
+fromenglish|s engleskog|s engleskog
+fromestonian|s estonskog|s estonskog
+fromfinnish|s finskog|s finskog
+fromfrench|s francuskog|s francuskog
+fromgalician|s galicijskog|s galicijskog
+fromhungarian|s ma\dj arskog|s ma\dj arskog
+fromitalian|s talijanskog|s talijanskog
+fromjapanese|s japanskog|s japanskog
+fromlatin|s latinskog|s latinskog
+fromlatvian|s letonskog|s letonskog
+frompolish|s poljskog|s poljskog
+fromportuguese|s portugalskog|s portugalskog
+fromrussian|s ruskog|s ruskog
+fromslovene|sa slovenskog|sa slovenskog
+fromukrainian|s ukrajinskog|s ukrajinskog
+countryeu|Europska unija|EU
+countryep|Europska unija|EP
+countryfr|Francuska|FR
+countryuk|Velika Britanija|GB
+patent|patent|pat\adddot
+patenteu|europski patent|europski pat\adddot
+patentfr|francuski patent|francuski pat\adddot
+patentuk|britanski patent|britanski pat\adddot
+patentus|US patent|US pat\adddot
+patreq|patentni zahtjev|pat\adddot\ zahtjev
+patreqeu|europski patentni zahtjev|EU pat\adddotspace zahtjev
+patrequs|US patentni zahtjev|US pat\adddot\ zahtjev
+file|datoteka|datoteka
+library|biblioteka|biblioteka
+commonera|n\adddotspace e\adddot|n\adddotspace e\adddot
+beforecommonera|pr\adddotspace n\adddotspace e\adddot|pr\adddotspace n\adddotspace e\adddot
+annodomini|poslije Krista|p\adddotspace Kr\adddot
+beforechrist|prije Krista|pr\adddotspace Kr\adddot
+circa|oko|cca\adddot
+summer|ljeto|ljeto
+autumn|jesen|jesen
+winter|zima|zima
+am|prije podne|AM
+pm|poslije podne|PM
diff --git a/citeproc/biblatex-localization/czech.lbx.strings b/citeproc/biblatex-localization/czech.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/czech.lbx.strings
@@ -0,0 +1,91 @@
+bibliography|Bibliografie|Bibliografie
+references|Odkazy|Odkazy
+shorthands|Seznam zkratek|Zkratky
+editor|editor|ed\adddot
+compiler|sestavil|sest\adddot
+compilers|sestavili|sest\adddot
+redactor|redaktor|red\adddot
+reviser|korektor|kor\adddot
+founder|zakladatel|zakl\adddot
+annotations|anotace|anot\adddot
+afterword|doslov|dosl\adddot
+byauthor||
+bycompiler|sestaveno|sest\adddot
+withannotator|s\addnbspace anotacemi od|s\addnbspace anot\adddot\ od
+withafterword|s\addnbspace doslovem od|s\addnbspace dosl\adddot\ od
+and|a|a
+andothers|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot
+andmore|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot
+volume|svazek|sv\adddot
+volumes|svazky|sv\adddot
+involumes|in|in
+book|kniha|kniha
+reprint|dotisk|dotisk
+reprintof|dotisk|dotisk
+reprintas|dotisknuto jako|dotisknuto jako
+reprintfrom|dotisknuto z\addnbspace|dotisknuto z\addnbspace
+reviewof|recenze|recenz\adddot
+astitle|jako|jako
+bypublisher||
+page|strana|s\adddot
+pages|strany|s\adddot
+column|sloupec|sl\adddot
+columns|sloupce|sl\adddot
+section|sekce|\S
+sections|sekce|\S\S
+paragraph|odstavec|ods\adddot
+paragraphs|odstavce|ods\adddot
+pagetotal|strana|s\adddot
+pagetotals|strany|s\adddot
+columntotal|sloupec|sl\adddot
+columntotals|sloupce|sl\adddot
+sectiontotal|sekce|\S
+sectiontotals|sekce|\S\S
+paragraphtotal|odstavec|ods\adddot
+paragraphtotals|odstavce|ods\adddot
+in|in|in
+inseries|in|in
+ofseries|z|z
+chapter|kapitola|kap\adddot
+datacd|CD-ROM|CD-ROM
+audiocd|audio CD|audio CD
+version|verze|ver\adddot
+url|URL|URL
+inpress|v\addnbspace tisku|v\addnbspace tisku
+idem|idem|idem
+idemsm|idem|idem
+idemsf|eadem|eadem
+idemsn|idem|idem
+idempm|eidem|eidem
+idempf|eaedem|eaedem
+idempn|eadem|eadem
+idempp|eidem|eidem
+ibidem|ibidem|ibid\adddot
+opcit|op\adddotspace cit\adddot|op\adddotspace cit\adddot
+loccit|loc\adddotspace cit\adddot|loc\adddotspace cit\adddot
+confer|cf\adddot|cf\adddot
+sequens|sq\adddot|sq\adddot
+sequentes|sqq\adddot|sqq\adddot
+passim|passim|pass\adddot
+see|viz|viz
+january|leden|led\adddot
+april|duben|dub\adddot
+august|srpen|srp\adddot
+november|listopad|lis\adddot
+december|prosinec|pros\adddot
+langlatin|latina|lat\adddot
+fromlatin|z\addnbspace latiny|z\addnbspace lat\adddot
+countryfr|Francie|FR
+patent|patent|pat\adddot
+patentus|US patent|US pat\adddot
+file|soubor|soub\adddot
+library|knihovna|knih\adddot
+abstract|abstrakt|abst\adddot
+annotation|anotace|anot\adddot
+annodomini|po Kristu|po Kr\adddot
+circa|cirka|ca\adddot
+spring|jaro|jaro
+autumn|podzim|podzim
+winter|zima|zima
+am|AM|AM
+pm|PM|PM
diff --git a/citeproc/biblatex-localization/danish.lbx.strings b/citeproc/biblatex-localization/danish.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/danish.lbx.strings
@@ -0,0 +1,106 @@
+bibliography|Bibliografi|Bibliografi
+references|Litteraturhenvisninger|Litteratur
+shorthands|Forkortelser|Forkortelser
+editor|redakt\o r|red\adddot
+editors|redakt\o rer|red\adddot
+compiler|kompilator|kompilator
+compilers|kompilatorer|kompilatorer
+redactor|medredakt\o r|medred\adddot
+redactors|medredakt\o rer|medred\adddot
+reviser|revision|rev\adddot
+revisers|revision|rev\adddot
+founder|stifter|stifter
+founders|stiftere|stiftere
+continuator|videref\o rer|videref\adddot
+continuators|videref\o rere|videref\adddot
+collaborator|medarbejder|medarb\adddot
+collaborators|medarbejdere|medarb\adddot
+translator|overs\ae tter|overs\adddot
+translators|overs\ae ttere|overs\adddot
+commentator|kommentator|komm\adddot
+commentators|kommentatorer|komm\adddot
+annotator|kommentator|komm\adddot
+annotators|kommentatorer|komm\adddot
+commentary|kommentar|komm\adddot
+annotations|annoteringer|ann\adddot
+introduction|indledning|indl\adddot
+foreword|forord|forord
+afterword|efterord|efterord
+organizer|organisator|org\adddot
+organizers|organisatorer|org\adddot
+byorganizer|organiseret af|org\adddotspace av
+byauthor|af|af
+byeditor|redigeret af|red\adddotspace af
+bycompiler|kompileret af|komp\adddotspace af
+byredactor|bearbejdet af|bearb\adddotspace af
+byreviser|revideret af|rev\adddotspace af
+byreviewer|bed\o mt af|bed\adddotspace af
+byfounder|stiftet af|stiftet af
+bycontinuator|videref\o rt af|videref\adddotspace af
+bycollaborator|i samarbejde med|i samarb\adddotspace m\adddot
+bycommentator|kommenteret af|komm\adddot\ af
+byannotator|annoteret af|ann\adddot\ af
+withcommentator|med kommentarer af|m\adddotspace komm\adddot\ af
+withannotator|med annoteringer af|m\adddotspace ann\adddot\ af
+withintroduction|med indledning af|m\adddotspace indl\adddot\ af
+withforeword|med forord af|m\adddotspace forord af
+withafterword|med efterord af|m\adddotspace efterord af
+and|og|og
+andothers|med flere|m.fl\adddot
+andmore|med mere|m.m\adddot
+volume|bind|bd\adddot
+volumes|bind|bd\adddot
+involumes|i|i
+jourvol|\aa rgang|\aa rg\adddot
+jourser|r\ae kke|rk\adddot
+book|bog|bog
+part|del|del
+issue|nummer|nr\adddot
+newseries|ny r\ae kke|ny rk\adddot
+oldseries|gammel r\ae kke|gl. rk\adddot
+edition|udgave|udg\adddot
+reprint|genoptryk|genoptr\adddot
+reprintof|genoptryk af|genoptr\adddot\ af
+reprintas|genoptryk under titlen|genoptr\adddot\ under titlen
+reprintfrom|genoptryk fra|genoptr\adddot\ fra
+translationof|overs\ae ttelse af|overs\adddot\ af
+translationas|oversat under titlen|overs\adddotspace\ under titlen
+translationfrom|oversat fra|overs\adddotspace\ fra
+reviewof|bed\o mmelse af|bed\adddotspace af
+origpubas|oprindeligt udgivet som|opr\adddot\ udg\adddot\ som
+origpubin|oprindeligt udgivet i|opr\adddot\ udg\adddot\ i
+astitle|under titlen|under titlen
+bypublisher|af|af
+nodate|uden \aa rstal|u.\aa\adddot
+page|side|s\adddot
+pages|sider|s\adddot
+column|spalte|sp\adddot
+columns|spalter|sp\adddot
+line|linje|l\adddot
+lines|linjer|l\adddot
+verse|vers|v\adddot
+verses|vers|v\adddot
+section|paragraf|par\adddot
+sections|paragraffer|par\adddot
+paragraph|afsnit|afsn\adddot
+paragraphs|afsnit|afsn\adddot
+pagetotal|side|s\adddot
+pagetotals|sider|s\adddot
+columntotal|spalte|sp\adddot
+columntotals|spalter|sp\adddot
+line|linje|l\adddot
+lines|linjer|l\adddot
+verse|vers|v\adddot
+verses|vers|v\adddot
+linetotal|linje|l\adddot
+linetotals|linje|l\adddot
+versetotal|vers|v\adddot
+versetotals|vers|v\adddot
+sectiontotal|paragraf|par\adddot
+sectiontotals|paragraffer|par\adddot
+paragraphtotal|afsnit|afsn\adddot
+paragraphtotals|afsnit|afsn\adddot
+in|i|i
+inseries|i r\ae kken|i rk\adddot
+ofseries|fra r\ae kken|fra rk\adddot
+number|nummer|nr\adddot
diff --git a/citeproc/biblatex-localization/dutch.lbx.strings b/citeproc/biblatex-localization/dutch.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/dutch.lbx.strings
@@ -0,0 +1,23 @@
+bibliography|Bibliografie|Bibliografie
+references|Referenties|Referenties
+shorthands|Lijst van afkortingen|Afkortingen
+editor|redacteur|red\adddot
+editors|redacteurs|red\adddot
+compiler|samensteller|samenst\adddot
+compilers|samenstellers|samenst\adddot
+founder|oprichter|opr\adddot
+founders|oprichters|opr\adddot
+continuator|opvolger|opv\adddot
+continuators|opvolgers|opv\adddot
+redactor|redacteur|red\adddot
+redactors|redacteuren|red\adddot
+reviser|revisor|rev\adddot
+revisers|revisors|rev\adddot
+collaborator|medewerker|med\adddot
+collaborators|medewerkers|med\adddot
+translator|vertaler|vert\adddot
+translators|vertalers|vert\adddot
+commentator|commentator|comm\adddot
+commentators|commentatoren|comm\adddot
+annotator|annotator|annot\adddot
+annotators|annotatoren|annot\adddot
diff --git a/citeproc/biblatex-localization/english.lbx.strings b/citeproc/biblatex-localization/english.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/english.lbx.strings
@@ -0,0 +1,254 @@
+bibliography|Bibliography|Bibliography
+references|References|References
+shorthands|List of Abbreviations|Abbreviations
+editor|editor|ed\adddot
+editors|editors|eds\adddot
+compiler|compiler|comp\adddot
+compilers|compilers|comp\adddot
+redactor|redactor|red\adddot
+redactors|redactors|red\adddot
+reviser|reviser|rev\adddot
+revisers|revisers|rev\adddot
+founder|founder|found\adddot
+founders|founders|found\adddot
+continuator|continued|cont\adddot
+continuators|continued|cont\adddot
+collaborator|collaborator|collab\adddot
+collaborators|collaborators|collab\adddot
+translator|translator|trans\adddot
+translators|translators|trans\adddot
+commentator|commentator|comm\adddot
+commentators|commentators|comm\adddot
+annotator|annotator|annot\adddot
+annotators|annotators|annot\adddot
+commentary|commentary|comm\adddot
+annotations|annotations|annot\adddot
+introduction|introduction|intro\adddot
+foreword|foreword|forew\adddot
+afterword|afterword|afterw\adddot
+organizer|organizer|org\adddot
+organizers|organizers|orgs\adddot
+byorganizer|organized by|org\adddotspace by
+byauthor|by|by
+byeditor|edited by|ed\adddotspace by
+bycompiler|compiled by|comp\adddotspace by
+byredactor|redacted by|red\adddotspace by
+byreviser|revised by|rev\adddotspace by
+byreviewer|reviewed by|rev\adddotspace by
+byfounder|founded by|found\adddotspace by
+bycontinuator|continued by|cont\adddotspace by
+bycollaborator|in collaboration with|in collab\adddotspace with
+bytranslator|translated \lbx@lfromlang\ by|trans\adddot\ \lbx@sfromlang\ by
+bycommentator|commented by|comm\adddot\ by
+byannotator|annotated by|annot\adddot\ by
+withcommentator|with a commentary by|with a comment\adddot\ by
+withannotator|with annotations by|with annots\adddot\ by
+withintroduction|with an introduction by|with an intro\adddot\ by
+withforeword|with a foreword by|with a forew\adddot\ by
+withafterword|with an afterword by|with an afterw\adddot\ by
+and|and|and
+andothers|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot
+andmore|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot
+volume|volume|vol\adddot
+volumes|volumes|vols\adddot
+involumes|in|in
+jourvol|volume|vol\adddot
+jourser|series|ser\adddot
+book|book|book
+part|part|part
+issue|issue|issue
+newseries|new series|new ser\adddot
+oldseries|old series|old ser\adddot
+edition|edition|ed\adddot
+reprint|reprint|repr\adddot
+reprintof|reprint of|repr\adddotspace of
+reprintas|reprinted as|rpt\adddotspace as
+reprintfrom|reprinted from|repr\adddotspace from
+reviewof|review of|rev\adddotspace of
+translationof|translation of|trans\adddotspace of
+translationas|translated as|trans\adddotspace as
+translationfrom|translated from|trans\adddotspace from
+origpubas|originally published as|orig\adddotspace pub\adddotspace as
+origpubin|originally published in|orig\adddotspace pub\adddotspace in
+astitle|as|as
+bypublisher|by|by
+nodate|no date|n\adddot d\adddot
+page|page|p\adddot
+pages|pages|pp\adddot
+column|column|col\adddot
+columns|columns|cols\adddot
+line|line|l\adddot
+lines|lines|ll\adddot
+verse|verse|v\adddot
+verses|verses|vv\adddot
+section|section|\S
+sections|sections|\S\S
+paragraph|paragraph|par\adddot
+paragraphs|paragraphs|par\adddot
+pagetotal|page|p\adddot
+pagetotals|pages|pp\adddot
+columntotal|column|col\adddot
+columntotals|columns|cols\adddot
+linetotal|line|l\adddot
+linetotals|lines|ll\adddot
+versetotal|verse|v\adddot
+versetotals|verses|vv\adddot
+sectiontotal|section|\S
+sectiontotals|sections|\S\S
+paragraphtotal|paragraph|par\adddot
+paragraphtotals|paragraphs|par\adddot
+in|in|in
+inseries|in|in
+ofseries|of|of
+number|number|no\adddot
+chapter|chapter|chap\adddot
+bathesis|Bachelor's thesis|BA\addabbrvspace thesis
+mathesis|Master's thesis|MA\addabbrvspace thesis
+phdthesis|PhD\addabbrvspace thesis|PhD\addabbrvspace thesis
+candthesis|Candidate thesis|Cand\adddotspace thesis
+resreport|research report|research rep\adddot
+techreport|technical report|tech\adddotspace rep\adddot
+software|computer software|comp\adddotspace software
+datacd|CD-ROM|CD-ROM
+audiocd|audio CD|audio CD
+version|version|version
+url|address|address
+urlfrom|available from|available from
+urlseen|visited on|visited on
+inpreparation|in preparation|in preparation
+submitted|submitted|submitted
+forthcoming|forthcoming|forthcoming
+inpress|in press|in press
+prepublished|pre-published|pre-published
+citedas|henceforth cited as|henceforth cited as
+thiscite|especially|esp\adddot
+seenote|see note|see n\adddot
+quotedin|quoted in|qtd\adddotspace in
+idem|idem|idem
+idemsm|idem|idem
+idemsf|eadem|eadem
+idemsn|idem|idem
+idempm|eidem|eidem
+idempf|eaedem|eaedem
+idempn|eadem|eadem
+idempp|eidem|eidem
+ibidem|ibidem|ibid\adddot
+opcit|op\adddotspace cit\adddot|op\adddotspace cit\adddot
+loccit|loc\adddotspace cit\adddot|loc\adddotspace cit\adddot
+confer|cf\adddot|cf\adddot
+sequens|sq\adddot|sq\adddot
+sequentes|sqq\adddot|sqq\adddot
+passim|passim|pass\adddot
+see|see|see
+seealso|see also|see also
+backrefpage|cited on page|cit\adddotspace on p\adddot
+backrefpages|cited on pages|cit\adddotspace on pp\adddot
+january|January|Jan\adddot
+february|February|Feb\adddot
+march|March|Mar\adddot
+april|April|Apr\adddot
+may|May|May
+june|June|June
+july|July|July
+august|August|Aug\adddot
+september|September|Sept\adddot
+october|October|Oct\adddot
+november|November|Nov\adddot
+december|December|Dec\adddot
+langamerican|American|American
+langbrazilian|Brazilian|Brazilian
+langbulgarian|Bulgarian|Bulgarian
+langcatalan|Catalan|Catalan
+langcroatian|Croatian|Croatian
+langczech|Czech|Czech
+langdanish|Danish|Danish
+langdutch|Dutch|Dutch
+langenglish|English|English
+langestonian|Estonian|Estonian
+langfinnish|Finnish|Finnish
+langfrench|French|French
+langgalician|Galician|Galician
+langgerman|German|German
+langgreek|Greek|Greek
+langhungarian|Hungarian|Hungarian
+langitalian|Italian|Italian
+langjapanese|Japanese|Japanese
+langlatin|Latin|Latin
+langlatvian|Latvian|Latvian
+langlithuanian|Lithuanian|Lithuanian
+langnorwegian|Norwegian|Norwegian
+langpolish|Polish|Polish
+langportuguese|Portuguese|Portuguese
+langrussian|Russian|Russian
+langserbian|Serbian|Serbian
+langslovak|Slovak|Slovak
+langslovene|Slovene|Slovene
+langspanish|Spanish|Spanish
+langswedish|Swedish|Swedish
+langturkish|Turkish|Turkish
+langukrainian|Ukrainian|Ukrainian
+fromamerican|from the American|from the American
+frombrazilian|from the Brazilian|from the Brazilian
+frombulgarian|from the Bulgarian|from the Bulgarian
+fromcatalan|from the Catalan|from the Catalan
+fromcroatian|from the Croatian|from the Croatian
+fromczech|from the Czech|from the Czech
+fromdanish|from the Danish|from the Danish
+fromdutch|from the Dutch|from the Dutch
+fromenglish|from the English|from the English
+fromestonian|from the Estonian|from the Estonian
+fromfinnish|from the Finnish|from the Finnish
+fromfrench|from the French|from the French
+fromgalician|from the Galician|from the Galician
+fromgerman|from the German|from the German
+fromgreek|from the Greek|from the Greek
+fromhungarian|from the Hungarian|from the Hungarian
+fromitalian|from the Italian|from the Italian
+fromjapanese|from the Japanese|from the Japanese
+fromlatin|from the Latin|from the Latin
+fromlatvian|from the Latvian|from the Latvian
+fromlithuanian|from the Lithuanian|from the Lithuanian
+fromnorwegian|from the Norwegian|from the Norwegian
+frompolish|from the Polish|from the Polish
+fromportuguese|from the Portuguese|from the Portuguese
+fromrussian|from the Russian|from the Russian
+fromserbian|from the Serbian|from the Serbian
+fromslovak|from the Slovak|from the Slovak
+fromslovene|from the Slovene|from the Slovene
+fromspanish|from the Spanish|from the Spanish
+fromswedish|from the Swedish|from the Swedish
+fromturkish|from the Turkish|from the Turkish
+fromukrainian|from the Ukrainian|from the Ukrainian
+countryde|Germany|DE
+countryeu|European Union|EU
+countryep|European Union|EP
+countryfr|France|FR
+countryuk|United Kingdom|GB
+countryus|United States of America|US
+patent|patent|pat\adddot
+patentde|German patent|German pat\adddot
+patenteu|European patent|European pat\adddot
+patentfr|French patent|French pat\adddot
+patentuk|British patent|British pat\adddot
+patentus|U.S\adddotspace patent|U.S\adddotspace pat\adddot
+patreq|patent request|pat\adddot\ req\adddot
+patreqde|German patent request|German pat\adddot\ req\adddot
+patreqeu|European patent request|European pat\adddot\ req\adddot
+patreqfr|French patent request|French pat\adddot\ req\adddot
+patrequk|British patent request|British pat\adddot\ req\adddot
+patrequs|U.S\adddotspace patent request|U.S\adddotspace pat\adddot\ req\adddot
+file|file|file
+library|library|library
+abstract|abstract|abstract
+annotation|annotations|annotations
+commonera|Common Era|CE
+beforecommonera|Before Common Era|BCE
+annodomini|Anno Domini|AD
+beforechrist|Before Christ|BC
+circa|circa|ca\adddot
+spring|Spring|Spr\adddot
+summer|Summer|Sum\adddot
+autumn|Autumn|Aut\adddot
+winter|Winter|Win\adddot
+am|AM|AM
+pm|PM|PM
diff --git a/citeproc/biblatex-localization/estonian.lbx.strings b/citeproc/biblatex-localization/estonian.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/estonian.lbx.strings
@@ -0,0 +1,178 @@
+bibliography|bibliograafia|bibliograafia
+references|viited|viited
+editor|toimetaja|toim\adddot
+editors|toimetajad|toim\adddot
+compiler|koostaja|koost\adddot
+compilers|koostajad|koost\adddot
+redactor|toimetaja|toim\adddot
+redactors|toimetajad|toim\adddot
+reviser|toimetaja|toim\adddot
+revisers|toimetajad|toim\adddot
+founder|asutaja|asutaja
+founders|asutajad|asutajad
+commentator|kommenteerija|kommenteerija
+commentators|kommenteerijad|kommenteerijad
+annotator|kommenteerija|kommenteerija
+annotators|kommenteerijad|kommenteerijad
+commentary|kommentaarid|kommentaarid
+annotations|kommentaarid|kommentaarid
+introduction|sissejuhatus|sissejuhatus
+organizer|korraldaja|korraldaja
+organizers|korraldajad|korraldajad
+byorganizer|korraldanud|korraldanud
+byauthor|kirjutanud|kirj\adddot
+byeditor|toimetanud|toim\adddot
+bycompiler|koostanud|koost\adddot
+byredactor|toimetanud|toim\adddot
+byreviewer|vaadanud|vaadanud
+byfounder|asutanud|asutanud
+bycommentator|kommenteerinud|kommenteerinud
+byannotator|kommenteerinud|kommenteerinud
+withcommentator|koos kommentaaridega|koos kommentaaridega
+withannotator|koos kommentaaridega|koos kommentaaridega
+withintroduction|koos tutvustusega|koos tutvustusega
+and|ja|ja
+involumes|osas|osas
+jourser|seeria|seeria
+book|raamat|raamat
+part|osa|osa
+issue|number|nr\adddot
+newseries|uus seerias|uus seer\adddot
+oldseries|vana seeria|vana seer\adddot
+reviewof|arvustus teosest|arvustus teosest
+origpubas|algselt avaldatud kui|algselt avaldatud kui
+origpubin|algselt avaldatud aastal|algselt avaldatud aastal
+astitle|pealkirjaga|pealkirjaga
+column|veerg|veerg
+columns|veerud|veerud
+line|rida|rida
+lines|read|read
+verse|salm|salm
+verses|salmid|salmid
+section|jagu|jagu
+sections|jaod|jaod
+columntotal|veerge kokku|veerge kokku
+columntotals|veergusid kokku|veergusid kokku
+linetotal|ridu kokku|ridu kokku
+linetotals|ridasid kokku|ridasid kokku
+versetotal|salmi kokku|salmi kokku
+versetotals|salmesid kokku|salmesid kokku
+sectiontotal|jagusid kokku|jagusid kokku
+sectiontotals|jagusid kokku|jagusid kokku
+in|teoses|teoses
+inseries|sarjas|sarjas
+ofseries|sarjast|sarjast
+number|number|nr
+resreport|uuringuraport|uuringuraport
+techreport|tehniline raport|tehniline raport
+software|tarkvara|tarkvara
+datacd|CD-ROM|CD-ROM
+audiocd|audioplaat|audioplaat
+version|versioon|versioon
+url|aadress|aadress
+urlfrom|saadaval|saadaval
+urlseen|vaadatud|vaadatud
+inpreparation|koostamisel|koostamisel
+submitted|esitatud|esitatud
+forthcoming|tulevases|tulevases
+citedas|edaspidi viidatud kui|edaspidi viidatud kui
+thiscite|eriti|eriti
+quotedin|noteeritud|noteeritud
+see|vaata|vt
+seealso|vaata ka|vt ka
+backrefpage|viidatud lehel|viidatud lehel
+january|jaanuar|jaanuar
+february|veebruar|veebruar
+april|aprill|aprill
+may|mai|mai
+june|juuni|juuni
+july|juuli|juuli
+august|august|august
+september|september|september
+october|oktoober|oktoober
+november|november|november
+december|detsember|detsember
+langamerican|Ameerika inglise keel|Ameerika inglise keel
+langbrazilian|brasiilia keel|brasiilia keel
+langbulgarian|bulgaaria keel|bulgaaria keel
+langcatalan|katalaani keel|katalaani keel
+langcroatian|horvaadi keel|horvaadi keel
+langdanish|taani keel|taani keel
+langdutch|hollandi keel|hollandi keel
+langenglish|inglise keel|inglise keel
+langestonian|eesti keel|eesti keel
+langfinnish|soome keel|soome keel
+langfrench|prantsuse keel|prantsuse keel
+langgalician|galeegi keel|galeegi keel
+langgerman|saksa keel|saksa keel
+langgreek|kreeka keel|kreeka keel
+langhungarian|ungari keel|ungari keel
+langitalian|itaalia keel|itaalia keel
+langjapanese|jaapani keel|jaapani keel
+langlatin|ladina keel|ladina keel
+langnorwegian|norra keel|norra keel
+langpolish|poola keel|poola keel
+langportuguese|portugali keel|portugali keel
+langrussian|vene keel|vene keel
+langslovak|slovakia keel|slovakia keel
+langslovene|sloveeni keel|sloveeni keel
+langspanish|hispaania keel|hispaania keel
+langswedish|rootsi keel|rootsi keel
+langukrainian|ukraina keel|ukraina keel
+fromamerican|Ameerika inglise keelest|Ameerika inglise keelest
+frombrazilian|brasiilia keelest|brasiilia keelest
+frombulgarian|bulgaaria keelest|bulgaaria keelest
+fromcatalan|katalani keelest|kalatalani keelest
+fromcroatian|horvaadi keelest|horvaadi keelest
+fromdanish|taani keelest|taani keelest
+fromdutch|hollandi keelest|hollandi keelest
+fromenglish|inglise keelest|inglise keelest
+fromestonian|eesti keelest|eesti keelest
+fromfinnish|soome keelest|soome keelest
+fromfrench|prantsuse keelest|prantsuse keelest
+fromgalician|galeegi keelest|galeegi keelest
+fromgerman|saksa keelest|saksa keelest
+fromgreek|kreeka keelest|kreeka keelest
+fromhungarian|ungari keelest|ungari keelest
+fromitalian|itaalia keelest|itaalia keelest
+fromjapanese|jaapani keelest|jaapani keelest
+fromlatin|ladina keelest|ladina keelest
+fromnorwegian|norra keelest|norra keelest
+fromportuguese|portugali keelest|portugali keelest
+fromrussian|vene keelest|vene keelest
+fromslovak|slovakia keelest|slovakia keelest
+fromslovene|sloveenia keelest|sloveenia keelest
+fromspanish|hispaania keelest|hispaania keelest
+fromswedish|rootsi keelest|rootsi keelest
+fromukrainian|ukraina keelest|ukraina keelest
+countryde|Saksamaa|DE
+countryeu|Euroopa Liit|EL
+countryep|Euroopa Parlament|EP
+countryfr|Prantsusmaa|FR
+countryuk|Suurbritannia|GB
+countryus|Ameerika|US
+patent|patent|pat\adddot
+patentde|Saksa patent|Saksa pat\adddot
+patenteu|Euroopa patent|Euroopa pat\adddot
+patentfr|Prantsuse patent|Prantsuse pat\adddot
+patentuk|Briti patent|Briti pat\adddot
+patentus|U.S\adddotspace patent|U.S\adddotspace pat\adddot
+patreq|patendi taotlus|pat\adddotspace taotl\adddot
+patreqde|Saksa patendi taotlus|Saksa pat\adddotspace taotl\adddot
+patreqeu|Euroopa patendi taotlus|Euroopa pat\adddotspace taotl\adddot
+patreqfr|Prantsuse patendi taotlus|Prantsuse pat\adddotspace taotl\adddot
+patrequk|Briti patendi taotlus|Briti pat\adddotspace taotl\adddot
+patrequs|U.S\adddotspace patendi taotlus.|U.S\adddotspace pat\adddotspace taotl\adddot
+file|fail|fail
+library|raamatukogu|raamatukogu
+abstract|teesid|teesid
+annotation|kommentaarid|kommentaarid
+commonera|meie ajaarvamise j\"argi|m\adddot a\adddot j
+beforecommonera|enne meie ajaarvamist|e\adddot m\adddot a
+annodomini|p\"arast Kristust|pKr
+beforechrist|enne Kristust|eKr
+spring|kevadel|kevadel
+summer|suvel|suvel
+winter|talvel|talvel
+am|AM|AM
+pm|PM|PM
diff --git a/citeproc/biblatex-localization/finnish.lbx.strings b/citeproc/biblatex-localization/finnish.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/finnish.lbx.strings
@@ -0,0 +1,254 @@
+bibliography|Kirjallisuusluettelo|Kirjallisuus
+references|Viitteet|Viitteet
+shorthands|Lyhenteet|Lyhenteet
+editor|toimittanut|toim\adddot
+editors|toimittaneet|toim\adddot
+compiler|koontanut|koontanut
+compilers|koontaneet|koontaneet
+redactor|toimittanut|toim\adddot
+redactors|toimittaneet|toim\adddot
+reviser|toimittanut|toim\adddot
+revisers|toimittaneet|toim\adddot
+founder|perustaja|perustaja
+founders|perustajat|perustajat
+continuator|jatkaja|jatkaja
+continuators|jatkajat|jatkajat
+collaborator|avustaja|avustaja
+collaborators|avustajat|avustajat
+translator|k\"a\"ant\"anyt|k\"a\"ant\adddot
+translators|k\"a\"ant\"anyt|k\"a\"ant\adddot
+commentator|kommentaarin kirjoittanut|kommentaarin kirjoittanut
+commentators|kommentaarin kirjoittaneet|kommentaarin kirjoittaneet
+annotator|selityksin varustanut|selityksin varustanut
+annotators|selityksin varustaneet|selityksin varustaneet
+commentary|kommentaari|kommentaari
+annotations|selitykset|selitykset
+introduction|johdanto|johdanto
+foreword|esipuhe|esipuhe
+afterword|j\"alkisanat|j\"alkisanat
+organizer|toimittanut|toim\adddot
+organizers|toimittaneet|toim\adddot
+byorganizer|toimittanut|toim\adddot
+byauthor|kirjoittanut|kirj\adddot
+byeditor|toimittanut|toim\adddot
+bycompiler|koontanut|koontanut
+byredactor|toimittanut|toim\adddot
+byreviser|toimittanut|toim\adddot
+byreviewer|toimittanut|toim\adddot
+byfounder|perustanut|perustanut
+bycontinuator|jatkanut|jatkanut
+bycollaborator|yhteisty\"oss\"a|yhteisty\"oss\"a
+bytranslator|\lbx@lfromlang k\"a\"ant\"anyt|\lbx@sfromlang k\"a\"ant\adddot
+bycommentator|kommentaarin kirjoittanut|kommentaarin kirjoittanut
+byannotator|selityksin varustanut|selityksin varustanut
+withcommentator|kommentaarin kirjoittanut|kommentaarin kirjoittanut
+withannotator|selityksin varustanut|selityksin varustanut
+withintroduction|johdannon kirjottanut|johdannon kirjottanut
+withforeword|esipuheen kirjoittanut|esipuheen kirjoittanut
+withafterword|j\"alkisanat kirjoittanut|j\"alkisanat kirjoittanut
+and|ja|ja
+andothers|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot
+andmore|jne\adddot|jne\adddot
+volume|volyymi|vol\adddot
+volumes|volyymit|vol\adddot
+involumes||
+jourvol|volyymi|vol\adddot
+jourser|sarja|sarja
+book|kirja|kirja
+part|osa|osa
+issue|numero|numero
+newseries|uusi sarja|uusi sarja
+oldseries|vanha sarja|vanha sarja
+edition|painos|painos
+reprint|j\"alkipainos|j\"alkipainos
+reprintof|julkaistu aiemmin nimell\"a|julkaistu aiemmin nimell\"a
+reprintas|julkaistu uudelleen nimell\"a|julkaistu uudelleen nimell\"a
+reprintfrom|julkaistu aiemmin nimell\"a|julkaistu aiemmin nimell\"a
+translationof|k\"a\"ann\"os teoksesta|k\"a\"ann\"os teoksesta
+translationas|k\"a\"annetty nimell\"a|k\"a\"annetty nimell\"a
+translationfrom|k\"a\"annetty kielest\"a|k\"a\"annetty kielest\"a
+reviewof|arvostelu teoksesta|arvostelu teoksesta
+origpubas|julkaistu ensi kerran nimell\"a|julkaistu ensi kerran nimell\"a
+origpubin|julkaistu ensi kerran vuonna|julkaistu ensi kerran vuonna
+astitle|nimell\"a|nimell\"a
+bypublisher|julkaissut|julkaissut
+page|sivu|s\adddot
+pages|sivut|s\adddot
+column|palsta|palsta
+columns|palstat|palstat
+line|rivi|rivi
+lines|rivit|rivit
+nodate|ei julkaisup\"aiv\"a\"a|ei julkaisup\"aiv\"a\"a
+verse|s\"ae|s\"ae
+verses|s\"akeet|s\"akeet
+section|kohta|kohta
+sections|kohdat|kohdat
+paragraph|kappale|kappale
+paragraphs|kappaleet|kappaleet
+pagetotal|sivu|s\adddot
+pagetotals|sivut|s\adddot
+columntotal|palsta|palsta
+columntotals|palstat|palstat
+linetotal|rivi|rivi
+linetotals|rivit|rivit
+versetotal|s\"ae|s\"ae
+versetotals|s\"akeet|s\"akeet
+sectiontotal|kohta|kohta
+sectiontotals|kohdat|kohdat
+paragraphtotal|kappale|kappale
+paragraphtotals|kappaleet|kappaleet
+in|teoksessa|teoksessa
+inseries|sarjassa|sarjassa
+ofseries|sarjassa|sarjassa
+number|numero|nro
+chapter|luku|luku
+bathesis|tutkielma|tutkielma
+mathesis|tutkielma|tutkielma
+phdthesis|tohtorinv\"ait\"oskirja|tohtorinv\"ait\"oskirja
+candthesis|kanditaatintutkielma|kanditaatintutkielma
+resreport|tutkimusraportti|tutkimusraportti
+techreport|tekninen raportti|tekninen raportti
+software|ohjelmisto|ohjelmisto
+datacd|data-CD|data-CD
+audiocd|\"a\"ani-CD|\"a\"ani-CD
+version|versio|versio
+url|url|url
+urlfrom|saatavilla osoitteesta|saatavilla osoitteesta
+urlseen|viitattu|viitattu
+inpreparation|valmisteilla|valmisteilla
+submitted|l\"ahetetty|l\"ahetetty
+forthcoming|hyv\"aksytty julkaistavaksi|hyv\"aksytty julkaistavaksi
+inpress|painossa|painossa
+prepublished|esijulkaistu|esijulkaistu
+citedas|jatkossa|jatkossa
+thiscite|sama|sama
+seenote|katso viite|katso viite
+quotedin|lainattu teoksessa|lainattu teoksessa
+idem|idem|id\adddot
+idemsf|idem|id\adddot
+idemsm|idem|id\adddot
+idemsn|idem|id\adddot
+idempf|idem|id\adddot
+idempm|idem|id\adddot
+idempn|idem|id\adddot
+idempp|idem|id\adddot
+ibidem|ibidem|ibid\adddot
+opcit|op\adddotspace cit\adddot|op\adddotspace cit\adddot
+loccit|loc\adddotspace cit\adddot|loc\adddotspace cit\adddot
+confer|cf\adddot|cf\adddot
+sequens|sq\adddot|sq\adddot
+sequentes|sqq\adddot|sqq\adddot
+passim|passim|pass\adddot
+see|katso|ks\adddot
+seealso|katso my\"os|katso my\"os
+backrefpage|katso sivu|ks\adddotspace s\adddot
+backrefpages|katso sivut|ks\adddotspace s\adddot
+january|tammikuuta|tammikuuta
+february|helmikuuta|helmikuuta
+march|maaliskuuta|maaliskuuta
+april|huhtikuuta|huhtikuuta
+may|toukokuuta|toukokuuta
+june|kes\"akuuta|kes\"akuuta
+july|hein\"akuuta|hein\"akuuta
+august|elokuuta|elokuuta
+september|syyskuuta|syyskuuta
+october|lokakuuta|lokakuuta
+november|marraskuuta|marraskuuta
+december|joulukuuta|joulukuuta
+basicjanuary|tammikuu|tammikuu
+basicfebruary|helmikuu|helmikuu
+basicmarch|maaliskuu|maaliskuu
+basicapril|huhtikuu|huhtikuu
+basicmay|toukokuu|toukokuu
+basicjune|kes\"akuu|kes\"akuu
+basicjuly|hein\"akuu|hein\"akuu
+basicaugust|elokuu|elokuu
+basicseptember|syyskuu|syyskuu
+basicoctober|lokakuu|lokakuu
+basicnovember|marraskuu|marraskuu
+basicdecember|joulukuu|joulukuu
+langamerican|amerikanenglanti|amerikanenglanti
+langbrazilian|brasilianportugali|brasilianportugali
+langbulgarian|bulgaria|bulgaria
+langcatalan|katalonia|katalonia
+langcroatian|kroatia|kroatia
+langdanish|tanska|tanska
+langdutch|hollanti|hollanti
+langenglish|englanti|englanti
+langestonian|viro|viro
+langfinnish|suomi|suomi
+langfrench|ranska|ranska
+langgalician|galicia|galicia
+langgerman|saksa|saksa
+langgreek|kreikka|kreikka
+langhungarian|unkari|unkari
+langitalian|italia|italia
+langlatin|latina|latina
+langlatvian|latvia|latvia
+langnorwegian|norja|norja
+langpolish|puola|puola
+langportuguese|portugali|portugali
+langrussian|ven\"aj\"a|ven\"aj\"a
+langslovak|slovakia|slovakia
+langslovene|slovenia|slovenia
+langspanish|espanja|espanja
+langswedish|ruotsi|ruotsi
+fromamerican|englannin kielest\"a|englannin kielest\"a
+frombrazilian|portugalin kielest\"a|portugalin kielest\"a
+frombulgarian|bulgarian kielest\"a|bulgarian kielest\"a
+fromcatalan|katalonian kielest\"a|katalonian kielest\"a
+fromcroatian|kroatian kielest\"a|kroatian kielest\"a
+fromdanish|tanskan kielest\"a|tanskan kielest\"a
+fromdutch|hollannin kielest\"a|hollannin kielest\"a
+fromenglish|englannin kielest\"a|englannin kielest\"a
+fromestonian|viron kielest\"a|viron kielest\"a
+fromfinnish|suomen kielest\"a|suomen kielest\"a
+fromfrench|ranskan kielest\"a|ranskan kielest\"a
+fromgalician|galician kielest\"a|galician kielest\"a
+fromgerman|saksan kielest\"a|saksan kielest\"a
+fromgreek|kreikan kielest\"a|kreikan kielest\"a
+fromhungarian|unkarin kielest\"a|unkarin kielest\"a
+fromitalian|italian kielest\"a|italian kielest\"a
+fromlatin|latinan kielest\"a|latinan kielest\"a
+fromlatvian|latvian kielest\"a|latvian kielest\"a
+fromnorwegian|norjan kielest\"a|norjan kielest\"a
+frompolish|puolan kielest\"a|puolan kielest\"a
+fromportuguese|portugalin kielest\"a|portugalin kielest\"a
+fromrussian|ven\"aj\"an kielest\"a|ven\"aj\"an kielest\"a
+fromslovak|slovakian kielest\"a|slovakian kielest\"a
+fromslovene|slovenian kielest\"a|slovenian kielest\"a
+fromspanish|espanjan kielest\"a|espanjan kielest\"a
+fromswedish|ruotsin kielest\"a|ruotsin kielest\"a
+countryde|Saksa|DE
+countryeu|Euroopan Unioni|EU
+countryep|Euroopan Unioni|EP
+countryfr|Ranska|FR
+countryuk|Iso-Britannia|GB
+countryus|Yhdysvallat|US
+patent|patentti|pat\adddot
+patentde|saksalainen patentti|saksalainen pat\adddot
+patenteu|Euroopan Unionin patentti|Euroopan Unionin pat\adddot
+patentfr|ranskalainen patentti|ranskalainen pat\adddot
+patentuk|isobritannialainen patentti|isobritannialainen pat\adddot
+patentus|yhdysvaltalainen patentti|yhdysvaltalainen pat\adddot
+patreq|patenttihakemus|pat\adddot\ hak\adddot
+patreqde|saksalainen patenttihakemus|saksalainen pat\adddot\ hak\adddot
+patreqeu|Euroopan Unionin patenttihakemus|Euroopan Unionin pat\adddot\ hak\adddot
+patreqfr|ranskalainen patenttihakemus|ranskalainen pat\adddot\ hak\adddot
+patrequk|isobritannialainen patenttihakemus|isobritannialainen pat\adddot\ hak\adddot
+patrequs|yhdysvaltalainen patenttihakemus|yhdysvaltalainen pat\adddot\ hak\adddot
+file|tiedosto|tiedosto
+library|kirjasto|kirjasto
+abstract|tiivistelm\"a|tiivistelm\"a
+annotation|selitykset|selitykset
+commonera|j\"alkeen ajanlaskun alun|jaa\adddot
+beforecommonera|ennen ajanlaskun alkua|eaa\adddot
+annodomini|j\"alkeen Kristuksen syntym\"an|jKr\adddot
+beforechrist|ennen Kristuksen syntym\"a\"a|eKr\adddot
+circa|noin|n\adddot
+spring|kev\"at|kev\"at
+summer|kes\"a|kes\"a
+autumn|syksy|syksy
+winter|talvi|talvi
+am|ap\adddot|ip\adddot
+pm|ip\adddot|ip\adddot
diff --git a/citeproc/biblatex-localization/french.lbx.strings b/citeproc/biblatex-localization/french.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/french.lbx.strings
@@ -0,0 +1,245 @@
+bibliography|Bibliographie|Bibliographie
+references|R\'ef\'erences|R\'ef\'erences
+shorthands|Liste des abr\'eviations|Abr\'eviations
+editor|\'editeur|\'ed\adddot
+editors|\'editeurs|\'ed\adddot
+compiler|compilateur|comp\adddot
+compilers|compilateurs|comp\adddot
+redactor|r\'edacteur|r\'ed\adddot
+redactors|r\'edacteurs|r\'ed\adddot
+reviser|r\'eviseur|r\'ev\adddot
+revisers|r\'eviseurs|r\'ev\adddot
+founder|fondateur|fond\adddot
+founders|fondateurs|fond\adddot
+continuator|continuateur|cont\adddot
+continuators|continuateurs|cont\adddot
+collaborator|collaborateur|coll\adddot
+collaborators|collaborateurs|coll\adddot
+translator|traducteur|trad\adddot
+translators|traducteurs|trad\adddot
+commentator|commentateur|comm\adddot
+commentators|commentateurs|comm\adddot
+annotator|annotateur|annot\adddot
+annotators|annotateurs|annot\adddot
+commentary|commentaires|comment\adddot
+annotations|annotations|annot\adddot
+introduction|introduction|introd\adddot
+foreword|pr\'eface|pr\'ef\adddot
+afterword|postface|postf\adddot
+editortr|\'editeur et traducteur|\'ed\adddotspace et trad\adddot
+editorstr|\'editeurs et traducteurs|\'ed\adddotspace et trad\adddot
+organizer|organisateur|org\adddot
+organizers|organisateurs|org\adddot
+byorganizer|organis\'e par|org\adddotspace par
+byauthor|par|par
+byeditor|sous la direction \smartof|sous la dir\adddotspace\smartof
+bycompiler|compil\'e par|comp\adddotspace par
+byredactor|r\'edig\'e par|r\'ed\adddotspace par
+byreviser|r\'evis\'e par|r\'ev\adddotspace par
+byreviewer|examin\'e par|ex\adddotspace par
+byfounder|d\'ecouvert par|d\'ecouv\adddotspace par
+bycontinuator|continu\'e par|cont\adddotspace par
+bytranslator|traduit \lbx@lfromlang\ par|trad\adddotspace \lbx@sfromlang\ par
+bycommentator|comment\'e par|comm\adddotspace par
+byannotator|annot\'e par|annot\adddotspace par
+withcommentator|avec des commentaires \smartof|avec des comment\adddotspace\smartof
+withannotator|avec des annotations \smartof|avec des annot\adddotspace\smartof
+withintroduction|avec une introduction \smartof|avec une introd\adddotspace\smartof
+withforeword|avec une pr\'eface \smartof|avec une pr\'ef\adddotspace\smartof
+withafterword|avec une postface \smartof|avec une postf\adddotspace\smartof
+and|et|et
+andothers|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot
+andmore|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot
+volume|tome|t\adddot
+volumes|tomes|t\adddot
+involumes|en|en
+jourvol|tome|t\adddot
+jourser|s\'erie|s\'er\adddot
+book|livre|livre
+part|partie|partie
+issue|\'edition|\'ed\adddot
+newseries|nouvelle s\'erie|nouv\adddotspace s\'er\adddot
+oldseries|ancienne s\'erie|anc\adddotspace s\'er\adddot
+edition|\'edition|\'ed\adddot
+reprint|r\'eimpression|r\'eimpr\adddot
+reprintof|r\'eimpression de|r\'eimpr\adddotspace de
+reprintas|r\'eimpression sous le titre|r\'eimpr\adddotspace sous le titre
+reprintfrom|r\'eimpression \`a partir \smartof|r\'eimpr\adddotspace \`a part\adddotspace\smartof
+translationof|traduction de|trad\adddotspace de
+translationas|traduit sous le titre|trad\adddotspace sous le titre
+translationfrom|traduit de|trad\adddotspace de
+reviewof|critique de|crit.\adddotspace de
+origpubas|publi\'e \`a l'origine sous le titre|pub\adddotspace \`a l'orig\adddotspace sous le titre
+origpubin|publi\'e \`a l'origine en|pub\adddotspace \`a l'orig\adddotspace en
+astitle|sous le titre|sous le titre
+bypublisher|par|par
+page|page|p\adddot
+pages|pages|p\adddot
+column|colonne|col\adddot
+columns|colonnes|col\adddot
+line|ligne|l\adddot
+lines|lignes|l\adddot
+verse|vers|v\adddot
+verses|vers|v\adddot
+section|section|sect\adddot
+sections|sections|sect\adddot
+paragraph|paragraphe|\S
+paragraphs|paragraphes|\S
+pagetotal|page|p\adddot
+pagetotals|pages|p\adddot
+columntotal|colonne|col\adddot
+columntotals|colonnes|col\adddot
+linetotal|ligne|l\adddot
+linetotals|lignes|l\adddot
+versetotal|vers|v\adddot
+versetotals|vers|v\adddot
+sectiontotal|section|sect\adddot
+sectiontotals|sections|sect\adddot
+paragraphtotal|paragraphe|\S
+paragraphtotals|paragraphes|\S
+in|in|in
+inseries|in|in
+ofseries|de|de
+number|num\'ero|n\textsuperscript{o
+chapter|chapitre|chap\adddot
+bathesis|m\'emoire de bachelor|m\'em\adddotspace de bach\adddot
+mathesis|m\'emoire de master|m\'em\adddotspace de mast\adddot
+phdthesis|th\`ese de doctorat|th\`ese de doct\adddot
+candthesis|th\`ese de candidature|th\`ese de cand\adddot
+resreport|rapport scientifique|rapp\adddotspace scient\adddot
+techreport|rapport technique|rapp\adddotspace tech\adddot
+software|logiciel|logiciel
+datacd|c\'ed\'erom|c\'ed\'erom
+audiocd|disque compact audio|CD
+version|version|version
+url|adresse|adresse
+urlfrom|disponible \`a l'adresse|disp\adddotspace \`a l'adr\adddot
+urlseen|visit\'e le|visit\'e le
+inpreparation|en pr\'eparation|en pr\'ep\adddot
+submitted|soumis|soumis
+inpress|sous presse|sous presse
+prepublished|pr\'epubli\'e|pr\'epubl\adddot
+citedas|d\'esign\'e ci-apr\`es par|ci-apr\`es
+thiscite|sp\'ecialement|sp\'ec\adddot
+seenote|voir note|cf\adddotspace note
+quotedin|cit\'e dans|cit\'e dans
+idem|idem|idem
+idemsm|idem|idem
+idemsf|eadem|eadem
+idemsn|idem|idem
+idempm|eidem|eidem
+idempf|eaedem|eaedem
+idempn|eadem|eadem
+idempp|eidem|eidem
+ibidem|ibidem|ibid\adddot
+opcit|op\adddotspace cit\adddot|op\adddotspace cit\adddot
+loccit|loc\adddotspace cit\adddot|loc\adddotspace cit\adddot
+confer|cf\adddot|cf\adddot
+sequens|sq\adddot|sq\adddot
+sequentes|sqq\adddot|sqq\adddot
+passim|passim|pass\adddot
+see|cf\adddot|cf\adddot
+seealso|cf\adddotspace aussi|cf\adddotspace aussi
+backrefpage|cf\adddotspace page|cf\adddotspace p\adddot
+backrefpages|cf\adddotspace pages|cf\adddotspace p\adddot
+january|janvier|jan\adddot
+february|f\'evrier|f\'ev\adddot
+march|mars|mars
+april|avril|avr\adddot
+may|mai|mai
+june|juin|juin
+july|juillet|juill\adddot
+august|ao\^ut|ao\^ut
+september|septembre|sept\adddot
+october|octobre|oct\adddot
+november|novembre|nov\adddot
+december|d\'ecembre|d\'ec\adddot
+langamerican|am\'ericain|am\'ericain
+langbrazilian|br\'esilien|br\'esilien
+langbulgarian|bulgare|bulgare
+langcatalan|catalan|catalan
+langcroatian|croate|croate
+langczech|tch\`eque|tch\`eque
+langdanish|danois|danois
+langdutch|n\'eerlandais|n\'eerlandais
+langenglish|anglais|anglais
+langestonian|estonien|estonien
+langfinnish|finnois|finnois
+langgalician|galicien|galicien
+langgerman|allemand|allemand
+langgreek|grec|grec
+langhungarian|hongrois|hongrois
+langitalian|italien|italien
+langjapanese|japonais|japonais
+langlatin|latin|latin
+langlatvian|letton|letton
+langnorwegian|norv\'egien|norv\'egien
+langpolish|polonais|polonais
+langportuguese|portugais|portugais
+langrussian|russe|russe
+langserbian|serbe|serbe
+langslovak|slovaque|slovaque
+langslovene|slov\`ene|slov\`ene
+langspanish|espagnol|espagnol
+langswedish|su\'edois|su\'edois
+langukrainian|ukrainien|ukrainien
+fromamerican|de l'am\'ericain|de l'am\'ericain
+frombrazilian|du br\'esilien|du br\'esilien
+frombulgarian|du bulgare|du bulgare
+fromcatalan|du catalan|du catalan
+fromcroatian|du croate|du croate
+fromczech|du tch\`eque|du tch\`eque
+fromdanish|du danois|du danois
+fromdutch|du n\'eerlandais|du n\'eerlandais
+fromenglish|de l'anglais|de l'anglais
+fromestonian|de l'estonien|de l'estonien
+fromfinnish|du finnois|du finnois
+fromgalician|du galicien|du galicien
+fromgerman|de l'allemand|de l'allemand
+fromgreek|du grec|du grec
+fromhungarian|du hongrois|du hongrois
+fromitalian|de l'italien|de l'italien
+fromjapanese|du japonais|du japonais
+fromlatin|du latin|du latin
+fromlatvian|du letton|du letton
+fromnorwegian|du norv\'egien|du norv\'egien
+frompolish|du polonais|du polonais
+fromportuguese|du portugais|du portugais
+fromrussian|du russe|du russe
+fromserbian|du serbe|du serbe
+fromslovak|du slovaque|du slovaque
+fromslovene|du slov\`ene|du slov\`ene
+fromspanish|de l'espagnol|de l'espagnol
+fromswedish|du su\'edois|du su\'edois
+fromukrainian|de l'ukrainien|de l'ukrainien
+countryde|Allemagne|DE
+countryeu|Union europ\'eenne|EU
+countryep|Union europ\'eenne|EP
+countryfr|France|FR
+countryuk|Royaume-Uni|GB
+countryus|\'Etats-Unis|US
+patent|brevet|brev\adddot
+patentde|brevet allemand|brev\adddotspace allem\adddot
+patenteu|brevet europ\'een|brev\adddotspace europ\adddot
+patentuk|brevet britannique|brev\adddotspace brit\adddot
+patentus|brevet am\'ericain|brev\adddotspace am\'er\adddot
+patreq|demande de brevet|demande de brev\adddot
+patreqde|demande de brevet allemand|demande de brev\adddotspace allem\adddot
+patreqeu|demande de brevet europ\'een|demande de brev\adddotspace europ\adddot
+patrequk|demande de brevet britannique|demande de brev\adddotspace brit\adddot
+patrequs|demande de brevet am\'ericain|demande de brev\adddotspace am\'er\adddot
+file|fichier|fichier
+library|biblioth\`eque|biblioth\adddot
+abstract|r\'esum\'e|r\'es\adddot
+annotation|annotations|annotations
+commonera|de l'\`ere commune|EC
+beforecommonera|avant l'\`ere commune|AEC
+annodomini|apr\`es J\'esus-Christ|apr\adddotspace J\adddot-C\adddot
+beforechrist|avant J\'esus-Christ|av\adddotspace J\adddot-C\adddot
+circa|vers|vers
+spring|printemps|printemps
+summer|\'et\'e|\'et\'e
+autumn|automne|automne
+winter|hiver|hiver
+am|AM|AM
+pm|PM|PM
diff --git a/citeproc/biblatex-localization/galician.lbx.strings b/citeproc/biblatex-localization/galician.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/galician.lbx.strings
@@ -0,0 +1,28 @@
+bibliography|Bibliograf\'ia|Bibliograf\'ia
+references|Referencias|Referencias
+shorthands|Lista de abreviaturas|Abreviaturas
+editor|editor|ed\adddot
+editors|editores|eds\adddot
+compiler|compilador|comp\adddot
+compilers|compiladores|comp\adddot
+redactor|redactor|red\adddot
+redactors|redactores|red\adddot
+reviser|revisor|rev\adddot
+revisers|revisores|revs\adddot
+founder|fundador|fund\adddot
+founders|fundadores|fund\adddot
+continuator|continuador|cont\adddot
+continuators|continuadores|cont\adddot
+collaborator|colaborador|col\adddot
+collaborators|colaboradores|cols\adddot
+translator|tradutor|trad\adddot
+translators|tradutores|trads\adddot
+commentator|comentador|coment\adddot
+commentators|comentadores|coments\adddot
+annotator|anotador|anot\adddot
+annotators|anotadores|anots\adddot
+commentary|comentario|coment\adddot
+annotations|notas|notas
+introduction|introduci\'on|introd\adddot
+foreword|prefacio|pref\adddot
+afterword|posfacio|posf\adddot
diff --git a/citeproc/biblatex-localization/german.lbx.strings b/citeproc/biblatex-localization/german.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/german.lbx.strings
@@ -0,0 +1,28 @@
+bibliography|Literaturverzeichnis|Literatur
+references|Literaturverzeichnis|Literatur
+shorthands|Sigelverzeichnis|Sigel
+editor|Herausgeber|Hrsg\adddot
+editors|Herausgeber|Hrsg\adddot
+compiler|Kompilator|Komp\adddot
+compilers|Kompilatoren|Komp\adddot
+redactor|Bearbeiter|Bearb\adddot
+redactors|Bearbeiter|Bearb\adddot
+reviser|\"Uberarbeiter|\"Uberarb\adddot
+revisers|\"Uberarbeiter|\"Uberarb\adddot
+founder|Begr\"under|Begr\adddot
+founders|Begr\"under|Begr\adddot
+continuator|Fortf\"uhrer|Fortf\adddot
+continuators|Fortf\"uhrer|Fortf\adddot
+collaborator|Mitarbeiter|Mitarb\adddot
+collaborators|Mitarbeiter|Mitarb\adddot
+translator|\"Ubersetzer|\"Ubers\adddot
+translators|\"Ubersetzer|\"Ubers\adddot
+commentator|Kommentator|Komm\adddot
+commentators|Kommentatoren|Komm\adddot
+annotator|Kommentator|Komm\adddot
+annotators|Kommentatoren|Komm\adddot
+commentary|Kommentar|Komm\adddot
+annotations|Erl\"auterungen|Erl\"aut\adddot
+introduction|Einleitung|Einl\adddot
+foreword|Vorwort|Vorw\adddot
+afterword|Nachwort|Nachw\adddot
diff --git a/citeproc/biblatex-localization/greek.lbx.strings b/citeproc/biblatex-localization/greek.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/greek.lbx.strings
@@ -0,0 +1,9 @@
+bibliography|Βιβλιογραφία|Βιβλιογραφία
+references|Αναφορές|Αναφορές
+shorthands|Κατάλογος συντμήσεων|Συντμήσεις
+editor|επιμελητής|επιμελητής
+editors|επιμελητές|επιμελητές
+compiler|συντάκτης|συντάκτης
+compilers|συντάκτες|συντάκτες
+redactor|συντάκτης|συντάκτης
+redactors|συντάκτες|συντάκτες
diff --git a/citeproc/biblatex-localization/hungarian.lbx.strings b/citeproc/biblatex-localization/hungarian.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/hungarian.lbx.strings
diff --git a/citeproc/biblatex-localization/icelandic.lbx.strings b/citeproc/biblatex-localization/icelandic.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/icelandic.lbx.strings
@@ -0,0 +1,7 @@
+bibliography|Heimildaskr\'a|Heimildaskr\'a
+references|Heimildir|Heimildir
+shorthands|Listi yfir skammstafanir|Skammstafanir
+editor|ristj\'ori|ritstj\adddot
+editors|ritstj\'orar|ritstj\adddot
+compiler|samantekt|samantekt
+compilers|samantekt|samantekt
diff --git a/citeproc/biblatex-localization/italian.lbx.strings b/citeproc/biblatex-localization/italian.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/italian.lbx.strings
@@ -0,0 +1,9 @@
+bibliography|Bibliografia|Bibliografia
+references|Riferimenti bibliografici|Riferimenti bibliografici
+shorthands|Elenco delle sigle|Sigle
+editor|curatore|cur\adddot
+editors|curatori|cur\adddot
+compiler|compilatore|comp\adddot
+compilers|compilatori|comp\adddot
+redactor|redattore|red\adddot
+redactors|redattori|red\adddot
diff --git a/citeproc/biblatex-localization/latvian.lbx.strings b/citeproc/biblatex-localization/latvian.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/latvian.lbx.strings
@@ -0,0 +1,75 @@
+redactor|redaktors|redakt\adddot
+redactors|redaktori|radakt\adddot
+reviser|revidents|revid\adddot
+revisers|revidenti|revid\adddot
+introduction|ievads|ievads
+byeditor|izdevis|izdevis
+bytranslator|tulkojis|tulk\adddot
+withintroduction|ar ievadu no|ar ievadu no
+byeditortr|izdevis un tulkojis|izdev\adddotspace un tulk\adddot
+and|un|un
+andothers|un citi|u\adddotspace c\adddot
+jourvol|izdevums|izdev\adddot
+issue|izdevums|izdev\adddot
+edition|izdevums|izdev\adddot
+translationof|tulkojums no|tulk\adddotspace no
+translationfrom|tulkots no|tulk\adddotspace no
+reviewof|recenzija|recenz\adddot
+bypublisher|no|no
+nodate|bez datuma|bez dat\adddot
+page|lappuse|lpp\adddot
+pages|lappuses|lpp\adddot
+column|sleja|sleja
+columns|slejas|slejas
+line|rinda|rinda
+lines|rindas|rindas
+verse|pants|pants
+verses|panti|panti
+paragraph|rindkopa|rindk\adddot
+paragraphs|rindkopas|rindk\adddot
+pagetotal|lappuse|lpp\adddot
+pagetotals|lappuses|lpp\adddot
+columntotal|sleja|sleja
+columntotals|slejas|slejas
+linetotal|rinda|rinda
+linetotals|rindas|rindas
+versetotal|pants|pants
+versetotals|panti|panti
+paragraphtotal|rindkopa|rindk\adddot
+paragraphtotals|rindkopas|rindk\adddot
+in||
+number|numurs|nr\adddot
+datacd|datu CD|datu CD
+audiocd|audio CD|audio CD
+version|versija|versija
+url|pieejams|pieejams
+urlfrom|pieejams no|pieejams no
+inpreparation|tiek gatavots|tiek gatavots
+submitted|iesniegts|iesniegts
+march|marts|marts
+may|maijs|maijs
+august|augusts|aug\adddot
+september|septembris|sept\adddot
+october|oktobris|okt\adddot
+november|novembris|nov\adddot
+december|decembris|dec\adddot
+langfinnish|somu|somu
+langrussian|krievu|krievu
+langswedish|zviedru|zviedru
+fromfinnish|no somu|no somu
+fromrussian|no krievu|no krievu
+fromswedish|no zviedru|no zviedru
+countryep|Eiropas Parlaments|EP
+countryfr|Francija|FR
+patent|patents|patents
+patenteu|Eiropas patents|Eiropas pat\adddot
+patentus|ASV patents|ASV pat\adddot
+file|fails|fails
+circa|ap|ap
+spring|pavasaris|pav\adddot
+summer|vasara|vas\adddot
+autumn|rudens|rud\adddot
+winter|ziema|ziema
+am|AM|AM
+pm|PM|PM
+dateyear|gada|g\adddot
diff --git a/citeproc/biblatex-localization/lithuanian.lbx.strings b/citeproc/biblatex-localization/lithuanian.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/lithuanian.lbx.strings
@@ -0,0 +1,31 @@
+bibliography|Bibliografija|Bibliografija
+references|Literatūros sąrašas|Literatūra
+shorthands|Santrumpų sąrašas|Santrumpos
+editor|sudarytojas|sud\adddot
+editors|sudarytojai|sud\adddot
+compiler|parengėjas|pareng\adddot
+compilers|parengėjai|pareng\adddot
+redactor|redaktorius|red\adddot
+redactors|redaktoriai|red\adddot
+reviser|korektorius|kor\adddot
+revisers|korektoriai|kor\adddot
+founder|pradininkas|prad\adddot
+founders|pradininkai|prad\adddot
+continuator|tęsėjas|tęs\adddot
+continuators|tęsėjai|tęs\adddot
+collaborator|bendradarbis|bendr\adddot
+collaborators|bendradarbiai|bendr\adddot
+translator|vertėjas|vert\adddot
+translators|vertėjai|vert\adddot
+commentator|komentarų autorius|koment\adddotspace aut\adddot
+commentators|komentarų autoriai|koment\adddotspace aut\adddot
+annotator|paaiškinimų autorius|paaišk\adddotspace aut\adddot
+annotators|paaiškinimų autoriai|paaišk\adddotspace aut\adddot
+commentary|komentarai|koment\adddot
+annotations|paaiškinimai|paaišk\adddot
+introduction|įvadas|įv\adddot
+foreword|pratarmė|prat\adddot
+afterword|pabaigos žodis|pab\adddotspace žodis
+organizer|organizatorius|org\adddot
+organizers|organizatoriai|org\adddot
+byorganizer|organizavo|org\adddot
diff --git a/citeproc/biblatex-localization/magyar.lbx.strings b/citeproc/biblatex-localization/magyar.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/magyar.lbx.strings
@@ -0,0 +1,29 @@
+bibliography|Irodalomjegyz\'ek|Irodalom
+references|Hivatkoz\'asok|Hivatkoz\'asok
+shorthands|R\"ovid\'it\'esek jegyz\'eke|R\"ovid\'it\'esek
+compiler|\"ossze\'all\'it\'o|\"ossze\'all\adddot
+compilers|\"ossze\'all\'it\'ok|\"ossze\'all\adddot
+reviser|korrektor|korr\adddot
+revisers|korrektorok|korr\adddot
+founder|alap\'it\'o|alap\adddot
+founders|alap\'it\'ok|alap\adddot
+%continuator||
+%continuators||
+translator|ford\'it\'o|ford\adddot
+translators|ford\'it\'ok|ford\adddot
+commentator|komment\'ator|komm\adddot
+commentators|komment\'atorok|komm\adddot
+annotator|jegyzetek \'ir\'oja|jegyz\adddot
+annotators|jegyzetek \'ir\'oi|jegyz\adddot
+commentary|komment\'ar|komm\adddot
+annotations|jegyzetek|jegyz\adddot
+introduction|bevezet\'es|bev\adddot
+afterword|ut\'osz\'o|ut\'osz\'o
+byorganizer|szervezte|szerv\adddot
+byauthor|\'irta|\'irta
+byeditor|szerkesztette|szerk\adddot
+bycompiler|\"ossze\'all\'itotta|\"ossze\'all\adddot
+byredactor|sajt\'o al\'a rendezte|kiad\adddot
+byreviser|jav\'itotta|jav\adddot
+byreviewer|b\'ir\'alta|b\'ir\adddot
+byfounder|alap\'itotta|alap\adddot
diff --git a/citeproc/biblatex-localization/naustrian.lbx.strings b/citeproc/biblatex-localization/naustrian.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/naustrian.lbx.strings
@@ -0,0 +1,2 @@
+citedas|im Folgenden zitiert als|im Folgenden zit\adddotspace als
+january|J\"anner|J\"an\adddot
diff --git a/citeproc/biblatex-localization/newzealand.lbx.strings b/citeproc/biblatex-localization/newzealand.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/newzealand.lbx.strings
diff --git a/citeproc/biblatex-localization/ngerman.lbx.strings b/citeproc/biblatex-localization/ngerman.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/ngerman.lbx.strings
@@ -0,0 +1,1 @@
+citedas|im Folgenden zitiert als|im Folgenden zit\adddotspace als
diff --git a/citeproc/biblatex-localization/norsk.lbx.strings b/citeproc/biblatex-localization/norsk.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/norsk.lbx.strings
@@ -0,0 +1,98 @@
+bibliography|Bibliografi|Bibliografi
+references|Referanser|Referanser
+shorthands|Forkortelser|Forkortelser
+compiler|kompilator|komp\adddot
+compilers|kompilatorer|komp\adddot
+redactor|bearbeidelse|bearb\adddot
+redactors|bearbeidelse|bearb\adddot
+reviser|revisjon|rev\adddot
+revisers|revisjon|rev\adddot
+founder|grunnlegger|grunnl\adddot
+founders|grunnleggere|grunnl\adddot
+collaborator|samarbeid|samarb\adddot
+collaborators|samarbeid|samarb\adddot
+translator|oversetter|overs\adddot
+translators|oversettere|overs\adddot
+commentator|kommentarer|komm\adddot
+commentators|kommentarer|komm\adddot
+annotator|forklaringer|forkl\adddot
+annotators|forklaringer|forkl\adddot
+commentary|kommentarer|komm\adddot
+annotations|forklaringer|forkl\adddot
+introduction|innledning|innl\adddot
+foreword|forord|forord
+afterword|etterord|etterord
+organizer|organisator|org\adddot
+organizers|organisatorer|org\adddot
+byorganizer|organisert av|org\adddotspace av
+byauthor|av|av
+byeditor|redigert av|red\adddotspace av
+bycompiler|kompilert av|komp\adddotspace av
+byredactor|bearbeidet av|bearb\adddotspace av
+byreviser|revidert av|rev\adddotspace av
+byreviewer|kritikk ved|krit\adddotspace ved
+byfounder|grunnlagt av|grunnl\adddotspace av
+bycollaborator|i samarbeid med|i samarb\adddotspace med
+bytranslator|oversatt \lbx@lfromlang\ av|overs\adddot\ \lbx@sfromlang\ av
+bycommentator|kommentert av|komm\adddot\ av
+byannotator|forklart av|forkl\adddot\ av
+withcommentator|med kommentarer av|med komm\adddot\ av
+withannotator|med forklaringer av|med forkl\adddot\ av
+withintroduction|med innledning av|med innl\adddot\ av
+withforeword|med forord av|med forord av
+withafterword|med etterord av|med etterord av
+and|og|og
+andothers|med flere|mfl\adddot
+andmore|med mer|m.m\adddot
+volume|bind|bd\adddot
+volumes|bind|bd\adddot
+involumes|i|i
+jourser|serie|ser\adddot
+book|bok|bok
+part|del|del
+issue|nummer|nr\adddot
+newseries|ny serie|ny ser\adddot
+oldseries|gammel serie|gl\adddotspace ser\adddot
+edition|utgave|utg\adddot
+reprint|opptrykk|opptr\adddot
+reprintof|opptrykk av|opptr\adddotspace av
+reprintas|trykt om som|tr\adddotspace om som
+reprintfrom|opptrykk fra|opptr\adddotspace fra
+translationof|oversettelse av|overs\adddotspace av
+translationas|oversatt som|overs\adddotspace som
+translationfrom|oversatt fra|overs\adddotspace fra
+reviewof|kritikk av|krit\adddotspace av
+origpubas|opprinnelig utgitt som|oppr\adddot\ utg\adddot\ som
+origpubin|opprinnelig utgitt i|oppr\adddot\ utg\adddot\ i
+astitle|som|som
+bypublisher|av|av
+nodate|udatert|udatert
+page|side|s\adddot
+pages|sider|s\adddot
+column|spalte|sp\adddot
+columns|spalter|sp\adddot
+line|linje|l\adddot
+lines|linjer|l\adddot
+verse|vers|v\adddot
+verses|vers|v\adddot
+section|avsnitt|avsn\adddot
+sections|avsnitt|avsn\adddot
+paragraph|avsnitt|avsn\adddot
+paragraphs|avsnitt|avsn\adddot
+pagetotal|side|s\adddot
+pagetotals|sider|s\adddot
+columntotal|spalte|sp\adddot
+columntotals|spalter|sp\adddot
+linetotal|linje|l\adddot
+linetotals|linjer|l\adddot
+versetotal|vers|v\adddot
+versetotals|vers|v\adddot
+sectiontotal|avsnitt|avsn\adddot
+sectiontotals|avsnitt|avsn\adddot
+paragraphtotal|avsnitt|avsn\adddot
+paragraphtotals|avsnitt|avsn\adddot
+in|i|i
+inseries|i|i
+ofseries|av|av
+number|nummer|nr\adddot
+chapter|kapittel|kap\adddot
diff --git a/citeproc/biblatex-localization/nswissgerman.lbx.strings b/citeproc/biblatex-localization/nswissgerman.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/nswissgerman.lbx.strings
@@ -0,0 +1,2 @@
+citedas|im Folgenden zitiert als|im Folgenden zit\adddotspace als
+countryuk|Grossbritannien|GB
diff --git a/citeproc/biblatex-localization/nynorsk.lbx.strings b/citeproc/biblatex-localization/nynorsk.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/nynorsk.lbx.strings
@@ -0,0 +1,28 @@
+references|Referansar|Referansar
+shorthands|Forkortingar|Forkortingar
+compilers|kompilatorar|komp\adddot
+redactor|omarbeiding|omarb\adddot
+redactors|omarbeiding|omarb\adddot
+founder|grunnleggjar|grunnl\adddot
+founders|grunnleggjarar|grunnl\adddot
+translator|omsetjar|oms\adddot
+translators|omsetjarar|oms\adddot
+commentator|kommentarar|komm\adddot
+commentators|kommentarar|komm\adddot
+annotator|forklaringar|forkl\adddot
+annotators|forklaringar|forkl\adddot
+commentary|kommentarar|komm\adddot
+annotations|forklaringar|forkl\adddot
+introduction|innleiing|innl\adddot
+organizers|organisatorar|org\adddot
+byredactor|omarbeidd av|omarb\adddotspace av
+withcommentator|med kommentarar av|med komm\adddot\ av
+withannotator|med forklaringar av|med forkl\adddot\ av
+withintroduction|med innleiing av|med innl\adddot\ av
+andothers|med fleire|mfl\adddot
+andmore|med meir|m.m\adddot
+oldseries|gamal serie|gl\adddotspace ser\adddot
+translationof|omsetjing av|oms\adddotspace av
+translationas|omsett som|oms\adddotspace som
+origpubas|opphavleg utgitt som|opph\adddot\ utg\adddot\ som
+origpubin|opphavleg utgitt i|opph\adddot\ utg\adddot\ i
diff --git a/citeproc/biblatex-localization/polish.lbx.strings b/citeproc/biblatex-localization/polish.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/polish.lbx.strings
@@ -0,0 +1,100 @@
+bibliography|Bibliografia|Bibliografia
+references|Bibliografia|Bibliografia
+editor|redaktor|red\adddot
+editors|redaktorzy|red\adddot
+compiler|redaktor|red\adddot
+compilers|redaktorzy|red\adddot
+redactor|redaktor|red\adddot
+redactors|redaktorzy|red\adddot
+reviser|korektor|kor\adddot
+revisers|korektorzy|kor\adddot
+collaborator|uczestnik|ucz\adddot
+collaborators|uczestnicy|ucz\adddot
+translator|t\l umacz|t\l um\adddot
+translators|t\l umacze|t\l um\adddot
+commentator|komentator|kom\adddot
+commentators|komentatorzy|kom\adddot
+annotator|uwaga|uw\adddot
+annotators|uwagi|uw\adddot
+commentary|komentarz|kom\adddot
+annotations|komentarze|kom\adddot
+foreword|przedmowa|przedm\adddot
+afterword|pos\l owie|pos\l \adddot
+editortr|redaktor i t\l umacz|red\adddotspace i per\adddot
+editorstr|redaktorzy i t\l umacze|red\adddotspace i per\adddot
+editorco|redaktor i komentator|red\adddotspace i kom\adddot
+translatorco|t\l umacz i komentator|t\l um\adddotspace i kom\adddot
+translatorsco|t\l umacze i komentatorzy|t\l um\adddotspace i kom\adddot
+organizer|organizator|org\adddot
+organizers|organizatorzy|org\adddot
+byorganizer|organizowane|org\adddot
+byauthor|autorstwo|aut\adddot
+byeditor|redagowa\l|red\adddot
+byredactor|zredagowano|zred\adddot
+byreviser|poprawione|popr\adddot
+byreviewer|recenzja|rec\adddot
+bytranslator|t\l umaczenie \lbx@lfromlang|t\l um\adddotspace \lbx@sfromlang
+bycommentator|skomentowane przez|skom\adddot
+byannotator|uwagi od|uw\adddot
+withcommentator|komentarze|kom\adddot
+withannotator|uwagi|uw\adddot
+withforeword|przedmowa|przedm\adddot
+withafterword|pos\l owie|pos\l \adddot
+byeditoran|zredagowany i z uwagami|zredag\adddotspace i z uw\adddot
+byeditoraf|zredagowany, z pos\l owiem|zred., z pos\l \adddot
+byeditorcofo|zredagowany, komentarze i przedmowa|zred., kom\adddotspace i przedm\adddot
+byeditorcoaf|zredagowany, komentarze i pos\l owie|zred., kom\adddotspace i pos\l \adddot
+byeditoranfo|zredagowany, uwagi i przedmowa|zred., uw\adddotspace i przedm\adddot
+byeditoranaf|zredagowany, uwagi i pos\l owie|zred., uw\adddotspace i pos\l \adddot
+and|i|i
+andothers|i inni|i in\adddot
+andmore|i inni|i in\adddot
+volume|tom|t\adddot
+volumes|tomy|t\adddot
+involumes|w|w
+jourvol|tom|t\adddot
+jourser|seria|ser\adddot
+issue|wydanie|wyd\adddot
+newseries|nowa seria|now\adddotspace ser\adddot
+oldseries|stara seria|star\adddotspace ser\adddot
+edition|wydruk|wyd\adddot
+reprint|przedruk|przedr\adddot
+reprintof|przedruk|przedr\adddot
+reprintas|przedrukowano jako|przedr\adddotspace jako
+reprintfrom|przedrukowano z|przedr\adddotspace z
+translationof|t\l umaczenie|t\l um\adddot
+translationas|t\l umaczenie jako|t\l um\adddotspace jako
+translationfrom|t\l umaczenie z|t\l um\adddotspace z
+reviewof|recenzja na\addcolon|rec\adddotspace na\addcolon
+origpubin|pierwodruk wydano w|pierw\adddotspace wyd\adddotspace w
+astitle|pod tytu\l em|pod tyt\adddot
+page|strona|s\adddot
+pages|strony|s\adddot
+column|kolumna|kol\adddot
+columns|kolumny|kol\adddot
+line|linijka|l\adddot
+lines|linijki|l\adddot
+nodate|bez daty|b\adddot d\adddot
+verse|werset|wer\adddot
+verses|wersety|wer\adddot
+section|paragraf|par\adddot
+sections|paragrafy|par\adddot
+paragraph|akapit|akap\adddot
+paragraphs|akapity|akap\adddot
+pagetotal|strona|s\adddot
+pagetotals|strony|s\adddot
+columntotal|kolumna|kol\adddot
+columntotals|kolumny|kol\adddot
+linetotal|wers|wer\adddot
+linetotals|wersy|wer\adddot
+versetotal|wiersz|wier\adddot
+versetotals|wiersze|wier\adddot
+sectiontotal|paragraf|par\adddot
+sectiontotals|paragrafy|par\adddot
+paragraphtotal|akapit|akap\adddot
+paragraphtotals|akapit|akap\adddot
+in|w|w
+inseries|w|w
+ofseries|z|z
+number|numer|nr\adddot
+chapter|rozdzia\l |rozd\adddot
diff --git a/citeproc/biblatex-localization/portuges.lbx.strings b/citeproc/biblatex-localization/portuges.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/portuges.lbx.strings
diff --git a/citeproc/biblatex-localization/portuguese.lbx.strings b/citeproc/biblatex-localization/portuguese.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/portuguese.lbx.strings
@@ -0,0 +1,95 @@
+bibliography|Bibliografia|Bibliografia
+references|Refer\^encias|Refer\^encias
+shorthands|Lista de Abreviaturas|Abreviaturas
+editor|editor|ed\adddot
+editors|editores|eds\adddot
+compiler|compilador|comp\adddot
+compilers|compiladores|comp\adddot
+redactor|redator|red\adddot
+redactors|redatores|red\adddot
+reviser|revisor|rev\adddot
+revisers|revisores|rev\adddot
+founder|fundador|fund\adddot
+founders|fundadores|fund\adddot
+continuator|continuador|cont\adddot
+continuators|continuadores|cont\adddot
+collaborator|colaborador|col\adddot
+collaborators|colaboradores|col\adddot
+translator|tradutor|trad\adddot
+translators|tradutores|trad\adddot
+commentator|comentador|coment\adddot
+commentators|comentadores|coment\adddot
+annotator|anotador|anot\adddot
+annotators|anotadores|anot\adddot
+commentary|coment\'ario|coment\adddot
+annotations|notas|notas
+foreword|pref\'acio|pref\adddot
+afterword|posf\'acio|posf\adddot
+organizer|organizador|org\adddot
+organizers|organizadores|orgs\adddot
+byorganizer|organizado por|org\adddotspace por
+byauthor|por|por
+byeditor|editado por|ed\adddotspace por
+bycompiler|compilado por|comp\adddotspace por
+byredactor|redigido por|red\adddotspace por
+byreviser|revisto por|rev\adddotspace por
+byreviewer|resenhado por|res\adddotspace por
+byfounder|fundado por|fund\adddotspace por
+bycontinuator|continuado por|cont\adddotspace por
+bytranslator|traduzido \lbx@lfromlang\ por|trad\adddot\ \lbx@sfromlang\ por
+bycommentator|comentado por|coment\adddot\ por
+byannotator|notas de|notas de
+withcommentator|com coment\'arios de|com coment\adddot\ de
+withannotator|com notas de|com notas de
+withforeword|com pref\'acio de|com pref\adddot\ de
+withafterword|com posf\'acio de|com posf\adddot\ de
+and|e|e
+andothers|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot
+andmore|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot
+volume|volume|vol\adddot
+volumes|volumes|vols\adddot
+involumes|em|em
+jourvol|volume|vol\adddot
+jourser|s\'erie|s\'er\adddot
+book|livro|livro
+part|parte|parte
+issue|n\'umero|n\'umero
+newseries|nova s\'erie|nova s\'er\adddot
+oldseries|s\'erie antiga|s\'er\adddot\ antiga
+reprint|reimpress\~ao|reimpr\adddot
+reprintof|reimpress\~ao de|reimpr\adddotspace de
+reprintas|reimpresso como|reimpr\adddotspace como
+reprintfrom|reimpresso|reimpr\adddot
+translationas|traduzido como|trad\adddotspace como
+translationfrom|traduzido do|trad\adddotspace do
+reviewof|resenha de|res\adddotspace de
+origpubas|originalmente publicado como|orig\adddotspace pub\adddotspace como
+origpubin|originalmente publicado em|orig\adddotspace pub\adddotspace em
+astitle|como|como
+bypublisher|por|por
+nodate|sem data|s\adddot d\adddot
+page|p\'agina|p\adddot
+pages|p\'aginas|pp\adddot
+column|coluna|col\adddot
+columns|colunas|cols\adddot
+line|linha|l\adddot
+lines|linhas|ll\adddot
+verse|verso|v\adddot
+verses|versos|vv\adddot
+paragraph|par\'agrafo|par\adddot
+paragraphs|par\'agrafo|par\adddot
+pagetotal|p\'agina|p\adddot
+pagetotals|p\'aginas|pp\adddot
+columntotal|coluna|col\adddot
+columntotals|colunas|cols\adddot
+linetotal|linha|l\adddot
+linetotals|linhas|ll\adddot
+versetotal|verso|v\adddot
+versetotals|versos|vv\adddot
+paragraphtotal|par\'agrafo|par\adddot
+paragraphtotals|par\'agrafo|par\adddot
+in|em|em
+inseries|em|em
+ofseries|de|de
+number|n\'umero|n\adddot\textordmasculine
+chapter|cap\'\i tulo|cap\adddot
diff --git a/citeproc/biblatex-localization/russian.lbx.strings b/citeproc/biblatex-localization/russian.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/russian.lbx.strings
@@ -0,0 +1,102 @@
+bibliography|Список литературы|Список литературы
+references|Список литературы|Список литературы
+shorthands|Список сокращений|Сокращения
+editor|редактор|ред\adddot
+editors|редакторы|ред\adddot
+compiler|составитель|сост\adddot
+compilers|составители|сост\adddot
+redactor|редактор|ред\adddot
+redactors|редакторы|ред\adddot
+reviser|ревизионный корректор|ревиз\adddotspace кор\adddot
+revisers|ревизионные корректоры|ревиз\adddotspace кор\adddot
+founder|основатель|осн\adddot
+founders|основатели|осн\adddot
+continuator|продолжатель|прод\adddot
+continuators|продолжатели|прод\adddot
+collaborator|участник|участ\adddot
+collaborators|участники|участ\adddot
+translator|переводчик|пер\adddot
+translators|переводчики|пер\adddot
+commentator|комментатор|коммент\adddot
+commentators|комментаторы|коммент\adddot
+annotator|примечания|примеч\adddot
+annotators|примечания|примеч\adddot
+commentary|комментарий|коммент\adddot
+annotations|примечания|примеч\adddot
+introduction|вступительная статья|вступ\adddotspace ст\adddot
+foreword|предисловие|предисл\adddot
+afterword|послесловие|послесл\adddot
+organizer|организатор|орг\adddot
+organizers|организаторы|орг\adddot
+byorganizer|организатор|орг\adddot
+byauthor||
+byeditor|под редакцией|под\addabbrvspace ред\adddot
+bycompiler|составитель|сост\adddot
+byredactor|под редакцией|под\addabbrvspace ред\adddot
+byreviser|исправлено|испр\adddot
+byreviewer|рецензия|рец\adddot
+byfounder|учредитель|учр\adddot
+bycontinuator|продолжение|продолж\adddot
+bycollaborator|при участии|при\addabbrvspace уч\adddot
+bytranslator|перевод \lbx@lfromlang|пер\adddot\ \lbx@sfromlang
+bycommentator|комментарии|коммент\adddot
+byannotator|примечания|примеч\adddot
+withcommentator|комментарии|коммент\adddot
+withannotator|примечания|примеч\adddot
+withintroduction|вступительная статья|вступ\adddotspace ст\adddot
+withforeword|предисловие|предисл\adddot
+withafterword|послесловие|послесл\adddot
+and|и|и
+andothers|и\addabbrvspace др\adddot|и\addabbrvspace др\adddot
+andmore|и\addabbrvspace др\adddot|и\addabbrvspace др\adddot
+volume|том|т\adddot
+volumes|томах|т\adddot
+involumes|в|в
+jourvol|том|т\adddot
+jourser|серия|сер\adddot
+book|книга|кн\adddot
+part|часть|ч\adddot
+issue|выпуск|вып\adddot
+newseries|новая серия|нов\adddotspace сер\adddot
+oldseries|старая серия|стар\adddotspace сер\adddot
+edition|издание|изд\adddot
+reprint|переиздание|переизд\adddot
+reprintof|переиздание|переизд\adddot
+reprintas|переиздано как|переизд\adddotspace как
+reprintfrom|переиздано с|переизд\adddotspace с
+translationof|перевод по изданию\addcolon|пер\adddotspace по изд\adddot\addcolon
+translationas|перевод\addcolon|пер\adddot\addcolon
+translationfrom|перевод с|пер\adddotspace с
+reviewof|рецензия на\addcolon|рец\adddotspace на\addcolon
+astitle|\addcolon|\addcolon
+bypublisher|\addcomma|\addcomma
+nodate|б\adddot г\adddot|б\adddot г\adddot
+page|страница|с\adddot
+pages|страницы|с\adddot
+column|колонка|кол\adddot
+columns|колонки|кол\adddot
+line|строка|строка
+lines|строки|строка
+verse|стих|стих
+verses|стихи|стихи
+section|параграф|\S
+sections|параграфы|\S\S
+paragraph|абзац|абз\adddot
+paragraphs|абзацы|абз\adddot
+pagetotal|страница|с\adddot
+pagetotals|страницы|с\adddot
+columntotal|колонка|кол\adddot
+columntotals|колонки|кол\adddot
+linetotal|строка|строка
+linetotals|строки|строка
+versetotal|стих|стих
+versetotals|стихи|стихи
+sectiontotal|параграф|\S
+sectiontotals|параграфы|\S\S
+paragraphtotal|абзац|абз\adddot
+paragraphtotals|абзацы|абз\adddot
+in|в|в
+inseries|в|в
+ofseries|из|из
+number|номер|№
+chapter|глава|гл\adddot
diff --git a/citeproc/biblatex-localization/serbian.lbx.strings b/citeproc/biblatex-localization/serbian.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/serbian.lbx.strings
diff --git a/citeproc/biblatex-localization/serbianc.lbx.strings b/citeproc/biblatex-localization/serbianc.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/serbianc.lbx.strings
diff --git a/citeproc/biblatex-localization/slovak.lbx.strings b/citeproc/biblatex-localization/slovak.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/slovak.lbx.strings
@@ -0,0 +1,82 @@
+references|Referencie|Referencie
+shorthands|Zoznam skratiek|Skratky
+editor|editor|ed\adddot
+editors|editori|ed\adddot
+compilers|zostavovatelia|zost\adddot
+redactor|redaktor|red\adddot
+redactors|redaktori|red\adddot
+reviser|korektor|kor\adddot
+revisers|korektori|kor\adddot
+founders|zakladatelia|zakl\adddot
+translators|prekladatelia|prekl\adddot
+foreword|predhovor|predh\adddot
+afterword|doslov|dosl\adddot
+byauthor||
+withforeword|s\addnbspace predhovorom od|s\addnbspace predh\adddot\ od
+withafterword|s\addnbspace doslovom od|s\addnbspace dosl\adddot\ od
+and|a|a
+andothers|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot
+andmore|et\addabbrvspace al\adddot|et\addabbrvspace al\adddot
+involumes|in|in
+book|kniha|kniha
+edition|vydanie|vyd\adddot
+reviewof|recenzia|recenz\adddot
+translationof|preklad|prekl\adddot
+astitle|ako|ako
+bypublisher||
+page|strana|s\adddot
+pages|strany|s\adddot
+line|riadok|r\adddot
+lines|riadky|r\adddot
+section|sekcia|\S
+sections|sekcie|\S\S
+paragraph|odsek|ods\adddot
+paragraphs|odseky|ods\adddot
+pagetotal|strana|s\adddot
+pagetotals|strany|s\adddot
+linetotal|riadok|r\adddot
+linetotals|riadky|r\adddot
+sectiontotal|sekcia|\S
+sectiontotals|sekcie|\S\S
+paragraphtotal|odsek|ods\adddot
+paragraphtotals|odseky|ods\adddot
+in|in|in
+inseries|in|in
+ofseries|z|z
+chapter|kapitola|kap\adddot
+datacd|CD-ROM|CD-ROM
+audiocd|audio CD|audio CD
+version|verzia|ver\adddot
+url|URL|URL
+idem|idem|idem
+idemsm|idem|idem
+idemsf|eadem|eadem
+idemsn|idem|idem
+idempm|eidem|eidem
+idempf|eaedem|eaedem
+idempn|eadem|eadem
+idempp|eidem|eidem
+ibidem|ibidem|ibid\adddot
+opcit|op\adddotspace cit\adddot|op\adddotspace cit\adddot
+loccit|loc\adddotspace cit\adddot|loc\adddotspace cit\adddot
+confer|cf\adddot|cf\adddot
+sequens|sq\adddot|sq\adddot
+sequentes|sqq\adddot|sqq\adddot
+passim|passim|pass\adddot
+march|marec|mar\adddot
+august|august|aug\adddot
+september|september|sept\adddot
+november|november|nov\adddot
+december|december|dec\adddot
+countryde|Nemecko|DE
+patent|patent|pat\adddot
+patentus|US patent|US pat\adddot
+abstract|abstrakt|abst\adddot
+annodomini|po Kristovi|po Kr\adddot
+beforechrist|pred Kristom|pred Kr\adddot
+circa|cirka|ca\adddot
+spring|jar|jar
+summer|leto|leto
+winter|zima|zima
+am|AM|AM
+pm|PM|PM
diff --git a/citeproc/biblatex-localization/slovene.lbx.strings b/citeproc/biblatex-localization/slovene.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/slovene.lbx.strings
@@ -0,0 +1,28 @@
+bibliography|Literatura|Literatura
+references|Literatura|Literatura
+shorthands|Kratice|Kratice
+editor|urednik|ur\adddot
+editors|uredniki|ur\adddot
+compiler|sestavljalec|sest\adddot
+compilers|sestavljalci|sest\adddot
+redactor|redaktor|redaktor
+redactors|redaktorji|redaktorji
+reviser|korektor|korektor
+revisers|korektorji|korektorji
+founder|snovalec|snovalec
+founders|snovalci|snovalci
+continuator|nadaljevalec|nadaljevalec
+continuators|nadaljevalci|nadaljevalci
+collaborator|sodelavec|sod\adddot
+collaborators|sodelavci|sod\adddot
+translator|prevajalec|prev\adddot
+translators|prevajalci|prev\adddot
+commentator|komentator|komentator
+commentators|komentatorji|komentatorji
+annotator|anotator|anotator
+annotators|anotatorji|anotatorji
+commentary|komentar|komentar
+annotations|opombe|op\adddot
+introduction|uvod|uvod
+foreword|predgovor|predg\adddot
+afterword|spremna beseda|spr\adddotspace b\adddot
diff --git a/citeproc/biblatex-localization/slovenian.lbx.strings b/citeproc/biblatex-localization/slovenian.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/slovenian.lbx.strings
diff --git a/citeproc/biblatex-localization/spanish.lbx.strings b/citeproc/biblatex-localization/spanish.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/spanish.lbx.strings
@@ -0,0 +1,190 @@
+references|Referencias|Referencias
+shorthands|Lista de abreviaturas|Abreviaturas
+editor|edici\'on|ed\adddot
+editors|edici\'on|eds\adddot
+commentator|comentario|com\adddot
+commentators|comentarios|coms\adddot
+annotator|anotaciones|anot\adddot
+annotators|anotaciones|anots\adddot
+commentary|comentario|com\adddot
+annotations|notas|notas
+introduction|introducci\'on|intr\adddot
+foreword|pr\'ologo|pr\'ol\adddot
+organizer|organizaci\'on|org\adddot
+organizers|organizaci\'on|orgs\adddot
+byorganizer|organizado por|org\adddotspace por
+byauthor|de|de
+byeditor|editado por|ed\adddotspace por
+bycompiler|compilado por|comp\adddotspace por
+byredactor|redacci\'on de|red\adddotspace de
+byreviser|revisado por|rev\adddotspace por
+byfounder|fundado por|fund\adddotspace por
+bycontinuator|continuado por|cont\adddotspace por
+bytranslator|traducido \lbx@lfromlang\ por|trad\adddot \lbx@sfromlang\ por
+bycommentator|comentado por|com\adddotspace por
+byannotator|anotado por|anot\adddotspace por
+withcommentator|con comentario de|con com\adddotspace de
+withannotator|con notas de|con notas de
+withintroduction|con introduci\'on de|con intr\adddotspace de
+withforeword|con pr\'ologo de|con pr\'ol\adddotspace de
+and|y|y
+andothers|y~col\adddot|y~col\adddot
+andmore|et\adddotspace al\adddot|et\adddotspace al\adddot
+volume|volumen|vol\adddot
+volumes|vol\'umenes|vols\adddot
+involumes|en|en
+jourvol|volumen|vol\adddot
+jourser|\'epoca|\'ep\adddot
+book|libro|libro
+part|parte|parte
+issue|n\'umero|n\'um\adddot
+newseries|nueva \'epoca|n\adddotspace \'ep\adddot
+oldseries|antigua \'epoca|ant\adddotspace \'ep\adddot
+edition|edici\'on|ed\adddot
+reprintas|reimpreso como|reimp\adddotspace como
+translationas|traducido como|trad\adddotspace como
+translationfrom|traducido del|trad\adddotspace del
+origpubas|publicado originalmente como|pub\adddotspace orig\adddotspace como
+origpubin|publicado originalmente en|pub\adddot orig\adddot en
+bypublisher|por la editorial|por la ed\adddot
+page|p\'agina|p\'ag\adddot
+pages|p\'aginas|p\'ags\adddot
+column|columna|col\adddot
+columns|columnas|cols\adddot
+verse|verso|v\adddot
+verses|versos|vv\adddot
+sections|secciones|secs\adddot
+pagetotal|p\'agina|p\'ag\adddot
+pagetotals|p\'aginas|p\'ags\adddot
+columntotal|columna|col\adddot
+columntotals|columnas|cols\adddot
+versetotal|verso|v\adddot
+versetotals|versos|vv\adddot
+sectiontotals|secciones|secs\adddot
+in|en|en
+inseries|en|en
+ofseries|de|de
+number|n\'umero|n\sptext{o
+chapter|cap\'itulo|cap\adddot
+bathesis|Tesis de licenciatura|Tesis de lic\adddot
+phdthesis|Tesis doctoral|Tesis doct\adddot
+candthesis|Tesis de candidatura doctoral|Tesis de cand\adddotspace doct\adddot
+techreport|informe t\'ecnico|inf\adddotspace t\'ec\adddot
+software|programa|prog\adddot
+datacd|disco de datos|CD de datos
+audiocd|disco de audio|CD de audio
+version|versi\'on|ver\adddot
+url|direcci\'on|direcci\'on
+urlfrom|disponible desde|disp\adddotspace desde
+urlseen|visitado|visitado
+submitted|enviado|enviado
+forthcoming|pr\'oximamente|prox\adddot
+inpress|en prensa|en prensa
+prepublished|previamente publicado|prepublicado
+citedas|citado en adelante como|cit\adddotspace en adelante como
+thiscite|especialmente|esp\adddot
+seenote|ver nota|ver n\adddot
+quotedin|citado en|cit\adddotspace en
+loccit|loc\adddotspace cit\adddot|loc\adddot cit\adddot
+confer|cf\adddot|cf\adddot
+sequens|s\adddot|s\adddot
+sequentes|ss\adddot|ss\adddot
+passim|p\'assim|p\'assim
+see|v\'ease|vid\adddot
+seealso|v\'ease tambi\'en|vid\adddotspace tambi\'en
+backrefpage|v\'ease p\'agina|vid\adddotspace p\'ag\adddot
+backrefpages|v\'eanse p\'aginas|vid\adddotspace p\'ags\adddot
+january|enero|ene\adddot
+february|febrero|feb\adddot
+march|marzo|mar\adddot
+april|abril|abr\adddot
+may|mayo|mayo
+june|junio|jun\adddot
+july|julio|jul\adddot
+august|agosto|ago\adddot
+september|septiembre|sep\adddot
+october|octubre|oct\adddot
+november|noviembre|nov\adddot
+december|diciembre|dic\adddot
+langbrazilian|brasile\~no|brasile\~no
+langbulgarian|b\'ulgaro|b\'ulgaro
+langcroatian|croata|croata
+langczech|checo|checo
+langdanish|dan\'es|dan\'es
+langdutch|neerland\'es|neerland\'es
+langenglish|ingl\'es|ingl\'es
+langestonian|estonio|estonio
+langfrench|franc\'es|franc\'es
+langgalician|gallego|gallego
+langgerman|alem\'an|alem\'an
+langgreek|griego|griego
+langhungarian|h\'ungaro|h\'ungaro
+langitalian|italiano|italiano
+langjapanese|japon\'es|japon\'es
+langlatvian|lituano|lituano
+langnorwegian|noruego|noruego
+langpolish|polaco|polaco
+langportuguese|portugu\'es|portugu\'es
+langrussian|ruso|ruso
+langslovak|eslovaco|eslovaco
+langslovene|esloveno|esloveno
+langspanish|espa\~nol|espa\~nol
+langswedish|sueco|sueco
+langukrainian|ucraniano|ucraniano
+frombrazilian|del brasile\~no|del brasile\~no
+frombulgarian|del b\'ulgaro|del b\'ulgaro
+fromcroatian|del croata|del croata
+fromczech|del checo|del checo
+fromdanish|del dan\'es|del dan\'es
+fromdutch|del neerland\'es|del neerland\'es
+fromenglish|del ingl\'es|del ingl\'es
+fromestonian|del estonio|del estonio
+fromfrench|del franc\'es|del franc\'es
+fromgalician|del gallego|del gallego
+fromgerman|del alem\'an|del alem\'an
+fromgreek|del griego|del griego
+fromhungarian|del h\'ungaro|del h\'ungaro
+fromitalian|del italiano|del italiano
+fromjapanese|del japon\'es|del japon\'es
+fromlatvian|del lituano|del lituano
+fromnorwegian|del noruego|del noruego
+frompolish|del polaco|del polaco
+fromportuguese|del portugu\'es|del portugu\'es
+fromrussian|del ruso|del ruso
+fromslovak|del eslovaco|del eslovaco
+fromslovene|del esloveno|del esloveno
+fromspanish|del espa\~nol|del espa\~nol
+fromswedish|del sueco|del sueco
+fromukrainian|del ucraniano|del ucraniano
+countryde|Alemania|DE
+countryeu|Uni\'on Europea|EU
+countryep|Uni\'on Europea|EP
+countryfr|Francia|FR
+countryuk|Reino Unido|GB
+countryus|Estados Unidos|US
+patent|patente|pat\adddot
+patentde|patente alemana|pat\adddotspace alemana
+patenteu|patente europea|pat\adddotspace europea
+patentfr|patente francesa|pat\adddotspace francesa
+patentuk|patente brit\'anica|pat\adddotspace brit\'anica
+patentus|patente estadounidense|pat\adddotspace estadounidense
+patreq|solicitud de patente|sol\adddotspace de pat\adddot
+patreqde|solicitud de patente alemana|sol\adddotspace de pat\adddot alemana
+patreqeu|solicitud de patente europea|sol\adddotspace de pat\adddot europea
+patreqfr|solicitud de patente francesa|sol\adddotspace de pat\adddot francesa
+patrequk|solicitud de patente brit\'anica|sol\adddotspace de pat\adddot brit\'anica
+patrequs|solicitud de patente estadounidense|sol\adddotspace de pat\adddot estadounidense
+file|archivo|archivo
+library|biblioteca|bibl\adddot
+abstract|resumen|resumen
+commonera|era com\'un|e\adddotspace c\adddot
+beforecommonera|antes de la era com\'un|a\adddotspace e\adddotspace c\adddot
+annodomini|despu\'es de Cristo|d\adddotspace C\adddot
+beforechrist|antes de Cristo|a\adddotspace C\adddot
+circa|circa|ca\adddot
+spring|primavera|prim\adddot
+summer|verano|ver\adddot
+autumn|oto\~no|ot\adddot
+winter|invierno|inv\adddot
+am|a\adddotspace m\adddot|a\adddot m\adddot
+pm|p\adddotspace m\adddot|p\adddot m\adddot
diff --git a/citeproc/biblatex-localization/swedish.lbx.strings b/citeproc/biblatex-localization/swedish.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/swedish.lbx.strings
@@ -0,0 +1,9 @@
+bibliography|Litteraturf\"orteckning|Litteratur
+references|Referenser|Referenser
+shorthands|F\"orkortningar|F\"orkortningar
+editor|utgivare|utg\adddot
+editors|utgivare|utg\adddot
+compiler|sammanst\"allare|sammanst\adddot
+compilers|sammanst\"allare|sammanst\adddot
+redactor|redakt\"or|red\adddot
+redactors|redakt\"orer|red\adddot
diff --git a/citeproc/biblatex-localization/swissgerman.lbx.strings b/citeproc/biblatex-localization/swissgerman.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/swissgerman.lbx.strings
@@ -0,0 +1,1 @@
+countryuk|Grossbritannien|GB
diff --git a/citeproc/biblatex-localization/turkish.lbx.strings b/citeproc/biblatex-localization/turkish.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/turkish.lbx.strings
@@ -0,0 +1,157 @@
+references|Kaynaklar|Kaynaklar
+shorthands|K\i saltmalar dizini|K\i saltmalar
+compiler|derleyen|der\adddot
+compilers|derleyenler|der\adddot
+redactor|yay\i na haz\i rlayan|yay\adddot\ haz\adddot
+redactors|yay\i na haz\i rlayanlar|yay\adddot\ haz\adddot
+reviser|tashih eden|tashih\adddot
+revisers|tashih edenler|tashih\adddot
+founder|kurucu|kur\adddot
+founders|kurucular|kur\adddot
+continuator|tamamlayan|tam\adddot
+continuators|tamamlayanlar|tam\adddot
+collaborator|ortak|ortak
+collaborators|ortaklar|ortaklar
+commentator|yorumlayan|yrm\adddot
+commentators|yorumlayanlar|yrm\adddot
+commentary|yorum|yrm\adddot
+byauthor|yazar|yazar
+bycompiler|derleyen|der\adddot
+byredactor|yay\i na haz\i rlayan|yay\adddot\ haz\adddot
+byreviser|tashih|tashih
+byfounder|kurucu|kur\adddot
+bycontinuator|tamamlayan|tam\adddot
+bycommentator|yorumlayan|yrm\adddot
+withcommentator|yorumlar\i yla katk\i da bulunan|yrm\adddot\ kat\adddot\ bul\adddot
+and|ve|ve
+volume|cilt|c\adddot
+volumes|cilt|c\adddot
+jourvol|cilt|c\adddot
+jourser|seri|seri
+book|kitap|kitap
+part|k\i s\i m|k\i s\i m
+issue|say\i|say\i
+newseries|yeni seri|yeni seri
+oldseries|eski seri|eski seri
+edition|bask\i|bs\adddot
+reprint|yeni bask\i s\i|yeni bask\i s\i
+reprintof|yeni bask\i s\i|yeni bask\i s\i
+reprintas|yeni bask\i s\i|yeni bask\i s\i
+reprintfrom|yeni bask\i s\i|yeni bask\i s\i
+reviewof|derlenen eser|der\adddot\ eser
+origpubas|as\i l eser|as\i l eser
+origpubin|as\i l eser yay\i n tarihi|as\i l eser yay\i n tarihi
+bypublisher|yay\i n evi|yay\i n evi
+nodate|tarih yok|t\adddot y\adddot
+page|sayfa|s\adddot
+pages|sayfalar|ss\adddot
+line|sat\i r|sat\adddot
+lines|sat\i rlar|sat\adddot
+verse|m\i sra|m\i s\adddot
+verses|m\i sralar|m\i s\adddot
+paragraph|paragraf|par\adddot
+paragraphs|paragraflar|par\adddot
+pagetotal|toplam sayfa|s\adddot
+pagetotals|toplam sayfalar|ss\adddot
+linetotal|toplam sat\i r|sat\adddot
+linetotals|toplam sat\i rlar|sat\adddot
+versetotal|toplam m\i sra|m\i s\adddot
+versetotals|toplam m\i sralar|m\i s\adddot
+paragraphtotal|toplam paragraf|par\adddot
+paragraphtotals|toplam paragraflar|par\adddot
+inseries|serilerde|serilerde
+ofseries|serilerde|serilerde
+number|numara|no\adddot
+bathesis|lisans tezi|lis\adddot\ tezi
+phdthesis|doktora tezi|dok\adddot\ tezi
+candthesis|aday tezi|aday tezi
+techreport|teknik rapor|tek\adddot\ rap\adddot
+software|bilgisayar yaz\i l\i m\i|bilg\adddot\ yaz\adddot
+datacd|CD|CD
+audiocd|ses CD'si|ses CD'si
+version|versiyon|ver\adddot
+forthcoming|yak\i nda|yak\i nda
+prepublished|taslak bas\i m\i|taslak bas\i m\i
+citedas|at\i f olarak|at\i f olarak
+seenote|nota bak\i n\i z|nota bkz\adddot
+quotedin|al\i nt\i|al\i nt\i
+idem|ayn\i|ayn\i
+idemsm|ayn\i|ayn\i
+idemsf|ayn\i|ayn\i
+idemsn|ayn\i|ayn\i
+idempm|ayn\i lar\i|ayn\i lar\i
+idempf|ayn\i lar\i|ayn\i lar\i
+idempn|ayn\i lar\i|ayn\i lar\i
+idempp|ayn\i lar\i|ayn\i lar\i
+loccit|at\i f yap\i lan yer|at\i f yap\adddot\ yer
+sequens|takip eden|takip eden
+sequentes|takip eden|takip eden
+passim|rastgele|rastgele
+see|bak\i n\i z|bkz\adddot
+seealso|ayr\i ca bak\i n\i z|ayr\i ca bkz\adddot
+january|Ocak|Ocak
+march|Mart|Mar\adddot
+april|Nisan|Nis\adddot
+may|May\i s|May\adddot
+june|Haziran|Haz\adddot
+july|Temmuz|Tem\adddot
+october|Ekim|Ekim
+november|Kas\i m|Kas\adddot
+december|Aral\i k|Ara\adddot
+langamerican|Amerikanca|Amerikanca
+langbrazilian|Brezilyanca|Brezilyanca
+langbulgarian|Bulgarca|Bulgarca
+langcatalan|Katalanca|Katalanca
+langdanish|Danimarkanca|Danimarkanca
+langestonian|Estonca|Estonca
+langfinnish|Fince|Fince
+langfrench|Frans\i zca|Frans\i zca
+langgalician|Galce|Galce
+langgerman|Almanca|Almanca
+langgreek|Yunanca|Yunanca
+langhungarian|Macarca|Macarca
+langjapanese|Japonca|Japonca
+langlatin|Latince|Latince
+langlatvian|Letonca|Letonca
+langlithuanian|Litvanca|Litvanca
+langpolish|Polonyaca|Polonyaca
+langportuguese|Portekizce|Portekizce
+langslovene|Slovence|Slovence
+langukrainian|Ukraynaca|Ukraynaca
+fromamerican|Amerikanca'dan|Amerikanca'dan
+frombrazilian|Brezilyanca'dan|Brezilyanca'dan
+frombulgarian|Bulgarca'dan|Bulgarca'dan
+fromcatalan|Katalanca'dan|Katalanca'dan
+fromdanish|Danimarkanca'dan|Danimarkanca'dan
+fromestonian|Estonyaca'dan|Estonyaca'dan
+fromfinnish|Fince'den|Fince'den
+fromfrench|Frans\i zca'dan|Frans\i zca'dan
+fromgalician|Galyaca'dan|Galyaca'dan
+fromgerman|Almanca'dan|Almanca'dan
+fromgreek|Yunanca'dan|Yunanca'dan
+fromhungarian|Macarca'dan|Macarca'dan
+fromjapanese|Japonca'dan|Japonca'dan
+fromlatin|Latince'den|Latince'den
+fromlatvian|Latvianca'dan|Latvianca'dan
+fromlithuanian|Litvanca'dan|Litvanca'dan
+frompolish|Polonyaca'dan|Polonyaca'dan
+fromportuguese|Portekizce'den|Portekizce'den
+fromslovene|Slovence'den|Slovence'den
+fromukrainian|Ukraynaca'dan|Ukraynaca'dan
+countryde|Almanya|DE
+countryfr|Fransa|FR
+patent|patent|pat\adddot
+patentde|Alman patenti|Alman pat\adddot
+patenteu|Avrupa patenti|Avrupa pat\adddot
+patentfr|Frans\i z patenti|Frans\i z pat\adddot
+patentus|Amerika patenti|Amerika pat\adddot
+patreq|patent beklemede|pat\adddot\ bek\adddot
+patreqde|Alman patenti beklemede|Alman pat\adddot\ bek\adddot
+patreqeu|Avrupa patenti beklemede|Avrupa pat\adddot\ bek\adddot
+patreqfr|Frans\i z patenti beklemede|Frans\i z pat\adddot\ bek\adddot
+patrequs|Amerika patenti beklemede|Amerika pat\adddot\ bek\adddot
+file|dosya|dosya
+commonera|milattan sonra|MS
+annodomini|milattan sonra|MS
+summer|Yaz|Yaz
+autumn|Sonbahar|Sonbahar
diff --git a/citeproc/biblatex-localization/ukrainian.lbx.strings b/citeproc/biblatex-localization/ukrainian.lbx.strings
new file mode 100644
--- /dev/null
+++ b/citeproc/biblatex-localization/ukrainian.lbx.strings
@@ -0,0 +1,102 @@
+bibliography|Перелік літератури|Література
+references|Перелік літератури|Література
+shorthands|Перелік скорочень|Скорочення
+editor|редактор|ред\adddot
+editors|редактори|ред\adddot
+compiler|укладач|уклад\adddot
+compilers|укладачі|уклад\adddot
+redactor|редактор|ред\adddot
+redactors|редактори|ред\adddot
+reviser|ревізійний коректор|ревіз\adddotspace кор\adddot
+revisers|ревізійні коректори|ревіз\adddotspace кор\adddot
+founder|засновник|засн\adddot
+founders|засновник|засн\adddot
+continuator|продовжувач|прод\adddot
+continuators|продовжувачі|прод\adddot
+collaborator|учасник|учас\adddot
+collaborators|учасники|учас\adddot
+translator|перекладач|пер\adddot
+translators|перекладачі|пер\adddot
+commentator|коментатор|комент\adddot
+commentators|коментатори|комент\adddot
+annotator|примітки|прим\adddot
+annotators|примітки|прим\adddot
+commentary|коментар|комент\adddot
+annotations|примітки|прим\adddot
+introduction|вступна стаття|вступ\adddotspace ст\adddot
+foreword|передмова|передм\adddot
+afterword|післямова|післям\adddot
+organizer|організатор|орг\adddot
+organizers|організатори|орг\adddot
+byorganizer|організатор|орг\adddot
+byauthor|згідно автора|згідн\adddot авт\adddot
+byeditor|за редакцією|за\addabbrvspace ред\adddot
+bycompiler|укладач|уклад\adddot
+byredactor|за редакцією|за\addabbrvspace ред\adddot
+byreviser|виправлено|випр\adddot
+byreviewer|рецензія|рец\adddot
+byfounder|засновник|засн\adddot
+bycontinuator|продовження|продовж\adddot
+bycollaborator|за участю|за\addabbrvspace уч\adddot
+bytranslator|переклад \lbx@lfromlang|пер\adddot\ \lbx@sfromlang
+bycommentator|коментарі|комент\adddot
+byannotator|примітки|прим\adddot
+withcommentator|коментарі|комент\adddot
+withannotator|примітки|прим\adddot
+withintroduction|вступна стаття|вступ\adddotspace ст\adddot
+withforeword|передмовие|передм\adddot
+withafterword|післямовие|післям\adddot
+and|та|та
+andothers|та\addabbrvspace ін\adddot|та\addabbrvspace ін\adddot
+andmore|та\addabbrvspace ін\adddot|та\addabbrvspace ін\adddot
+volume|том|т\adddot
+volumes|томах|т\adddot
+involumes|в|в
+jourvol|том|т\adddot
+jourser|серія|сер\adddot
+book|книга|кн\adddot
+part|частина|ч\adddot
+issue|випуск|вип\adddot
+newseries|нова серія|нов\adddotspace сер\adddot
+oldseries|стара серія|стар\adddotspace сер\adddot
+edition|видання|вид\adddot
+reprint|перевидання|перевид\adddot
+reprintof|перевидання|перевид\adddot
+reprintas|перевидано як|перевид\adddotspace як
+reprintfrom|перевидано з|перевид\adddotspace з
+translationof|переклад по виданню\addcolon|пер\adddotspace по вид\adddot\addcolon
+translationas|переклад\addcolon|пер\adddot\addcolon
+translationfrom|переклад з|пер\adddotspace з
+reviewof|рецензія на\addcolon|рец\adddotspace на\addcolon
+astitle|\addcolon|\addcolon
+bypublisher|\addcomma|\addcomma
+nodate|б\adddot р\adddot|б\adddot р\adddot
+page|сторінка|с\adddot
+pages|сторінки|с\adddot
+column|колонка|кол\adddot
+columns|колонки|кол\adddot
+line|рядок|рядок
+lines|рядки|рядки
+verse|вірш|вірш
+verses|вірші|вірші
+section|параграф|\S
+sections|параграфи|\S\S
+paragraph|абзац|абз\adddot
+paragraphs|абзаци|абз\adddot
+pagetotal|сторінка|с\adddot
+pagetotals|сторінки|с\adddot
+columntotal|колонка|кол\adddot
+columntotals|колонки|кол\adddot
+linetotal|рядок|рядок
+linetotals|рядки|рядки
+versetotal|вірш|вірш
+versetotals|вірші|вірші
+sectiontotal|параграф|\S
+sectiontotals|параграфи|\S\S
+paragraphtotal|абзац|абз\adddot
+paragraphtotals|абзаци|абз\adddot
+in|в|в
+inseries|в|в
+ofseries|із|із
+number|номер|№
+chapter|глава|гл\adddot
diff --git a/data/default.csl b/data/default.csl
new file mode 100644
--- /dev/null
+++ b/data/default.csl
@@ -0,0 +1,648 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="display-and-sort" page-range-format="chicago">
+  <info>
+    <title>Chicago Manual of Style 17th edition (author-date)</title>
+    <id>http://www.zotero.org/styles/chicago-author-date</id>
+    <link href="http://www.zotero.org/styles/chicago-author-date" rel="self"/>
+    <link href="http://www.chicagomanualofstyle.org/tools_citationguide.html" rel="documentation"/>
+    <author>
+      <name>Julian Onions</name>
+      <email>julian.onions@gmail.com</email>
+    </author>
+    <contributor>
+      <name>Sebastian Karcher</name>
+    </contributor>
+    <contributor>
+      <name>Richard Karnesky</name>
+      <email>karnesky+zotero@gmail.com</email>
+      <uri>http://arc.nucapt.northwestern.edu/Richard_Karnesky</uri>
+    </contributor>
+    <contributor>
+      <name>Andrew Dunning</name>
+      <email>andrew.dunning@utoronto.ca</email>
+      <uri>https://orcid.org/0000-0003-0464-5036</uri>
+    </contributor>
+    <contributor>
+      <name>Matthew Roth</name>
+      <email>matthew.g.roth@yale.edu</email>
+      <uri> https://orcid.org/0000-0001-7902-6331</uri>
+    </contributor>
+    <category citation-format="author-date"/>
+    <category field="generic-base"/>
+    <summary>The author-date variant of the Chicago style</summary>
+    <updated>2018-01-24T12:00:00+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="en">
+    <terms>
+      <term name="editor" form="verb-short">ed.</term>
+      <term name="container-author" form="verb">by</term>
+      <term name="translator" form="verb-short">trans.</term>
+      <term name="editortranslator" form="verb">edited and translated by</term>
+      <term name="translator" form="short">trans.</term>
+    </terms>
+  </locale>
+  <macro name="secondary-contributors">
+    <choose>
+      <if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="none">
+        <group delimiter=". ">
+          <names variable="editor translator" delimiter=". ">
+            <label form="verb" text-case="capitalize-first" suffix=" "/>
+            <name and="text" delimiter=", "/>
+          </names>
+          <names variable="director" delimiter=". ">
+            <label form="verb" text-case="capitalize-first" suffix=" "/>
+            <name and="text" delimiter=", "/>
+          </names>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="container-contributors">
+    <choose>
+      <if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
+        <group prefix=", " delimiter=", ">
+          <names variable="container-author" delimiter=", ">
+            <label form="verb" suffix=" "/>
+            <name and="text" delimiter=", "/>
+          </names>
+          <names variable="editor translator" delimiter=", ">
+            <label form="verb" suffix=" "/>
+            <name and="text" delimiter=", "/>
+          </names>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="editor">
+    <names variable="editor">
+      <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="short" prefix=", "/>
+    </names>
+  </macro>
+  <macro name="translator">
+    <names variable="translator">
+      <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="short" prefix=", "/>
+    </names>
+  </macro>
+  <macro name="recipient">
+    <choose>
+      <if type="personal_communication">
+        <choose>
+          <if variable="genre">
+            <text variable="genre" text-case="capitalize-first"/>
+          </if>
+          <else>
+            <text term="letter" text-case="capitalize-first"/>
+          </else>
+        </choose>
+      </if>
+    </choose>
+    <names variable="recipient" delimiter=", ">
+      <label form="verb" prefix=" " text-case="lowercase" suffix=" "/>
+      <name and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="substitute-title">
+    <choose>
+      <if type="article-magazine article-newspaper review review-book" match="any">
+        <text macro="container-title"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="contributors">
+    <group delimiter=". ">
+      <names variable="author">
+        <name and="text" name-as-sort-order="first" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+        <label form="short" prefix=", "/>
+        <substitute>
+          <names variable="editor"/>
+          <names variable="translator"/>
+          <names variable="director"/>
+          <text macro="substitute-title"/>
+          <text macro="title"/>
+        </substitute>
+      </names>
+      <text macro="recipient"/>
+    </group>
+  </macro>
+  <macro name="contributors-short">
+    <names variable="author">
+      <name form="short" and="text" delimiter=", " initialize-with=". "/>
+      <substitute>
+        <names variable="editor"/>
+        <names variable="translator"/>
+        <names variable="director"/>
+        <text macro="substitute-title"/>
+        <text macro="title"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="interviewer">
+    <names variable="interviewer" delimiter=", ">
+      <label form="verb" prefix=" " text-case="capitalize-first" suffix=" "/>
+      <name and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="archive">
+    <group delimiter=". ">
+      <text variable="archive_location" text-case="capitalize-first"/>
+      <text variable="archive"/>
+      <text variable="archive-place"/>
+    </group>
+  </macro>
+  <macro name="access">
+    <group delimiter=". ">
+      <choose>
+        <if type="graphic report" match="any">
+          <text macro="archive"/>
+        </if>
+        <else-if type="article-journal bill book chapter legal_case legislation motion_picture paper-conference" match="none">
+          <text macro="archive"/>
+        </else-if>
+      </choose>
+      <choose>
+        <if type="webpage post-weblog" match="any">
+          <date variable="issued" form="text"/>
+        </if>
+      </choose>
+      <choose>
+        <if variable="issued" match="none">
+          <group delimiter=" ">
+            <text term="accessed" text-case="capitalize-first"/>
+            <date variable="accessed" form="text"/>
+          </group>
+        </if>
+      </choose>
+      <choose>
+        <if type="legal_case" match="none">
+          <choose>
+            <if variable="DOI">
+              <text variable="DOI" prefix="https://doi.org/"/>
+            </if>
+            <else>
+              <text variable="URL"/>
+            </else>
+          </choose>
+        </if>
+      </choose>
+    </group>
+  </macro>
+  <macro name="title">
+    <choose>
+      <if variable="title" match="none">
+        <choose>
+          <if type="personal_communication" match="none">
+            <text variable="genre" text-case="capitalize-first"/>
+          </if>
+        </choose>
+      </if>
+      <else-if type="bill book graphic legislation motion_picture song" match="any">
+        <text variable="title" text-case="title" font-style="italic"/>
+        <group prefix=" (" suffix=")" delimiter=" ">
+          <text term="version"/>
+          <text variable="version"/>
+        </group>
+      </else-if>
+      <else-if variable="reviewed-author">
+        <choose>
+          <if variable="reviewed-title">
+            <group delimiter=". ">
+              <text variable="title" text-case="title" quotes="true"/>
+              <group delimiter=", ">
+                <text variable="reviewed-title" text-case="title" font-style="italic" prefix="Review of "/>
+                <names variable="reviewed-author">
+                  <label form="verb-short" text-case="lowercase" suffix=" "/>
+                  <name and="text" delimiter=", "/>
+                </names>
+              </group>
+            </group>
+          </if>
+          <else>
+            <group delimiter=", ">
+              <text variable="title" text-case="title" font-style="italic" prefix="Review of "/>
+              <names variable="reviewed-author">
+                <label form="verb-short" text-case="lowercase" suffix=" "/>
+                <name and="text" delimiter=", "/>
+              </names>
+            </group>
+          </else>
+        </choose>
+      </else-if>
+      <else-if type="legal_case interview patent" match="any">
+        <text variable="title"/>
+      </else-if>
+      <else>
+        <text variable="title" text-case="title" quotes="true"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="edition">
+    <choose>
+      <if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+        <choose>
+          <if is-numeric="edition">
+            <group delimiter=" " prefix=". ">
+              <number variable="edition" form="ordinal"/>
+              <text term="edition" form="short" strip-periods="true"/>
+            </group>
+          </if>
+          <else>
+            <text variable="edition" text-case="capitalize-first" prefix=". "/>
+          </else>
+        </choose>
+      </if>
+      <else-if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
+        <choose>
+          <if is-numeric="edition">
+            <group delimiter=" " prefix=", ">
+              <number variable="edition" form="ordinal"/>
+              <text term="edition" form="short"/>
+            </group>
+          </if>
+          <else>
+            <text variable="edition" prefix=", "/>
+          </else>
+        </choose>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="locators">
+    <choose>
+      <if type="article-journal">
+        <choose>
+          <if variable="volume">
+            <text variable="volume" prefix=" "/>
+            <group prefix=" (" suffix=")">
+              <choose>
+                <if variable="issue">
+                  <text variable="issue"/>
+                </if>
+                <else>
+                  <date variable="issued">
+                    <date-part name="month"/>
+                  </date>
+                </else>
+              </choose>
+            </group>
+          </if>
+          <else-if variable="issue">
+            <group delimiter=" " prefix=", ">
+              <text term="issue" form="short"/>
+              <text variable="issue"/>
+              <date variable="issued" prefix="(" suffix=")">
+                <date-part name="month"/>
+              </date>
+            </group>
+          </else-if>
+          <else>
+            <date variable="issued" prefix=", ">
+              <date-part name="month"/>
+            </date>
+          </else>
+        </choose>
+      </if>
+      <else-if type="legal_case">
+        <text variable="volume" prefix=", "/>
+        <text variable="container-title" prefix=" "/>
+        <text variable="page" prefix=" "/>
+      </else-if>
+      <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+        <group prefix=". " delimiter=". ">
+          <group>
+            <text term="volume" form="short" text-case="capitalize-first" suffix=" "/>
+            <number variable="volume" form="numeric"/>
+          </group>
+          <group>
+            <number variable="number-of-volumes" form="numeric"/>
+            <text term="volume" form="short" prefix=" " plural="true"/>
+          </group>
+        </group>
+      </else-if>
+      <else-if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
+        <choose>
+          <if variable="page" match="none">
+            <group prefix=". ">
+              <text term="volume" form="short" text-case="capitalize-first" suffix=" "/>
+              <number variable="volume" form="numeric"/>
+            </group>
+          </if>
+        </choose>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="locators-chapter">
+    <choose>
+      <if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
+        <choose>
+          <if variable="page">
+            <group prefix=", ">
+              <text variable="volume" suffix=":"/>
+              <text variable="page"/>
+            </group>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators-article">
+    <choose>
+      <if type="article-newspaper">
+        <group prefix=", " delimiter=", ">
+          <group delimiter=" ">
+            <text variable="edition"/>
+            <text term="edition"/>
+          </group>
+          <group>
+            <text term="section" form="short" suffix=" "/>
+            <text variable="section"/>
+          </group>
+        </group>
+      </if>
+      <else-if type="article-journal">
+        <choose>
+          <if variable="volume issue" match="any">
+            <text variable="page" prefix=": "/>
+          </if>
+          <else>
+            <text variable="page" prefix=", "/>
+          </else>
+        </choose>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="point-locators">
+    <choose>
+      <if variable="locator">
+        <choose>
+          <if locator="page" match="none">
+            <choose>
+              <if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+                <choose>
+                  <if variable="volume">
+                    <group>
+                      <text term="volume" form="short" suffix=" "/>
+                      <number variable="volume" form="numeric"/>
+                      <label variable="locator" form="short" prefix=", " suffix=" "/>
+                    </group>
+                  </if>
+                  <else>
+                    <label variable="locator" form="short" suffix=" "/>
+                  </else>
+                </choose>
+              </if>
+              <else>
+                <label variable="locator" form="short" suffix=" "/>
+              </else>
+            </choose>
+          </if>
+          <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+            <number variable="volume" form="numeric" suffix=":"/>
+          </else-if>
+        </choose>
+        <text variable="locator"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="container-prefix">
+    <text term="in" text-case="capitalize-first"/>
+  </macro>
+  <macro name="container-title">
+    <choose>
+      <if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
+        <text macro="container-prefix" suffix=" "/>
+      </if>
+    </choose>
+    <choose>
+      <if type="webpage">
+        <text variable="container-title" text-case="title"/>
+      </if>
+      <else-if type="legal_case" match="none">
+        <group delimiter=" ">
+          <text variable="container-title" text-case="title" font-style="italic"/>
+          <choose>
+            <if type="post-weblog">
+              <text value="(blog)"/>
+            </if>
+          </choose>
+        </group>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="publisher">
+    <group delimiter=": ">
+      <text variable="publisher-place"/>
+      <text variable="publisher"/>
+    </group>
+  </macro>
+  <macro name="date">
+    <choose>
+      <if variable="issued">
+        <group delimiter=" ">
+          <date variable="original-date" form="text" date-parts="year" prefix="(" suffix=")"/>
+          <date variable="issued">
+            <date-part name="year"/>
+          </date>
+        </group>
+      </if>
+      <else-if variable="status">
+        <text variable="status" text-case="capitalize-first"/>
+      </else-if>
+      <else>
+        <text term="no date" form="short"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="date-in-text">
+    <choose>
+      <if variable="issued">
+        <group delimiter=" ">
+          <date variable="original-date" form="text" date-parts="year" prefix="[" suffix="]"/>
+          <date variable="issued">
+            <date-part name="year"/>
+          </date>
+        </group>
+      </if>
+      <else-if variable="status">
+        <text variable="status"/>
+      </else-if>
+      <else>
+        <text term="no date" form="short"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="day-month">
+    <date variable="issued">
+      <date-part name="month"/>
+      <date-part name="day" prefix=" "/>
+    </date>
+  </macro>
+  <macro name="collection-title">
+    <choose>
+      <if match="none" type="article-journal">
+        <choose>
+          <if match="none" is-numeric="collection-number">
+            <group delimiter=", ">
+              <text variable="collection-title" text-case="title"/>
+              <text variable="collection-number"/>
+            </group>
+          </if>
+          <else>
+            <group delimiter=" ">
+              <text variable="collection-title" text-case="title"/>
+              <text variable="collection-number"/>
+            </group>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="collection-title-journal">
+    <choose>
+      <if type="article-journal">
+        <group delimiter=" ">
+          <text variable="collection-title"/>
+          <text variable="collection-number"/>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="event">
+    <group>
+      <text term="presented at" suffix=" "/>
+      <text variable="event"/>
+    </group>
+  </macro>
+  <macro name="description">
+    <choose>
+      <if type="interview">
+        <group delimiter=". ">
+          <text macro="interviewer"/>
+          <text variable="medium" text-case="capitalize-first"/>
+        </group>
+      </if>
+      <else-if type="patent">
+        <group delimiter=" " prefix=". ">
+          <text variable="authority"/>
+          <text variable="number"/>
+        </group>
+      </else-if>
+      <else>
+        <text variable="medium" text-case="capitalize-first" prefix=". "/>
+      </else>
+    </choose>
+    <choose>
+      <if variable="title" match="none"/>
+      <else-if type="thesis personal_communication speech" match="any"/>
+      <else>
+        <group delimiter=" " prefix=". ">
+          <text variable="genre" text-case="capitalize-first"/>
+          <choose>
+            <if type="report">
+              <text variable="number"/>
+            </if>
+          </choose>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="issue">
+    <choose>
+      <if type="legal_case">
+        <text variable="authority" prefix=". "/>
+      </if>
+      <else-if type="speech">
+        <group prefix=". " delimiter=", ">
+          <group delimiter=" ">
+            <text variable="genre" text-case="capitalize-first"/>
+            <text macro="event"/>
+          </group>
+          <text variable="event-place"/>
+          <text macro="day-month"/>
+        </group>
+      </else-if>
+      <else-if type="article-newspaper article-magazine personal_communication" match="any">
+        <date variable="issued" form="text" prefix=", "/>
+      </else-if>
+      <else-if type="patent">
+        <group delimiter=", " prefix=", ">
+          <group delimiter=" ">
+            <!--Needs Localization-->
+            <text value="filed"/>
+            <date variable="submitted" form="text"/>
+          </group>
+          <group delimiter=" ">
+            <choose>
+              <if variable="issued submitted" match="all">
+                <text term="and"/>
+              </if>
+            </choose>
+            <!--Needs Localization-->
+            <text value="issued"/>
+            <date variable="issued" form="text"/>
+          </group>
+        </group>
+      </else-if>
+      <else-if type="article-journal" match="any"/>
+      <else>
+        <group prefix=". " delimiter=", ">
+          <choose>
+            <if type="thesis">
+              <text variable="genre" text-case="capitalize-first"/>
+            </if>
+          </choose>
+          <text macro="publisher"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <citation et-al-min="4" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true" givenname-disambiguation-rule="primary-name" collapse="year" after-collapse-delimiter="; ">
+    <layout prefix="(" suffix=")" delimiter="; ">
+      <group delimiter=", ">
+        <choose>
+          <if variable="issued accessed" match="any">
+            <group delimiter=" ">
+              <text macro="contributors-short"/>
+              <text macro="date-in-text"/>
+            </group>
+          </if>
+          <!---comma before forthcoming and n.d.-->
+          <else>
+            <group delimiter=", ">
+              <text macro="contributors-short"/>
+              <text macro="date-in-text"/>
+            </group>
+          </else>
+        </choose>
+        <text macro="point-locators"/>
+      </group>
+    </layout>
+  </citation>
+  <bibliography hanging-indent="true" et-al-min="11" et-al-use-first="7" subsequent-author-substitute="&#8212;&#8212;&#8212;" entry-spacing="0">
+    <sort>
+      <key macro="contributors"/>
+      <key variable="issued"/>
+      <key variable="title"/>
+    </sort>
+    <layout suffix=".">
+      <group delimiter=". ">
+        <text macro="contributors"/>
+        <text macro="date"/>
+        <text macro="title"/>
+      </group>
+      <text macro="description"/>
+      <text macro="secondary-contributors" prefix=". "/>
+      <text macro="container-title" prefix=". "/>
+      <text macro="container-contributors"/>
+      <text macro="edition"/>
+      <text macro="locators-chapter"/>
+      <text macro="collection-title-journal" prefix=", " suffix=", "/>
+      <text macro="locators"/>
+      <text macro="collection-title" prefix=". "/>
+      <text macro="issue"/>
+      <text macro="locators-article"/>
+      <text macro="access" prefix=". "/>
+    </layout>
+  </bibliography>
+</style>
diff --git a/data/epub.css b/data/epub.css
--- a/data/epub.css
+++ b/data/epub.css
@@ -7,9 +7,10 @@
 h4 { text-align: left; }
 h5 { text-align: left; }
 h6 { text-align: left; }
+/* For title, author, and date on the cover page */
 h1.title { }
-h2.author { }
-h3.date { }
+p.author { }
+p.date { }
 nav#toc ol,
 nav#landmarks ol { padding: 0; margin-left: 1em; }
 nav#toc ol li,
diff --git a/data/pandoc.lua b/data/pandoc.lua
--- a/data/pandoc.lua
+++ b/data/pandoc.lua
@@ -556,18 +556,18 @@
 
 --- Creates a table element.
 -- @function Table
--- @tparam      Attr         attr       attributes
 -- @tparam      Caption      caption    table caption
 -- @tparam      {ColSpec,...} colspecs  column alignments and widths
 -- @tparam      TableHead    head       table head
 -- @tparam      {TableBody,..} bodies   table bodies
 -- @treturn     TableFoot    foot       table foot
+-- @tparam[opt] Attr         attr       attributes
 M.Table = M.Block:create_constructor(
   "Table",
-  function(attr, caption, colspecs, head, bodies, foot)
+  function(caption, colspecs, head, bodies, foot, attr)
     return {
       c = {
-        attr,
+        ensureAttr(attr),
         caption,
         List:new(colspecs),
         head,
@@ -1056,6 +1056,30 @@
     fields[i] = name
   end
   return make_next_function(fields), t, nil
+end
+
+--
+-- Legacy and compatibility types
+--
+
+--- Creates a simple (old style) table element.
+-- @function SimpleTable
+-- @tparam      {Inline,...} caption    table caption
+-- @tparam      {AlignDefault|AlignLeft|AlignRight|AlignCenter,...} aligns alignments
+-- @tparam      {int,...}    widths     column widths
+-- @tparam      {Block,...}  headers    header row
+-- @tparam      {{Block,...}} rows      table rows
+-- @treturn     Block                   table element
+M.SimpleTable = function(caption, aligns, widths, headers, rows)
+  return {
+    caption = ensureInlineList(caption),
+    aligns = List:new(aligns),
+    widths = List:new(widths),
+    headers = List:new(headers),
+    rows = List:new(rows),
+    tag = "SimpleTable",
+    t = "SimpleTable",
+  }
 end
 
 
diff --git a/data/sample.lua b/data/sample.lua
--- a/data/sample.lua
+++ b/data/sample.lua
@@ -21,7 +21,7 @@
 -- configure the writer.
 local meta = PANDOC_DOCUMENT.meta
 
--- Chose the image format based on the value of the
+-- Choose the image format based on the value of the
 -- `image_format` meta value.
 local image_format = meta.image_format
   and stringify(meta.image_format)
@@ -45,9 +45,9 @@
         return '&gt;'
       elseif x == '&' then
         return '&amp;'
-      elseif x == '"' then
+      elseif in_attribute and x == '"' then
         return '&quot;'
-      elseif x == "'" then
+      elseif in_attribute and x == "'" then
         return '&#39;'
       else
         return x
@@ -141,8 +141,8 @@
   return '<del>' .. s .. '</del>'
 end
 
-function Link(s, src, tit, attr)
-  return "<a href='" .. escape(src,true) .. "' title='" ..
+function Link(s, tgt, tit, attr)
+  return "<a href='" .. escape(tgt,true) .. "' title='" ..
          escape(tit,true) .. "'>" .. s .. "</a>"
 end
 
@@ -271,7 +271,7 @@
 
 -- Convert pandoc alignment to something HTML can use.
 -- align is AlignLeft, AlignRight, AlignCenter, or AlignDefault.
-function html_align(align)
+local function html_align(align)
   if align == 'AlignLeft' then
     return 'left'
   elseif align == 'AlignRight' then
@@ -286,7 +286,7 @@
 function CaptionedImage(src, tit, caption, attr)
    return '<div class="figure">\n<img src="' .. escape(src,true) ..
       '" title="' .. escape(tit,true) .. '"/>\n' ..
-      '<p class="caption">' .. caption .. '</p>\n</div>'
+      '<p class="caption">' .. escape(caption) .. '</p>\n</div>'
 end
 
 -- Caption is a string, aligns is an array of strings,
@@ -357,4 +357,3 @@
     return function() return "" end
   end
 setmetatable(_G, meta)
-
diff --git a/data/templates/default.latex b/data/templates/default.latex
--- a/data/templates/default.latex
+++ b/data/templates/default.latex
@@ -368,10 +368,25 @@
 $if(csl-refs)$
 \newlength{\cslhangindent}
 \setlength{\cslhangindent}{1.5em}
-\newenvironment{cslreferences}%
-  {$if(csl-hanging-indent)$\setlength{\parindent}{0pt}%
-  \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}%
-  {\par}
+\newlength{\csllabelwidth}
+\setlength{\csllabelwidth}{3em}
+\newenvironment{CSLReferences}[3] % #1 hanging-ident, #2 entry sp
+ {% don't indent paragraphs
+  \setlength{\parindent}{0pt}
+  % turn on hanging indent if param 1 is 1
+  \ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
+  % set line spacing
+  % set entry spacing
+  \ifnum #2 > 0
+  \setlength{\parskip}{#3\baselineskip}
+  \fi
+ }%
+ {}
+\usepackage{calc} % for \widthof, \maxof
+\newcommand{\CSLBlock}[1]{#1\hfill\break}
+\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\maxof{\widthof{#1}}{\csllabelwidth}}{#1}}
+\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth}{#1}}
+\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
 $endif$
 
 $if(title)$
diff --git a/data/templates/default.opendocument b/data/templates/default.opendocument
--- a/data/templates/default.opendocument
+++ b/data/templates/default.opendocument
@@ -31,7 +31,7 @@
 $endfor$
 $if(toc)$
 <text:table-of-content>
-  <text:table-of-content-source text:outline-level="10">
+  <text:table-of-content-source text:outline-level="$toc-depth$">
     <text:index-title-template text:style-name="Contents_20_Heading">$toc-title$</text:index-title-template>
     <text:table-of-content-entry-template text:outline-level="1"
     text:style-name="Contents_20_1">
diff --git a/data/templates/styles.html b/data/templates/styles.html
--- a/data/templates/styles.html
+++ b/data/templates/styles.html
@@ -1,3 +1,111 @@
+$if(document-css)$
+html {
+  line-height: $if(linestretch)$$linestretch$$else$1.7$endif$;
+  font-family: $if(mainfont)$$mainfont$$else$Georgia, serif$endif$;
+  font-size: $if(fontsize)$$fontsize$$else$20px$endif$;
+  color: $if(fontcolor)$$fontcolor$$else$#1a1a1a$endif$;
+  background-color: $if(backgroundcolor)$$backgroundcolor$$else$#fdfdfd$endif$;
+}
+body {
+  margin: 0 auto;
+  max-width: 40em;
+  padding-left: $if(margin-left)$$margin-left$$else$50px$endif$;
+  padding-right: $if(margin-right)$$margin-right$$else$50px$endif$;
+  padding-top: $if(margin-top)$$margin-top$$else$50px$endif$;
+  padding-bottom: $if(margin-bottom)$$margin-bottom$$else$50px$endif$;
+  hyphens: auto;
+  word-wrap: break-word;
+  text-rendering: optimizeLegibility;
+  font-kerning: normal;
+}
+@media (max-width: 600px) {
+  body {
+    font-size: 0.9em;
+    padding: 1em;
+  }
+}
+@media print {
+  body {
+    background-color: transparent;
+    color: black;
+  }
+  p, h2, h3 {
+    orphans: 3;
+    widows: 3;
+  }
+  h2, h3, h4 {
+    page-break-after: avoid;
+  }
+}
+p {
+  margin-top: 1.7em;
+}
+a {
+  color: $if(linkcolor)$$linkcolor$$else$#1a1a1a$endif$;
+}
+a:visited {
+  color: $if(linkcolor)$$linkcolor$$else$#1a1a1a$endif$;
+}
+img {
+  max-width: 100%;
+}
+h1, h2, h3, h4, h5, h6 {
+  margin-top: 1.7em;
+}
+ol, ul {
+  padding-left: 1.7em;
+  margin-top: 1.7em;
+}
+li > ol, li > ul {
+  margin-top: 0;
+}
+blockquote {
+  margin: 1.7em 0 1.7em 1.7em;
+  padding-left: 1em;
+  border-left: 2px solid #e6e6e6;
+  font-style: italic;
+}
+code {
+  font-family: $if(monofont)$$monofont$$else$Menlo, Monaco, 'Lucida Console', Consolas, monospace$endif$;
+  background-color: #f0f0f0;
+  font-size: 85%;
+  margin: 0;
+  padding: .2em .4em;
+}
+pre {
+  line-height: 1.5em;
+  padding: 1em;
+  background-color: #f0f0f0;
+  overflow: auto;
+}
+pre code {
+  padding: 0;
+  overflow: visible;
+}
+hr {
+  background-color: #1a1a1a;
+  border: none;
+  height: 1px;
+  margin-top: 1.7em;
+}
+table {
+  border-collapse: collapse;
+  width: 100%;
+  overflow-x: auto;
+  display: block;
+}
+th, td {
+  border-bottom: 1px solid lightgray;
+  padding: 1em 3em 1em 0;
+}
+header {
+  margin-bottom: 6em;
+  text-align: center;
+}
+nav a:not(:hover) {
+  text-decoration: none;
+}
+$endif$
 code{white-space: pre-wrap;}
 span.smallcaps{font-variant: small-caps;}
 span.underline{text-decoration: underline;}
@@ -12,4 +120,28 @@
 $endif$
 $if(displaymath-css)$
 .display.math{display: block; text-align: center; margin: 0.5rem auto;}
+$endif$
+$if(csl-css)$
+div.csl-bib-body { }
+div.csl-entry {
+  clear: both;
+$if(csl-entry-spacing)$
+  margin-bottom: $csl-entry-spacing$;
+$endif$
+}
+.hanging div.csl-entry {
+  margin-left:2em;
+  text-indent:-2em;
+}
+div.csl-left-margin {
+  min-width:2em;
+  float:left;
+}
+div.csl-right-inline {
+  margin-left:2em;
+  padding-left:1em;
+}
+div.csl-indent {
+  margin-left: 2em;
+}
 $endif$
diff --git a/man/pandoc.1 b/man/pandoc.1
--- a/man/pandoc.1
+++ b/man/pandoc.1
@@ -1,7225 +1,7367 @@
 .\"t
-.\" Automatically generated by Pandoc 2.10.1
-.\"
-.TH "Pandoc User\[aq]s Guide" "" "July 23, 2020" "pandoc 2.10.1" ""
-.hy
-.SH NAME
-pandoc - general markup converter
-.SH SYNOPSIS
-.PP
-\f[C]pandoc\f[R] [\f[I]options\f[R]] [\f[I]input-file\f[R]]...
-.SH DESCRIPTION
-.PP
-Pandoc is a Haskell library for converting from one markup format to
-another, and a command-line tool that uses this library.
-.PP
-Pandoc can convert between numerous markup and word processing formats,
-including, but not limited to, various flavors of Markdown, HTML, LaTeX
-and Word docx.
-For the full lists of input and output formats, see the \f[C]--from\f[R]
-and \f[C]--to\f[R] options below.
-Pandoc can also produce PDF output: see creating a PDF, below.
-.PP
-Pandoc\[aq]s enhanced version of Markdown includes syntax for tables,
-definition lists, metadata blocks, footnotes, citations, math, and much
-more.
-See below under Pandoc\[aq]s Markdown.
-.PP
-Pandoc has a modular design: it consists of a set of readers, which
-parse text in a given format and produce a native representation of the
-document (an \f[I]abstract syntax tree\f[R] or AST), and a set of
-writers, which convert this native representation into a target format.
-Thus, adding an input or output format requires only adding a reader or
-writer.
-Users can also run custom pandoc filters to modify the intermediate AST.
-.PP
-Because pandoc\[aq]s intermediate representation of a document is less
-expressive than many of the formats it converts between, one should not
-expect perfect conversions between every format and every other.
-Pandoc attempts to preserve the structural elements of a document, but
-not formatting details such as margin size.
-And some document elements, such as complex tables, may not fit into
-pandoc\[aq]s simple document model.
-While conversions from pandoc\[aq]s Markdown to all formats aspire to be
-perfect, conversions from formats more expressive than pandoc\[aq]s
-Markdown can be expected to be lossy.
-.SS Using pandoc
-.PP
-If no \f[I]input-files\f[R] are specified, input is read from
-\f[I]stdin\f[R].
-Output goes to \f[I]stdout\f[R] by default.
-For output to a file, use the \f[C]-o\f[R] option:
-.IP
-.nf
-\f[C]
-pandoc -o output.html input.txt
-\f[R]
-.fi
-.PP
-By default, pandoc produces a document fragment.
-To produce a standalone document (e.g.
-a valid HTML file including \f[C]<head>\f[R] and \f[C]<body>\f[R]), use
-the \f[C]-s\f[R] or \f[C]--standalone\f[R] flag:
-.IP
-.nf
-\f[C]
-pandoc -s -o output.html input.txt
-\f[R]
-.fi
-.PP
-For more information on how standalone documents are produced, see
-Templates below.
-.PP
-If multiple input files are given, \f[C]pandoc\f[R] will concatenate
-them all (with blank lines between them) before parsing.
-(Use \f[C]--file-scope\f[R] to parse files individually.)
-.SS Specifying formats
-.PP
-The format of the input and output can be specified explicitly using
-command-line options.
-The input format can be specified using the \f[C]-f/--from\f[R] option,
-the output format using the \f[C]-t/--to\f[R] option.
-Thus, to convert \f[C]hello.txt\f[R] from Markdown to LaTeX, you could
-type:
-.IP
-.nf
-\f[C]
-pandoc -f markdown -t latex hello.txt
-\f[R]
-.fi
-.PP
-To convert \f[C]hello.html\f[R] from HTML to Markdown:
-.IP
-.nf
-\f[C]
-pandoc -f html -t markdown hello.html
-\f[R]
-.fi
-.PP
-Supported input and output formats are listed below under Options (see
-\f[C]-f\f[R] for input formats and \f[C]-t\f[R] for output formats).
-You can also use \f[C]pandoc --list-input-formats\f[R] and
-\f[C]pandoc --list-output-formats\f[R] to print lists of supported
-formats.
-.PP
-If the input or output format is not specified explicitly,
-\f[C]pandoc\f[R] will attempt to guess it from the extensions of the
-filenames.
-Thus, for example,
-.IP
-.nf
-\f[C]
-pandoc -o hello.tex hello.txt
-\f[R]
-.fi
-.PP
-will convert \f[C]hello.txt\f[R] from Markdown to LaTeX.
-If no output file is specified (so that output goes to
-\f[I]stdout\f[R]), or if the output file\[aq]s extension is unknown, the
-output format will default to HTML.
-If no input file is specified (so that input comes from
-\f[I]stdin\f[R]), or if the input files\[aq] extensions are unknown, the
-input format will be assumed to be Markdown.
-.SS Character encoding
-.PP
-Pandoc uses the UTF-8 character encoding for both input and output.
-If your local character encoding is not UTF-8, you should pipe input and
-output through \f[C]iconv\f[R]:
-.IP
-.nf
-\f[C]
-iconv -t utf-8 input.txt | pandoc | iconv -f utf-8
-\f[R]
-.fi
-.PP
-Note that in some output formats (such as HTML, LaTeX, ConTeXt, RTF,
-OPML, DocBook, and Texinfo), information about the character encoding is
-included in the document header, which will only be included if you use
-the \f[C]-s/--standalone\f[R] option.
-.SS Creating a PDF
-.PP
-To produce a PDF, specify an output file with a \f[C].pdf\f[R]
-extension:
-.IP
-.nf
-\f[C]
-pandoc test.txt -o test.pdf
-\f[R]
-.fi
-.PP
-By default, pandoc will use LaTeX to create the PDF, which requires that
-a LaTeX engine be installed (see \f[C]--pdf-engine\f[R] below).
-Alternatively, pandoc can use ConTeXt, roff ms, or HTML as an
-intermediate format.
-To do this, specify an output file with a \f[C].pdf\f[R] extension, as
-before, but add the \f[C]--pdf-engine\f[R] option or
-\f[C]-t context\f[R], \f[C]-t html\f[R], or \f[C]-t ms\f[R] to the
-command line.
-The tool used to generate the PDF from the intermediate format may be
-specified using \f[C]--pdf-engine\f[R].
-.PP
-You can control the PDF style using variables, depending on the
-intermediate format used: see variables for LaTeX, variables for
-ConTeXt, variables for \f[C]wkhtmltopdf\f[R], variables for ms.
-When HTML is used as an intermediate format, the output can be styled
-using \f[C]--css\f[R].
-.PP
-To debug the PDF creation, it can be useful to look at the intermediate
-representation: instead of \f[C]-o test.pdf\f[R], use for example
-\f[C]-s -o test.tex\f[R] to output the generated LaTeX.
-You can then test it with \f[C]pdflatex test.tex\f[R].
-.PP
-When using LaTeX, the following packages need to be available (they are
-included with all recent versions of TeX Live): \f[C]amsfonts\f[R],
-\f[C]amsmath\f[R], \f[C]lm\f[R], \f[C]unicode-math\f[R],
-\f[C]ifxetex\f[R], \f[C]ifluatex\f[R], \f[C]listings\f[R] (if the
-\f[C]--listings\f[R] option is used), \f[C]fancyvrb\f[R],
-\f[C]longtable\f[R], \f[C]booktabs\f[R], \f[C]graphicx\f[R] (if the
-document contains images), \f[C]hyperref\f[R], \f[C]xcolor\f[R],
-\f[C]ulem\f[R], \f[C]geometry\f[R] (with the \f[C]geometry\f[R] variable
-set), \f[C]setspace\f[R] (with \f[C]linestretch\f[R]), and
-\f[C]babel\f[R] (with \f[C]lang\f[R]).
-The use of \f[C]xelatex\f[R] or \f[C]lualatex\f[R] as the PDF engine
-requires \f[C]fontspec\f[R].
-\f[C]xelatex\f[R] uses \f[C]polyglossia\f[R] (with \f[C]lang\f[R]),
-\f[C]xecjk\f[R], and \f[C]bidi\f[R] (with the \f[C]dir\f[R] variable
-set).
-If the \f[C]mathspec\f[R] variable is set, \f[C]xelatex\f[R] will use
-\f[C]mathspec\f[R] instead of \f[C]unicode-math\f[R].
-The \f[C]upquote\f[R] and \f[C]microtype\f[R] packages are used if
-available, and \f[C]csquotes\f[R] will be used for typography if the
-\f[C]csquotes\f[R] variable or metadata field is set to a true value.
-The \f[C]natbib\f[R], \f[C]biblatex\f[R], \f[C]bibtex\f[R], and
-\f[C]biber\f[R] packages can optionally be used for citation rendering.
-The following packages will be used to improve output quality if
-present, but pandoc does not require them to be present:
-\f[C]upquote\f[R] (for straight quotes in verbatim environments),
-\f[C]microtype\f[R] (for better spacing adjustments), \f[C]parskip\f[R]
-(for better inter-paragraph spaces), \f[C]xurl\f[R] (for better line
-breaks in URLs), \f[C]bookmark\f[R] (for better PDF bookmarks), and
-\f[C]footnotehyper\f[R] or \f[C]footnote\f[R] (to allow footnotes in
-tables).
-.SS Reading from the Web
-.PP
-Instead of an input file, an absolute URI may be given.
-In this case pandoc will fetch the content using HTTP:
-.IP
-.nf
-\f[C]
-pandoc -f html -t markdown https://www.fsf.org
-\f[R]
-.fi
-.PP
-It is possible to supply a custom User-Agent string or other header when
-requesting a document from a URL:
-.IP
-.nf
-\f[C]
-pandoc -f html -t markdown --request-header User-Agent:\[dq]Mozilla/5.0\[dq] \[rs]
-  https://www.fsf.org
-\f[R]
-.fi
-.SH OPTIONS
-.SS General options
-.TP
-\f[B]\f[CB]-f\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]-r\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]--from=\f[B]\f[R]\f[I]FORMAT\f[R], \f[B]\f[CB]--read=\f[B]\f[R]\f[I]FORMAT\f[R]
-Specify input format.
-\f[I]FORMAT\f[R] can be:
-.RS
-.IP \[bu] 2
-\f[C]commonmark\f[R] (CommonMark Markdown)
-.IP \[bu] 2
-\f[C]commonmark_x\f[R] (CommonMark Markdown with extensions)
-.IP \[bu] 2
-\f[C]creole\f[R] (Creole 1.0)
-.IP \[bu] 2
-\f[C]csv\f[R] (CSV table)
-.IP \[bu] 2
-\f[C]docbook\f[R] (DocBook)
-.IP \[bu] 2
-\f[C]docx\f[R] (Word docx)
-.IP \[bu] 2
-\f[C]dokuwiki\f[R] (DokuWiki markup)
-.IP \[bu] 2
-\f[C]epub\f[R] (EPUB)
-.IP \[bu] 2
-\f[C]fb2\f[R] (FictionBook2 e-book)
-.IP \[bu] 2
-\f[C]gfm\f[R] (GitHub-Flavored Markdown), or the deprecated and less
-accurate \f[C]markdown_github\f[R]; use \f[C]markdown_github\f[R] only
-if you need extensions not supported in \f[C]gfm\f[R].
-.IP \[bu] 2
-\f[C]haddock\f[R] (Haddock markup)
-.IP \[bu] 2
-\f[C]html\f[R] (HTML)
-.IP \[bu] 2
-\f[C]ipynb\f[R] (Jupyter notebook)
-.IP \[bu] 2
-\f[C]jats\f[R] (JATS XML)
-.IP \[bu] 2
-\f[C]jira\f[R] (Jira/Confluence wiki markup)
-.IP \[bu] 2
-\f[C]json\f[R] (JSON version of native AST)
-.IP \[bu] 2
-\f[C]latex\f[R] (LaTeX)
-.IP \[bu] 2
-\f[C]markdown\f[R] (Pandoc\[aq]s Markdown)
-.IP \[bu] 2
-\f[C]markdown_mmd\f[R] (MultiMarkdown)
-.IP \[bu] 2
-\f[C]markdown_phpextra\f[R] (PHP Markdown Extra)
-.IP \[bu] 2
-\f[C]markdown_strict\f[R] (original unextended Markdown)
-.IP \[bu] 2
-\f[C]mediawiki\f[R] (MediaWiki markup)
-.IP \[bu] 2
-\f[C]man\f[R] (roff man)
-.IP \[bu] 2
-\f[C]muse\f[R] (Muse)
-.IP \[bu] 2
-\f[C]native\f[R] (native Haskell)
-.IP \[bu] 2
-\f[C]odt\f[R] (ODT)
-.IP \[bu] 2
-\f[C]opml\f[R] (OPML)
-.IP \[bu] 2
-\f[C]org\f[R] (Emacs Org mode)
-.IP \[bu] 2
-\f[C]rst\f[R] (reStructuredText)
-.IP \[bu] 2
-\f[C]t2t\f[R] (txt2tags)
-.IP \[bu] 2
-\f[C]textile\f[R] (Textile)
-.IP \[bu] 2
-\f[C]tikiwiki\f[R] (TikiWiki markup)
-.IP \[bu] 2
-\f[C]twiki\f[R] (TWiki markup)
-.IP \[bu] 2
-\f[C]vimwiki\f[R] (Vimwiki)
-.PP
-Extensions can be individually enabled or disabled by appending
-\f[C]+EXTENSION\f[R] or \f[C]-EXTENSION\f[R] to the format name.
-See Extensions below, for a list of extensions and their names.
-See \f[C]--list-input-formats\f[R] and \f[C]--list-extensions\f[R],
-below.
-.RE
-.TP
-\f[B]\f[CB]-t\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]-w\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]--to=\f[B]\f[R]\f[I]FORMAT\f[R], \f[B]\f[CB]--write=\f[B]\f[R]\f[I]FORMAT\f[R]
-Specify output format.
-\f[I]FORMAT\f[R] can be:
-.RS
-.IP \[bu] 2
-\f[C]asciidoc\f[R] (AsciiDoc) or \f[C]asciidoctor\f[R] (AsciiDoctor)
-.IP \[bu] 2
-\f[C]beamer\f[R] (LaTeX beamer slide show)
-.IP \[bu] 2
-\f[C]commonmark\f[R] (CommonMark Markdown)
-.IP \[bu] 2
-\f[C]commonmark_x\f[R] (CommonMark Markdown with extensions)
-.IP \[bu] 2
-\f[C]context\f[R] (ConTeXt)
-.IP \[bu] 2
-\f[C]docbook\f[R] or \f[C]docbook4\f[R] (DocBook 4)
-.IP \[bu] 2
-\f[C]docbook5\f[R] (DocBook 5)
-.IP \[bu] 2
-\f[C]docx\f[R] (Word docx)
-.IP \[bu] 2
-\f[C]dokuwiki\f[R] (DokuWiki markup)
-.IP \[bu] 2
-\f[C]epub\f[R] or \f[C]epub3\f[R] (EPUB v3 book)
-.IP \[bu] 2
-\f[C]epub2\f[R] (EPUB v2)
-.IP \[bu] 2
-\f[C]fb2\f[R] (FictionBook2 e-book)
-.IP \[bu] 2
-\f[C]gfm\f[R] (GitHub-Flavored Markdown), or the deprecated and less
-accurate \f[C]markdown_github\f[R]; use \f[C]markdown_github\f[R] only
-if you need extensions not supported in \f[C]gfm\f[R].
-.IP \[bu] 2
-\f[C]haddock\f[R] (Haddock markup)
-.IP \[bu] 2
-\f[C]html\f[R] or \f[C]html5\f[R] (HTML, i.e.
-HTML5/XHTML polyglot markup)
-.IP \[bu] 2
-\f[C]html4\f[R] (XHTML 1.0 Transitional)
-.IP \[bu] 2
-\f[C]icml\f[R] (InDesign ICML)
-.IP \[bu] 2
-\f[C]ipynb\f[R] (Jupyter notebook)
-.IP \[bu] 2
-\f[C]jats_archiving\f[R] (JATS XML, Archiving and Interchange Tag Set)
-.IP \[bu] 2
-\f[C]jats_articleauthoring\f[R] (JATS XML, Article Authoring Tag Set)
-.IP \[bu] 2
-\f[C]jats_publishing\f[R] (JATS XML, Journal Publishing Tag Set)
-.IP \[bu] 2
-\f[C]jats\f[R] (alias for \f[C]jats_archiving\f[R])
-.IP \[bu] 2
-\f[C]jira\f[R] (Jira/Confluence wiki markup)
-.IP \[bu] 2
-\f[C]json\f[R] (JSON version of native AST)
-.IP \[bu] 2
-\f[C]latex\f[R] (LaTeX)
-.IP \[bu] 2
-\f[C]man\f[R] (roff man)
-.IP \[bu] 2
-\f[C]markdown\f[R] (Pandoc\[aq]s Markdown)
-.IP \[bu] 2
-\f[C]markdown_mmd\f[R] (MultiMarkdown)
-.IP \[bu] 2
-\f[C]markdown_phpextra\f[R] (PHP Markdown Extra)
-.IP \[bu] 2
-\f[C]markdown_strict\f[R] (original unextended Markdown)
-.IP \[bu] 2
-\f[C]mediawiki\f[R] (MediaWiki markup)
-.IP \[bu] 2
-\f[C]ms\f[R] (roff ms)
-.IP \[bu] 2
-\f[C]muse\f[R] (Muse),
-.IP \[bu] 2
-\f[C]native\f[R] (native Haskell),
-.IP \[bu] 2
-\f[C]odt\f[R] (OpenOffice text document)
-.IP \[bu] 2
-\f[C]opml\f[R] (OPML)
-.IP \[bu] 2
-\f[C]opendocument\f[R] (OpenDocument)
-.IP \[bu] 2
-\f[C]org\f[R] (Emacs Org mode)
-.IP \[bu] 2
-\f[C]pdf\f[R] (PDF)
-.IP \[bu] 2
-\f[C]plain\f[R] (plain text),
-.IP \[bu] 2
-\f[C]pptx\f[R] (PowerPoint slide show)
-.IP \[bu] 2
-\f[C]rst\f[R] (reStructuredText)
-.IP \[bu] 2
-\f[C]rtf\f[R] (Rich Text Format)
-.IP \[bu] 2
-\f[C]texinfo\f[R] (GNU Texinfo)
-.IP \[bu] 2
-\f[C]textile\f[R] (Textile)
-.IP \[bu] 2
-\f[C]slideous\f[R] (Slideous HTML and JavaScript slide show)
-.IP \[bu] 2
-\f[C]slidy\f[R] (Slidy HTML and JavaScript slide show)
-.IP \[bu] 2
-\f[C]dzslides\f[R] (DZSlides HTML5 + JavaScript slide show),
-.IP \[bu] 2
-\f[C]revealjs\f[R] (reveal.js HTML5 + JavaScript slide show)
-.IP \[bu] 2
-\f[C]s5\f[R] (S5 HTML and JavaScript slide show)
-.IP \[bu] 2
-\f[C]tei\f[R] (TEI Simple)
-.IP \[bu] 2
-\f[C]xwiki\f[R] (XWiki markup)
-.IP \[bu] 2
-\f[C]zimwiki\f[R] (ZimWiki markup)
-.IP \[bu] 2
-the path of a custom Lua writer, see Custom writers below
-.PP
-Note that \f[C]odt\f[R], \f[C]docx\f[R], \f[C]epub\f[R], and
-\f[C]pdf\f[R] output will not be directed to \f[I]stdout\f[R] unless
-forced with \f[C]-o -\f[R].
-.PP
-Extensions can be individually enabled or disabled by appending
-\f[C]+EXTENSION\f[R] or \f[C]-EXTENSION\f[R] to the format name.
-See Extensions below, for a list of extensions and their names.
-See \f[C]--list-output-formats\f[R] and \f[C]--list-extensions\f[R],
-below.
-.RE
-.TP
-\f[B]\f[CB]-o\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--output=\f[B]\f[R]\f[I]FILE\f[R]
-Write output to \f[I]FILE\f[R] instead of \f[I]stdout\f[R].
-If \f[I]FILE\f[R] is \f[C]-\f[R], output will go to \f[I]stdout\f[R],
-even if a non-textual format (\f[C]docx\f[R], \f[C]odt\f[R],
-\f[C]epub2\f[R], \f[C]epub3\f[R]) is specified.
-.TP
-\f[B]\f[CB]--data-dir=\f[B]\f[R]\f[I]DIRECTORY\f[R]
-Specify the user data directory to search for pandoc data files.
-If this option is not specified, the default user data directory will be
-used.
-On *nix and macOS systems this will be the \f[C]pandoc\f[R] subdirectory
-of the XDG data directory (by default, \f[C]$HOME/.local/share\f[R],
-overridable by setting the \f[C]XDG_DATA_HOME\f[R] environment
-variable).
-If that directory does not exist, \f[C]$HOME/.pandoc\f[R] will be used
-(for backwards compatibility).
-In Windows the default user data directory is
-\f[C]C:\[rs]Users\[rs]USERNAME\[rs]AppData\[rs]Roaming\[rs]pandoc\f[R].
-You can find the default user data directory on your system by looking
-at the output of \f[C]pandoc --version\f[R].
-A \f[C]reference.odt\f[R], \f[C]reference.docx\f[R], \f[C]epub.css\f[R],
-\f[C]templates\f[R], \f[C]slidy\f[R], \f[C]slideous\f[R], or
-\f[C]s5\f[R] directory placed in this directory will override
-pandoc\[aq]s normal defaults.
-.TP
-\f[B]\f[CB]-d\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--defaults=\f[B]\f[R]\f[I]FILE\f[R]
-Specify a set of default option settings.
-\f[I]FILE\f[R] is a YAML file whose fields correspond to command-line
-option settings.
-All options for document conversion, including input and output files,
-can be set using a defaults file.
-The file will be searched for first in the working directory, and then
-in the \f[C]defaults\f[R] subdirectory of the user data directory (see
-\f[C]--data-dir\f[R]).
-The \f[C].yaml\f[R] extension may be omitted.
-See the section Default files for more information on the file format.
-Settings from the defaults file may be overridden or extended by
-subsequent options on the command line.
-.TP
-\f[B]\f[CB]--bash-completion\f[B]\f[R]
-Generate a bash completion script.
-To enable bash completion with pandoc, add this to your
-\f[C].bashrc\f[R]:
-.RS
-.IP
-.nf
-\f[C]
-eval \[dq]$(pandoc --bash-completion)\[dq]
-\f[R]
-.fi
-.RE
-.TP
-\f[B]\f[CB]--verbose\f[B]\f[R]
-Give verbose debugging output.
-.TP
-\f[B]\f[CB]--quiet\f[B]\f[R]
-Suppress warning messages.
-.TP
-\f[B]\f[CB]--fail-if-warnings\f[B]\f[R]
-Exit with error status if there are any warnings.
-.TP
-\f[B]\f[CB]--log=\f[B]\f[R]\f[I]FILE\f[R]
-Write log messages in machine-readable JSON format to \f[I]FILE\f[R].
-All messages above DEBUG level will be written, regardless of verbosity
-settings (\f[C]--verbose\f[R], \f[C]--quiet\f[R]).
-.TP
-\f[B]\f[CB]--list-input-formats\f[B]\f[R]
-List supported input formats, one per line.
-.TP
-\f[B]\f[CB]--list-output-formats\f[B]\f[R]
-List supported output formats, one per line.
-.TP
-\f[B]\f[CB]--list-extensions\f[B]\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]FORMAT\f[R]]
-List supported extensions for \f[I]FORMAT\f[R], one per line, preceded
-by a \f[C]+\f[R] or \f[C]-\f[R] indicating whether it is enabled by
-default in \f[I]FORMAT\f[R].
-If \f[I]FORMAT\f[R] is not specified, defaults for pandoc\[aq]s Markdown
-are given.
-.TP
-\f[B]\f[CB]--list-highlight-languages\f[B]\f[R]
-List supported languages for syntax highlighting, one per line.
-.TP
-\f[B]\f[CB]--list-highlight-styles\f[B]\f[R]
-List supported styles for syntax highlighting, one per line.
-See \f[C]--highlight-style\f[R].
-.TP
-\f[B]\f[CB]-v\f[B]\f[R], \f[B]\f[CB]--version\f[B]\f[R]
-Print version.
-.TP
-\f[B]\f[CB]-h\f[B]\f[R], \f[B]\f[CB]--help\f[B]\f[R]
-Show usage message.
-.SS Reader options
-.TP
-\f[B]\f[CB]--shift-heading-level-by=\f[B]\f[R]\f[I]NUMBER\f[R]
-Shift heading levels by a positive or negative integer.
-For example, with \f[C]--shift-heading-level-by=-1\f[R], level 2
-headings become level 1 headings, and level 3 headings become level 2
-headings.
-Headings cannot have a level less than 1, so a heading that would be
-shifted below level 1 becomes a regular paragraph.
-Exception: with a shift of -N, a level-N heading at the beginning of the
-document replaces the metadata title.
-\f[C]--shift-heading-level-by=-1\f[R] is a good choice when converting
-HTML or Markdown documents that use an initial level-1 heading for the
-document title and level-2+ headings for sections.
-\f[C]--shift-heading-level-by=1\f[R] may be a good choice for converting
-Markdown documents that use level-1 headings for sections to HTML, since
-pandoc uses a level-1 heading to render the document title.
-.TP
-\f[B]\f[CB]--base-header-level=\f[B]\f[R]\f[I]NUMBER\f[R]
-\f[I]Deprecated. Use \f[CI]--shift-heading-level-by\f[I]=X instead,
-where X = NUMBER - 1.\f[R] Specify the base level for headings (defaults
-to 1).
-.TP
-\f[B]\f[CB]--strip-empty-paragraphs\f[B]\f[R]
-\f[I]Deprecated. Use the \f[CI]+empty_paragraphs\f[I] extension
-instead.\f[R] Ignore paragraphs with no content.
-This option is useful for converting word processing documents where
-users have used empty paragraphs to create inter-paragraph space.
-.TP
-\f[B]\f[CB]--indented-code-classes=\f[B]\f[R]\f[I]CLASSES\f[R]
-Specify classes to use for indented code blocks--for example,
-\f[C]perl,numberLines\f[R] or \f[C]haskell\f[R].
-Multiple classes may be separated by spaces or commas.
-.TP
-\f[B]\f[CB]--default-image-extension=\f[B]\f[R]\f[I]EXTENSION\f[R]
-Specify a default extension to use when image paths/URLs have no
-extension.
-This allows you to use the same source for formats that require
-different kinds of images.
-Currently this option only affects the Markdown and LaTeX readers.
-.TP
-\f[B]\f[CB]--file-scope\f[B]\f[R]
-Parse each file individually before combining for multifile documents.
-This will allow footnotes in different files with the same identifiers
-to work as expected.
-If this option is set, footnotes and links will not work across files.
-Reading binary files (docx, odt, epub) implies \f[C]--file-scope\f[R].
-.TP
-\f[B]\f[CB]-F\f[B]\f[R] \f[I]PROGRAM\f[R], \f[B]\f[CB]--filter=\f[B]\f[R]\f[I]PROGRAM\f[R]
-Specify an executable to be used as a filter transforming the pandoc AST
-after the input is parsed and before the output is written.
-The executable should read JSON from stdin and write JSON to stdout.
-The JSON must be formatted like pandoc\[aq]s own JSON input and output.
-The name of the output format will be passed to the filter as the first
-argument.
-Hence,
-.RS
-.IP
-.nf
-\f[C]
-pandoc --filter ./caps.py -t latex
-\f[R]
-.fi
-.PP
-is equivalent to
-.IP
-.nf
-\f[C]
-pandoc -t json | ./caps.py latex | pandoc -f json -t latex
-\f[R]
-.fi
-.PP
-The latter form may be useful for debugging filters.
-.PP
-Filters may be written in any language.
-\f[C]Text.Pandoc.JSON\f[R] exports \f[C]toJSONFilter\f[R] to facilitate
-writing filters in Haskell.
-Those who would prefer to write filters in python can use the module
-\f[C]pandocfilters\f[R], installable from PyPI.
-There are also pandoc filter libraries in PHP, perl, and
-JavaScript/node.js.
-.PP
-In order of preference, pandoc will look for filters in
-.IP "1." 3
-a specified full or relative path (executable or non-executable)
-.IP "2." 3
-\f[C]$DATADIR/filters\f[R] (executable or non-executable) where
-\f[C]$DATADIR\f[R] is the user data directory (see \f[C]--data-dir\f[R],
-above).
-.IP "3." 3
-\f[C]$PATH\f[R] (executable only)
-.PP
-Filters and Lua-filters are applied in the order specified on the
-command line.
-.RE
-.TP
-\f[B]\f[CB]-L\f[B]\f[R] \f[I]SCRIPT\f[R], \f[B]\f[CB]--lua-filter=\f[B]\f[R]\f[I]SCRIPT\f[R]
-Transform the document in a similar fashion as JSON filters (see
-\f[C]--filter\f[R]), but use pandoc\[aq]s build-in Lua filtering system.
-The given Lua script is expected to return a list of Lua filters which
-will be applied in order.
-Each Lua filter must contain element-transforming functions indexed by
-the name of the AST element on which the filter function should be
-applied.
-.RS
-.PP
-The \f[C]pandoc\f[R] Lua module provides helper functions for element
-creation.
-It is always loaded into the script\[aq]s Lua environment.
-.PP
-The following is an example Lua script for macro-expansion:
-.IP
-.nf
-\f[C]
-function expand_hello_world(inline)
-  if inline.c == \[aq]{{helloworld}}\[aq] then
-    return pandoc.Emph{ pandoc.Str \[dq]Hello, World\[dq] }
-  else
-    return inline
-  end
-end
-
-return {{Str = expand_hello_world}}
-\f[R]
-.fi
-.PP
-In order of preference, pandoc will look for Lua filters in
-.IP "1." 3
-a specified full or relative path (executable or non-executable)
-.IP "2." 3
-\f[C]$DATADIR/filters\f[R] (executable or non-executable) where
-\f[C]$DATADIR\f[R] is the user data directory (see \f[C]--data-dir\f[R],
-above).
-.RE
-.TP
-\f[B]\f[CB]-M\f[B]\f[R] \f[I]KEY\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]VAL\f[R]], \f[B]\f[CB]--metadata=\f[B]\f[R]\f[I]KEY\f[R][\f[B]\f[CB]:\f[B]\f[R]\f[I]VAL\f[R]]
-Set the metadata field \f[I]KEY\f[R] to the value \f[I]VAL\f[R].
-A value specified on the command line overrides a value specified in the
-document using YAML metadata blocks.
-Values will be parsed as YAML boolean or string values.
-If no value is specified, the value will be treated as Boolean true.
-Like \f[C]--variable\f[R], \f[C]--metadata\f[R] causes template
-variables to be set.
-But unlike \f[C]--variable\f[R], \f[C]--metadata\f[R] affects the
-metadata of the underlying document (which is accessible from filters
-and may be printed in some output formats) and metadata values will be
-escaped when inserted into the template.
-.TP
-\f[B]\f[CB]--metadata-file=\f[B]\f[R]\f[I]FILE\f[R]
-Read metadata from the supplied YAML (or JSON) file.
-This option can be used with every input format, but string scalars in
-the YAML file will always be parsed as Markdown.
-Generally, the input will be handled the same as in YAML metadata
-blocks.
-This option can be used repeatedly to include multiple metadata files;
-values in files specified later on the command line will be preferred
-over those specified in earlier files.
-Metadata values specified inside the document, or by using \f[C]-M\f[R],
-overwrite values specified with this option.
-.TP
-\f[B]\f[CB]-p\f[B]\f[R], \f[B]\f[CB]--preserve-tabs\f[B]\f[R]
-Preserve tabs instead of converting them to spaces.
-(By default, pandoc converts tabs to spaces before parsing its input.)
-Note that this will only affect tabs in literal code spans and code
-blocks.
-Tabs in regular text are always treated as spaces.
-.TP
-\f[B]\f[CB]--tab-stop=\f[B]\f[R]\f[I]NUMBER\f[R]
-Specify the number of spaces per tab (default is 4).
-.TP
-\f[B]\f[CB]--track-changes=accept\f[B]\f[R]|\f[B]\f[CB]reject\f[B]\f[R]|\f[B]\f[CB]all\f[B]\f[R]
-Specifies what to do with insertions, deletions, and comments produced
-by the MS Word \[dq]Track Changes\[dq] feature.
-\f[C]accept\f[R] (the default), inserts all insertions, and ignores all
-deletions.
-\f[C]reject\f[R] inserts all deletions and ignores insertions.
-Both \f[C]accept\f[R] and \f[C]reject\f[R] ignore comments.
-\f[C]all\f[R] puts in insertions, deletions, and comments, wrapped in
-spans with \f[C]insertion\f[R], \f[C]deletion\f[R],
-\f[C]comment-start\f[R], and \f[C]comment-end\f[R] classes,
-respectively.
-The author and time of change is included.
-\f[C]all\f[R] is useful for scripting: only accepting changes from a
-certain reviewer, say, or before a certain date.
-If a paragraph is inserted or deleted, \f[C]track-changes=all\f[R]
-produces a span with the class
-\f[C]paragraph-insertion\f[R]/\f[C]paragraph-deletion\f[R] before the
-affected paragraph break.
-This option only affects the docx reader.
-.TP
-\f[B]\f[CB]--extract-media=\f[B]\f[R]\f[I]DIR\f[R]
-Extract images and other media contained in or linked from the source
-document to the path \f[I]DIR\f[R], creating it if necessary, and adjust
-the images references in the document so they point to the extracted
-files.
-If the source format is a binary container (docx, epub, or odt), the
-media is extracted from the container and the original filenames are
-used.
-Otherwise the media is read from the file system or downloaded, and new
-filenames are constructed based on SHA1 hashes of the contents.
-.TP
-\f[B]\f[CB]--abbreviations=\f[B]\f[R]\f[I]FILE\f[R]
-Specifies a custom abbreviations file, with abbreviations one to a line.
-If this option is not specified, pandoc will read the data file
-\f[C]abbreviations\f[R] from the user data directory or fall back on a
-system default.
-To see the system default, use
-\f[C]pandoc --print-default-data-file=abbreviations\f[R].
-The only use pandoc makes of this list is in the Markdown reader.
-Strings ending in a period that are found in this list will be followed
-by a nonbreaking space, so that the period will not produce
-sentence-ending space in formats like LaTeX.
-.SS General writer options
-.TP
-\f[B]\f[CB]-s\f[B]\f[R], \f[B]\f[CB]--standalone\f[B]\f[R]
-Produce output with an appropriate header and footer (e.g.
-a standalone HTML, LaTeX, TEI, or RTF file, not a fragment).
-This option is set automatically for \f[C]pdf\f[R], \f[C]epub\f[R],
-\f[C]epub3\f[R], \f[C]fb2\f[R], \f[C]docx\f[R], and \f[C]odt\f[R]
-output.
-For \f[C]native\f[R] output, this option causes metadata to be included;
-otherwise, metadata is suppressed.
-.TP
-\f[B]\f[CB]--template=\f[B]\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
-Use the specified file as a custom template for the generated document.
-Implies \f[C]--standalone\f[R].
-See Templates, below, for a description of template syntax.
-If no extension is specified, an extension corresponding to the writer
-will be added, so that \f[C]--template=special\f[R] looks for
-\f[C]special.html\f[R] for HTML output.
-If the template is not found, pandoc will search for it in the
-\f[C]templates\f[R] subdirectory of the user data directory (see
-\f[C]--data-dir\f[R]).
-If this option is not used, a default template appropriate for the
-output format will be used (see \f[C]-D/--print-default-template\f[R]).
-.TP
-\f[B]\f[CB]-V\f[B]\f[R] \f[I]KEY\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]VAL\f[R]], \f[B]\f[CB]--variable=\f[B]\f[R]\f[I]KEY\f[R][\f[B]\f[CB]:\f[B]\f[R]\f[I]VAL\f[R]]
-Set the template variable \f[I]KEY\f[R] to the value \f[I]VAL\f[R] when
-rendering the document in standalone mode.
-If no \f[I]VAL\f[R] is specified, the key will be given the value
-\f[C]true\f[R].
-.TP
-\f[B]\f[CB]-D\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]--print-default-template=\f[B]\f[R]\f[I]FORMAT\f[R]
-Print the system default template for an output \f[I]FORMAT\f[R].
-(See \f[C]-t\f[R] for a list of possible \f[I]FORMAT\f[R]s.) Templates
-in the user data directory are ignored.
-This option may be used with \f[C]-o\f[R]/\f[C]--output\f[R] to redirect
-output to a file, but \f[C]-o\f[R]/\f[C]--output\f[R] must come before
-\f[C]--print-default-template\f[R] on the command line.
-.RS
-.PP
-Note that some of the default templates use partials, for example
-\f[C]styles.html\f[R].
-To print the partials, use \f[C]--print-default-data-file\f[R]: for
-example, \f[C]--print-default-data-file=templates/styles.html\f[R].
-.RE
-.TP
-\f[B]\f[CB]--print-default-data-file=\f[B]\f[R]\f[I]FILE\f[R]
-Print a system default data file.
-Files in the user data directory are ignored.
-This option may be used with \f[C]-o\f[R]/\f[C]--output\f[R] to redirect
-output to a file, but \f[C]-o\f[R]/\f[C]--output\f[R] must come before
-\f[C]--print-default-data-file\f[R] on the command line.
-.TP
-\f[B]\f[CB]--eol=crlf\f[B]\f[R]|\f[B]\f[CB]lf\f[B]\f[R]|\f[B]\f[CB]native\f[B]\f[R]
-Manually specify line endings: \f[C]crlf\f[R] (Windows), \f[C]lf\f[R]
-(macOS/Linux/UNIX), or \f[C]native\f[R] (line endings appropriate to the
-OS on which pandoc is being run).
-The default is \f[C]native\f[R].
-.TP
-\f[B]\f[CB]--dpi\f[B]\f[R]=\f[I]NUMBER\f[R]
-Specify the default dpi (dots per inch) value for conversion from pixels
-to inch/centimeters and vice versa.
-(Technically, the correct term would be ppi: pixels per inch.) The
-default is 96dpi.
-When images contain information about dpi internally, the encoded value
-is used instead of the default specified by this option.
-.TP
-\f[B]\f[CB]--wrap=auto\f[B]\f[R]|\f[B]\f[CB]none\f[B]\f[R]|\f[B]\f[CB]preserve\f[B]\f[R]
-Determine how text is wrapped in the output (the source code, not the
-rendered version).
-With \f[C]auto\f[R] (the default), pandoc will attempt to wrap lines to
-the column width specified by \f[C]--columns\f[R] (default 72).
-With \f[C]none\f[R], pandoc will not wrap lines at all.
-With \f[C]preserve\f[R], pandoc will attempt to preserve the wrapping
-from the source document (that is, where there are nonsemantic newlines
-in the source, there will be nonsemantic newlines in the output as
-well).
-Automatic wrapping does not currently work in HTML output.
-In \f[C]ipynb\f[R] output, this option affects wrapping of the contents
-of markdown cells.
-.TP
-\f[B]\f[CB]--columns=\f[B]\f[R]\f[I]NUMBER\f[R]
-Specify length of lines in characters.
-This affects text wrapping in the generated source code (see
-\f[C]--wrap\f[R]).
-It also affects calculation of column widths for plain text tables (see
-Tables below).
-.TP
-\f[B]\f[CB]--toc\f[B]\f[R], \f[B]\f[CB]--table-of-contents\f[B]\f[R]
-Include an automatically generated table of contents (or, in the case of
-\f[C]latex\f[R], \f[C]context\f[R], \f[C]docx\f[R], \f[C]odt\f[R],
-\f[C]opendocument\f[R], \f[C]rst\f[R], or \f[C]ms\f[R], an instruction
-to create one) in the output document.
-This option has no effect unless \f[C]-s/--standalone\f[R] is used, and
-it has no effect on \f[C]man\f[R], \f[C]docbook4\f[R],
-\f[C]docbook5\f[R], or \f[C]jats\f[R] output.
-.RS
-.PP
-Note that if you are producing a PDF via \f[C]ms\f[R], the table of
-contents will appear at the beginning of the document, before the title.
-If you would prefer it to be at the end of the document, use the option
-\f[C]--pdf-engine-opt=--no-toc-relocation\f[R].
-.RE
-.TP
-\f[B]\f[CB]--toc-depth=\f[B]\f[R]\f[I]NUMBER\f[R]
-Specify the number of section levels to include in the table of
-contents.
-The default is 3 (which means that level-1, 2, and 3 headings will be
-listed in the contents).
-.TP
-\f[B]\f[CB]--strip-comments\f[B]\f[R]
-Strip out HTML comments in the Markdown or Textile source, rather than
-passing them on to Markdown, Textile or HTML output as raw HTML.
-This does not apply to HTML comments inside raw HTML blocks when the
-\f[C]markdown_in_html_blocks\f[R] extension is not set.
-.TP
-\f[B]\f[CB]--no-highlight\f[B]\f[R]
-Disables syntax highlighting for code blocks and inlines, even when a
-language attribute is given.
-.TP
-\f[B]\f[CB]--highlight-style=\f[B]\f[R]\f[I]STYLE\f[R]|\f[I]FILE\f[R]
-Specifies the coloring style to be used in highlighted source code.
-Options are \f[C]pygments\f[R] (the default), \f[C]kate\f[R],
-\f[C]monochrome\f[R], \f[C]breezeDark\f[R], \f[C]espresso\f[R],
-\f[C]zenburn\f[R], \f[C]haddock\f[R], and \f[C]tango\f[R].
-For more information on syntax highlighting in pandoc, see Syntax
-highlighting, below.
-See also \f[C]--list-highlight-styles\f[R].
-.RS
-.PP
-Instead of a \f[I]STYLE\f[R] name, a JSON file with extension
-\f[C].theme\f[R] may be supplied.
-This will be parsed as a KDE syntax highlighting theme and (if valid)
-used as the highlighting style.
-.PP
-To generate the JSON version of an existing style, use
-\f[C]--print-highlight-style\f[R].
-.RE
-.TP
-\f[B]\f[CB]--print-highlight-style=\f[B]\f[R]\f[I]STYLE\f[R]|\f[I]FILE\f[R]
-Prints a JSON version of a highlighting style, which can be modified,
-saved with a \f[C].theme\f[R] extension, and used with
-\f[C]--highlight-style\f[R].
-This option may be used with \f[C]-o\f[R]/\f[C]--output\f[R] to redirect
-output to a file, but \f[C]-o\f[R]/\f[C]--output\f[R] must come before
-\f[C]--print-highlight-style\f[R] on the command line.
-.TP
-\f[B]\f[CB]--syntax-definition=\f[B]\f[R]\f[I]FILE\f[R]
-Instructs pandoc to load a KDE XML syntax definition file, which will be
-used for syntax highlighting of appropriately marked code blocks.
-This can be used to add support for new languages or to use altered
-syntax definitions for existing languages.
-This option may be repeated to add multiple syntax definitions.
-.TP
-\f[B]\f[CB]-H\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--include-in-header=\f[B]\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
-Include contents of \f[I]FILE\f[R], verbatim, at the end of the header.
-This can be used, for example, to include special CSS or JavaScript in
-HTML documents.
-This option can be used repeatedly to include multiple files in the
-header.
-They will be included in the order specified.
-Implies \f[C]--standalone\f[R].
-.TP
-\f[B]\f[CB]-B\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--include-before-body=\f[B]\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
-Include contents of \f[I]FILE\f[R], verbatim, at the beginning of the
-document body (e.g.
-after the \f[C]<body>\f[R] tag in HTML, or the
-\f[C]\[rs]begin{document}\f[R] command in LaTeX).
-This can be used to include navigation bars or banners in HTML
-documents.
-This option can be used repeatedly to include multiple files.
-They will be included in the order specified.
-Implies \f[C]--standalone\f[R].
-.TP
-\f[B]\f[CB]-A\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--include-after-body=\f[B]\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
-Include contents of \f[I]FILE\f[R], verbatim, at the end of the document
-body (before the \f[C]</body>\f[R] tag in HTML, or the
-\f[C]\[rs]end{document}\f[R] command in LaTeX).
-This option can be used repeatedly to include multiple files.
-They will be included in the order specified.
-Implies \f[C]--standalone\f[R].
-.TP
-\f[B]\f[CB]--resource-path=\f[B]\f[R]\f[I]SEARCHPATH\f[R]
-List of paths to search for images and other resources.
-The paths should be separated by \f[C]:\f[R] on Linux, UNIX, and macOS
-systems, and by \f[C];\f[R] on Windows.
-If \f[C]--resource-path\f[R] is not specified, the default resource path
-is the working directory.
-Note that, if \f[C]--resource-path\f[R] is specified, the working
-directory must be explicitly listed or it will not be searched.
-For example: \f[C]--resource-path=.:test\f[R] will search the working
-directory and the \f[C]test\f[R] subdirectory, in that order.
-.RS
-.PP
-\f[C]--resource-path\f[R] only has an effect if (a) the output format
-embeds images (for example, \f[C]docx\f[R], \f[C]pdf\f[R], or
-\f[C]html\f[R] with \f[C]--self-contained\f[R]) or (b) it is used
-together with \f[C]--extract-media\f[R].
-.RE
-.TP
-\f[B]\f[CB]--request-header=\f[B]\f[R]\f[I]NAME\f[R]\f[B]\f[CB]:\f[B]\f[R]\f[I]VAL\f[R]
-Set the request header \f[I]NAME\f[R] to the value \f[I]VAL\f[R] when
-making HTTP requests (for example, when a URL is given on the command
-line, or when resources used in a document must be downloaded).
-If you\[aq]re behind a proxy, you also need to set the environment
-variable \f[C]http_proxy\f[R] to \f[C]http://...\f[R].
-.TP
-\f[B]\f[CB]--no-check-certificate\f[B]\f[R]
-Disable the certificate verification to allow access to unsecure HTTP
-resources (for example when the certificate is no longer valid or self
-signed).
-.SS Options affecting specific writers
-.TP
-\f[B]\f[CB]--self-contained\f[B]\f[R]
-Produce a standalone HTML file with no external dependencies, using
-\f[C]data:\f[R] URIs to incorporate the contents of linked scripts,
-stylesheets, images, and videos.
-Implies \f[C]--standalone\f[R].
-The resulting file should be \[dq]self-contained,\[dq] in the sense that
-it needs no external files and no net access to be displayed properly by
-a browser.
-This option works only with HTML output formats, including
-\f[C]html4\f[R], \f[C]html5\f[R], \f[C]html+lhs\f[R],
-\f[C]html5+lhs\f[R], \f[C]s5\f[R], \f[C]slidy\f[R], \f[C]slideous\f[R],
-\f[C]dzslides\f[R], and \f[C]revealjs\f[R].
-Scripts, images, and stylesheets at absolute URLs will be downloaded;
-those at relative URLs will be sought relative to the working directory
-(if the first source file is local) or relative to the base URL (if the
-first source file is remote).
-Elements with the attribute \f[C]data-external=\[dq]1\[dq]\f[R] will be
-left alone; the documents they link to will not be incorporated in the
-document.
-Limitation: resources that are loaded dynamically through JavaScript
-cannot be incorporated; as a result, \f[C]--self-contained\f[R] does not
-work with \f[C]--mathjax\f[R], and some advanced features (e.g.
-zoom or speaker notes) may not work in an offline
-\[dq]self-contained\[dq] \f[C]reveal.js\f[R] slide show.
-.TP
-\f[B]\f[CB]--html-q-tags\f[B]\f[R]
-Use \f[C]<q>\f[R] tags for quotes in HTML.
-.TP
-\f[B]\f[CB]--ascii\f[B]\f[R]
-Use only ASCII characters in output.
-Currently supported for XML and HTML formats (which use entities instead
-of UTF-8 when this option is selected), CommonMark, gfm, and Markdown
-(which use entities), roff ms (which use hexadecimal escapes), and to a
-limited degree LaTeX (which uses standard commands for accented
-characters when possible).
-roff man output uses ASCII by default.
-.TP
-\f[B]\f[CB]--reference-links\f[B]\f[R]
-Use reference-style links, rather than inline links, in writing Markdown
-or reStructuredText.
-By default inline links are used.
-The placement of link references is affected by the
-\f[C]--reference-location\f[R] option.
-.TP
-\f[B]\f[CB]--reference-location = block\f[B]\f[R]|\f[B]\f[CB]section\f[B]\f[R]|\f[B]\f[CB]document\f[B]\f[R]
-Specify whether footnotes (and references, if \f[C]reference-links\f[R]
-is set) are placed at the end of the current (top-level) block, the
-current section, or the document.
-The default is \f[C]document\f[R].
-Currently only affects the markdown writer.
-.TP
-\f[B]\f[CB]--atx-headers\f[B]\f[R]
-Use ATX-style headings in Markdown output.
-The default is to use setext-style headings for levels 1 to 2, and then
-ATX headings.
-(Note: for \f[C]gfm\f[R] output, ATX headings are always used.) This
-option also affects markdown cells in \f[C]ipynb\f[R] output.
-.TP
-\f[B]\f[CB]--top-level-division=[default|section|chapter|part]\f[B]\f[R]
-Treat top-level headings as the given division type in LaTeX, ConTeXt,
-DocBook, and TEI output.
-The hierarchy order is part, chapter, then section; all headings are
-shifted such that the top-level heading becomes the specified type.
-The default behavior is to determine the best division type via
-heuristics: unless other conditions apply, \f[C]section\f[R] is chosen.
-When the \f[C]documentclass\f[R] variable is set to \f[C]report\f[R],
-\f[C]book\f[R], or \f[C]memoir\f[R] (unless the \f[C]article\f[R] option
-is specified), \f[C]chapter\f[R] is implied as the setting for this
-option.
-If \f[C]beamer\f[R] is the output format, specifying either
-\f[C]chapter\f[R] or \f[C]part\f[R] will cause top-level headings to
-become \f[C]\[rs]part{..}\f[R], while second-level headings remain as
-their default type.
-.TP
-\f[B]\f[CB]-N\f[B]\f[R], \f[B]\f[CB]--number-sections\f[B]\f[R]
-Number section headings in LaTeX, ConTeXt, HTML, Docx, or EPUB output.
-By default, sections are not numbered.
-Sections with class \f[C]unnumbered\f[R] will never be numbered, even if
-\f[C]--number-sections\f[R] is specified.
-.TP
-\f[B]\f[CB]--number-offset=\f[B]\f[R]\f[I]NUMBER\f[R][\f[B]\f[CB],\f[B]\f[R]\f[I]NUMBER\f[R]\f[B]\f[CB],\f[B]\f[R]\f[I]...\f[R]]
-Offset for section headings in HTML output (ignored in other output
-formats).
-The first number is added to the section number for top-level headings,
-the second for second-level headings, and so on.
-So, for example, if you want the first top-level heading in your
-document to be numbered \[dq]6\[dq], specify
-\f[C]--number-offset=5\f[R].
-If your document starts with a level-2 heading which you want to be
-numbered \[dq]1.5\[dq], specify \f[C]--number-offset=1,4\f[R].
-Offsets are 0 by default.
-Implies \f[C]--number-sections\f[R].
-.TP
-\f[B]\f[CB]--listings\f[B]\f[R]
-Use the \f[C]listings\f[R] package for LaTeX code blocks.
-The package does not support multi-byte encoding for source code.
-To handle UTF-8 you would need to use a custom template.
-This issue is fully documented here: Encoding issue with the listings
-package.
-.TP
-\f[B]\f[CB]-i\f[B]\f[R], \f[B]\f[CB]--incremental\f[B]\f[R]
-Make list items in slide shows display incrementally (one by one).
-The default is for lists to be displayed all at once.
-.TP
-\f[B]\f[CB]--slide-level=\f[B]\f[R]\f[I]NUMBER\f[R]
-Specifies that headings with the specified level create slides (for
-\f[C]beamer\f[R], \f[C]s5\f[R], \f[C]slidy\f[R], \f[C]slideous\f[R],
-\f[C]dzslides\f[R]).
-Headings above this level in the hierarchy are used to divide the slide
-show into sections; headings below this level create subheads within a
-slide.
-Note that content that is not contained under slide-level headings will
-not appear in the slide show.
-The default is to set the slide level based on the contents of the
-document; see Structuring the slide show.
-.TP
-\f[B]\f[CB]--section-divs\f[B]\f[R]
-Wrap sections in \f[C]<section>\f[R] tags (or \f[C]<div>\f[R] tags for
-\f[C]html4\f[R]), and attach identifiers to the enclosing
-\f[C]<section>\f[R] (or \f[C]<div>\f[R]) rather than the heading itself.
-See Heading identifiers, below.
-.TP
-\f[B]\f[CB]--email-obfuscation=none\f[B]\f[R]|\f[B]\f[CB]javascript\f[B]\f[R]|\f[B]\f[CB]references\f[B]\f[R]
-Specify a method for obfuscating \f[C]mailto:\f[R] links in HTML
-documents.
-\f[C]none\f[R] leaves \f[C]mailto:\f[R] links as they are.
-\f[C]javascript\f[R] obfuscates them using JavaScript.
-\f[C]references\f[R] obfuscates them by printing their letters as
-decimal or hexadecimal character references.
-The default is \f[C]none\f[R].
-.TP
-\f[B]\f[CB]--id-prefix=\f[B]\f[R]\f[I]STRING\f[R]
-Specify a prefix to be added to all identifiers and internal links in
-HTML and DocBook output, and to footnote numbers in Markdown and Haddock
-output.
-This is useful for preventing duplicate identifiers when generating
-fragments to be included in other pages.
-.TP
-\f[B]\f[CB]-T\f[B]\f[R] \f[I]STRING\f[R], \f[B]\f[CB]--title-prefix=\f[B]\f[R]\f[I]STRING\f[R]
-Specify \f[I]STRING\f[R] as a prefix at the beginning of the title that
-appears in the HTML header (but not in the title as it appears at the
-beginning of the HTML body).
-Implies \f[C]--standalone\f[R].
-.TP
-\f[B]\f[CB]-c\f[B]\f[R] \f[I]URL\f[R], \f[B]\f[CB]--css=\f[B]\f[R]\f[I]URL\f[R]
-Link to a CSS style sheet.
-This option can be used repeatedly to include multiple files.
-They will be included in the order specified.
-.RS
-.PP
-A stylesheet is required for generating EPUB.
-If none is provided using this option (or the \f[C]css\f[R] or
-\f[C]stylesheet\f[R] metadata fields), pandoc will look for a file
-\f[C]epub.css\f[R] in the user data directory (see
-\f[C]--data-dir\f[R]).
-If it is not found there, sensible defaults will be used.
-.RE
-.TP
-\f[B]\f[CB]--reference-doc=\f[B]\f[R]\f[I]FILE\f[R]
-Use the specified file as a style reference in producing a docx or ODT
-file.
-.RS
-.TP
-Docx
-For best results, the reference docx should be a modified version of a
-docx file produced using pandoc.
-The contents of the reference docx are ignored, but its stylesheets and
-document properties (including margins, page size, header, and footer)
-are used in the new docx.
-If no reference docx is specified on the command line, pandoc will look
-for a file \f[C]reference.docx\f[R] in the user data directory (see
-\f[C]--data-dir\f[R]).
-If this is not found either, sensible defaults will be used.
-.RS
-.PP
-To produce a custom \f[C]reference.docx\f[R], first get a copy of the
-default \f[C]reference.docx\f[R]:
-\f[C]pandoc -o custom-reference.docx --print-default-data-file reference.docx\f[R].
-Then open \f[C]custom-reference.docx\f[R] in Word, modify the styles as
-you wish, and save the file.
-For best results, do not make changes to this file other than modifying
-the styles used by pandoc:
-.PP
-Paragraph styles:
-.IP \[bu] 2
-Normal
-.IP \[bu] 2
-Body Text
-.IP \[bu] 2
-First Paragraph
-.IP \[bu] 2
-Compact
-.IP \[bu] 2
-Title
-.IP \[bu] 2
-Subtitle
-.IP \[bu] 2
-Author
-.IP \[bu] 2
-Date
-.IP \[bu] 2
-Abstract
-.IP \[bu] 2
-Bibliography
-.IP \[bu] 2
-Heading 1
-.IP \[bu] 2
-Heading 2
-.IP \[bu] 2
-Heading 3
-.IP \[bu] 2
-Heading 4
-.IP \[bu] 2
-Heading 5
-.IP \[bu] 2
-Heading 6
-.IP \[bu] 2
-Heading 7
-.IP \[bu] 2
-Heading 8
-.IP \[bu] 2
-Heading 9
-.IP \[bu] 2
-Block Text
-.IP \[bu] 2
-Footnote Text
-.IP \[bu] 2
-Definition Term
-.IP \[bu] 2
-Definition
-.IP \[bu] 2
-Caption
-.IP \[bu] 2
-Table Caption
-.IP \[bu] 2
-Image Caption
-.IP \[bu] 2
-Figure
-.IP \[bu] 2
-Captioned Figure
-.IP \[bu] 2
-TOC Heading
-.PP
-Character styles:
-.IP \[bu] 2
-Default Paragraph Font
-.IP \[bu] 2
-Body Text Char
-.IP \[bu] 2
-Verbatim Char
-.IP \[bu] 2
-Footnote Reference
-.IP \[bu] 2
-Hyperlink
-.IP \[bu] 2
-Section Number
-.PP
-Table style:
-.IP \[bu] 2
-Table
-.RE
-.TP
-ODT
-For best results, the reference ODT should be a modified version of an
-ODT produced using pandoc.
-The contents of the reference ODT are ignored, but its stylesheets are
-used in the new ODT.
-If no reference ODT is specified on the command line, pandoc will look
-for a file \f[C]reference.odt\f[R] in the user data directory (see
-\f[C]--data-dir\f[R]).
-If this is not found either, sensible defaults will be used.
-.RS
-.PP
-To produce a custom \f[C]reference.odt\f[R], first get a copy of the
-default \f[C]reference.odt\f[R]:
-\f[C]pandoc -o custom-reference.odt --print-default-data-file reference.odt\f[R].
-Then open \f[C]custom-reference.odt\f[R] in LibreOffice, modify the
-styles as you wish, and save the file.
-.RE
-.TP
-PowerPoint
-Templates included with Microsoft PowerPoint 2013 (either with
-\f[C].pptx\f[R] or \f[C].potx\f[R] extension) are known to work, as are
-most templates derived from these.
-.RS
-.PP
-The specific requirement is that the template should begin with the
-following first four layouts:
-.IP "1." 3
-Title Slide
-.IP "2." 3
-Title and Content
-.IP "3." 3
-Section Header
-.IP "4." 3
-Two Content
-.PP
-All templates included with a recent version of MS PowerPoint will fit
-these criteria.
-(You can click on \f[C]Layout\f[R] under the \f[C]Home\f[R] menu to
-check.)
-.PP
-You can also modify the default \f[C]reference.pptx\f[R]: first run
-\f[C]pandoc -o custom-reference.pptx --print-default-data-file reference.pptx\f[R],
-and then modify \f[C]custom-reference.pptx\f[R] in MS PowerPoint (pandoc
-will use the first four layout slides, as mentioned above).
-.RE
-.RE
-.TP
-\f[B]\f[CB]--epub-cover-image=\f[B]\f[R]\f[I]FILE\f[R]
-Use the specified image as the EPUB cover.
-It is recommended that the image be less than 1000px in width and
-height.
-Note that in a Markdown source document you can also specify
-\f[C]cover-image\f[R] in a YAML metadata block (see EPUB Metadata,
-below).
-.TP
-\f[B]\f[CB]--epub-metadata=\f[B]\f[R]\f[I]FILE\f[R]
-Look in the specified XML file for metadata for the EPUB.
-The file should contain a series of Dublin Core elements.
-For example:
-.RS
-.IP
-.nf
-\f[C]
- <dc:rights>Creative Commons</dc:rights>
- <dc:language>es-AR</dc:language>
-\f[R]
-.fi
-.PP
-By default, pandoc will include the following metadata elements:
-\f[C]<dc:title>\f[R] (from the document title), \f[C]<dc:creator>\f[R]
-(from the document authors), \f[C]<dc:date>\f[R] (from the document
-date, which should be in ISO 8601 format), \f[C]<dc:language>\f[R] (from
-the \f[C]lang\f[R] variable, or, if is not set, the locale), and
-\f[C]<dc:identifier id=\[dq]BookId\[dq]>\f[R] (a randomly generated
-UUID).
-Any of these may be overridden by elements in the metadata file.
-.PP
-Note: if the source document is Markdown, a YAML metadata block in the
-document can be used instead.
-See below under EPUB Metadata.
-.RE
-.TP
-\f[B]\f[CB]--epub-embed-font=\f[B]\f[R]\f[I]FILE\f[R]
-Embed the specified font in the EPUB.
-This option can be repeated to embed multiple fonts.
-Wildcards can also be used: for example, \f[C]DejaVuSans-*.ttf\f[R].
-However, if you use wildcards on the command line, be sure to escape
-them or put the whole filename in single quotes, to prevent them from
-being interpreted by the shell.
-To use the embedded fonts, you will need to add declarations like the
-following to your CSS (see \f[C]--css\f[R]):
-.RS
-.IP
-.nf
-\f[C]
-\[at]font-face {
-font-family: DejaVuSans;
-font-style: normal;
-font-weight: normal;
-src:url(\[dq]DejaVuSans-Regular.ttf\[dq]);
-}
-\[at]font-face {
-font-family: DejaVuSans;
-font-style: normal;
-font-weight: bold;
-src:url(\[dq]DejaVuSans-Bold.ttf\[dq]);
-}
-\[at]font-face {
-font-family: DejaVuSans;
-font-style: italic;
-font-weight: normal;
-src:url(\[dq]DejaVuSans-Oblique.ttf\[dq]);
-}
-\[at]font-face {
-font-family: DejaVuSans;
-font-style: italic;
-font-weight: bold;
-src:url(\[dq]DejaVuSans-BoldOblique.ttf\[dq]);
-}
-body { font-family: \[dq]DejaVuSans\[dq]; }
-\f[R]
-.fi
-.RE
-.TP
-\f[B]\f[CB]--epub-chapter-level=\f[B]\f[R]\f[I]NUMBER\f[R]
-Specify the heading level at which to split the EPUB into separate
-\[dq]chapter\[dq] files.
-The default is to split into chapters at level-1 headings.
-This option only affects the internal composition of the EPUB, not the
-way chapters and sections are displayed to users.
-Some readers may be slow if the chapter files are too large, so for
-large documents with few level-1 headings, one might want to use a
-chapter level of 2 or 3.
-.TP
-\f[B]\f[CB]--epub-subdirectory=\f[B]\f[R]\f[I]DIRNAME\f[R]
-Specify the subdirectory in the OCF container that is to hold the
-EPUB-specific contents.
-The default is \f[C]EPUB\f[R].
-To put the EPUB contents in the top level, use an empty string.
-.TP
-\f[B]\f[CB]--ipynb-output=all|none|best\f[B]\f[R]
-Determines how ipynb output cells are treated.
-\f[C]all\f[R] means that all of the data formats included in the
-original are preserved.
-\f[C]none\f[R] means that the contents of data cells are omitted.
-\f[C]best\f[R] causes pandoc to try to pick the richest data block in
-each output cell that is compatible with the output format.
-The default is \f[C]best\f[R].
-.TP
-\f[B]\f[CB]--pdf-engine=\f[B]\f[R]\f[I]PROGRAM\f[R]
-Use the specified engine when producing PDF output.
-Valid values are \f[C]pdflatex\f[R], \f[C]lualatex\f[R],
-\f[C]xelatex\f[R], \f[C]latexmk\f[R], \f[C]tectonic\f[R],
-\f[C]wkhtmltopdf\f[R], \f[C]weasyprint\f[R], \f[C]prince\f[R],
-\f[C]context\f[R], and \f[C]pdfroff\f[R].
-If the engine is not in your PATH, the full path of the engine may be
-specified here.
-If this option is not specified, pandoc uses the following defaults
-depending on the output format specified using \f[C]-t/--to\f[R]:
-.RS
-.IP \[bu] 2
-\f[C]-t latex\f[R] or none: \f[C]pdflatex\f[R] (other options:
-\f[C]xelatex\f[R], \f[C]lualatex\f[R], \f[C]tectonic\f[R],
-\f[C]latexmk\f[R])
-.IP \[bu] 2
-\f[C]-t context\f[R]: \f[C]context\f[R]
-.IP \[bu] 2
-\f[C]-t html\f[R]: \f[C]wkhtmltopdf\f[R] (other options:
-\f[C]prince\f[R], \f[C]weasyprint\f[R]; see print-css.rocks for a good
-introduction to PDF generation from HTML/CSS.)
-.IP \[bu] 2
-\f[C]-t ms\f[R]: \f[C]pdfroff\f[R]
-.RE
-.TP
-\f[B]\f[CB]--pdf-engine-opt=\f[B]\f[R]\f[I]STRING\f[R]
-Use the given string as a command-line argument to the
-\f[C]pdf-engine\f[R].
-For example, to use a persistent directory \f[C]foo\f[R] for
-\f[C]latexmk\f[R]\[aq]s auxiliary files, use
-\f[C]--pdf-engine-opt=-outdir=foo\f[R].
-Note that no check for duplicate options is done.
-.SS Citation rendering
-.TP
-\f[B]\f[CB]--bibliography=\f[B]\f[R]\f[I]FILE\f[R]
-Set the \f[C]bibliography\f[R] field in the document\[aq]s metadata to
-\f[I]FILE\f[R], overriding any value set in the metadata, and process
-citations using \f[C]pandoc-citeproc\f[R].
-(This is equivalent to
-\f[C]--metadata bibliography=FILE --filter pandoc-citeproc\f[R].) If
-\f[C]--natbib\f[R] or \f[C]--biblatex\f[R] is also supplied,
-\f[C]pandoc-citeproc\f[R] is not used, making this equivalent to
-\f[C]--metadata bibliography=FILE\f[R].
-If you supply this argument multiple times, each \f[I]FILE\f[R] will be
-added to bibliography.
-.TP
-\f[B]\f[CB]--csl=\f[B]\f[R]\f[I]FILE\f[R]
-Set the \f[C]csl\f[R] field in the document\[aq]s metadata to
-\f[I]FILE\f[R], overriding any value set in the metadata.
-(This is equivalent to \f[C]--metadata csl=FILE\f[R].) This option is
-only relevant with \f[C]pandoc-citeproc\f[R].
-.TP
-\f[B]\f[CB]--citation-abbreviations=\f[B]\f[R]\f[I]FILE\f[R]
-Set the \f[C]citation-abbreviations\f[R] field in the document\[aq]s
-metadata to \f[I]FILE\f[R], overriding any value set in the metadata.
-(This is equivalent to
-\f[C]--metadata citation-abbreviations=FILE\f[R].) This option is only
-relevant with \f[C]pandoc-citeproc\f[R].
-.TP
-\f[B]\f[CB]--natbib\f[B]\f[R]
-Use \f[C]natbib\f[R] for citations in LaTeX output.
-This option is not for use with the \f[C]pandoc-citeproc\f[R] filter or
-with PDF output.
-It is intended for use in producing a LaTeX file that can be processed
-with \f[C]bibtex\f[R].
-.TP
-\f[B]\f[CB]--biblatex\f[B]\f[R]
-Use \f[C]biblatex\f[R] for citations in LaTeX output.
-This option is not for use with the \f[C]pandoc-citeproc\f[R] filter or
-with PDF output.
-It is intended for use in producing a LaTeX file that can be processed
-with \f[C]bibtex\f[R] or \f[C]biber\f[R].
-.SS Math rendering in HTML
-.PP
-The default is to render TeX math as far as possible using Unicode
-characters.
-Formulas are put inside a \f[C]span\f[R] with
-\f[C]class=\[dq]math\[dq]\f[R], so that they may be styled differently
-from the surrounding text if needed.
-However, this gives acceptable results only for basic math, usually you
-will want to use \f[C]--mathjax\f[R] or another of the following
-options.
-.TP
-\f[B]\f[CB]--mathjax\f[B]\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]URL\f[R]]
-Use MathJax to display embedded TeX math in HTML output.
-TeX math will be put between \f[C]\[rs](...\[rs])\f[R] (for inline math)
-or \f[C]\[rs][...\[rs]]\f[R] (for display math) and wrapped in
-\f[C]<span>\f[R] tags with class \f[C]math\f[R].
-Then the MathJax JavaScript will render it.
-The \f[I]URL\f[R] should point to the \f[C]MathJax.js\f[R] load script.
-If a \f[I]URL\f[R] is not provided, a link to the Cloudflare CDN will be
-inserted.
-.TP
-\f[B]\f[CB]--mathml\f[B]\f[R]
-Convert TeX math to MathML (in \f[C]epub3\f[R], \f[C]docbook4\f[R],
-\f[C]docbook5\f[R], \f[C]jats\f[R], \f[C]html4\f[R] and
-\f[C]html5\f[R]).
-This is the default in \f[C]odt\f[R] output.
-Note that currently only Firefox and Safari (and select e-book readers)
-natively support MathML.
-.TP
-\f[B]\f[CB]--webtex\f[B]\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]URL\f[R]]
-Convert TeX formulas to \f[C]<img>\f[R] tags that link to an external
-script that converts formulas to images.
-The formula will be URL-encoded and concatenated with the URL provided.
-For SVG images you can for example use
-\f[C]--webtex https://latex.codecogs.com/svg.latex?\f[R].
-If no URL is specified, the CodeCogs URL generating PNGs will be used
-(\f[C]https://latex.codecogs.com/png.latex?\f[R]).
-Note: the \f[C]--webtex\f[R] option will affect Markdown output as well
-as HTML, which is useful if you\[aq]re targeting a version of Markdown
-without native math support.
-.TP
-\f[B]\f[CB]--katex\f[B]\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]URL\f[R]]
-Use KaTeX to display embedded TeX math in HTML output.
-The \f[I]URL\f[R] is the base URL for the KaTeX library.
-That directory should contain a \f[C]katex.min.js\f[R] and a
-\f[C]katex.min.css\f[R] file.
-If a \f[I]URL\f[R] is not provided, a link to the KaTeX CDN will be
-inserted.
-.TP
-\f[B]\f[CB]--gladtex\f[B]\f[R]
-Enclose TeX math in \f[C]<eq>\f[R] tags in HTML output.
-The resulting HTML can then be processed by GladTeX to produce images of
-the typeset formulas and an HTML file with links to these images.
-So, the procedure is:
-.RS
-.IP
-.nf
-\f[C]
-pandoc -s --gladtex input.md -o myfile.htex
-gladtex -d myfile-images myfile.htex
-# produces myfile.html and images in myfile-images
-\f[R]
-.fi
-.RE
-.SS Options for wrapper scripts
-.TP
-\f[B]\f[CB]--dump-args\f[B]\f[R]
-Print information about command-line arguments to \f[I]stdout\f[R], then
-exit.
-This option is intended primarily for use in wrapper scripts.
-The first line of output contains the name of the output file specified
-with the \f[C]-o\f[R] option, or \f[C]-\f[R] (for \f[I]stdout\f[R]) if
-no output file was specified.
-The remaining lines contain the command-line arguments, one per line, in
-the order they appear.
-These do not include regular pandoc options and their arguments, but do
-include any options appearing after a \f[C]--\f[R] separator at the end
-of the line.
-.TP
-\f[B]\f[CB]--ignore-args\f[B]\f[R]
-Ignore command-line arguments (for use in wrapper scripts).
-Regular pandoc options are not ignored.
-Thus, for example,
-.RS
-.IP
-.nf
-\f[C]
-pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
-\f[R]
-.fi
-.PP
-is equivalent to
-.IP
-.nf
-\f[C]
-pandoc -o foo.html -s
-\f[R]
-.fi
-.RE
-.SH EXIT CODES
-.PP
-If pandoc completes successfully, it will return exit code 0.
-Nonzero exit codes have the following meanings:
-.PP
-.TS
-tab(@);
-r l.
-T{
-Code
-T}@T{
-Error
-T}
-_
-T{
-3
-T}@T{
-PandocFailOnWarningError
-T}
-T{
-4
-T}@T{
-PandocAppError
-T}
-T{
-5
-T}@T{
-PandocTemplateError
-T}
-T{
-6
-T}@T{
-PandocOptionError
-T}
-T{
-21
-T}@T{
-PandocUnknownReaderError
-T}
-T{
-22
-T}@T{
-PandocUnknownWriterError
-T}
-T{
-23
-T}@T{
-PandocUnsupportedExtensionError
-T}
-T{
-31
-T}@T{
-PandocEpubSubdirectoryError
-T}
-T{
-43
-T}@T{
-PandocPDFError
-T}
-T{
-47
-T}@T{
-PandocPDFProgramNotFoundError
-T}
-T{
-61
-T}@T{
-PandocHttpError
-T}
-T{
-62
-T}@T{
-PandocShouldNeverHappenError
-T}
-T{
-63
-T}@T{
-PandocSomeError
-T}
-T{
-64
-T}@T{
-PandocParseError
-T}
-T{
-65
-T}@T{
-PandocParsecError
-T}
-T{
-66
-T}@T{
-PandocMakePDFError
-T}
-T{
-67
-T}@T{
-PandocSyntaxMapError
-T}
-T{
-83
-T}@T{
-PandocFilterError
-T}
-T{
-91
-T}@T{
-PandocMacroLoop
-T}
-T{
-92
-T}@T{
-PandocUTF8DecodingError
-T}
-T{
-93
-T}@T{
-PandocIpynbDecodingError
-T}
-T{
-97
-T}@T{
-PandocCouldNotFindDataFileError
-T}
-T{
-99
-T}@T{
-PandocResourceNotFound
-T}
-.TE
-.SH DEFAULT FILES
-.PP
-The \f[C]--defaults\f[R] option may be used to specify a package of
-options.
-Here is a sample defaults file demonstrating all of the fields that may
-be used:
-.IP
-.nf
-\f[C]
-from: markdown+emoji
-# reader: may be used instead of from:
-to: html5
-# writer: may be used instead of to:
-
-# leave blank for output to stdout:
-output-file:
-# leave blank for input from stdin, use [] for no input:
-input-files:
-- preface.md
-- content.md
-# or you may use input-file: with a single value
-
-template: letter
-standalone: true
-self-contained: false
-
-# note that structured variables may be specified:
-variables:
-  documentclass: book
-  classoption:
-    - twosides
-    - draft
-
-# metadata values specified here are parsed as literal
-# string text, not markdown:
-metadata:
-  author:
-  - Sam Smith
-  - Julie Liu
-metadata-files:
-- boilerplate.yaml
-# or you may use metadata-file: with a single value
-
-# Note that these take files, not their contents:
-include-before-body: []
-include-after-body: []
-include-in-header: []
-resource-path: [\[dq].\[dq]]
-
-# filters will be assumed to be Lua filters if they have
-# the .lua extension, and json filters otherwise.  But
-# the filter type can also be specified explicitly, as shown:
-filters:
-- pandoc-citeproc
-- wordcount.lua
-- type: json
-  path: foo.lua
-
-file-scope: false
-
-data-dir:
-
-# ERROR, WARNING, or INFO
-verbosity: INFO
-log-file: log.json
-
-# citeproc, natbib, or biblatex
-cite-method: citeproc
-# part, chapter, section, or default:
-top-level-division: chapter
-abbreviations:
-
-pdf-engine: pdflatex
-pdf-engine-opts:
-- \[dq]-shell-escape\[dq]
-# you may also use pdf-engine-opt: with a single option
-# pdf-engine-opt: \[dq]-shell-escape\[dq]
-
-# auto, preserve, or none
-wrap: auto
-columns: 78
-dpi: 72
-
-extract-media: mediadir
-
-table-of-contents: true
-toc-depth: 2
-number-sections: false
-# a list of offsets at each heading level
-number-offset: [0,0,0,0,0,0]
-# toc: may also be used instead of table-of-contents:
-shift-heading-level-by: 1
-section-divs: true
-identifier-prefix: foo
-title-prefix: \[dq]\[dq]
-strip-empty-paragraphs: true
-# lf, crlf, or native
-eol: lf
-strip-comments: false
-indented-code-classes: []
-ascii: true
-default-image-extension: \[dq].jpg\[dq]
-
-# either a style name of a style definition file:
-highlight-style: pygments
-syntax-definitions:
-- c.xml
-# or you may use syntax-definition: with a single value
-listings: false
-
-reference-doc: myref.docx
-
-# method is plain, webtex, gladtex, mathml, mathjax, katex
-# you may specify a url with webtex, mathjax, katex
-html-math-method:
-  method: mathjax
-  url: \[dq]https://cdn.jsdelivr.net/npm/mathjax\[at]3/es5/tex-mml-chtml.js\[dq]
-# none, references, or javascript
-email-obfuscation: javascript
-
-tab-stop: 8
-preserve-tabs: true
-
-incremental: false
-slide-level: 2
-
-epub-subdirectory: EPUB
-epub-metadata: meta.xml
-epub-fonts:
-- foobar.otf
-epub-chapter-level: 1
-epub-cover-image: cover.jpg
-
-reference-links: true
-# block, section, or document
-reference-location: block
-atx-headers: false
-
-# accept, reject, or all
-track-changes: accept
-
-html-q-tags: false
-css:
-- site.css
-
-# none, all, or best
-ipynb-output: best
-
-# A list of two-element lists
-request-headers:
-- [\[dq]User-Agent\[dq], \[dq]Mozilla/5.0\[dq]]
-
-fail-if-warnings: false
-dump-args: false
-ignore-args: false
-trace: false
-\f[R]
-.fi
-.PP
-Fields that are omitted will just have their regular default values.
-So a defaults file can be as simple as one line:
-.IP
-.nf
-\f[C]
-verbosity: INFO
-\f[R]
-.fi
-.PP
-Default files can be placed in the \f[C]defaults\f[R] subdirectory of
-the user data directory and used from any directory.
-For example, one could create a file specifying defaults for writing
-letters, save it as \f[C]letter.yaml\f[R] in the \f[C]defaults\f[R]
-subdirectory of the user data directory, and then invoke these defaults
-from any directory using \f[C]pandoc --defaults letter\f[R] or
-\f[C]pandoc -dletter\f[R].
-.PP
-When multiple defaults are used, their contents will be combined.
-.PP
-Note that, where command-line arguments may be repeated
-(\f[C]--metadata-file\f[R], \f[C]--css\f[R],
-\f[C]--include-in-header\f[R], \f[C]--include-before-body\f[R],
-\f[C]--include-after-body\f[R], \f[C]--variable\f[R],
-\f[C]--metadata\f[R], \f[C]--syntax-definition\f[R]), the values
-specified on the command line will combine with values specified in the
-defaults file, rather than replacing them.
-.SH TEMPLATES
-.PP
-When the \f[C]-s/--standalone\f[R] option is used, pandoc uses a
-template to add header and footer material that is needed for a
-self-standing document.
-To see the default template that is used, just type
-.IP
-.nf
-\f[C]
-pandoc -D *FORMAT*
-\f[R]
-.fi
-.PP
-where \f[I]FORMAT\f[R] is the name of the output format.
-A custom template can be specified using the \f[C]--template\f[R]
-option.
-You can also override the system default templates for a given output
-format \f[I]FORMAT\f[R] by putting a file
-\f[C]templates/default.*FORMAT*\f[R] in the user data directory (see
-\f[C]--data-dir\f[R], above).
-\f[I]Exceptions:\f[R]
-.IP \[bu] 2
-For \f[C]odt\f[R] output, customize the \f[C]default.opendocument\f[R]
-template.
-.IP \[bu] 2
-For \f[C]pdf\f[R] output, customize the \f[C]default.latex\f[R] template
-(or the \f[C]default.context\f[R] template, if you use
-\f[C]-t context\f[R], or the \f[C]default.ms\f[R] template, if you use
-\f[C]-t ms\f[R], or the \f[C]default.html\f[R] template, if you use
-\f[C]-t html\f[R]).
-.IP \[bu] 2
-\f[C]docx\f[R] and \f[C]pptx\f[R] have no template (however, you can use
-\f[C]--reference-doc\f[R] to customize the output).
-.PP
-Templates contain \f[I]variables\f[R], which allow for the inclusion of
-arbitrary information at any point in the file.
-They may be set at the command line using the \f[C]-V/--variable\f[R]
-option.
-If a variable is not set, pandoc will look for the key in the
-document\[aq]s metadata, which can be set using either YAML metadata
-blocks or with the \f[C]-M/--metadata\f[R] option.
-In addition, some variables are given default values by pandoc.
-See Variables below for a list of variables used in pandoc\[aq]s default
-templates.
-.PP
-If you use custom templates, you may need to revise them as pandoc
-changes.
-We recommend tracking the changes in the default templates, and
-modifying your custom templates accordingly.
-An easy way to do this is to fork the pandoc-templates repository and
-merge in changes after each pandoc release.
-.SS Template syntax
-.SS Comments
-.PP
-Anything between the sequence \f[C]$--\f[R] and the end of the line will
-be treated as a comment and omitted from the output.
-.SS Delimiters
-.PP
-To mark variables and control structures in the template, either
-\f[C]$\f[R]...\f[C]$\f[R] or \f[C]${\f[R]...\f[C]}\f[R] may be used as
-delimiters.
-The styles may also be mixed in the same template, but the opening and
-closing delimiter must match in each case.
-The opening delimiter may be followed by one or more spaces or tabs,
-which will be ignored.
-The closing delimiter may be followed by one or more spaces or tabs,
-which will be ignored.
-.PP
-To include a literal \f[C]$\f[R] in the document, use \f[C]$$\f[R].
-.SS Interpolated variables
-.PP
-A slot for an interpolated variable is a variable name surrounded by
-matched delimiters.
-Variable names must begin with a letter and can contain letters,
-numbers, \f[C]_\f[R], \f[C]-\f[R], and \f[C].\f[R].
-The keywords \f[C]it\f[R], \f[C]if\f[R], \f[C]else\f[R],
-\f[C]endif\f[R], \f[C]for\f[R], \f[C]sep\f[R], and \f[C]endfor\f[R] may
-not be used as variable names.
-Examples:
-.IP
-.nf
-\f[C]
-$foo$
-$foo.bar.baz$
-$foo_bar.baz-bim$
-$ foo $
-${foo}
-${foo.bar.baz}
-${foo_bar.baz-bim}
-${ foo }
-\f[R]
-.fi
-.PP
-Variable names with periods are used to get at structured variable
-values.
-So, for example, \f[C]employee.salary\f[R] will return the value of the
-\f[C]salary\f[R] field of the object that is the value of the
-\f[C]employee\f[R] field.
-.IP \[bu] 2
-If the value of the variable is simple value, it will be rendered
-verbatim.
-(Note that no escaping is done; the assumption is that the calling
-program will escape the strings appropriately for the output format.)
-.IP \[bu] 2
-If the value is a list, the values will be concatenated.
-.IP \[bu] 2
-If the value is a map, the string \f[C]true\f[R] will be rendered.
-.IP \[bu] 2
-Every other value will be rendered as the empty string.
-.SS Conditionals
-.PP
-A conditional begins with \f[C]if(variable)\f[R] (enclosed in matched
-delimiters) and ends with \f[C]endif\f[R] (enclosed in matched
-delimiters).
-It may optionally contain an \f[C]else\f[R] (enclosed in matched
-delimiters).
-The \f[C]if\f[R] section is used if \f[C]variable\f[R] has a non-empty
-value, otherwise the \f[C]else\f[R] section is used (if present).
-Examples:
-.IP
-.nf
-\f[C]
-$if(foo)$bar$endif$
-
-$if(foo)$
-  $foo$
-$endif$
-
-$if(foo)$
-part one
-$else$
-part two
-$endif$
-
-${if(foo)}bar${endif}
-
-${if(foo)}
-  ${foo}
-${endif}
-
-${if(foo)}
-${ foo.bar }
-${else}
-no foo!
-${endif}
-\f[R]
-.fi
-.PP
-The keyword \f[C]elseif\f[R] may be used to simplify complex nested
-conditionals:
-.IP
-.nf
-\f[C]
-$if(foo)$
-XXX
-$elseif(bar)$
-YYY
-$else$
-ZZZ
-$endif$
-\f[R]
-.fi
-.SS For loops
-.PP
-A for loop begins with \f[C]for(variable)\f[R] (enclosed in matched
-delimiters) and ends with \f[C]endfor\f[R] (enclosed in matched
-delimiters.
-.IP \[bu] 2
-If \f[C]variable\f[R] is an array, the material inside the loop will be
-evaluated repeatedly, with \f[C]variable\f[R] being set to each value of
-the array in turn, and concatenated.
-.IP \[bu] 2
-If \f[C]variable\f[R] is a map, the material inside will be set to the
-map.
-.IP \[bu] 2
-If the value of the associated variable is not an array or a map, a
-single iteration will be performed on its value.
-.PP
-Examples:
-.IP
-.nf
-\f[C]
-$for(foo)$$foo$$sep$, $endfor$
-
-$for(foo)$
-  - $foo.last$, $foo.first$
-$endfor$
-
-${ for(foo.bar) }
-  - ${ foo.bar.last }, ${ foo.bar.first }
-${ endfor }
-
-$for(mymap)$
-$it.name$: $it.office$
-$endfor$
-\f[R]
-.fi
-.PP
-You may optionally specify a separator between consecutive values using
-\f[C]sep\f[R] (enclosed in matched delimiters).
-The material between \f[C]sep\f[R] and the \f[C]endfor\f[R] is the
-separator.
-.IP
-.nf
-\f[C]
-${ for(foo) }${ foo }${ sep }, ${ endfor }
-\f[R]
-.fi
-.PP
-Instead of using \f[C]variable\f[R] inside the loop, the special
-anaphoric keyword \f[C]it\f[R] may be used.
-.IP
-.nf
-\f[C]
-${ for(foo.bar) }
-  - ${ it.last }, ${ it.first }
-${ endfor }
-\f[R]
-.fi
-.SS Partials
-.PP
-Partials (subtemplates stored in different files) may be included by
-using the name of the partial, followed by \f[C]()\f[R], for example:
-.IP
-.nf
-\f[C]
-${ styles() }
-\f[R]
-.fi
-.PP
-Partials will be sought in the directory containing the main template.
-The file name will be assumed to have the same extension as the main
-template if it lacks an extension.
-When calling the partial, the full name including file extension can
-also be used:
-.IP
-.nf
-\f[C]
-${ styles.html() }
-\f[R]
-.fi
-.PP
-(If a partial is not found in the directory of the template, it will
-also be sought in the \f[C]templates\f[R] subdirectory of the user data
-directory.)
-.PP
-Partials may optionally be applied to variables using a colon:
-.IP
-.nf
-\f[C]
-${ date:fancy() }
-
-${ articles:bibentry() }
-\f[R]
-.fi
-.PP
-If \f[C]articles\f[R] is an array, this will iterate over its values,
-applying the partial \f[C]bibentry()\f[R] to each one.
-So the second example above is equivalent to
-.IP
-.nf
-\f[C]
-${ for(articles) }
-${ it:bibentry() }
-${ endfor }
-\f[R]
-.fi
-.PP
-Note that the anaphoric keyword \f[C]it\f[R] must be used when iterating
-over partials.
-In the above examples, the \f[C]bibentry\f[R] partial should contain
-\f[C]it.title\f[R] (and so on) instead of \f[C]articles.title\f[R].
-.PP
-Final newlines are omitted from included partials.
-.PP
-Partials may include other partials.
-.PP
-A separator between values of an array may be specified in square
-brackets, immediately after the variable name or partial:
-.IP
-.nf
-\f[C]
-${months[, ]}$
-
-${articles:bibentry()[; ]$
-\f[R]
-.fi
-.PP
-The separator in this case is literal and (unlike with \f[C]sep\f[R] in
-an explicit \f[C]for\f[R] loop) cannot contain interpolated variables or
-other template directives.
-.SS Nesting
-.PP
-To ensure that content is \[dq]nested,\[dq] that is, subsequent lines
-indented, use the \f[C]\[ha]\f[R] directive:
-.IP
-.nf
-\f[C]
-$item.number$  $\[ha]$$item.description$ ($item.price$)
-\f[R]
-.fi
-.PP
-In this example, if \f[C]item.description\f[R] has multiple lines, they
-will all be indented to line up with the first line:
-.IP
-.nf
-\f[C]
-00123  A fine bottle of 18-year old
-       Oban whiskey. ($148)
-\f[R]
-.fi
-.PP
-To nest multiple lines to the same level, align them with the
-\f[C]\[ha]\f[R] directive in the template.
-For example:
-.IP
-.nf
-\f[C]
-$item.number$  $\[ha]$$item.description$ ($item.price$)
-               (Available til $item.sellby$.)
-\f[R]
-.fi
-.PP
-will produce
-.IP
-.nf
-\f[C]
-00123  A fine bottle of 18-year old
-       Oban whiskey. ($148)
-       (Available til March 30, 2020.)
-\f[R]
-.fi
-.PP
-If a variable occurs by itself on a line, preceded by whitespace and not
-followed by further text or directives on the same line, and the
-variable\[aq]s value contains multiple lines, it will be nested
-automatically.
-.SS Breakable spaces
-.PP
-Normally, spaces in the template itself (as opposed to values of the
-interpolated variables) are not breakable, but they can be made
-breakable in part of the template by using the \f[C]\[ti]\f[R] keyword
-(ended with another \f[C]\[ti]\f[R]).
-.IP
-.nf
-\f[C]
-$\[ti]$This long line may break if the document is rendered
-with a short line length.$\[ti]$
-\f[R]
-.fi
-.SS Pipes
-.PP
-A pipe transforms the value of a variable or partial.
-Pipes are specified using a slash (\f[C]/\f[R]) between the variable
-name (or partial) and the pipe name.
-Example:
-.IP
-.nf
-\f[C]
-$for(name)$
-$name/uppercase$
-$endfor$
-
-$for(metadata/pairs)$
-- $it.key$: $it.value$
-$endfor$
-
-$employee:name()/uppercase$
-\f[R]
-.fi
-.PP
-Pipes may be chained:
-.IP
-.nf
-\f[C]
-$for(employees/pairs)$
-$it.key/alpha/uppercase$. $it.name$
-$endfor$
-\f[R]
-.fi
-.PP
-Some pipes take parameters:
-.IP
-.nf
-\f[C]
-|----------------------|------------|
-$for(employee)$
-$it.name.first/uppercase/left 20 \[dq]| \[dq]$$it.name.salary/right 10 \[dq] | \[dq] \[dq] |\[dq]$
-$endfor$
-|----------------------|------------|
-\f[R]
-.fi
-.PP
-Currently the following pipes are predefined:
-.IP \[bu] 2
-\f[C]pairs\f[R]: Converts a map or array to an array of maps, each with
-\f[C]key\f[R] and \f[C]value\f[R] fields.
-If the original value was an array, the \f[C]key\f[R] will be the array
-index, starting with 1.
-.IP \[bu] 2
-\f[C]uppercase\f[R]: Converts text to uppercase.
-.IP \[bu] 2
-\f[C]lowercase\f[R]: Converts text to lowercase.
-.IP \[bu] 2
-\f[C]length\f[R]: Returns the length of the value: number of characters
-for a textual value, number of elements for a map or array.
-.IP \[bu] 2
-\f[C]reverse\f[R]: Reverses a textual value or array, and has no effect
-on other values.
-.IP \[bu] 2
-\f[C]first\f[R]: Returns the first value of an array, if applied to a
-non-empty array; otherwise returns the original value.
-.IP \[bu] 2
-\f[C]last\f[R]: Returns the last value of an array, if applied to a
-non-empty array; otherwise returns the original value.
-.IP \[bu] 2
-\f[C]rest\f[R]: Returns all but the first value of an array, if applied
-to a non-empty array; otherwise returns the original value.
-.IP \[bu] 2
-\f[C]allbutlast\f[R]: Returns all but the last value of an array, if
-applied to a non-empty array; otherwise returns the original value.
-.IP \[bu] 2
-\f[C]chomp\f[R]: Removes trailing newlines (and breakable space).
-.IP \[bu] 2
-\f[C]nowrap\f[R]: Disables line wrapping on breakable spaces.
-.IP \[bu] 2
-\f[C]alpha\f[R]: Converts textual values that can be read as an integer
-into lowercase alphabetic characters \f[C]a..z\f[R] (mod 26).
-This can be used to get lettered enumeration from array indices.
-To get uppercase letters, chain with \f[C]uppercase\f[R].
-.IP \[bu] 2
-\f[C]roman\f[R]: Converts textual values that can be read as an integer
-into lowercase roman numerials.
-This can be used to get lettered enumeration from array indices.
-To get uppercase roman, chain with \f[C]uppercase\f[R].
-.IP \[bu] 2
-\f[C]left n \[dq]leftborder\[dq] \[dq]rightborder\[dq]\f[R]: Renders a
-textual value in a block of width \f[C]n\f[R], aligned to the left, with
-an optional left and right border.
-Has no effect on other values.
-This can be used to align material in tables.
-Widths are positive integers indicating the number of characters.
-Borders are strings inside double quotes; literal \f[C]\[dq]\f[R] and
-\f[C]\[rs]\f[R] characters must be backslash-escaped.
-.IP \[bu] 2
-\f[C]right n \[dq]leftborder\[dq] \[dq]rightborder\[dq]\f[R]: Renders a
-textual value in a block of width \f[C]n\f[R], aligned to the right, and
-has no effect on other values.
-.IP \[bu] 2
-\f[C]center n \[dq]leftborder\[dq] \[dq]rightborder\[dq]\f[R]: Renders a
-textual value in a block of width \f[C]n\f[R], aligned to the center,
-and has no effect on other values.
-.SS Variables
-.SS Metadata variables
-.TP
-\f[B]\f[CB]title\f[B]\f[R], \f[B]\f[CB]author\f[B]\f[R], \f[B]\f[CB]date\f[B]\f[R]
-allow identification of basic aspects of the document.
-Included in PDF metadata through LaTeX and ConTeXt.
-These can be set through a pandoc title block, which allows for multiple
-authors, or through a YAML metadata block:
-.RS
-.IP
-.nf
-\f[C]
----
-author:
-- Aristotle
-- Peter Abelard
-\&...
-\f[R]
-.fi
-.PP
-Note that if you just want to set PDF or HTML metadata, without
-including a title block in the document itself, you can set the
-\f[C]title-meta\f[R], \f[C]author-meta\f[R], and \f[C]date-meta\f[R]
-variables.
-(By default these are set automatically, based on \f[C]title\f[R],
-\f[C]author\f[R], and \f[C]date\f[R].)
-.RE
-.TP
-\f[B]\f[CB]subtitle\f[B]\f[R]
-document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and docx
-documents
-.TP
-\f[B]\f[CB]abstract\f[B]\f[R]
-document summary, included in LaTeX, ConTeXt, AsciiDoc, and docx
-documents
-.TP
-\f[B]\f[CB]keywords\f[B]\f[R]
-list of keywords to be included in HTML, PDF, ODT, pptx, docx and
-AsciiDoc metadata; repeat as for \f[C]author\f[R], above
-.TP
-\f[B]\f[CB]subject\f[B]\f[R]
-document subject, included in ODT, PDF, docx and pptx metadata
-.TP
-\f[B]\f[CB]description\f[B]\f[R]
-document description, included in ODT, docx and pptx metadata.
-Some applications show this as \f[C]Comments\f[R] metadata.
-.TP
-\f[B]\f[CB]category\f[B]\f[R]
-document category, included in docx and pptx metadata
-.PP
-Additionally, any root-level string metadata, not included in ODT, docx
-or pptx metadata is added as a \f[I]custom property\f[R].
-The following YAML metadata block for instance:
-.IP
-.nf
-\f[C]
----
-title:  \[aq]This is the title\[aq]
-subtitle: \[dq]This is the subtitle\[dq]
-author:
-- Author One
-- Author Two
-description: |
-    This is a long
-    description.
-
-    It consists of two paragraphs
-\&...
-\f[R]
-.fi
-.PP
-will include \f[C]title\f[R], \f[C]author\f[R] and \f[C]description\f[R]
-as standard document properties and \f[C]subtitle\f[R] as a custom
-property when converting to docx, ODT or pptx.
-.SS Language variables
-.TP
-\f[B]\f[CB]lang\f[B]\f[R]
-identifies the main language of the document using IETF language tags
-(following the BCP 47 standard), such as \f[C]en\f[R] or
-\f[C]en-GB\f[R].
-The Language subtag lookup tool can look up or verify these tags.
-This affects most formats, and controls hyphenation in PDF output when
-using LaTeX (through \f[C]babel\f[R] and \f[C]polyglossia\f[R]) or
-ConTeXt.
-.RS
-.PP
-Use native pandoc Divs and Spans with the \f[C]lang\f[R] attribute to
-switch the language:
-.IP
-.nf
-\f[C]
----
-lang: en-GB
-\&...
-
-Text in the main document language (British English).
-
-::: {lang=fr-CA}
-> Cette citation est \['e]crite en fran\[,c]ais canadien.
-:::
-
-More text in English. [\[aq]Zitat auf Deutsch.\[aq]]{lang=de}
-\f[R]
-.fi
-.RE
-.TP
-\f[B]\f[CB]dir\f[B]\f[R]
-the base script direction, either \f[C]rtl\f[R] (right-to-left) or
-\f[C]ltr\f[R] (left-to-right).
-.RS
-.PP
-For bidirectional documents, native pandoc \f[C]span\f[R]s and
-\f[C]div\f[R]s with the \f[C]dir\f[R] attribute (value \f[C]rtl\f[R] or
-\f[C]ltr\f[R]) can be used to override the base direction in some output
-formats.
-This may not always be necessary if the final renderer (e.g.
-the browser, when generating HTML) supports the Unicode Bidirectional
-Algorithm.
-.PP
-When using LaTeX for bidirectional documents, only the \f[C]xelatex\f[R]
-engine is fully supported (use \f[C]--pdf-engine=xelatex\f[R]).
-.RE
-.SS Variables for HTML math
-.TP
-\f[B]\f[CB]classoption\f[B]\f[R]
-when using KaTeX, you can render display math equations flush left using
-YAML metadata or with \f[C]-M classoption=fleqn\f[R].
-.SS Variables for HTML slides
-.PP
-These affect HTML output when producing slide shows with pandoc.
-.PP
-All reveal.js configuration options are available as variables.
-To turn off boolean flags that default to true in reveal.js, use
-\f[C]0\f[R].
-.TP
-\f[B]\f[CB]revealjs-url\f[B]\f[R]
-base URL for reveal.js documents (defaults to
-\f[C]https://unpkg.com/reveal.js\[at]\[ha]4/\f[R])
-.TP
-\f[B]\f[CB]s5-url\f[B]\f[R]
-base URL for S5 documents (defaults to \f[C]s5/default\f[R])
-.TP
-\f[B]\f[CB]slidy-url\f[B]\f[R]
-base URL for Slidy documents (defaults to
-\f[C]https://www.w3.org/Talks/Tools/Slidy2\f[R])
-.TP
-\f[B]\f[CB]slideous-url\f[B]\f[R]
-base URL for Slideous documents (defaults to \f[C]slideous\f[R])
-.TP
-\f[B]\f[CB]title-slide-attributes\f[B]\f[R]
-additional attributes for the title slide of reveal.js slide shows.
-See background in reveal.js and beamer for an example.
-.SS Variables for Beamer slides
-.PP
-These variables change the appearance of PDF slides using
-\f[C]beamer\f[R].
-.TP
-\f[B]\f[CB]aspectratio\f[B]\f[R]
-slide aspect ratio (\f[C]43\f[R] for 4:3 [default], \f[C]169\f[R] for
-16:9, \f[C]1610\f[R] for 16:10, \f[C]149\f[R] for 14:9, \f[C]141\f[R]
-for 1.41:1, \f[C]54\f[R] for 5:4, \f[C]32\f[R] for 3:2)
-.TP
-\f[B]\f[CB]beamerarticle\f[B]\f[R]
-produce an article from Beamer slides
-.TP
-\f[B]\f[CB]beameroption\f[B]\f[R]
-add extra beamer option with \f[C]\[rs]setbeameroption{}\f[R]
-.TP
-\f[B]\f[CB]institute\f[B]\f[R]
-author affiliations: can be a list when there are multiple authors
-.TP
-\f[B]\f[CB]logo\f[B]\f[R]
-logo image for slides
-.TP
-\f[B]\f[CB]navigation\f[B]\f[R]
-controls navigation symbols (default is \f[C]empty\f[R] for no
-navigation symbols; other valid values are \f[C]frame\f[R],
-\f[C]vertical\f[R], and \f[C]horizontal\f[R])
-.TP
-\f[B]\f[CB]section-titles\f[B]\f[R]
-enables \[dq]title pages\[dq] for new sections (default is true)
-.TP
-\f[B]\f[CB]theme\f[B]\f[R], \f[B]\f[CB]colortheme\f[B]\f[R], \f[B]\f[CB]fonttheme\f[B]\f[R], \f[B]\f[CB]innertheme\f[B]\f[R], \f[B]\f[CB]outertheme\f[B]\f[R]
-beamer themes
-.TP
-\f[B]\f[CB]themeoptions\f[B]\f[R]
-options for LaTeX beamer themes (a list).
-.TP
-\f[B]\f[CB]titlegraphic\f[B]\f[R]
-image for title slide
-.SS Variables for PowerPoint
-.PP
-These variables control the visual aspects of a slide show that are not
-easily controlled via templates.
-.TP
-\f[B]\f[CB]monofont\f[B]\f[R]
-font to use for code.
-.SS Variables for LaTeX
-.PP
-Pandoc uses these variables when creating a PDF with a LaTeX engine.
-.SS Layout
-.TP
-\f[B]\f[CB]block-headings\f[B]\f[R]
-make \f[C]\[rs]paragraph\f[R] and \f[C]\[rs]subparagraph\f[R] (fourth-
-and fifth-level headings, or fifth- and sixth-level with book classes)
-free-standing rather than run-in; requires further formatting to
-distinguish from \f[C]\[rs]subsubsection\f[R] (third- or fourth-level
-headings).
-Instead of using this option, KOMA-Script can adjust headings more
-extensively:
-.RS
-.IP
-.nf
-\f[C]
----
-documentclass: scrartcl
-header-includes: |
-  \[rs]RedeclareSectionCommand[
-    beforeskip=-10pt plus -2pt minus -1pt,
-    afterskip=1sp plus -1sp minus 1sp,
-    font=\[rs]normalfont\[rs]itshape]{paragraph}
-  \[rs]RedeclareSectionCommand[
-    beforeskip=-10pt plus -2pt minus -1pt,
-    afterskip=1sp plus -1sp minus 1sp,
-    font=\[rs]normalfont\[rs]scshape,
-    indent=0pt]{subparagraph}
-\&...
-\f[R]
-.fi
-.RE
-.TP
-\f[B]\f[CB]classoption\f[B]\f[R]
-option for document class, e.g.
-\f[C]oneside\f[R]; repeat for multiple options:
-.RS
-.IP
-.nf
-\f[C]
----
-classoption:
-- twocolumn
-- landscape
-\&...
-\f[R]
-.fi
-.RE
-.TP
-\f[B]\f[CB]documentclass\f[B]\f[R]
-document class: usually one of the standard classes, \f[C]article\f[R],
-\f[C]book\f[R], and \f[C]report\f[R]; the KOMA-Script equivalents,
-\f[C]scrartcl\f[R], \f[C]scrbook\f[R], and \f[C]scrreprt\f[R], which
-default to smaller margins; or \f[C]memoir\f[R]
-.TP
-\f[B]\f[CB]geometry\f[B]\f[R]
-option for \f[C]geometry\f[R] package, e.g.
-\f[C]margin=1in\f[R]; repeat for multiple options:
-.RS
-.IP
-.nf
-\f[C]
----
-geometry:
-- top=30mm
-- left=20mm
-- heightrounded
-\&...
-\f[R]
-.fi
-.RE
-.TP
-\f[B]\f[CB]hyperrefoptions\f[B]\f[R]
-option for \f[C]hyperref\f[R] package, e.g.
-\f[C]linktoc=all\f[R]; repeat for multiple options:
-.RS
-.IP
-.nf
-\f[C]
----
-hyperrefoptions:
-- linktoc=all
-- pdfwindowui
-- pdfpagemode=FullScreen
-\&...
-\f[R]
-.fi
-.RE
-.TP
-\f[B]\f[CB]indent\f[B]\f[R]
-uses document class settings for indentation (the default LaTeX template
-otherwise removes indentation and adds space between paragraphs)
-.TP
-\f[B]\f[CB]linestretch\f[B]\f[R]
-adjusts line spacing using the \f[C]setspace\f[R] package, e.g.
-\f[C]1.25\f[R], \f[C]1.5\f[R]
-.TP
-\f[B]\f[CB]margin-left\f[B]\f[R], \f[B]\f[CB]margin-right\f[B]\f[R], \f[B]\f[CB]margin-top\f[B]\f[R], \f[B]\f[CB]margin-bottom\f[B]\f[R]
-sets margins if \f[C]geometry\f[R] is not used (otherwise
-\f[C]geometry\f[R] overrides these)
-.TP
-\f[B]\f[CB]pagestyle\f[B]\f[R]
-control \f[C]\[rs]pagestyle{}\f[R]: the default article class supports
-\f[C]plain\f[R] (default), \f[C]empty\f[R] (no running heads or page
-numbers), and \f[C]headings\f[R] (section titles in running heads)
-.TP
-\f[B]\f[CB]papersize\f[B]\f[R]
-paper size, e.g.
-\f[C]letter\f[R], \f[C]a4\f[R]
-.TP
-\f[B]\f[CB]secnumdepth\f[B]\f[R]
-numbering depth for sections (with \f[C]--number-sections\f[R] option or
-\f[C]numbersections\f[R] variable)
-.SS Fonts
-.TP
-\f[B]\f[CB]fontenc\f[B]\f[R]
-allows font encoding to be specified through \f[C]fontenc\f[R] package
-(with \f[C]pdflatex\f[R]); default is \f[C]T1\f[R] (see LaTeX font
-encodings guide)
-.TP
-\f[B]\f[CB]fontfamily\f[B]\f[R]
-font package for use with \f[C]pdflatex\f[R]: TeX Live includes many
-options, documented in the LaTeX Font Catalogue.
-The default is Latin Modern.
-.TP
-\f[B]\f[CB]fontfamilyoptions\f[B]\f[R]
-options for package used as \f[C]fontfamily\f[R]; repeat for multiple
-options.
-For example, to use the Libertine font with proportional lowercase
-(old-style) figures through the \f[C]libertinus\f[R] package:
-.RS
-.IP
-.nf
-\f[C]
----
-fontfamily: libertinus
-fontfamilyoptions:
-- osf
-- p
-\&...
-\f[R]
-.fi
-.RE
-.TP
-\f[B]\f[CB]fontsize\f[B]\f[R]
-font size for body text.
-The standard classes allow 10pt, 11pt, and 12pt.
-To use another size, set \f[C]documentclass\f[R] to one of the
-KOMA-Script classes, such as \f[C]scrartcl\f[R] or \f[C]scrbook\f[R].
-.TP
-\f[B]\f[CB]mainfont\f[B]\f[R], \f[B]\f[CB]sansfont\f[B]\f[R], \f[B]\f[CB]monofont\f[B]\f[R], \f[B]\f[CB]mathfont\f[B]\f[R], \f[B]\f[CB]CJKmainfont\f[B]\f[R]
-font families for use with \f[C]xelatex\f[R] or \f[C]lualatex\f[R]: take
-the name of any system font, using the \f[C]fontspec\f[R] package.
-\f[C]CJKmainfont\f[R] uses the \f[C]xecjk\f[R] package.
-.TP
-\f[B]\f[CB]mainfontoptions\f[B]\f[R], \f[B]\f[CB]sansfontoptions\f[B]\f[R], \f[B]\f[CB]monofontoptions\f[B]\f[R], \f[B]\f[CB]mathfontoptions\f[B]\f[R], \f[B]\f[CB]CJKoptions\f[B]\f[R]
-options to use with \f[C]mainfont\f[R], \f[C]sansfont\f[R],
-\f[C]monofont\f[R], \f[C]mathfont\f[R], \f[C]CJKmainfont\f[R] in
-\f[C]xelatex\f[R] and \f[C]lualatex\f[R].
-Allow for any choices available through \f[C]fontspec\f[R]; repeat for
-multiple options.
-For example, to use the TeX Gyre version of Palatino with lowercase
-figures:
-.RS
-.IP
-.nf
-\f[C]
----
-mainfont: TeX Gyre Pagella
-mainfontoptions:
-- Numbers=Lowercase
-- Numbers=Proportional
-\&...
-\f[R]
-.fi
-.RE
-.TP
-\f[B]\f[CB]microtypeoptions\f[B]\f[R]
-options to pass to the microtype package
-.SS Links
-.TP
-\f[B]\f[CB]colorlinks\f[B]\f[R]
-add color to link text; automatically enabled if any of
-\f[C]linkcolor\f[R], \f[C]filecolor\f[R], \f[C]citecolor\f[R],
-\f[C]urlcolor\f[R], or \f[C]toccolor\f[R] are set
-.TP
-\f[B]\f[CB]linkcolor\f[B]\f[R], \f[B]\f[CB]filecolor\f[B]\f[R], \f[B]\f[CB]citecolor\f[B]\f[R], \f[B]\f[CB]urlcolor\f[B]\f[R], \f[B]\f[CB]toccolor\f[B]\f[R]
-color for internal links, external links, citation links, linked URLs,
-and links in table of contents, respectively: uses options allowed by
-\f[C]xcolor\f[R], including the \f[C]dvipsnames\f[R],
-\f[C]svgnames\f[R], and \f[C]x11names\f[R] lists
-.TP
-\f[B]\f[CB]links-as-notes\f[B]\f[R]
-causes links to be printed as footnotes
-.SS Front matter
-.TP
-\f[B]\f[CB]lof\f[B]\f[R], \f[B]\f[CB]lot\f[B]\f[R]
-include list of figures, list of tables
-.TP
-\f[B]\f[CB]thanks\f[B]\f[R]
-contents of acknowledgments footnote after document title
-.TP
-\f[B]\f[CB]toc\f[B]\f[R]
-include table of contents (can also be set using
-\f[C]--toc/--table-of-contents\f[R])
-.TP
-\f[B]\f[CB]toc-depth\f[B]\f[R]
-level of section to include in table of contents
-.SS BibLaTeX Bibliographies
-.PP
-These variables function when using BibLaTeX for citation rendering.
-.TP
-\f[B]\f[CB]biblatexoptions\f[B]\f[R]
-list of options for biblatex
-.TP
-\f[B]\f[CB]biblio-style\f[B]\f[R]
-bibliography style, when used with \f[C]--natbib\f[R] and
-\f[C]--biblatex\f[R].
-.TP
-\f[B]\f[CB]biblio-title\f[B]\f[R]
-bibliography title, when used with \f[C]--natbib\f[R] and
-\f[C]--biblatex\f[R].
-.TP
-\f[B]\f[CB]bibliography\f[B]\f[R]
-bibliography to use for resolving references
-.TP
-\f[B]\f[CB]natbiboptions\f[B]\f[R]
-list of options for natbib
-.SS Variables for ConTeXt
-.PP
-Pandoc uses these variables when creating a PDF with ConTeXt.
-.TP
-\f[B]\f[CB]fontsize\f[B]\f[R]
-font size for body text (e.g.
-\f[C]10pt\f[R], \f[C]12pt\f[R])
-.TP
-\f[B]\f[CB]headertext\f[B]\f[R], \f[B]\f[CB]footertext\f[B]\f[R]
-text to be placed in running header or footer (see ConTeXt Headers and
-Footers); repeat up to four times for different placement
-.TP
-\f[B]\f[CB]indenting\f[B]\f[R]
-controls indentation of paragraphs, e.g.
-\f[C]yes,small,next\f[R] (see ConTeXt Indentation); repeat for multiple
-options
-.TP
-\f[B]\f[CB]interlinespace\f[B]\f[R]
-adjusts line spacing, e.g.
-\f[C]4ex\f[R] (using \f[C]setupinterlinespace\f[R]); repeat for multiple
-options
-.TP
-\f[B]\f[CB]layout\f[B]\f[R]
-options for page margins and text arrangement (see ConTeXt Layout);
-repeat for multiple options
-.TP
-\f[B]\f[CB]linkcolor\f[B]\f[R], \f[B]\f[CB]contrastcolor\f[B]\f[R]
-color for links outside and inside a page, e.g.
-\f[C]red\f[R], \f[C]blue\f[R] (see ConTeXt Color)
-.TP
-\f[B]\f[CB]linkstyle\f[B]\f[R]
-typeface style for links, e.g.
-\f[C]normal\f[R], \f[C]bold\f[R], \f[C]slanted\f[R],
-\f[C]boldslanted\f[R], \f[C]type\f[R], \f[C]cap\f[R], \f[C]small\f[R]
-.TP
-\f[B]\f[CB]lof\f[B]\f[R], \f[B]\f[CB]lot\f[B]\f[R]
-include list of figures, list of tables
-.TP
-\f[B]\f[CB]mainfont\f[B]\f[R], \f[B]\f[CB]sansfont\f[B]\f[R], \f[B]\f[CB]monofont\f[B]\f[R], \f[B]\f[CB]mathfont\f[B]\f[R]
-font families: take the name of any system font (see ConTeXt Font
-Switching)
-.TP
-\f[B]\f[CB]margin-left\f[B]\f[R], \f[B]\f[CB]margin-right\f[B]\f[R], \f[B]\f[CB]margin-top\f[B]\f[R], \f[B]\f[CB]margin-bottom\f[B]\f[R]
-sets margins, if \f[C]layout\f[R] is not used (otherwise
-\f[C]layout\f[R] overrides these)
-.TP
-\f[B]\f[CB]pagenumbering\f[B]\f[R]
-page number style and location (using \f[C]setuppagenumbering\f[R]);
-repeat for multiple options
-.TP
-\f[B]\f[CB]papersize\f[B]\f[R]
-paper size, e.g.
-\f[C]letter\f[R], \f[C]A4\f[R], \f[C]landscape\f[R] (see ConTeXt Paper
-Setup); repeat for multiple options
-.TP
-\f[B]\f[CB]pdfa\f[B]\f[R]
-adds to the preamble the setup necessary to generate PDF/A of the type
-specified, e.g.
-\f[C]1a:2005\f[R], \f[C]2a\f[R].
-If no type is specified (i.e.
-the value is set to True, by e.g.
-\f[C]--metadata=pdfa\f[R] or \f[C]pdfa: true\f[R] in a YAML metadata
-block), \f[C]1b:2005\f[R] will be used as default, for reasons of
-backwards compatibility.
-Using \f[C]--variable=pdfa\f[R] without specified value is not
-supported.
-To successfully generate PDF/A the required ICC color profiles have to
-be available and the content and all included files (such as images)
-have to be standard conforming.
-The ICC profiles and output intent may be specified using the variables
-\f[C]pdfaiccprofile\f[R] and \f[C]pdfaintent\f[R].
-See also ConTeXt PDFA for more details.
-.TP
-\f[B]\f[CB]pdfaiccprofile\f[B]\f[R]
-when used in conjunction with \f[C]pdfa\f[R], specifies the ICC profile
-to use in the PDF, e.g.
-\f[C]default.cmyk\f[R].
-If left unspecified, \f[C]sRGB.icc\f[R] is used as default.
-May be repeated to include multiple profiles.
-Note that the profiles have to be available on the system.
-They can be obtained from ConTeXt ICC Profiles.
-.TP
-\f[B]\f[CB]pdfaintent\f[B]\f[R]
-when used in conjunction with \f[C]pdfa\f[R], specifies the output
-intent for the colors, e.g.
-\f[C]ISO coated v2 300\[rs]letterpercent\[rs]space (ECI)\f[R] If left
-unspecified, \f[C]sRGB IEC61966-2.1\f[R] is used as default.
-.TP
-\f[B]\f[CB]toc\f[B]\f[R]
-include table of contents (can also be set using
-\f[C]--toc/--table-of-contents\f[R])
-.TP
-\f[B]\f[CB]whitespace\f[B]\f[R]
-spacing between paragraphs, e.g.
-\f[C]none\f[R], \f[C]small\f[R] (using \f[C]setupwhitespace\f[R])
-.TP
-\f[B]\f[CB]includesource\f[B]\f[R]
-include all source documents as file attachments in the PDF file
-.SS Variables for \f[C]wkhtmltopdf\f[R]
-.PP
-Pandoc uses these variables when creating a PDF with
-\f[C]wkhtmltopdf\f[R].
-The \f[C]--css\f[R] option also affects the output.
-.TP
-\f[B]\f[CB]footer-html\f[B]\f[R], \f[B]\f[CB]header-html\f[B]\f[R]
-add information to the header and footer
-.TP
-\f[B]\f[CB]margin-left\f[B]\f[R], \f[B]\f[CB]margin-right\f[B]\f[R], \f[B]\f[CB]margin-top\f[B]\f[R], \f[B]\f[CB]margin-bottom\f[B]\f[R]
-set the page margins
-.TP
-\f[B]\f[CB]papersize\f[B]\f[R]
-sets the PDF paper size
-.SS Variables for man pages
-.TP
-\f[B]\f[CB]adjusting\f[B]\f[R]
-adjusts text to left (\f[C]l\f[R]), right (\f[C]r\f[R]), center
-(\f[C]c\f[R]), or both (\f[C]b\f[R]) margins
-.TP
-\f[B]\f[CB]footer\f[B]\f[R]
-footer in man pages
-.TP
-\f[B]\f[CB]header\f[B]\f[R]
-header in man pages
-.TP
-\f[B]\f[CB]hyphenate\f[B]\f[R]
-if \f[C]true\f[R] (the default), hyphenation will be used
-.TP
-\f[B]\f[CB]section\f[B]\f[R]
-section number in man pages
-.SS Variables for ms
-.TP
-\f[B]\f[CB]fontfamily\f[B]\f[R]
-font family (e.g.
-\f[C]T\f[R] or \f[C]P\f[R])
-.TP
-\f[B]\f[CB]indent\f[B]\f[R]
-paragraph indent (e.g.
-\f[C]2m\f[R])
-.TP
-\f[B]\f[CB]lineheight\f[B]\f[R]
-line height (e.g.
-\f[C]12p\f[R])
-.TP
-\f[B]\f[CB]pointsize\f[B]\f[R]
-point size (e.g.
-\f[C]10p\f[R])
-.SS Variables set automatically
-.PP
-Pandoc sets these variables automatically in response to options or
-document contents; users can also modify them.
-These vary depending on the output format, and include the following:
-.TP
-\f[B]\f[CB]body\f[B]\f[R]
-body of document
-.TP
-\f[B]\f[CB]date-meta\f[B]\f[R]
-the \f[C]date\f[R] variable converted to ISO 8601 YYYY-MM-DD, included
-in all HTML based formats (dzslides, epub, html, html4, html5, revealjs,
-s5, slideous, slidy).
-The recognized formats for \f[C]date\f[R] are: \f[C]mm/dd/yyyy\f[R],
-\f[C]mm/dd/yy\f[R], \f[C]yyyy-mm-dd\f[R] (ISO 8601),
-\f[C]dd MM yyyy\f[R] (e.g.
-either \f[C]02 Apr 2018\f[R] or \f[C]02 April 2018\f[R]),
-\f[C]MM dd, yyyy\f[R] (e.g.
-\f[C]Apr. 02, 2018\f[R] or
-\f[C]April 02, 2018),\f[R]yyyy[mm[dd]]]\f[C](e.g.\f[R]20180402,
-\f[C]201804\f[R] or \f[C]2018\f[R]).
-.TP
-\f[B]\f[CB]header-includes\f[B]\f[R]
-contents specified by \f[C]-H/--include-in-header\f[R] (may have
-multiple values)
-.TP
-\f[B]\f[CB]include-before\f[B]\f[R]
-contents specified by \f[C]-B/--include-before-body\f[R] (may have
-multiple values)
-.TP
-\f[B]\f[CB]include-after\f[B]\f[R]
-contents specified by \f[C]-A/--include-after-body\f[R] (may have
-multiple values)
-.TP
-\f[B]\f[CB]meta-json\f[B]\f[R]
-JSON representation of all of the document\[aq]s metadata.
-Field values are transformed to the selected output format.
-.TP
-\f[B]\f[CB]numbersections\f[B]\f[R]
-non-null value if \f[C]-N/--number-sections\f[R] was specified
-.TP
-\f[B]\f[CB]sourcefile\f[B]\f[R], \f[B]\f[CB]outputfile\f[B]\f[R]
-source and destination filenames, as given on the command line.
-\f[C]sourcefile\f[R] can also be a list if input comes from multiple
-files, or empty if input is from stdin.
-You can use the following snippet in your template to distinguish them:
-.RS
-.IP
-.nf
-\f[C]
-$if(sourcefile)$
-$for(sourcefile)$
-$sourcefile$
-$endfor$
-$else$
-(stdin)
-$endif$
-\f[R]
-.fi
-.PP
-Similarly, \f[C]outputfile\f[R] can be \f[C]-\f[R] if output goes to the
-terminal.
-.PP
-If you need absolute paths, use e.g.
-\f[C]$curdir$/$sourcefile$\f[R].
-.RE
-.TP
-\f[B]\f[CB]curdir\f[B]\f[R]
-working directory from which pandoc is run.
-.TP
-\f[B]\f[CB]toc\f[B]\f[R]
-non-null value if \f[C]--toc/--table-of-contents\f[R] was specified
-.TP
-\f[B]\f[CB]toc-title\f[B]\f[R]
-title of table of contents (works only with EPUB, HTML, opendocument,
-odt, docx, pptx, beamer, LaTeX)
-.SH EXTENSIONS
-.PP
-The behavior of some of the readers and writers can be adjusted by
-enabling or disabling various extensions.
-.PP
-An extension can be enabled by adding \f[C]+EXTENSION\f[R] to the format
-name and disabled by adding \f[C]-EXTENSION\f[R].
-For example, \f[C]--from markdown_strict+footnotes\f[R] is strict
-Markdown with footnotes enabled, while
-\f[C]--from markdown-footnotes-pipe_tables\f[R] is pandoc\[aq]s Markdown
-without footnotes or pipe tables.
-.PP
-The markdown reader and writer make by far the most use of extensions.
-Extensions only used by them are therefore covered in the section
-Pandoc\[aq]s Markdown below (See Markdown variants for
-\f[C]commonmark\f[R] and \f[C]gfm\f[R].) In the following, extensions
-that also work for other formats are covered.
-.PP
-Note that markdown extensions added to the \f[C]ipynb\f[R] format affect
-Markdown cells in Jupyter notebooks (as do command-line options like
-\f[C]--atx-headers\f[R]).
-.SS Typography
-.SS Extension: \f[C]smart\f[R]
-.PP
-Interpret straight quotes as curly quotes, \f[C]---\f[R] as em-dashes,
-\f[C]--\f[R] as en-dashes, and \f[C]...\f[R] as ellipses.
-Nonbreaking spaces are inserted after certain abbreviations, such as
-\[dq]Mr.\[dq]
-.PP
-This extension can be enabled/disabled for the following formats:
-.TP
-input formats
-\f[C]markdown\f[R], \f[C]commonmark\f[R], \f[C]latex\f[R],
-\f[C]mediawiki\f[R], \f[C]org\f[R], \f[C]rst\f[R], \f[C]twiki\f[R]
-.TP
-output formats
-\f[C]markdown\f[R], \f[C]latex\f[R], \f[C]context\f[R], \f[C]rst\f[R]
-.TP
-enabled by default in
-\f[C]markdown\f[R], \f[C]latex\f[R], \f[C]context\f[R] (both input and
-output)
-.PP
-Note: If you are \f[I]writing\f[R] Markdown, then the \f[C]smart\f[R]
-extension has the reverse effect: what would have been curly quotes
-comes out straight.
-.PP
-In LaTeX, \f[C]smart\f[R] means to use the standard TeX ligatures for
-quotation marks (\f[C]\[ga]\[ga]\f[R] and \f[C]\[aq]\[aq]\f[R] for
-double quotes, \f[C]\[ga]\f[R] and \f[C]\[aq]\f[R] for single quotes)
-and dashes (\f[C]--\f[R] for en-dash and \f[C]---\f[R] for em-dash).
-If \f[C]smart\f[R] is disabled, then in reading LaTeX pandoc will parse
-these characters literally.
-In writing LaTeX, enabling \f[C]smart\f[R] tells pandoc to use the
-ligatures when possible; if \f[C]smart\f[R] is disabled pandoc will use
-unicode quotation mark and dash characters.
-.SS Headings and sections
-.SS Extension: \f[C]auto_identifiers\f[R]
-.PP
-A heading without an explicitly specified identifier will be
-automatically assigned a unique identifier based on the heading text.
-.PP
-This extension can be enabled/disabled for the following formats:
-.TP
-input formats
-\f[C]markdown\f[R], \f[C]latex\f[R], \f[C]rst\f[R], \f[C]mediawiki\f[R],
-\f[C]textile\f[R]
-.TP
-output formats
-\f[C]markdown\f[R], \f[C]muse\f[R]
-.TP
-enabled by default in
-\f[C]markdown\f[R], \f[C]muse\f[R]
-.PP
-The default algorithm used to derive the identifier from the heading
-text is:
-.IP \[bu] 2
-Remove all formatting, links, etc.
-.IP \[bu] 2
-Remove all footnotes.
-.IP \[bu] 2
-Remove all non-alphanumeric characters, except underscores, hyphens, and
-periods.
-.IP \[bu] 2
-Replace all spaces and newlines with hyphens.
-.IP \[bu] 2
-Convert all alphabetic characters to lowercase.
-.IP \[bu] 2
-Remove everything up to the first letter (identifiers may not begin with
-a number or punctuation mark).
-.IP \[bu] 2
-If nothing is left after this, use the identifier \f[C]section\f[R].
-.PP
-Thus, for example,
-.PP
-.TS
-tab(@);
-l l.
-T{
-Heading
-T}@T{
-Identifier
-T}
-_
-T{
-\f[C]Heading identifiers in HTML\f[R]
-T}@T{
-\f[C]heading-identifiers-in-html\f[R]
-T}
-T{
-\f[C]Ma\[^i]tre d\[aq]h\[^o]tel\f[R]
-T}@T{
-\f[C]ma\[^i]tre-dh\[^o]tel\f[R]
-T}
-T{
-\f[C]*Dogs*?--in *my* house?\f[R]
-T}@T{
-\f[C]dogs--in-my-house\f[R]
-T}
-T{
-\f[C][HTML], [S5], or [RTF]?\f[R]
-T}@T{
-\f[C]html-s5-or-rtf\f[R]
-T}
-T{
-\f[C]3. Applications\f[R]
-T}@T{
-\f[C]applications\f[R]
-T}
-T{
-\f[C]33\f[R]
-T}@T{
-\f[C]section\f[R]
-T}
-.TE
-.PP
-These rules should, in most cases, allow one to determine the identifier
-from the heading text.
-The exception is when several headings have the same text; in this case,
-the first will get an identifier as described above; the second will get
-the same identifier with \f[C]-1\f[R] appended; the third with
-\f[C]-2\f[R]; and so on.
-.PP
-(However, a different algorithm is used if
-\f[C]gfm_auto_identifiers\f[R] is enabled; see below.)
-.PP
-These identifiers are used to provide link targets in the table of
-contents generated by the \f[C]--toc|--table-of-contents\f[R] option.
-They also make it easy to provide links from one section of a document
-to another.
-A link to this section, for example, might look like this:
-.IP
-.nf
-\f[C]
-See the section on
-[heading identifiers](#heading-identifiers-in-html-latex-and-context).
-\f[R]
-.fi
-.PP
-Note, however, that this method of providing links to sections works
-only in HTML, LaTeX, and ConTeXt formats.
-.PP
-If the \f[C]--section-divs\f[R] option is specified, then each section
-will be wrapped in a \f[C]section\f[R] (or a \f[C]div\f[R], if
-\f[C]html4\f[R] was specified), and the identifier will be attached to
-the enclosing \f[C]<section>\f[R] (or \f[C]<div>\f[R]) tag rather than
-the heading itself.
-This allows entire sections to be manipulated using JavaScript or
-treated differently in CSS.
-.SS Extension: \f[C]ascii_identifiers\f[R]
-.PP
-Causes the identifiers produced by \f[C]auto_identifiers\f[R] to be pure
-ASCII.
-Accents are stripped off of accented Latin letters, and non-Latin
-letters are omitted.
-.SS Extension: \f[C]gfm_auto_identifiers\f[R]
-.PP
-Changes the algorithm used by \f[C]auto_identifiers\f[R] to conform to
-GitHub\[aq]s method.
-Spaces are converted to dashes (\f[C]-\f[R]), uppercase characters to
-lowercase characters, and punctuation characters other than \f[C]-\f[R]
-and \f[C]_\f[R] are removed.
-Emojis are replaced by their names.
-.SS Math Input
-.PP
-The extensions \f[C]tex_math_dollars\f[R],
-\f[C]tex_math_single_backslash\f[R], and
-\f[C]tex_math_double_backslash\f[R] are described in the section about
-Pandoc\[aq]s Markdown.
-.PP
-However, they can also be used with HTML input.
-This is handy for reading web pages formatted using MathJax, for
-example.
-.SS Raw HTML/TeX
-.PP
-The following extensions are described in more detail in their
-respective sections of Pandoc\[aq]s Markdown:
-.IP \[bu] 2
-\f[C]raw_html\f[R] allows HTML elements which are not representable in
-pandoc\[aq]s AST to be parsed as raw HTML.
-By default, this is disabled for HTML input.
-.IP \[bu] 2
-\f[C]raw_tex\f[R] allows raw LaTeX, TeX, and ConTeXt to be included in a
-document.
-This extension can be enabled/disabled for the following formats (in
-addition to \f[C]markdown\f[R]):
-.RS 2
-.TP
-input formats
-\f[C]latex\f[R], \f[C]org\f[R], \f[C]textile\f[R], \f[C]html\f[R]
-(environments, \f[C]\[rs]ref\f[R], and \f[C]\[rs]eqref\f[R] only),
-\f[C]ipynb\f[R]
-.TP
-output formats
-\f[C]textile\f[R], \f[C]commonmark\f[R]
-.PP
-Note: as applied to \f[C]ipynb\f[R], \f[C]raw_html\f[R] and
-\f[C]raw_tex\f[R] affect not only raw TeX in markdown cells, but data
-with mime type \f[C]text/html\f[R] in output cells.
-Since the \f[C]ipynb\f[R] reader attempts to preserve the richest
-possible outputs when several options are given, you will get best
-results if you disable \f[C]raw_html\f[R] and \f[C]raw_tex\f[R] when
-converting to formats like \f[C]docx\f[R] which don\[aq]t allow raw
-\f[C]html\f[R] or \f[C]tex\f[R].
-.RE
-.IP \[bu] 2
-\f[C]native_divs\f[R] causes HTML \f[C]div\f[R] elements to be parsed as
-native pandoc Div blocks.
-If you want them to be parsed as raw HTML, use
-\f[C]-f html-native_divs+raw_html\f[R].
-.IP \[bu] 2
-\f[C]native_spans\f[R] causes HTML \f[C]span\f[R] elements to be parsed
-as native pandoc Span inlines.
-If you want them to be parsed as raw HTML, use
-\f[C]-f html-native_spans+raw_html\f[R].
-If you want to drop all \f[C]div\f[R]s and \f[C]span\f[R]s when
-converting HTML to Markdown, you can use
-\f[C]pandoc -f html-native_divs-native_spans -t markdown\f[R].
-.SS Literate Haskell support
-.SS Extension: \f[C]literate_haskell\f[R]
-.PP
-Treat the document as literate Haskell source.
-.PP
-This extension can be enabled/disabled for the following formats:
-.TP
-input formats
-\f[C]markdown\f[R], \f[C]rst\f[R], \f[C]latex\f[R]
-.TP
-output formats
-\f[C]markdown\f[R], \f[C]rst\f[R], \f[C]latex\f[R], \f[C]html\f[R]
-.PP
-If you append \f[C]+lhs\f[R] (or \f[C]+literate_haskell\f[R]) to one of
-the formats above, pandoc will treat the document as literate Haskell
-source.
-This means that
-.IP \[bu] 2
-In Markdown input, \[dq]bird track\[dq] sections will be parsed as
-Haskell code rather than block quotations.
-Text between \f[C]\[rs]begin{code}\f[R] and \f[C]\[rs]end{code}\f[R]
-will also be treated as Haskell code.
-For ATX-style headings the character \[aq]=\[aq] will be used instead of
-\[aq]#\[aq].
-.IP \[bu] 2
-In Markdown output, code blocks with classes \f[C]haskell\f[R] and
-\f[C]literate\f[R] will be rendered using bird tracks, and block
-quotations will be indented one space, so they will not be treated as
-Haskell code.
-In addition, headings will be rendered setext-style (with underlines)
-rather than ATX-style (with \[aq]#\[aq] characters).
-(This is because ghc treats \[aq]#\[aq] characters in column 1 as
-introducing line numbers.)
-.IP \[bu] 2
-In restructured text input, \[dq]bird track\[dq] sections will be parsed
-as Haskell code.
-.IP \[bu] 2
-In restructured text output, code blocks with class \f[C]haskell\f[R]
-will be rendered using bird tracks.
-.IP \[bu] 2
-In LaTeX input, text in \f[C]code\f[R] environments will be parsed as
-Haskell code.
-.IP \[bu] 2
-In LaTeX output, code blocks with class \f[C]haskell\f[R] will be
-rendered inside \f[C]code\f[R] environments.
-.IP \[bu] 2
-In HTML output, code blocks with class \f[C]haskell\f[R] will be
-rendered with class \f[C]literatehaskell\f[R] and bird tracks.
-.PP
-Examples:
-.IP
-.nf
-\f[C]
-pandoc -f markdown+lhs -t html
-\f[R]
-.fi
-.PP
-reads literate Haskell source formatted with Markdown conventions and
-writes ordinary HTML (without bird tracks).
-.IP
-.nf
-\f[C]
-pandoc -f markdown+lhs -t html+lhs
-\f[R]
-.fi
-.PP
-writes HTML with the Haskell code in bird tracks, so it can be copied
-and pasted as literate Haskell source.
-.PP
-Note that GHC expects the bird tracks in the first column, so indented
-literate code blocks (e.g.
-inside an itemized environment) will not be picked up by the Haskell
-compiler.
-.SS Other extensions
-.SS Extension: \f[C]empty_paragraphs\f[R]
-.PP
-Allows empty paragraphs.
-By default empty paragraphs are omitted.
-.PP
-This extension can be enabled/disabled for the following formats:
-.TP
-input formats
-\f[C]docx\f[R], \f[C]html\f[R]
-.TP
-output formats
-\f[C]docx\f[R], \f[C]odt\f[R], \f[C]opendocument\f[R], \f[C]html\f[R]
-.SS Extension: \f[C]native_numbering\f[R]
-.PP
-Enables native numbering of figures and tables.
-Enumeration starts at 1.
-.PP
-This extension can be enabled/disabled for the following formats:
-.TP
-output formats
-\f[C]odt\f[R], \f[C]opendocument\f[R]
-.SS Extension: \f[C]styles\f[R] {#ext-styles}
-.PP
-When converting from docx, read all docx styles as divs (for paragraph
-styles) and spans (for character styles) regardless of whether pandoc
-understands the meaning of these styles.
-This can be used with docx custom styles.
-Disabled by default.
-.TP
-input formats
-\f[C]docx\f[R]
-.SS Extension: \f[C]amuse\f[R]
-.PP
-In the \f[C]muse\f[R] input format, this enables Text::Amuse extensions
-to Emacs Muse markup.
-.SS Extension: \f[C]raw_markdown\f[R]
-.PP
-In the \f[C]ipynb\f[R] input format, this causes Markdown cells to be
-included as raw Markdown blocks (allowing lossless round-tripping)
-rather than being parsed.
-Use this only when you are targetting \f[C]ipynb\f[R] or a
-markdown-based output format.
-.SS Extension: \f[C]citations\f[R]
-.PP
-Some aspects of Pandoc\[aq]s Markdown citation syntax are also accepted
-in \f[C]org\f[R] input.
-.SS Extension: \f[C]ntb\f[R]
-.PP
-In the \f[C]context\f[R] output format this enables the use of Natural
-Tables (TABLE) instead of the default Extreme Tables (xtables).
-Natural tables allow more fine-grained global customization but come at
-a performance penalty compared to extreme tables.
-.SH PANDOC\[aq]S MARKDOWN
-.PP
-Pandoc understands an extended and slightly revised version of John
-Gruber\[aq]s Markdown syntax.
-This document explains the syntax, noting differences from standard
-Markdown.
-Except where noted, these differences can be suppressed by using the
-\f[C]markdown_strict\f[R] format instead of \f[C]markdown\f[R].
-Extensions can be enabled or disabled to specify the behavior more
-granularly.
-They are described in the following.
-See also Extensions above, for extensions that work also on other
-formats.
-.SS Philosophy
-.PP
-Markdown is designed to be easy to write, and, even more importantly,
-easy to read:
-.RS
-.PP
-A Markdown-formatted document should be publishable as-is, as plain
-text, without looking like it\[aq]s been marked up with tags or
-formatting instructions.
--- John Gruber
-.RE
-.PP
-This principle has guided pandoc\[aq]s decisions in finding syntax for
-tables, footnotes, and other extensions.
-.PP
-There is, however, one respect in which pandoc\[aq]s aims are different
-from the original aims of Markdown.
-Whereas Markdown was originally designed with HTML generation in mind,
-pandoc is designed for multiple output formats.
-Thus, while pandoc allows the embedding of raw HTML, it discourages it,
-and provides other, non-HTMLish ways of representing important document
-elements like definition lists, tables, mathematics, and footnotes.
-.SS Paragraphs
-.PP
-A paragraph is one or more lines of text followed by one or more blank
-lines.
-Newlines are treated as spaces, so you can reflow your paragraphs as you
-like.
-If you need a hard line break, put two or more spaces at the end of a
-line.
-.SS Extension: \f[C]escaped_line_breaks\f[R]
-.PP
-A backslash followed by a newline is also a hard line break.
-Note: in multiline and grid table cells, this is the only way to create
-a hard line break, since trailing spaces in the cells are ignored.
-.SS Headings
-.PP
-There are two kinds of headings: Setext and ATX.
-.SS Setext-style headings
-.PP
-A setext-style heading is a line of text \[dq]underlined\[dq] with a row
-of \f[C]=\f[R] signs (for a level-one heading) or \f[C]-\f[R] signs (for
-a level-two heading):
-.IP
-.nf
-\f[C]
-A level-one heading
-===================
-
-A level-two heading
--------------------
-\f[R]
-.fi
-.PP
-The heading text can contain inline formatting, such as emphasis (see
-Inline formatting, below).
-.SS ATX-style headings
-.PP
-An ATX-style heading consists of one to six \f[C]#\f[R] signs and a line
-of text, optionally followed by any number of \f[C]#\f[R] signs.
-The number of \f[C]#\f[R] signs at the beginning of the line is the
-heading level:
-.IP
-.nf
-\f[C]
-## A level-two heading
-
-### A level-three heading ###
-\f[R]
-.fi
-.PP
-As with setext-style headings, the heading text can contain formatting:
-.IP
-.nf
-\f[C]
-# A level-one heading with a [link](/url) and *emphasis*
-\f[R]
-.fi
-.SS Extension: \f[C]blank_before_header\f[R]
-.PP
-Standard Markdown syntax does not require a blank line before a heading.
-Pandoc does require this (except, of course, at the beginning of the
-document).
-The reason for the requirement is that it is all too easy for a
-\f[C]#\f[R] to end up at the beginning of a line by accident (perhaps
-through line wrapping).
-Consider, for example:
-.IP
-.nf
-\f[C]
-I like several of their flavors of ice cream:
-#22, for example, and #5.
-\f[R]
-.fi
-.SS Extension: \f[C]space_in_atx_header\f[R]
-.PP
-Many Markdown implementations do not require a space between the opening
-\f[C]#\f[R]s of an ATX heading and the heading text, so that
-\f[C]#5 bolt\f[R] and \f[C]#hashtag\f[R] count as headings.
-With this extension, pandoc does require the space.
-.SS Heading identifiers
-.PP
-See also the \f[C]auto_identifiers\f[R] extension above.
-.SS Extension: \f[C]header_attributes\f[R]
-.PP
-Headings can be assigned attributes using this syntax at the end of the
-line containing the heading text:
-.IP
-.nf
-\f[C]
-{#identifier .class .class key=value key=value}
-\f[R]
-.fi
-.PP
-Thus, for example, the following headings will all be assigned the
-identifier \f[C]foo\f[R]:
-.IP
-.nf
-\f[C]
-# My heading {#foo}
-
-## My heading ##    {#foo}
-
-My other heading   {#foo}
----------------
-\f[R]
-.fi
-.PP
-(This syntax is compatible with PHP Markdown Extra.)
-.PP
-Note that although this syntax allows assignment of classes and
-key/value attributes, writers generally don\[aq]t use all of this
-information.
-Identifiers, classes, and key/value attributes are used in HTML and
-HTML-based formats such as EPUB and slidy.
-Identifiers are used for labels and link anchors in the LaTeX, ConTeXt,
-Textile, Jira markup, and AsciiDoc writers.
-.PP
-Headings with the class \f[C]unnumbered\f[R] will not be numbered, even
-if \f[C]--number-sections\f[R] is specified.
-A single hyphen (\f[C]-\f[R]) in an attribute context is equivalent to
-\f[C].unnumbered\f[R], and preferable in non-English documents.
-So,
-.IP
-.nf
-\f[C]
-# My heading {-}
-\f[R]
-.fi
-.PP
-is just the same as
-.IP
-.nf
-\f[C]
-# My heading {.unnumbered}
-\f[R]
-.fi
-.PP
-If the \f[C]unlisted\f[R] class is present in addition to
-\f[C]unnumbered\f[R], the heading will not be included in a table of
-contents.
-(Currently this feature is only implemented for certain formats: those
-based on LaTeX and HTML, PowerPoint, and RTF.)
-.SS Extension: \f[C]implicit_header_references\f[R]
-.PP
-Pandoc behaves as if reference links have been defined for each heading.
-So, to link to a heading
-.IP
-.nf
-\f[C]
-# Heading identifiers in HTML
-\f[R]
-.fi
-.PP
-you can simply write
-.IP
-.nf
-\f[C]
-[Heading identifiers in HTML]
-\f[R]
-.fi
-.PP
-or
-.IP
-.nf
-\f[C]
-[Heading identifiers in HTML][]
-\f[R]
-.fi
-.PP
-or
-.IP
-.nf
-\f[C]
-[the section on heading identifiers][heading identifiers in
-HTML]
-\f[R]
-.fi
-.PP
-instead of giving the identifier explicitly:
-.IP
-.nf
-\f[C]
-[Heading identifiers in HTML](#heading-identifiers-in-html)
-\f[R]
-.fi
-.PP
-If there are multiple headings with identical text, the corresponding
-reference will link to the first one only, and you will need to use
-explicit links to link to the others, as described above.
-.PP
-Like regular reference links, these references are case-insensitive.
-.PP
-Explicit link reference definitions always take priority over implicit
-heading references.
-So, in the following example, the link will point to \f[C]bar\f[R], not
-to \f[C]#foo\f[R]:
-.IP
-.nf
-\f[C]
-# Foo
-
-[foo]: bar
-
-See [foo]
-\f[R]
-.fi
-.SS Block quotations
-.PP
-Markdown uses email conventions for quoting blocks of text.
-A block quotation is one or more paragraphs or other block elements
-(such as lists or headings), with each line preceded by a \f[C]>\f[R]
-character and an optional space.
-(The \f[C]>\f[R] need not start at the left margin, but it should not be
-indented more than three spaces.)
-.IP
-.nf
-\f[C]
-> This is a block quote. This
-> paragraph has two lines.
->
-> 1. This is a list inside a block quote.
-> 2. Second item.
-\f[R]
-.fi
-.PP
-A \[dq]lazy\[dq] form, which requires the \f[C]>\f[R] character only on
-the first line of each block, is also allowed:
-.IP
-.nf
-\f[C]
-> This is a block quote. This
-paragraph has two lines.
-
-> 1. This is a list inside a block quote.
-2. Second item.
-\f[R]
-.fi
-.PP
-Among the block elements that can be contained in a block quote are
-other block quotes.
-That is, block quotes can be nested:
-.IP
-.nf
-\f[C]
-> This is a block quote.
->
-> > A block quote within a block quote.
-\f[R]
-.fi
-.PP
-If the \f[C]>\f[R] character is followed by an optional space, that
-space will be considered part of the block quote marker and not part of
-the indentation of the contents.
-Thus, to put an indented code block in a block quote, you need five
-spaces after the \f[C]>\f[R]:
-.IP
-.nf
-\f[C]
->     code
-\f[R]
-.fi
-.SS Extension: \f[C]blank_before_blockquote\f[R]
-.PP
-Standard Markdown syntax does not require a blank line before a block
-quote.
-Pandoc does require this (except, of course, at the beginning of the
-document).
-The reason for the requirement is that it is all too easy for a
-\f[C]>\f[R] to end up at the beginning of a line by accident (perhaps
-through line wrapping).
-So, unless the \f[C]markdown_strict\f[R] format is used, the following
-does not produce a nested block quote in pandoc:
-.IP
-.nf
-\f[C]
-> This is a block quote.
->> Nested.
-\f[R]
-.fi
-.SS Verbatim (code) blocks
-.SS Indented code blocks
-.PP
-A block of text indented four spaces (or one tab) is treated as verbatim
-text: that is, special characters do not trigger special formatting, and
-all spaces and line breaks are preserved.
-For example,
-.IP
-.nf
-\f[C]
-    if (a > 3) {
-      moveShip(5 * gravity, DOWN);
-    }
-\f[R]
-.fi
-.PP
-The initial (four space or one tab) indentation is not considered part
-of the verbatim text, and is removed in the output.
-.PP
-Note: blank lines in the verbatim text need not begin with four spaces.
-.SS Fenced code blocks
-.SS Extension: \f[C]fenced_code_blocks\f[R]
-.PP
-In addition to standard indented code blocks, pandoc supports
-\f[I]fenced\f[R] code blocks.
-These begin with a row of three or more tildes (\f[C]\[ti]\f[R]) and end
-with a row of tildes that must be at least as long as the starting row.
-Everything between these lines is treated as code.
-No indentation is necessary:
-.IP
-.nf
-\f[C]
-\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
-if (a > 3) {
-  moveShip(5 * gravity, DOWN);
-}
-\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
-\f[R]
-.fi
-.PP
-Like regular code blocks, fenced code blocks must be separated from
-surrounding text by blank lines.
-.PP
-If the code itself contains a row of tildes or backticks, just use a
-longer row of tildes or backticks at the start and end:
-.IP
-.nf
-\f[C]
-\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
-\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
-code including tildes
-\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
-\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
-\f[R]
-.fi
-.SS Extension: \f[C]backtick_code_blocks\f[R]
-.PP
-Same as \f[C]fenced_code_blocks\f[R], but uses backticks
-(\f[C]\[ga]\f[R]) instead of tildes (\f[C]\[ti]\f[R]).
-.SS Extension: \f[C]fenced_code_attributes\f[R]
-.PP
-Optionally, you may attach attributes to fenced or backtick code block
-using this syntax:
-.IP
-.nf
-\f[C]
-\[ti]\[ti]\[ti]\[ti] {#mycode .haskell .numberLines startFrom=\[dq]100\[dq]}
-qsort []     = []
-qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
-               qsort (filter (>= x) xs)
-\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
-\f[R]
-.fi
-.PP
-Here \f[C]mycode\f[R] is an identifier, \f[C]haskell\f[R] and
-\f[C]numberLines\f[R] are classes, and \f[C]startFrom\f[R] is an
-attribute with value \f[C]100\f[R].
-Some output formats can use this information to do syntax highlighting.
-Currently, the only output formats that uses this information are HTML,
-LaTeX, Docx, Ms, and PowerPoint.
-If highlighting is supported for your output format and language, then
-the code block above will appear highlighted, with numbered lines.
-(To see which languages are supported, type
-\f[C]pandoc --list-highlight-languages\f[R].) Otherwise, the code block
-above will appear as follows:
-.IP
-.nf
-\f[C]
-<pre id=\[dq]mycode\[dq] class=\[dq]haskell numberLines\[dq] startFrom=\[dq]100\[dq]>
-  <code>
-  ...
-  </code>
-</pre>
-\f[R]
-.fi
-.PP
-The \f[C]numberLines\f[R] (or \f[C]number-lines\f[R]) class will cause
-the lines of the code block to be numbered, starting with \f[C]1\f[R] or
-the value of the \f[C]startFrom\f[R] attribute.
-The \f[C]lineAnchors\f[R] (or \f[C]line-anchors\f[R]) class will cause
-the lines to be clickable anchors in HTML output.
-.PP
-A shortcut form can also be used for specifying the language of the code
-block:
-.IP
-.nf
-\f[C]
-\[ga]\[ga]\[ga]haskell
-qsort [] = []
-\[ga]\[ga]\[ga]
-\f[R]
-.fi
-.PP
-This is equivalent to:
-.IP
-.nf
-\f[C]
-\[ga]\[ga]\[ga] {.haskell}
-qsort [] = []
-\[ga]\[ga]\[ga]
-\f[R]
-.fi
-.PP
-If the \f[C]fenced_code_attributes\f[R] extension is disabled, but input
-contains class attribute(s) for the code block, the first class
-attribute will be printed after the opening fence as a bare word.
-.PP
-To prevent all highlighting, use the \f[C]--no-highlight\f[R] flag.
-To set the highlighting style, use \f[C]--highlight-style\f[R].
-For more information on highlighting, see Syntax highlighting, below.
-.SS Line blocks
-.SS Extension: \f[C]line_blocks\f[R]
-.PP
-A line block is a sequence of lines beginning with a vertical bar
-(\f[C]|\f[R]) followed by a space.
-The division into lines will be preserved in the output, as will any
-leading spaces; otherwise, the lines will be formatted as Markdown.
-This is useful for verse and addresses:
-.IP
-.nf
-\f[C]
-| The limerick packs laughs anatomical
-| In space that is quite economical.
-|    But the good ones I\[aq]ve seen
-|    So seldom are clean
-| And the clean ones so seldom are comical
-
-| 200 Main St.
-| Berkeley, CA 94718
-\f[R]
-.fi
-.PP
-The lines can be hard-wrapped if needed, but the continuation line must
-begin with a space.
-.IP
-.nf
-\f[C]
-| The Right Honorable Most Venerable and Righteous Samuel L.
-  Constable, Jr.
-| 200 Main St.
-| Berkeley, CA 94718
-\f[R]
-.fi
-.PP
-This syntax is borrowed from reStructuredText.
-.SS Lists
-.SS Bullet lists
-.PP
-A bullet list is a list of bulleted list items.
-A bulleted list item begins with a bullet (\f[C]*\f[R], \f[C]+\f[R], or
-\f[C]-\f[R]).
-Here is a simple example:
-.IP
-.nf
-\f[C]
-* one
-* two
-* three
-\f[R]
-.fi
-.PP
-This will produce a \[dq]compact\[dq] list.
-If you want a \[dq]loose\[dq] list, in which each item is formatted as a
-paragraph, put spaces between the items:
-.IP
-.nf
-\f[C]
-* one
-
-* two
-
-* three
-\f[R]
-.fi
-.PP
-The bullets need not be flush with the left margin; they may be indented
-one, two, or three spaces.
-The bullet must be followed by whitespace.
-.PP
-List items look best if subsequent lines are flush with the first line
-(after the bullet):
-.IP
-.nf
-\f[C]
-* here is my first
-  list item.
-* and my second.
-\f[R]
-.fi
-.PP
-But Markdown also allows a \[dq]lazy\[dq] format:
-.IP
-.nf
-\f[C]
-* here is my first
-list item.
-* and my second.
-\f[R]
-.fi
-.SS Block content in list items
-.PP
-A list item may contain multiple paragraphs and other block-level
-content.
-However, subsequent paragraphs must be preceded by a blank line and
-indented to line up with the first non-space content after the list
-marker.
-.IP
-.nf
-\f[C]
-  * First paragraph.
-
-    Continued.
-
-  * Second paragraph. With a code block, which must be indented
-    eight spaces:
-
-        { code }
-\f[R]
-.fi
-.PP
-Exception: if the list marker is followed by an indented code block,
-which must begin 5 spaces after the list marker, then subsequent
-paragraphs must begin two columns after the last character of the list
-marker:
-.IP
-.nf
-\f[C]
-*     code
-
-  continuation paragraph
-\f[R]
-.fi
-.PP
-List items may include other lists.
-In this case the preceding blank line is optional.
-The nested list must be indented to line up with the first non-space
-character after the list marker of the containing list item.
-.IP
-.nf
-\f[C]
-* fruits
-  + apples
-    - macintosh
-    - red delicious
-  + pears
-  + peaches
-* vegetables
-  + broccoli
-  + chard
-\f[R]
-.fi
-.PP
-As noted above, Markdown allows you to write list items
-\[dq]lazily,\[dq] instead of indenting continuation lines.
-However, if there are multiple paragraphs or other blocks in a list
-item, the first line of each must be indented.
-.IP
-.nf
-\f[C]
-+ A lazy, lazy, list
-item.
-
-+ Another one; this looks
-bad but is legal.
-
-    Second paragraph of second
-list item.
-\f[R]
-.fi
-.SS Ordered lists
-.PP
-Ordered lists work just like bulleted lists, except that the items begin
-with enumerators rather than bullets.
-.PP
-In standard Markdown, enumerators are decimal numbers followed by a
-period and a space.
-The numbers themselves are ignored, so there is no difference between
-this list:
-.IP
-.nf
-\f[C]
-1.  one
-2.  two
-3.  three
-\f[R]
-.fi
-.PP
-and this one:
-.IP
-.nf
-\f[C]
-5.  one
-7.  two
-1.  three
-\f[R]
-.fi
-.SS Extension: \f[C]fancy_lists\f[R]
-.PP
-Unlike standard Markdown, pandoc allows ordered list items to be marked
-with uppercase and lowercase letters and roman numerals, in addition to
-Arabic numerals.
-List markers may be enclosed in parentheses or followed by a single
-right-parentheses or period.
-They must be separated from the text that follows by at least one space,
-and, if the list marker is a capital letter with a period, by at least
-two spaces.
-.PP
-The \f[C]fancy_lists\f[R] extension also allows \[aq]\f[C]#\f[R]\[aq] to
-be used as an ordered list marker in place of a numeral:
-.IP
-.nf
-\f[C]
-#. one
-#. two
-\f[R]
-.fi
-.SS Extension: \f[C]startnum\f[R]
-.PP
-Pandoc also pays attention to the type of list marker used, and to the
-starting number, and both of these are preserved where possible in the
-output format.
-Thus, the following yields a list with numbers followed by a single
-parenthesis, starting with 9, and a sublist with lowercase roman
-numerals:
-.IP
-.nf
-\f[C]
- 9)  Ninth
-10)  Tenth
-11)  Eleventh
-       i. subone
-      ii. subtwo
-     iii. subthree
-\f[R]
-.fi
-.PP
-Pandoc will start a new list each time a different type of list marker
-is used.
-So, the following will create three lists:
-.IP
-.nf
-\f[C]
-(2) Two
-(5) Three
-1.  Four
-*   Five
-\f[R]
-.fi
-.PP
-If default list markers are desired, use \f[C]#.\f[R]:
-.IP
-.nf
-\f[C]
-#.  one
-#.  two
-#.  three
-\f[R]
-.fi
-.SS Extension: \f[C]task_lists\f[R]
-.PP
-Pandoc supports task lists, using the syntax of GitHub-Flavored
-Markdown.
-.IP
-.nf
-\f[C]
-- [ ] an unchecked task list item
-- [x] checked item
-\f[R]
-.fi
-.SS Definition lists
-.SS Extension: \f[C]definition_lists\f[R]
-.PP
-Pandoc supports definition lists, using the syntax of PHP Markdown Extra
-with some extensions.
-.IP
-.nf
-\f[C]
-Term 1
-
-:   Definition 1
-
-Term 2 with *inline markup*
-
-:   Definition 2
-
-        { some code, part of Definition 2 }
-
-    Third paragraph of definition 2.
-\f[R]
-.fi
-.PP
-Each term must fit on one line, which may optionally be followed by a
-blank line, and must be followed by one or more definitions.
-A definition begins with a colon or tilde, which may be indented one or
-two spaces.
-.PP
-A term may have multiple definitions, and each definition may consist of
-one or more block elements (paragraph, code block, list, etc.), each
-indented four spaces or one tab stop.
-The body of the definition (including the first line, aside from the
-colon or tilde) should be indented four spaces.
-However, as with other Markdown lists, you can \[dq]lazily\[dq] omit
-indentation except at the beginning of a paragraph or other block
-element:
-.IP
-.nf
-\f[C]
-Term 1
-
-:   Definition
-with lazy continuation.
-
-    Second paragraph of the definition.
-\f[R]
-.fi
-.PP
-If you leave space before the definition (as in the example above), the
-text of the definition will be treated as a paragraph.
-In some output formats, this will mean greater spacing between
-term/definition pairs.
-For a more compact definition list, omit the space before the
-definition:
-.IP
-.nf
-\f[C]
-Term 1
-  \[ti] Definition 1
-
-Term 2
-  \[ti] Definition 2a
-  \[ti] Definition 2b
-\f[R]
-.fi
-.PP
-Note that space between items in a definition list is required.
-(A variant that loosens this requirement, but disallows \[dq]lazy\[dq]
-hard wrapping, can be activated with \f[C]compact_definition_lists\f[R]:
-see Non-pandoc extensions, below.)
-.SS Numbered example lists
-.SS Extension: \f[C]example_lists\f[R]
-.PP
-The special list marker \f[C]\[at]\f[R] can be used for sequentially
-numbered examples.
-The first list item with a \f[C]\[at]\f[R] marker will be numbered
-\[aq]1\[aq], the next \[aq]2\[aq], and so on, throughout the document.
-The numbered examples need not occur in a single list; each new list
-using \f[C]\[at]\f[R] will take up where the last stopped.
-So, for example:
-.IP
-.nf
-\f[C]
-(\[at])  My first example will be numbered (1).
-(\[at])  My second example will be numbered (2).
-
-Explanation of examples.
-
-(\[at])  My third example will be numbered (3).
-\f[R]
-.fi
-.PP
-Numbered examples can be labeled and referred to elsewhere in the
-document:
-.IP
-.nf
-\f[C]
-(\[at]good)  This is a good example.
-
-As (\[at]good) illustrates, ...
-\f[R]
-.fi
-.PP
-The label can be any string of alphanumeric characters, underscores, or
-hyphens.
-.PP
-Note: continuation paragraphs in example lists must always be indented
-four spaces, regardless of the length of the list marker.
-That is, example lists always behave as if the \f[C]four_space_rule\f[R]
-extension is set.
-This is because example labels tend to be long, and indenting content to
-the first non-space character after the label would be awkward.
-.SS Compact and loose lists
-.PP
-Pandoc behaves differently from \f[C]Markdown.pl\f[R] on some \[dq]edge
-cases\[dq] involving lists.
-Consider this source:
-.IP
-.nf
-\f[C]
-+   First
-+   Second:
-    -   Fee
-    -   Fie
-    -   Foe
-
-+   Third
-\f[R]
-.fi
-.PP
-Pandoc transforms this into a \[dq]compact list\[dq] (with no
-\f[C]<p>\f[R] tags around \[dq]First\[dq], \[dq]Second\[dq], or
-\[dq]Third\[dq]), while Markdown puts \f[C]<p>\f[R] tags around
-\[dq]Second\[dq] and \[dq]Third\[dq] (but not \[dq]First\[dq]), because
-of the blank space around \[dq]Third\[dq].
-Pandoc follows a simple rule: if the text is followed by a blank line,
-it is treated as a paragraph.
-Since \[dq]Second\[dq] is followed by a list, and not a blank line, it
-isn\[aq]t treated as a paragraph.
-The fact that the list is followed by a blank line is irrelevant.
-(Note: Pandoc works this way even when the \f[C]markdown_strict\f[R]
-format is specified.
-This behavior is consistent with the official Markdown syntax
-description, even though it is different from that of
-\f[C]Markdown.pl\f[R].)
-.SS Ending a list
-.PP
-What if you want to put an indented code block after a list?
-.IP
-.nf
-\f[C]
--   item one
--   item two
-
-    { my code block }
-\f[R]
-.fi
-.PP
-Trouble! Here pandoc (like other Markdown implementations) will treat
-\f[C]{ my code block }\f[R] as the second paragraph of item two, and not
-as a code block.
-.PP
-To \[dq]cut off\[dq] the list after item two, you can insert some
-non-indented content, like an HTML comment, which won\[aq]t produce
-visible output in any format:
-.IP
-.nf
-\f[C]
--   item one
--   item two
-
-<!-- end of list -->
-
-    { my code block }
-\f[R]
-.fi
-.PP
-You can use the same trick if you want two consecutive lists instead of
-one big list:
-.IP
-.nf
-\f[C]
-1.  one
-2.  two
-3.  three
-
-<!-- -->
-
-1.  uno
-2.  dos
-3.  tres
-\f[R]
-.fi
-.SS Horizontal rules
-.PP
-A line containing a row of three or more \f[C]*\f[R], \f[C]-\f[R], or
-\f[C]_\f[R] characters (optionally separated by spaces) produces a
-horizontal rule:
-.IP
-.nf
-\f[C]
-*  *  *  *
-
----------------
-\f[R]
-.fi
-.SS Tables
-.PP
-Four kinds of tables may be used.
-The first three kinds presuppose the use of a fixed-width font, such as
-Courier.
-The fourth kind can be used with proportionally spaced fonts, as it does
-not require lining up columns.
-.SS Extension: \f[C]table_captions\f[R]
-.PP
-A caption may optionally be provided with all 4 kinds of tables (as
-illustrated in the examples below).
-A caption is a paragraph beginning with the string \f[C]Table:\f[R] (or
-just \f[C]:\f[R]), which will be stripped off.
-It may appear either before or after the table.
-.SS Extension: \f[C]simple_tables\f[R]
-.PP
-Simple tables look like this:
-.IP
-.nf
-\f[C]
-  Right     Left     Center     Default
--------     ------ ----------   -------
-     12     12        12            12
-    123     123       123          123
-      1     1          1             1
-
-Table:  Demonstration of simple table syntax.
-\f[R]
-.fi
-.PP
-The header and table rows must each fit on one line.
-Column alignments are determined by the position of the header text
-relative to the dashed line below it:
-.IP \[bu] 2
-If the dashed line is flush with the header text on the right side but
-extends beyond it on the left, the column is right-aligned.
-.IP \[bu] 2
-If the dashed line is flush with the header text on the left side but
-extends beyond it on the right, the column is left-aligned.
-.IP \[bu] 2
-If the dashed line extends beyond the header text on both sides, the
-column is centered.
-.IP \[bu] 2
-If the dashed line is flush with the header text on both sides, the
-default alignment is used (in most cases, this will be left).
-.PP
-The table must end with a blank line, or a line of dashes followed by a
-blank line.
-.PP
-The column header row may be omitted, provided a dashed line is used to
-end the table.
-For example:
-.IP
-.nf
-\f[C]
--------     ------ ----------   -------
-     12     12        12             12
-    123     123       123           123
-      1     1          1              1
--------     ------ ----------   -------
-\f[R]
-.fi
-.PP
-When the header row is omitted, column alignments are determined on the
-basis of the first line of the table body.
-So, in the tables above, the columns would be right, left, center, and
-right aligned, respectively.
-.SS Extension: \f[C]multiline_tables\f[R]
-.PP
-Multiline tables allow header and table rows to span multiple lines of
-text (but cells that span multiple columns or rows of the table are not
-supported).
-Here is an example:
-.IP
-.nf
-\f[C]
--------------------------------------------------------------
- Centered   Default           Right Left
-  Header    Aligned         Aligned Aligned
------------ ------- --------------- -------------------------
-   First    row                12.0 Example of a row that
-                                    spans multiple lines.
-
-  Second    row                 5.0 Here\[aq]s another one. Note
-                                    the blank line between
-                                    rows.
--------------------------------------------------------------
-
-Table: Here\[aq]s the caption. It, too, may span
-multiple lines.
-\f[R]
-.fi
-.PP
-These work like simple tables, but with the following differences:
-.IP \[bu] 2
-They must begin with a row of dashes, before the header text (unless the
-header row is omitted).
-.IP \[bu] 2
-They must end with a row of dashes, then a blank line.
-.IP \[bu] 2
-The rows must be separated by blank lines.
-.PP
-In multiline tables, the table parser pays attention to the widths of
-the columns, and the writers try to reproduce these relative widths in
-the output.
-So, if you find that one of the columns is too narrow in the output, try
-widening it in the Markdown source.
-.PP
-The header may be omitted in multiline tables as well as simple tables:
-.IP
-.nf
-\f[C]
------------ ------- --------------- -------------------------
-   First    row                12.0 Example of a row that
-                                    spans multiple lines.
-
-  Second    row                 5.0 Here\[aq]s another one. Note
-                                    the blank line between
-                                    rows.
------------ ------- --------------- -------------------------
-
-: Here\[aq]s a multiline table without a header.
-\f[R]
-.fi
-.PP
-It is possible for a multiline table to have just one row, but the row
-should be followed by a blank line (and then the row of dashes that ends
-the table), or the table may be interpreted as a simple table.
-.SS Extension: \f[C]grid_tables\f[R]
-.PP
-Grid tables look like this:
-.IP
-.nf
-\f[C]
-: Sample grid table.
-
-+---------------+---------------+--------------------+
-| Fruit         | Price         | Advantages         |
-+===============+===============+====================+
-| Bananas       | $1.34         | - built-in wrapper |
-|               |               | - bright color     |
-+---------------+---------------+--------------------+
-| Oranges       | $2.10         | - cures scurvy     |
-|               |               | - tasty            |
-+---------------+---------------+--------------------+
-\f[R]
-.fi
-.PP
-The row of \f[C]=\f[R]s separates the header from the table body, and
-can be omitted for a headerless table.
-The cells of grid tables may contain arbitrary block elements (multiple
-paragraphs, code blocks, lists, etc.).
-Cells that span multiple columns or rows are not supported.
-Grid tables can be created easily using Emacs\[aq] table-mode
-(\f[C]M-x table-insert\f[R]).
-.PP
-Alignments can be specified as with pipe tables, by putting colons at
-the boundaries of the separator line after the header:
-.IP
-.nf
-\f[C]
-+---------------+---------------+--------------------+
-| Right         | Left          | Centered           |
-+==============:+:==============+:==================:+
-| Bananas       | $1.34         | built-in wrapper   |
-+---------------+---------------+--------------------+
-\f[R]
-.fi
-.PP
-For headerless tables, the colons go on the top line instead:
-.IP
-.nf
-\f[C]
-+--------------:+:--------------+:------------------:+
-| Right         | Left          | Centered           |
-+---------------+---------------+--------------------+
-\f[R]
-.fi
-.SS Grid Table Limitations
-.PP
-Pandoc does not support grid tables with row spans or column spans.
-This means that neither variable numbers of columns across rows nor
-variable numbers of rows across columns are supported by Pandoc.
-All grid tables must have the same number of columns in each row, and
-the same number of rows in each column.
-For example, the Docutils sample grid tables will not render as expected
-with Pandoc.
-.SS Extension: \f[C]pipe_tables\f[R]
-.PP
-Pipe tables look like this:
-.IP
-.nf
-\f[C]
-| Right | Left | Default | Center |
-|------:|:-----|---------|:------:|
-|   12  |  12  |    12   |    12  |
-|  123  |  123 |   123   |   123  |
-|    1  |    1 |     1   |     1  |
-
-  : Demonstration of pipe table syntax.
-\f[R]
-.fi
-.PP
-The syntax is identical to PHP Markdown Extra tables.
-The beginning and ending pipe characters are optional, but pipes are
-required between all columns.
-The colons indicate column alignment as shown.
-The header cannot be omitted.
-To simulate a headerless table, include a header with blank cells.
-.PP
-Since the pipes indicate column boundaries, columns need not be
-vertically aligned, as they are in the above example.
-So, this is a perfectly legal (though ugly) pipe table:
-.IP
-.nf
-\f[C]
-fruit| price
------|-----:
-apple|2.05
-pear|1.37
-orange|3.09
-\f[R]
-.fi
-.PP
-The cells of pipe tables cannot contain block elements like paragraphs
-and lists, and cannot span multiple lines.
-If a pipe table contains a row whose Markdown content is wider than the
-column width (see \f[C]--columns\f[R]), then the table will take up the
-full text width and the cell contents will wrap, with the relative cell
-widths determined by the number of dashes in the line separating the
-table header from the table body.
-(For example \f[C]---|-\f[R] would make the first column 3/4 and the
-second column 1/4 of the full text width.) On the other hand, if no
-lines are wider than column width, then cell contents will not be
-wrapped, and the cells will be sized to their contents.
-.PP
-Note: pandoc also recognizes pipe tables of the following form, as can
-be produced by Emacs\[aq] orgtbl-mode:
-.IP
-.nf
-\f[C]
-| One | Two   |
-|-----+-------|
-| my  | table |
-| is  | nice  |
-\f[R]
-.fi
-.PP
-The difference is that \f[C]+\f[R] is used instead of \f[C]|\f[R].
-Other orgtbl features are not supported.
-In particular, to get non-default column alignment, you\[aq]ll need to
-add colons as above.
-.SS Metadata blocks
-.SS Extension: \f[C]pandoc_title_block\f[R]
-.PP
-If the file begins with a title block
-.IP
-.nf
-\f[C]
-% title
-% author(s) (separated by semicolons)
-% date
-\f[R]
-.fi
-.PP
-it will be parsed as bibliographic information, not regular text.
-(It will be used, for example, in the title of standalone LaTeX or HTML
-output.) The block may contain just a title, a title and an author, or
-all three elements.
-If you want to include an author but no title, or a title and a date but
-no author, you need a blank line:
-.IP
-.nf
-\f[C]
-%
-% Author
-\f[R]
-.fi
-.IP
-.nf
-\f[C]
-% My title
-%
-% June 15, 2006
-\f[R]
-.fi
-.PP
-The title may occupy multiple lines, but continuation lines must begin
-with leading space, thus:
-.IP
-.nf
-\f[C]
-% My title
-  on multiple lines
-\f[R]
-.fi
-.PP
-If a document has multiple authors, the authors may be put on separate
-lines with leading space, or separated by semicolons, or both.
-So, all of the following are equivalent:
-.IP
-.nf
-\f[C]
-% Author One
-  Author Two
-\f[R]
-.fi
-.IP
-.nf
-\f[C]
-% Author One; Author Two
-\f[R]
-.fi
-.IP
-.nf
-\f[C]
-% Author One;
-  Author Two
-\f[R]
-.fi
-.PP
-The date must fit on one line.
-.PP
-All three metadata fields may contain standard inline formatting
-(italics, links, footnotes, etc.).
-.PP
-Title blocks will always be parsed, but they will affect the output only
-when the \f[C]--standalone\f[R] (\f[C]-s\f[R]) option is chosen.
-In HTML output, titles will appear twice: once in the document head --
-this is the title that will appear at the top of the window in a browser
--- and once at the beginning of the document body.
-The title in the document head can have an optional prefix attached
-(\f[C]--title-prefix\f[R] or \f[C]-T\f[R] option).
-The title in the body appears as an H1 element with class
-\[dq]title\[dq], so it can be suppressed or reformatted with CSS.
-If a title prefix is specified with \f[C]-T\f[R] and no title block
-appears in the document, the title prefix will be used by itself as the
-HTML title.
-.PP
-The man page writer extracts a title, man page section number, and other
-header and footer information from the title line.
-The title is assumed to be the first word on the title line, which may
-optionally end with a (single-digit) section number in parentheses.
-(There should be no space between the title and the parentheses.)
-Anything after this is assumed to be additional footer and header text.
-A single pipe character (\f[C]|\f[R]) should be used to separate the
-footer text from the header text.
-Thus,
-.IP
-.nf
-\f[C]
-% PANDOC(1)
-\f[R]
-.fi
-.PP
-will yield a man page with the title \f[C]PANDOC\f[R] and section 1.
-.IP
-.nf
-\f[C]
-% PANDOC(1) Pandoc User Manuals
-\f[R]
-.fi
-.PP
-will also have \[dq]Pandoc User Manuals\[dq] in the footer.
-.IP
-.nf
-\f[C]
-% PANDOC(1) Pandoc User Manuals | Version 4.0
-\f[R]
-.fi
-.PP
-will also have \[dq]Version 4.0\[dq] in the header.
-.SS Extension: \f[C]yaml_metadata_block\f[R]
-.PP
-A YAML metadata block is a valid YAML object, delimited by a line of
-three hyphens (\f[C]---\f[R]) at the top and a line of three hyphens
-(\f[C]---\f[R]) or three dots (\f[C]...\f[R]) at the bottom.
-A YAML metadata block may occur anywhere in the document, but if it is
-not at the beginning, it must be preceded by a blank line.
-(Note that, because of the way pandoc concatenates input files when
-several are provided, you may also keep the metadata in a separate YAML
-file and pass it to pandoc as an argument, along with your Markdown
-files:
-.IP
-.nf
-\f[C]
-pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html
-\f[R]
-.fi
-.PP
-Just be sure that the YAML file begins with \f[C]---\f[R] and ends with
-\f[C]---\f[R] or \f[C]...\f[R].) Alternatively, you can use the
-\f[C]--metadata-file\f[R] option.
-Using that approach however, you cannot reference content (like
-footnotes) from the main markdown input document.
-.PP
-Metadata will be taken from the fields of the YAML object and added to
-any existing document metadata.
-Metadata can contain lists and objects (nested arbitrarily), but all
-string scalars will be interpreted as Markdown.
-Fields with names ending in an underscore will be ignored by pandoc.
-(They may be given a role by external processors.) Field names must not
-be interpretable as YAML numbers or boolean values (so, for example,
-\f[C]yes\f[R], \f[C]True\f[R], and \f[C]15\f[R] cannot be used as field
-names).
-.PP
-A document may contain multiple metadata blocks.
-If two metadata blocks attempt to set the same field, the value from the
-second block will be taken.
-.PP
-When pandoc is used with \f[C]-t markdown\f[R] to create a Markdown
-document, a YAML metadata block will be produced only if the
-\f[C]-s/--standalone\f[R] option is used.
-All of the metadata will appear in a single block at the beginning of
-the document.
-.PP
-Note that YAML escaping rules must be followed.
-Thus, for example, if a title contains a colon, it must be quoted.
-The pipe character (\f[C]|\f[R]) can be used to begin an indented block
-that will be interpreted literally, without need for escaping.
-This form is necessary when the field contains blank lines or
-block-level formatting:
-.IP
-.nf
-\f[C]
----
-title:  \[aq]This is the title: it contains a colon\[aq]
-author:
-- Author One
-- Author Two
-keywords: [nothing, nothingness]
-abstract: |
-  This is the abstract.
-
-  It consists of two paragraphs.
-\&...
-\f[R]
-.fi
-.PP
-Template variables will be set automatically from the metadata.
-Thus, for example, in writing HTML, the variable \f[C]abstract\f[R] will
-be set to the HTML equivalent of the Markdown in the \f[C]abstract\f[R]
-field:
-.IP
-.nf
-\f[C]
-<p>This is the abstract.</p>
-<p>It consists of two paragraphs.</p>
-\f[R]
-.fi
-.PP
-Variables can contain arbitrary YAML structures, but the template must
-match this structure.
-The \f[C]author\f[R] variable in the default templates expects a simple
-list or string, but can be changed to support more complicated
-structures.
-The following combination, for example, would add an affiliation to the
-author if one is given:
-.IP
-.nf
-\f[C]
----
-title: The document title
-author:
-- name: Author One
-  affiliation: University of Somewhere
-- name: Author Two
-  affiliation: University of Nowhere
-\&...
-\f[R]
-.fi
-.PP
-To use the structured authors in the example above, you would need a
-custom template:
-.IP
-.nf
-\f[C]
-$for(author)$
-$if(author.name)$
-$author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$
-$else$
-$author$
-$endif$
-$endfor$
-\f[R]
-.fi
-.PP
-Raw content to include in the document\[aq]s header may be specified
-using \f[C]header-includes\f[R]; however, it is important to mark up
-this content as raw code for a particular output format, using the
-\f[C]raw_attribute\f[R] extension), or it will be interpreted as
-markdown.
-For example:
-.IP
-.nf
-\f[C]
-header-includes:
-- |
-  \[ga]\[ga]\[ga]{=latex}
-  \[rs]let\[rs]oldsection\[rs]section
-  \[rs]renewcommand{\[rs]section}[1]{\[rs]clearpage\[rs]oldsection{#1}}
-  \[ga]\[ga]\[ga]
-\f[R]
-.fi
-.SS Backslash escapes
-.SS Extension: \f[C]all_symbols_escapable\f[R]
-.PP
-Except inside a code block or inline code, any punctuation or space
-character preceded by a backslash will be treated literally, even if it
-would normally indicate formatting.
-Thus, for example, if one writes
-.IP
-.nf
-\f[C]
-*\[rs]*hello\[rs]**
-\f[R]
-.fi
-.PP
-one will get
-.IP
-.nf
-\f[C]
-<em>*hello*</em>
-\f[R]
-.fi
-.PP
-instead of
-.IP
-.nf
-\f[C]
-<strong>hello</strong>
-\f[R]
-.fi
-.PP
-This rule is easier to remember than standard Markdown\[aq]s rule, which
-allows only the following characters to be backslash-escaped:
-.IP
-.nf
-\f[C]
-\[rs]\[ga]*_{}[]()>#+-.!
-\f[R]
-.fi
-.PP
-(However, if the \f[C]markdown_strict\f[R] format is used, the standard
-Markdown rule will be used.)
-.PP
-A backslash-escaped space is parsed as a nonbreaking space.
-In TeX output, it will appear as \f[C]\[ti]\f[R].
-In HTML and XML output, it will appear as a literal unicode nonbreaking
-space character (note that it will thus actually look
-\[dq]invisible\[dq] in the generated HTML source; you can still use the
-\f[C]--ascii\f[R] command-line option to make it appear as an explicit
-entity).
-.PP
-A backslash-escaped newline (i.e.
-a backslash occurring at the end of a line) is parsed as a hard line
-break.
-It will appear in TeX output as \f[C]\[rs]\[rs]\f[R] and in HTML as
-\f[C]<br />\f[R].
-This is a nice alternative to Markdown\[aq]s \[dq]invisible\[dq] way of
-indicating hard line breaks using two trailing spaces on a line.
-.PP
-Backslash escapes do not work in verbatim contexts.
-.SS Inline formatting
-.SS Emphasis
-.PP
-To \f[I]emphasize\f[R] some text, surround it with \f[C]*\f[R]s or
-\f[C]_\f[R], like this:
-.IP
-.nf
-\f[C]
-This text is _emphasized with underscores_, and this
-is *emphasized with asterisks*.
-\f[R]
-.fi
-.PP
-Double \f[C]*\f[R] or \f[C]_\f[R] produces \f[B]strong emphasis\f[R]:
-.IP
-.nf
-\f[C]
-This is **strong emphasis** and __with underscores__.
-\f[R]
-.fi
-.PP
-A \f[C]*\f[R] or \f[C]_\f[R] character surrounded by spaces, or
-backslash-escaped, will not trigger emphasis:
-.IP
-.nf
-\f[C]
-This is * not emphasized *, and \[rs]*neither is this\[rs]*.
-\f[R]
-.fi
-.SS Extension: \f[C]intraword_underscores\f[R]
-.PP
-Because \f[C]_\f[R] is sometimes used inside words and identifiers,
-pandoc does not interpret a \f[C]_\f[R] surrounded by alphanumeric
-characters as an emphasis marker.
-If you want to emphasize just part of a word, use \f[C]*\f[R]:
-.IP
-.nf
-\f[C]
-feas*ible*, not feas*able*.
-\f[R]
-.fi
-.SS Strikeout
-.SS Extension: \f[C]strikeout\f[R]
-.PP
-To strikeout a section of text with a horizontal line, begin and end it
-with \f[C]\[ti]\[ti]\f[R].
-Thus, for example,
-.IP
-.nf
-\f[C]
-This \[ti]\[ti]is deleted text.\[ti]\[ti]
-\f[R]
-.fi
-.SS Superscripts and subscripts
-.SS Extension: \f[C]superscript\f[R], \f[C]subscript\f[R]
-.PP
-Superscripts may be written by surrounding the superscripted text by
-\f[C]\[ha]\f[R] characters; subscripts may be written by surrounding the
-subscripted text by \f[C]\[ti]\f[R] characters.
-Thus, for example,
-.IP
-.nf
-\f[C]
-H\[ti]2\[ti]O is a liquid.  2\[ha]10\[ha] is 1024.
-\f[R]
-.fi
-.PP
-The text between \f[C]\[ha]...\[ha]\f[R] or \f[C]\[ti]...\[ti]\f[R] may
-not contain spaces or newlines.
-If the superscripted or subscripted text contains spaces, these spaces
-must be escaped with backslashes.
-(This is to prevent accidental superscripting and subscripting through
-the ordinary use of \f[C]\[ti]\f[R] and \f[C]\[ha]\f[R], and also bad
-interactions with footnotes.) Thus, if you want the letter P with \[aq]a
-cat\[aq] in subscripts, use \f[C]P\[ti]a\[rs] cat\[ti]\f[R], not
-\f[C]P\[ti]a cat\[ti]\f[R].
-.SS Verbatim
-.PP
-To make a short span of text verbatim, put it inside backticks:
-.IP
-.nf
-\f[C]
-What is the difference between \[ga]>>=\[ga] and \[ga]>>\[ga]?
-\f[R]
-.fi
-.PP
-If the verbatim text includes a backtick, use double backticks:
-.IP
-.nf
-\f[C]
-Here is a literal backtick \[ga]\[ga] \[ga] \[ga]\[ga].
-\f[R]
-.fi
-.PP
-(The spaces after the opening backticks and before the closing backticks
-will be ignored.)
-.PP
-The general rule is that a verbatim span starts with a string of
-consecutive backticks (optionally followed by a space) and ends with a
-string of the same number of backticks (optionally preceded by a space).
-.PP
-Note that backslash-escapes (and other Markdown constructs) do not work
-in verbatim contexts:
-.IP
-.nf
-\f[C]
-This is a backslash followed by an asterisk: \[ga]\[rs]*\[ga].
-\f[R]
-.fi
-.SS Extension: \f[C]inline_code_attributes\f[R]
-.PP
-Attributes can be attached to verbatim text, just as with fenced code
-blocks:
-.IP
-.nf
-\f[C]
-\[ga]<$>\[ga]{.haskell}
-\f[R]
-.fi
-.SS Small caps
-.PP
-To write small caps, use the \f[C]smallcaps\f[R] class:
-.IP
-.nf
-\f[C]
-[Small caps]{.smallcaps}
-\f[R]
-.fi
-.PP
-Or, without the \f[C]bracketed_spans\f[R] extension:
-.IP
-.nf
-\f[C]
-<span class=\[dq]smallcaps\[dq]>Small caps</span>
-\f[R]
-.fi
-.PP
-For compatibility with other Markdown flavors, CSS is also supported:
-.IP
-.nf
-\f[C]
-<span style=\[dq]font-variant:small-caps;\[dq]>Small caps</span>
-\f[R]
-.fi
-.PP
-This will work in all output formats that support small caps.
-.SS Math
-.SS Extension: \f[C]tex_math_dollars\f[R]
-.PP
-Anything between two \f[C]$\f[R] characters will be treated as TeX math.
-The opening \f[C]$\f[R] must have a non-space character immediately to
-its right, while the closing \f[C]$\f[R] must have a non-space character
-immediately to its left, and must not be followed immediately by a
-digit.
-Thus, \f[C]$20,000 and $30,000\f[R] won\[aq]t parse as math.
-If for some reason you need to enclose text in literal \f[C]$\f[R]
-characters, backslash-escape them and they won\[aq]t be treated as math
-delimiters.
-.PP
-For display math, use \f[C]$$\f[R] delimiters.
-(In this case, the delimiters may be separated from the formula by
-whitespace.)
-.PP
-TeX math will be printed in all output formats.
-How it is rendered depends on the output format:
-.TP
-LaTeX
-It will appear verbatim surrounded by \f[C]\[rs](...\[rs])\f[R] (for
-inline math) or \f[C]\[rs][...\[rs]]\f[R] (for display math).
-.TP
-Markdown, Emacs Org mode, ConTeXt, ZimWiki
-It will appear verbatim surrounded by \f[C]$...$\f[R] (for inline math)
-or \f[C]$$...$$\f[R] (for display math).
-.TP
-XWiki
-It will appear verbatim surrounded by
-\f[C]{{formula}}..{{/formula}}\f[R].
-.TP
-reStructuredText
-It will be rendered using an interpreted text role \f[C]:math:\f[R].
-.TP
-AsciiDoc
-For AsciiDoc output format (\f[C]-t asciidoc\f[R]) it will appear
-verbatim surrounded by \f[C]latexmath:[$...$]\f[R] (for inline math) or
-\f[C][latexmath]++++\[rs][...\[rs]]+++\f[R] (for display math).
-For AsciiDoctor output format (\f[C]-t asciidoctor\f[R]) the LaTex
-delimiters (\f[C]$..$\f[R] and \f[C]\[rs][..\[rs]]\f[R]) are omitted.
-.TP
-Texinfo
-It will be rendered inside a \f[C]\[at]math\f[R] command.
-.TP
-roff man, Jira markup
-It will be rendered verbatim without \f[C]$\f[R]\[aq]s.
-.TP
-MediaWiki, DokuWiki
-It will be rendered inside \f[C]<math>\f[R] tags.
-.TP
-Textile
-It will be rendered inside \f[C]<span class=\[dq]math\[dq]>\f[R] tags.
-.TP
-RTF, OpenDocument
-It will be rendered, if possible, using Unicode characters, and will
-otherwise appear verbatim.
-.TP
-ODT
-It will be rendered, if possible, using MathML.
-.TP
-DocBook
-If the \f[C]--mathml\f[R] flag is used, it will be rendered using MathML
-in an \f[C]inlineequation\f[R] or \f[C]informalequation\f[R] tag.
-Otherwise it will be rendered, if possible, using Unicode characters.
-.TP
-Docx
-It will be rendered using OMML math markup.
-.TP
-FictionBook2
-If the \f[C]--webtex\f[R] option is used, formulas are rendered as
-images using CodeCogs or other compatible web service, downloaded and
-embedded in the e-book.
-Otherwise, they will appear verbatim.
-.TP
-HTML, Slidy, DZSlides, S5, EPUB
-The way math is rendered in HTML will depend on the command-line options
-selected.
-Therefore see Math rendering in HTML above.
-.SS Raw HTML
-.SS Extension: \f[C]raw_html\f[R]
-.PP
-Markdown allows you to insert raw HTML (or DocBook) anywhere in a
-document (except verbatim contexts, where \f[C]<\f[R], \f[C]>\f[R], and
-\f[C]&\f[R] are interpreted literally).
-(Technically this is not an extension, since standard Markdown allows
-it, but it has been made an extension so that it can be disabled if
-desired.)
-.PP
-The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,
-DZSlides, EPUB, Markdown, CommonMark, Emacs Org mode, and Textile
-output, and suppressed in other formats.
-.PP
-For a more explicit way of including raw HTML in a Markdown document,
-see the \f[C]raw_attribute\f[R] extension.
-.PP
-In the CommonMark format, if \f[C]raw_html\f[R] is enabled,
-superscripts, subscripts, strikeouts and small capitals will be
-represented as HTML.
-Otherwise, plain-text fallbacks will be used.
-Note that even if \f[C]raw_html\f[R] is disabled, tables will be
-rendered with HTML syntax if they cannot use pipe syntax.
-.SS Extension: \f[C]markdown_in_html_blocks\f[R]
-.PP
-Standard Markdown allows you to include HTML \[dq]blocks\[dq]: blocks of
-HTML between balanced tags that are separated from the surrounding text
-with blank lines, and start and end at the left margin.
-Within these blocks, everything is interpreted as HTML, not Markdown; so
-(for example), \f[C]*\f[R] does not signify emphasis.
-.PP
-Pandoc behaves this way when the \f[C]markdown_strict\f[R] format is
-used; but by default, pandoc interprets material between HTML block tags
-as Markdown.
-Thus, for example, pandoc will turn
-.IP
-.nf
-\f[C]
-<table>
-<tr>
-<td>*one*</td>
-<td>[a link](https://google.com)</td>
-</tr>
-</table>
-\f[R]
-.fi
-.PP
-into
-.IP
-.nf
-\f[C]
-<table>
-<tr>
-<td><em>one</em></td>
-<td><a href=\[dq]https://google.com\[dq]>a link</a></td>
-</tr>
-</table>
-\f[R]
-.fi
-.PP
-whereas \f[C]Markdown.pl\f[R] will preserve it as is.
-.PP
-There is one exception to this rule: text between \f[C]<script>\f[R] and
-\f[C]<style>\f[R] tags is not interpreted as Markdown.
-.PP
-This departure from standard Markdown should make it easier to mix
-Markdown with HTML block elements.
-For example, one can surround a block of Markdown text with
-\f[C]<div>\f[R] tags without preventing it from being interpreted as
-Markdown.
-.SS Extension: \f[C]native_divs\f[R]
-.PP
-Use native pandoc \f[C]Div\f[R] blocks for content inside
-\f[C]<div>\f[R] tags.
-For the most part this should give the same output as
-\f[C]markdown_in_html_blocks\f[R], but it makes it easier to write
-pandoc filters to manipulate groups of blocks.
-.SS Extension: \f[C]native_spans\f[R]
-.PP
-Use native pandoc \f[C]Span\f[R] blocks for content inside
-\f[C]<span>\f[R] tags.
-For the most part this should give the same output as
-\f[C]raw_html\f[R], but it makes it easier to write pandoc filters to
-manipulate groups of inlines.
-.SS Extension: \f[C]raw_tex\f[R]
-.PP
-In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
-included in a document.
-Inline TeX commands will be preserved and passed unchanged to the LaTeX
-and ConTeXt writers.
-Thus, for example, you can use LaTeX to include BibTeX citations:
-.IP
-.nf
-\f[C]
-This result was proved in \[rs]cite{jones.1967}.
-\f[R]
-.fi
-.PP
-Note that in LaTeX environments, like
-.IP
-.nf
-\f[C]
-\[rs]begin{tabular}{|l|l|}\[rs]hline
-Age & Frequency \[rs]\[rs] \[rs]hline
-18--25  & 15 \[rs]\[rs]
-26--35  & 33 \[rs]\[rs]
-36--45  & 22 \[rs]\[rs] \[rs]hline
-\[rs]end{tabular}
-\f[R]
-.fi
-.PP
-the material between the begin and end tags will be interpreted as raw
-LaTeX, not as Markdown.
-.PP
-For a more explicit and flexible way of including raw TeX in a Markdown
-document, see the \f[C]raw_attribute\f[R] extension.
-.PP
-Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
-Emacs Org mode, and ConTeXt.
-.SS Generic raw attribute
-.SS Extension: \f[C]raw_attribute\f[R]
-.PP
-Inline spans and fenced code blocks with a special kind of attribute
-will be parsed as raw content with the designated format.
-For example, the following produces a raw roff \f[C]ms\f[R] block:
-.IP
-.nf
-\f[C]
-\[ga]\[ga]\[ga]{=ms}
-\&.MYMACRO
-blah blah
-\[ga]\[ga]\[ga]
-\f[R]
-.fi
-.PP
-And the following produces a raw \f[C]html\f[R] inline element:
-.IP
-.nf
-\f[C]
-This is \[ga]<a>html</a>\[ga]{=html}
-\f[R]
-.fi
-.PP
-This can be useful to insert raw xml into \f[C]docx\f[R] documents, e.g.
-a pagebreak:
-.IP
-.nf
-\f[C]
-\[ga]\[ga]\[ga]{=openxml}
-<w:p>
-  <w:r>
-    <w:br w:type=\[dq]page\[dq]/>
-  </w:r>
-</w:p>
-\[ga]\[ga]\[ga]
-\f[R]
-.fi
-.PP
-The format name should match the target format name (see
-\f[C]-t/--to\f[R], above, for a list, or use
-\f[C]pandoc --list-output-formats\f[R]).
-Use \f[C]openxml\f[R] for \f[C]docx\f[R] output, \f[C]opendocument\f[R]
-for \f[C]odt\f[R] output, \f[C]html5\f[R] for \f[C]epub3\f[R] output,
-\f[C]html4\f[R] for \f[C]epub2\f[R] output, and \f[C]latex\f[R],
-\f[C]beamer\f[R], \f[C]ms\f[R], or \f[C]html5\f[R] for \f[C]pdf\f[R]
-output (depending on what you use for \f[C]--pdf-engine\f[R]).
-.PP
-This extension presupposes that the relevant kind of inline code or
-fenced code block is enabled.
-Thus, for example, to use a raw attribute with a backtick code block,
-\f[C]backtick_code_blocks\f[R] must be enabled.
-.PP
-The raw attribute cannot be combined with regular attributes.
-.SS LaTeX macros
-.SS Extension: \f[C]latex_macros\f[R]
-.PP
-When this extension is enabled, pandoc will parse LaTeX macro
-definitions and apply the resulting macros to all LaTeX math and raw
-LaTeX.
-So, for example, the following will work in all output formats, not just
-LaTeX:
-.IP
-.nf
-\f[C]
-\[rs]newcommand{\[rs]tuple}[1]{\[rs]langle #1 \[rs]rangle}
-
-$\[rs]tuple{a, b, c}$
-\f[R]
-.fi
-.PP
-Note that LaTeX macros will not be applied if they occur inside a raw
-span or block marked with the \f[C]raw_attribute\f[R] extension.
-.PP
-When \f[C]latex_macros\f[R] is disabled, the raw LaTeX and math will not
-have macros applied.
-This is usually a better approach when you are targeting LaTeX or PDF.
-.PP
-Macro definitions in LaTeX will be passed through as raw LaTeX only if
-\f[C]latex_macros\f[R] is not enabled.
-Macro definitions in Markdown source (or other formats allowing
-\f[C]raw_tex\f[R]) will be passed through regardless of whether
-\f[C]latex_macros\f[R] is enabled.
-.SS Links
-.PP
-Markdown allows links to be specified in several ways.
-.SS Automatic links
-.PP
-If you enclose a URL or email address in pointy brackets, it will become
-a link:
-.IP
-.nf
-\f[C]
-<https://google.com>
-<sam\[at]green.eggs.ham>
-\f[R]
-.fi
-.SS Inline links
-.PP
-An inline link consists of the link text in square brackets, followed by
-the URL in parentheses.
-(Optionally, the URL can be followed by a link title, in quotes.)
-.IP
-.nf
-\f[C]
-This is an [inline link](/url), and here\[aq]s [one with
-a title](https://fsf.org \[dq]click here for a good time!\[dq]).
-\f[R]
-.fi
-.PP
-There can be no space between the bracketed part and the parenthesized
-part.
-The link text can contain formatting (such as emphasis), but the title
-cannot.
-.PP
-Email addresses in inline links are not autodetected, so they have to be
-prefixed with \f[C]mailto\f[R]:
-.IP
-.nf
-\f[C]
-[Write me!](mailto:sam\[at]green.eggs.ham)
-\f[R]
-.fi
-.SS Reference links
-.PP
-An \f[I]explicit\f[R] reference link has two parts, the link itself and
-the link definition, which may occur elsewhere in the document (either
-before or after the link).
-.PP
-The link consists of link text in square brackets, followed by a label
-in square brackets.
-(There cannot be space between the two unless the
-\f[C]spaced_reference_links\f[R] extension is enabled.) The link
-definition consists of the bracketed label, followed by a colon and a
-space, followed by the URL, and optionally (after a space) a link title
-either in quotes or in parentheses.
-The label must not be parseable as a citation (assuming the
-\f[C]citations\f[R] extension is enabled): citations take precedence
-over link labels.
-.PP
-Here are some examples:
-.IP
-.nf
-\f[C]
-[my label 1]: /foo/bar.html  \[dq]My title, optional\[dq]
-[my label 2]: /foo
-[my label 3]: https://fsf.org (The free software foundation)
-[my label 4]: /bar#special  \[aq]A title in single quotes\[aq]
-\f[R]
-.fi
-.PP
-The URL may optionally be surrounded by angle brackets:
-.IP
-.nf
-\f[C]
-[my label 5]: <http://foo.bar.baz>
-\f[R]
-.fi
-.PP
-The title may go on the next line:
-.IP
-.nf
-\f[C]
-[my label 3]: https://fsf.org
-  \[dq]The free software foundation\[dq]
-\f[R]
-.fi
-.PP
-Note that link labels are not case sensitive.
-So, this will work:
-.IP
-.nf
-\f[C]
-Here is [my link][FOO]
-
-[Foo]: /bar/baz
-\f[R]
-.fi
-.PP
-In an \f[I]implicit\f[R] reference link, the second pair of brackets is
-empty:
-.IP
-.nf
-\f[C]
-See [my website][].
-
-[my website]: http://foo.bar.baz
-\f[R]
-.fi
-.PP
-Note: In \f[C]Markdown.pl\f[R] and most other Markdown implementations,
-reference link definitions cannot occur in nested constructions such as
-list items or block quotes.
-Pandoc lifts this arbitrary seeming restriction.
-So the following is fine in pandoc, though not in most other
-implementations:
-.IP
-.nf
-\f[C]
-> My block [quote].
->
-> [quote]: /foo
-\f[R]
-.fi
-.SS Extension: \f[C]shortcut_reference_links\f[R]
-.PP
-In a \f[I]shortcut\f[R] reference link, the second pair of brackets may
-be omitted entirely:
-.IP
-.nf
-\f[C]
-See [my website].
-
-[my website]: http://foo.bar.baz
-\f[R]
-.fi
-.SS Internal links
-.PP
-To link to another section of the same document, use the automatically
-generated identifier (see Heading identifiers).
-For example:
-.IP
-.nf
-\f[C]
-See the [Introduction](#introduction).
-\f[R]
-.fi
-.PP
-or
-.IP
-.nf
-\f[C]
-See the [Introduction].
-
-[Introduction]: #introduction
-\f[R]
-.fi
-.PP
-Internal links are currently supported for HTML formats (including HTML
-slide shows and EPUB), LaTeX, and ConTeXt.
-.SS Images
-.PP
-A link immediately preceded by a \f[C]!\f[R] will be treated as an
-image.
-The link text will be used as the image\[aq]s alt text:
-.IP
-.nf
-\f[C]
-![la lune](lalune.jpg \[dq]Voyage to the moon\[dq])
-
-![movie reel]
-
-[movie reel]: movie.gif
-\f[R]
-.fi
-.SS Extension: \f[C]implicit_figures\f[R]
-.PP
-An image with nonempty alt text, occurring by itself in a paragraph,
-will be rendered as a figure with a caption.
-The image\[aq]s alt text will be used as the caption.
-.IP
-.nf
-\f[C]
-![This is the caption](/url/of/image.png)
-\f[R]
-.fi
-.PP
-How this is rendered depends on the output format.
-Some output formats (e.g.
-RTF) do not yet support figures.
-In those formats, you\[aq]ll just get an image in a paragraph by itself,
-with no caption.
-.PP
-If you just want a regular inline image, just make sure it is not the
-only thing in the paragraph.
-One way to do this is to insert a nonbreaking space after the image:
-.IP
-.nf
-\f[C]
-![This image won\[aq]t be a figure](/url/of/image.png)\[rs]
-\f[R]
-.fi
-.PP
-Note that in reveal.js slide shows, an image in a paragraph by itself
-that has the \f[C]stretch\f[R] class will fill the screen, and the
-caption and figure tags will be omitted.
-.SS Extension: \f[C]link_attributes\f[R]
-.PP
-Attributes can be set on links and images:
-.IP
-.nf
-\f[C]
-An inline ![image](foo.jpg){#id .class width=30 height=20px}
-and a reference ![image][ref] with attributes.
-
-[ref]: foo.jpg \[dq]optional title\[dq] {#id .class key=val key2=\[dq]val 2\[dq]}
-\f[R]
-.fi
-.PP
-(This syntax is compatible with PHP Markdown Extra when only
-\f[C]#id\f[R] and \f[C].class\f[R] are used.)
-.PP
-For HTML and EPUB, all known HTML5 attributes except \f[C]width\f[R] and
-\f[C]height\f[R] (but including \f[C]srcset\f[R] and \f[C]sizes\f[R])
-are passed through as is.
-Unknown attributes are passed through as custom attributes, with
-\f[C]data-\f[R] prepended.
-The other writers ignore attributes that are not specifically supported
-by their output format.
-.PP
-The \f[C]width\f[R] and \f[C]height\f[R] attributes on images are
-treated specially.
-When used without a unit, the unit is assumed to be pixels.
-However, any of the following unit identifiers can be used:
-\f[C]px\f[R], \f[C]cm\f[R], \f[C]mm\f[R], \f[C]in\f[R], \f[C]inch\f[R]
-and \f[C]%\f[R].
-There must not be any spaces between the number and the unit.
-For example:
-.IP
-.nf
-\f[C]
-![](file.jpg){ width=50% }
-\f[R]
-.fi
-.IP \[bu] 2
-Dimensions may be converted to a form that is compatible with the output
-format (for example, dimensions given in pixels will be converted to
-inches when converting HTML to LaTeX).
-Conversion between pixels and physical measurements is affected by the
-\f[C]--dpi\f[R] option (by default, 96 dpi is assumed, unless the image
-itself contains dpi information).
-.IP \[bu] 2
-The \f[C]%\f[R] unit is generally relative to some available space.
-For example the above example will render to the following.
-.RS 2
-.IP \[bu] 2
-HTML:
-\f[C]<img href=\[dq]file.jpg\[dq] style=\[dq]width: 50%;\[dq] />\f[R]
-.IP \[bu] 2
-LaTeX:
-\f[C]\[rs]includegraphics[width=0.5\[rs]textwidth,height=\[rs]textheight]{file.jpg}\f[R]
-(If you\[aq]re using a custom template, you need to configure
-\f[C]graphicx\f[R] as in the default template.)
-.IP \[bu] 2
-ConTeXt:
-\f[C]\[rs]externalfigure[file.jpg][width=0.5\[rs]textwidth]\f[R]
-.RE
-.IP \[bu] 2
-Some output formats have a notion of a class (ConTeXt) or a unique
-identifier (LaTeX \f[C]\[rs]caption\f[R]), or both (HTML).
-.IP \[bu] 2
-When no \f[C]width\f[R] or \f[C]height\f[R] attributes are specified,
-the fallback is to look at the image resolution and the dpi metadata
-embedded in the image file.
-.SS Divs and Spans
-.PP
-Using the \f[C]native_divs\f[R] and \f[C]native_spans\f[R] extensions
-(see above), HTML syntax can be used as part of markdown to create
-native \f[C]Div\f[R] and \f[C]Span\f[R] elements in the pandoc AST (as
-opposed to raw HTML).
-However, there is also nicer syntax available:
-.SS Extension: \f[C]fenced_divs\f[R]
-.PP
-Allow special fenced syntax for native \f[C]Div\f[R] blocks.
-A Div starts with a fence containing at least three consecutive colons
-plus some attributes.
-The attributes may optionally be followed by another string of
-consecutive colons.
-The attribute syntax is exactly as in fenced code blocks (see Extension:
-\f[C]fenced_code_attributes\f[R]).
-As with fenced code blocks, one can use either attributes in curly
-braces or a single unbraced word, which will be treated as a class name.
-The Div ends with another line containing a string of at least three
-consecutive colons.
-The fenced Div should be separated by blank lines from preceding and
-following blocks.
-.PP
-Example:
-.IP
-.nf
-\f[C]
-::::: {#special .sidebar}
-Here is a paragraph.
-
-And another.
-:::::
-\f[R]
-.fi
-.PP
-Fenced divs can be nested.
-Opening fences are distinguished because they \f[I]must\f[R] have
-attributes:
-.IP
-.nf
-\f[C]
-::: Warning ::::::
-This is a warning.
-
-::: Danger
-This is a warning within a warning.
-:::
-::::::::::::::::::
-\f[R]
-.fi
-.PP
-Fences without attributes are always closing fences.
-Unlike with fenced code blocks, the number of colons in the closing
-fence need not match the number in the opening fence.
-However, it can be helpful for visual clarity to use fences of different
-lengths to distinguish nested divs from their parents.
-.SS Extension: \f[C]bracketed_spans\f[R]
-.PP
-A bracketed sequence of inlines, as one would use to begin a link, will
-be treated as a \f[C]Span\f[R] with attributes if it is followed
-immediately by attributes:
-.IP
-.nf
-\f[C]
-[This is *some text*]{.class key=\[dq]val\[dq]}
-\f[R]
-.fi
-.SS Footnotes
-.SS Extension: \f[C]footnotes\f[R]
-.PP
-Pandoc\[aq]s Markdown allows footnotes, using the following syntax:
-.IP
-.nf
-\f[C]
-Here is a footnote reference,[\[ha]1] and another.[\[ha]longnote]
-
-[\[ha]1]: Here is the footnote.
-
-[\[ha]longnote]: Here\[aq]s one with multiple blocks.
-
-    Subsequent paragraphs are indented to show that they
-belong to the previous footnote.
-
-        { some.code }
-
-    The whole paragraph can be indented, or just the first
-    line.  In this way, multi-paragraph footnotes work like
-    multi-paragraph list items.
-
-This paragraph won\[aq]t be part of the note, because it
-isn\[aq]t indented.
-\f[R]
-.fi
-.PP
-The identifiers in footnote references may not contain spaces, tabs, or
-newlines.
-These identifiers are used only to correlate the footnote reference with
-the note itself; in the output, footnotes will be numbered sequentially.
-.PP
-The footnotes themselves need not be placed at the end of the document.
-They may appear anywhere except inside other block elements (lists,
-block quotes, tables, etc.).
-Each footnote should be separated from surrounding content (including
-other footnotes) by blank lines.
-.SS Extension: \f[C]inline_notes\f[R]
-.PP
-Inline footnotes are also allowed (though, unlike regular notes, they
-cannot contain multiple paragraphs).
-The syntax is as follows:
-.IP
-.nf
-\f[C]
-Here is an inline note.\[ha][Inlines notes are easier to write, since
-you don\[aq]t have to pick an identifier and move down to type the
-note.]
-\f[R]
-.fi
-.PP
-Inline and regular footnotes may be mixed freely.
-.SS Citations
-.SS Extension: \f[C]citations\f[R]
-.PP
-Using an external filter, \f[C]pandoc-citeproc\f[R], pandoc can
-automatically generate citations and a bibliography in a number of
-styles.
-Basic usage is
-.IP
-.nf
-\f[C]
-pandoc --filter pandoc-citeproc myinput.txt
-\f[R]
-.fi
-.PP
-In order to use this feature, you will need to specify a bibliography
-file using the \f[C]bibliography\f[R] metadata field in a YAML metadata
-section, or \f[C]--bibliography\f[R] command line argument.
-You can supply multiple \f[C]--bibliography\f[R] arguments or set
-\f[C]bibliography\f[R] metadata field to YAML array, if you want to use
-multiple bibliography files.
-The bibliography may have any of these formats:
-.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{
-RIS
-T}@T{
-\&.ris
-T}
-.TE
-.PP
-Note that \f[C].bib\f[R] can be used with both BibTeX and BibLaTeX
-files; use \f[C].bibtex\f[R] to force BibTeX.
-.PP
-Note that \f[C]pandoc-citeproc --bib2json\f[R] and
-\f[C]pandoc-citeproc --bib2yaml\f[R] can produce \f[C].json\f[R] and
-\f[C].yaml\f[R] files from any of the supported formats.
-.PP
-In-field markup: In BibTeX and BibLaTeX databases, pandoc-citeproc
-parses a subset of LaTeX markup; in CSL YAML databases, pandoc Markdown;
-and in CSL JSON databases, an HTML-like markup:
-.TP
-\f[B]\f[CB]<i>...</i>\f[B]\f[R]
-italics
-.TP
-\f[B]\f[CB]<b>...</b>\f[B]\f[R]
-bold
-.TP
-\f[B]\f[CB]<span style=\[dq]font-variant:small-caps;\[dq]>...</span>\f[B]\f[R] or \f[B]\f[CB]<sc>...</sc>\f[B]\f[R]
-small capitals
-.TP
-\f[B]\f[CB]<sub>...</sub>\f[B]\f[R]
-subscript
-.TP
-\f[B]\f[CB]<sup>...</sup>\f[B]\f[R]
-superscript
-.TP
-\f[B]\f[CB]<span class=\[dq]nocase\[dq]>...</span>\f[B]\f[R]
-prevent a phrase from being capitalized as title case
-.PP
-\f[C]pandoc-citeproc -j\f[R] and \f[C]-y\f[R] interconvert the CSL JSON
-and CSL YAML formats as far as possible.
-.PP
-As an alternative to specifying a bibliography file using
-\f[C]--bibliography\f[R] or the YAML metadata field
-\f[C]bibliography\f[R], you can include the citation data directly in
-the \f[C]references\f[R] field of the document\[aq]s YAML metadata.
-The field should contain an array of YAML-encoded references, for
-example:
-.IP
-.nf
-\f[C]
----
-references:
-- type: article-journal
-  id: WatsonCrick1953
-  author:
-  - family: Watson
-    given: J. D.
-  - family: Crick
-    given: F. H. C.
-  issued:
-    date-parts:
-    - - 1953
-      - 4
-      - 25
-  title: \[aq]Molecular structure of nucleic acids: a structure for deoxyribose
-    nucleic acid\[aq]
-  title-short: Molecular structure of nucleic acids
-  container-title: Nature
-  volume: 171
-  issue: 4356
-  page: 737-738
-  DOI: 10.1038/171737a0
-  URL: https://www.nature.com/articles/171737a0
-  language: en-GB
-\&...
-\f[R]
-.fi
-.PP
-(\f[C]pandoc-citeproc --bib2yaml\f[R] can produce these from a
-bibliography file in one of the supported formats.)
-.PP
-Citations and references can be formatted using any style supported by
-the Citation Style Language, listed in the Zotero Style Repository.
-These files are specified using the \f[C]--csl\f[R] option or the
-\f[C]csl\f[R] metadata field.
-By default, \f[C]pandoc-citeproc\f[R] will use the Chicago Manual of
-Style author-date format.
-The CSL project provides further information on finding and editing
-styles.
-.PP
-To make your citations hyperlinks to the corresponding bibliography
-entries, add \f[C]link-citations: true\f[R] to your YAML metadata.
-.PP
-Citations go inside square brackets and are separated by semicolons.
-Each citation must have a key, composed of \[aq]\[at]\[aq] + the
-citation identifier from the database, and may optionally have a prefix,
-a locator, and a suffix.
-The citation key must begin with a letter, digit, or \f[C]_\f[R], and
-may contain alphanumerics, \f[C]_\f[R], and internal punctuation
-characters (\f[C]:.#$%&-+?<>\[ti]/\f[R]).
-Here are some examples:
-.IP
-.nf
-\f[C]
-Blah blah [see \[at]doe99, pp. 33-35; also \[at]smith04, chap. 1].
-
-Blah blah [\[at]doe99, pp. 33-35, 38-39 and *passim*].
-
-Blah blah [\[at]smith04; \[at]doe99].
-\f[R]
-.fi
-.PP
-\f[C]pandoc-citeproc\f[R] detects locator terms in the CSL locale files.
-Either abbreviated or unabbreviated forms are accepted.
-In the \f[C]en-US\f[R] locale, locator terms can be written in either
-singular or plural forms, as \f[C]book\f[R],
-\f[C]bk.\f[R]/\f[C]bks.\f[R]; \f[C]chapter\f[R],
-\f[C]chap.\f[R]/\f[C]chaps.\f[R]; \f[C]column\f[R],
-\f[C]col.\f[R]/\f[C]cols.\f[R]; \f[C]figure\f[R],
-\f[C]fig.\f[R]/\f[C]figs.\f[R]; \f[C]folio\f[R],
-\f[C]fol.\f[R]/\f[C]fols.\f[R]; \f[C]number\f[R],
-\f[C]no.\f[R]/\f[C]nos.\f[R]; \f[C]line\f[R],
-\f[C]l.\f[R]/\f[C]ll.\f[R]; \f[C]note\f[R], \f[C]n.\f[R]/\f[C]nn.\f[R];
-\f[C]opus\f[R], \f[C]op.\f[R]/\f[C]opp.\f[R]; \f[C]page\f[R],
-\f[C]p.\f[R]/\f[C]pp.\f[R]; \f[C]paragraph\f[R],
-\f[C]para.\f[R]/\f[C]paras.\f[R]; \f[C]part\f[R],
-\f[C]pt.\f[R]/\f[C]pts.\f[R]; \f[C]section\f[R],
-\f[C]sec.\f[R]/\f[C]secs.\f[R]; \f[C]sub verbo\f[R],
-\f[C]s.v.\f[R]/\f[C]s.vv.\f[R]; \f[C]verse\f[R],
-\f[C]v.\f[R]/\f[C]vv.\f[R]; \f[C]volume\f[R],
-\f[C]vol.\f[R]/\f[C]vols.\f[R]; \f[C]\[ps]\f[R]/\f[C]\[ps]\[ps]\f[R];
-\f[C]\[sc]\f[R]/\f[C]\[sc]\[sc]\f[R].
-If no locator term is used, \[dq]page\[dq] is assumed.
-.PP
-\f[C]pandoc-citeproc\f[R] will use heuristics to distinguish the locator
-from the suffix.
-In complex cases, the locator can be enclosed in curly braces (using
-\f[C]pandoc-citeproc\f[R] 0.15 and higher only):
-.IP
-.nf
-\f[C]
-[\[at]smith{ii, A, D-Z}, with a suffix]
-[\[at]smith, {pp. iv, vi-xi, (xv)-(xvii)} with suffix here]
-\f[R]
-.fi
-.PP
-A minus sign (\f[C]-\f[R]) before the \f[C]\[at]\f[R] will suppress
-mention of the author in the citation.
-This can be useful when the author is already mentioned in the text:
-.IP
-.nf
-\f[C]
-Smith says blah [-\[at]smith04].
-\f[R]
-.fi
-.PP
-You can also write an in-text citation, as follows:
-.IP
-.nf
-\f[C]
-\[at]smith04 says blah.
-
-\[at]smith04 [p. 33] says blah.
-\f[R]
-.fi
-.PP
-If the style calls for a list of works cited, it will be placed in a div
-with id \f[C]refs\f[R], if one exists:
-.IP
-.nf
-\f[C]
-::: {#refs}
-:::
-\f[R]
-.fi
-.PP
-Otherwise, it will be placed at the end of the document.
-Generation of the bibliography can be suppressed by setting
-\f[C]suppress-bibliography: true\f[R] in the YAML metadata.
-.PP
-If you wish the bibliography to have a section heading, you can set
-\f[C]reference-section-title\f[R] in the metadata, or put the heading at
-the beginning of the div with id \f[C]refs\f[R] (if you are using it) or
-at the end of your document:
-.IP
-.nf
-\f[C]
-last paragraph...
-
-# References
-\f[R]
-.fi
-.PP
-The bibliography will be inserted after this heading.
-Note that the \f[C]unnumbered\f[R] class will be added to this heading,
-so that the section will not be numbered.
-.PP
-If you want to include items in the bibliography without actually citing
-them in the body text, you can define a dummy \f[C]nocite\f[R] metadata
-field and put the citations there:
-.IP
-.nf
-\f[C]
----
-nocite: |
-  \[at]item1, \[at]item2
-\&...
-
-\[at]item3
-\f[R]
-.fi
-.PP
-In this example, the document will contain a citation for
-\f[C]item3\f[R] only, but the bibliography will contain entries for
-\f[C]item1\f[R], \f[C]item2\f[R], and \f[C]item3\f[R].
-.PP
-It is possible to create a bibliography with all the citations, whether
-or not they appear in the document, by using a wildcard:
-.IP
-.nf
-\f[C]
----
-nocite: |
-  \[at]*
-\&...
-\f[R]
-.fi
-.PP
-For LaTeX output, you can also use \f[C]natbib\f[R] or
-\f[C]biblatex\f[R] to render the bibliography.
-In order to do so, specify bibliography files as outlined above, and add
-\f[C]--natbib\f[R] or \f[C]--biblatex\f[R] argument to \f[C]pandoc\f[R]
-invocation.
-Bear in mind that bibliography files have to be in respective format
-(either BibTeX or BibLaTeX).
-.PP
-For more information, see the pandoc-citeproc man page.
-.SS Non-pandoc extensions
-.PP
-The following Markdown syntax extensions are not enabled by default in
-pandoc, but may be enabled by adding \f[C]+EXTENSION\f[R] to the format
-name, where \f[C]EXTENSION\f[R] is the name of the extension.
-Thus, for example, \f[C]markdown+hard_line_breaks\f[R] is Markdown with
-hard line breaks.
-.SS Extension: \f[C]attributes\f[R]
-.PP
-Allows attributes to be attached to any inline or block-level element.
-The syntax for the attributes is the same as that used in
-\f[C]header_attributes\f[R].
-.IP \[bu] 2
-Attributes that occur immediately after an inline element affect that
-element.
-If they follow a space, then they belong to the space.
-(Hence, this option subsumes \f[C]inline_code_attributes\f[R] and
-\f[C]link_attributes\f[R].)
-.IP \[bu] 2
-Attributes that occur immediately before a block element, on a line by
-themselves, affect that element.
-.IP \[bu] 2
-Consecutive attribute specifiers may be used, either for blocks or for
-inlines.
-Their attributes will be combined.
-.IP \[bu] 2
-Attributes that occur at the end of the text of a Setext or ATX heading
-(separated by whitespace from the text) affect the heading element.
-(Hence, this option subsumes \f[C]header_attributes\f[R].)
-.IP \[bu] 2
-Attributes that occur after the opening fence in a fenced code block
-affect the code block element.
-(Hence, this option subsumes \f[C]fenced_code_attributes\f[R].)
-.IP \[bu] 2
-Attributes that occur at the end of a reference link definition affect
-links that refer to that definition.
-.PP
-Note that pandoc\[aq]s AST does not currently allow attributes to be
-attached to arbitrary elements.
-Hence a Span or Div container will be added if needed.
-.SS Extension: \f[C]old_dashes\f[R]
-.PP
-Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes:
-\f[C]-\f[R] before a numeral is an en-dash, and \f[C]--\f[R] is an
-em-dash.
-This option only has an effect if \f[C]smart\f[R] is enabled.
-It is selected automatically for \f[C]textile\f[R] input.
-.SS Extension: \f[C]angle_brackets_escapable\f[R]
-.PP
-Allow \f[C]<\f[R] and \f[C]>\f[R] to be backslash-escaped, as they can
-be in GitHub flavored Markdown but not original Markdown.
-This is implied by pandoc\[aq]s default \f[C]all_symbols_escapable\f[R].
-.SS Extension: \f[C]lists_without_preceding_blankline\f[R]
-.PP
-Allow a list to occur right after a paragraph, with no intervening blank
-space.
-.SS Extension: \f[C]four_space_rule\f[R]
-.PP
-Selects the pandoc <= 2.0 behavior for parsing lists, so that four
-spaces indent are needed for list item continuation paragraphs.
-.SS Extension: \f[C]spaced_reference_links\f[R]
-.PP
-Allow whitespace between the two components of a reference link, for
-example,
-.IP
-.nf
-\f[C]
-[foo] [bar].
-\f[R]
-.fi
-.SS Extension: \f[C]hard_line_breaks\f[R]
-.PP
-Causes all newlines within a paragraph to be interpreted as hard line
-breaks instead of spaces.
-.SS Extension: \f[C]ignore_line_breaks\f[R]
-.PP
-Causes newlines within a paragraph to be ignored, rather than being
-treated as spaces or as hard line breaks.
-This option is intended for use with East Asian languages where spaces
-are not used between words, but text is divided into lines for
-readability.
-.SS Extension: \f[C]east_asian_line_breaks\f[R]
-.PP
-Causes newlines within a paragraph to be ignored, rather than being
-treated as spaces or as hard line breaks, when they occur between two
-East Asian wide characters.
-This is a better choice than \f[C]ignore_line_breaks\f[R] for texts that
-include a mix of East Asian wide characters and other characters.
-.SS Extension: \f[C]emoji\f[R]
-.PP
-Parses textual emojis like \f[C]:smile:\f[R] as Unicode emoticons.
-.SS Extension: \f[C]tex_math_single_backslash\f[R]
-.PP
-Causes anything between \f[C]\[rs](\f[R] and \f[C]\[rs])\f[R] to be
-interpreted as inline TeX math, and anything between \f[C]\[rs][\f[R]
-and \f[C]\[rs]]\f[R] to be interpreted as display TeX math.
-Note: a drawback of this extension is that it precludes escaping
-\f[C](\f[R] and \f[C][\f[R].
-.SS Extension: \f[C]tex_math_double_backslash\f[R]
-.PP
-Causes anything between \f[C]\[rs]\[rs](\f[R] and \f[C]\[rs]\[rs])\f[R]
-to be interpreted as inline TeX math, and anything between
-\f[C]\[rs]\[rs][\f[R] and \f[C]\[rs]\[rs]]\f[R] to be interpreted as
-display TeX math.
-.SS Extension: \f[C]markdown_attribute\f[R]
-.PP
-By default, pandoc interprets material inside block-level tags as
-Markdown.
-This extension changes the behavior so that Markdown is only parsed
-inside block-level tags if the tags have the attribute
-\f[C]markdown=1\f[R].
-.SS Extension: \f[C]mmd_title_block\f[R]
-.PP
-Enables a MultiMarkdown style title block at the top of the document,
-for example:
-.IP
-.nf
-\f[C]
-Title:   My title
-Author:  John Doe
-Date:    September 1, 2008
-Comment: This is a sample mmd title block, with
-         a field spanning multiple lines.
-\f[R]
-.fi
-.PP
-See the MultiMarkdown documentation for details.
-If \f[C]pandoc_title_block\f[R] or \f[C]yaml_metadata_block\f[R] is
-enabled, it will take precedence over \f[C]mmd_title_block\f[R].
-.SS Extension: \f[C]abbreviations\f[R]
-.PP
-Parses PHP Markdown Extra abbreviation keys, like
-.IP
-.nf
-\f[C]
-*[HTML]: Hypertext Markup Language
-\f[R]
-.fi
-.PP
-Note that the pandoc document model does not support abbreviations, so
-if this extension is enabled, abbreviation keys are simply skipped (as
-opposed to being parsed as paragraphs).
-.SS Extension: \f[C]autolink_bare_uris\f[R]
-.PP
-Makes all absolute URIs into links, even when not surrounded by pointy
-braces \f[C]<...>\f[R].
-.SS Extension: \f[C]mmd_link_attributes\f[R]
-.PP
-Parses multimarkdown style key-value attributes on link and image
-references.
-This extension should not be confused with the \f[C]link_attributes\f[R]
-extension.
-.IP
-.nf
-\f[C]
-This is a reference ![image][ref] with multimarkdown attributes.
-
-[ref]: https://path.to/image \[dq]Image title\[dq] width=20px height=30px
-       id=myId class=\[dq]myClass1 myClass2\[dq]
-\f[R]
-.fi
-.SS Extension: \f[C]mmd_header_identifiers\f[R]
-.PP
-Parses multimarkdown style heading identifiers (in square brackets,
-after the heading but before any trailing \f[C]#\f[R]s in an ATX
-heading).
-.SS Extension: \f[C]compact_definition_lists\f[R]
-.PP
-Activates the definition list syntax of pandoc 1.12.x and earlier.
-This syntax differs from the one described above under Definition lists
-in several respects:
-.IP \[bu] 2
-No blank line is required between consecutive items of the definition
-list.
-.IP \[bu] 2
-To get a \[dq]tight\[dq] or \[dq]compact\[dq] list, omit space between
-consecutive items; the space between a term and its definition does not
-affect anything.
-.IP \[bu] 2
-Lazy wrapping of paragraphs is not allowed: the entire definition must
-be indented four spaces.
-.SS Extension: \f[C]gutenberg\f[R]
-.PP
-Use Project Gutenberg conventions for \f[C]plain\f[R] output: all-caps
-for strong emphasis, surround by underscores for regular emphasis, add
-extra blank space around headings.
-.SS Markdown variants
-.PP
-In addition to pandoc\[aq]s extended Markdown, the following Markdown
-variants are supported:
-.TP
-\f[B]\f[CB]markdown_phpextra\f[B]\f[R] (PHP Markdown Extra)
-\f[C]footnotes\f[R], \f[C]pipe_tables\f[R], \f[C]raw_html\f[R],
-\f[C]markdown_attribute\f[R], \f[C]fenced_code_blocks\f[R],
-\f[C]definition_lists\f[R], \f[C]intraword_underscores\f[R],
-\f[C]header_attributes\f[R], \f[C]link_attributes\f[R],
-\f[C]abbreviations\f[R], \f[C]shortcut_reference_links\f[R],
-\f[C]spaced_reference_links\f[R].
-.TP
-\f[B]\f[CB]markdown_github\f[B]\f[R] (deprecated GitHub-Flavored Markdown)
-\f[C]pipe_tables\f[R], \f[C]raw_html\f[R], \f[C]fenced_code_blocks\f[R],
-\f[C]auto_identifiers\f[R], \f[C]gfm_auto_identifiers\f[R],
-\f[C]backtick_code_blocks\f[R], \f[C]autolink_bare_uris\f[R],
-\f[C]space_in_atx_header\f[R], \f[C]intraword_underscores\f[R],
-\f[C]strikeout\f[R], \f[C]task_lists\f[R], \f[C]emoji\f[R],
-\f[C]shortcut_reference_links\f[R], \f[C]angle_brackets_escapable\f[R],
-\f[C]lists_without_preceding_blankline\f[R].
-.TP
-\f[B]\f[CB]markdown_mmd\f[B]\f[R] (MultiMarkdown)
-\f[C]pipe_tables\f[R], \f[C]raw_html\f[R], \f[C]markdown_attribute\f[R],
-\f[C]mmd_link_attributes\f[R], \f[C]tex_math_double_backslash\f[R],
-\f[C]intraword_underscores\f[R], \f[C]mmd_title_block\f[R],
-\f[C]footnotes\f[R], \f[C]definition_lists\f[R],
-\f[C]all_symbols_escapable\f[R], \f[C]implicit_header_references\f[R],
-\f[C]auto_identifiers\f[R], \f[C]mmd_header_identifiers\f[R],
-\f[C]shortcut_reference_links\f[R], \f[C]implicit_figures\f[R],
-\f[C]superscript\f[R], \f[C]subscript\f[R],
-\f[C]backtick_code_blocks\f[R], \f[C]spaced_reference_links\f[R],
-\f[C]raw_attribute\f[R].
-.TP
-\f[B]\f[CB]markdown_strict\f[B]\f[R] (Markdown.pl)
-\f[C]raw_html\f[R], \f[C]shortcut_reference_links\f[R],
-\f[C]spaced_reference_links\f[R].
-.PP
-We also support \f[C]commonmark\f[R] and \f[C]gfm\f[R] (GitHub-Flavored
-Markdown, which is implemented as a set of extensions on
-\f[C]commonmark\f[R]).
-.PP
-Note, however, that \f[C]commonmark\f[R] and \f[C]gfm\f[R] have limited
-support for extensions.
-Only those listed below (and \f[C]smart\f[R], \f[C]raw_tex\f[R], and
-\f[C]hard_line_breaks\f[R]) will work.
-The extensions can, however, all be individually disabled.
-Also, \f[C]raw_tex\f[R] only affects \f[C]gfm\f[R] output, not input.
-.TP
-\f[B]\f[CB]gfm\f[B]\f[R] (GitHub-Flavored Markdown)
-\f[C]pipe_tables\f[R], \f[C]raw_html\f[R], \f[C]native_divs\f[R],
-\f[C]fenced_code_blocks\f[R], \f[C]auto_identifiers\f[R],
-\f[C]gfm_auto_identifiers\f[R], \f[C]backtick_code_blocks\f[R],
-\f[C]autolink_bare_uris\f[R], \f[C]space_in_atx_header\f[R],
-\f[C]intraword_underscores\f[R], \f[C]strikeout\f[R],
-\f[C]task_lists\f[R], \f[C]emoji\f[R],
-\f[C]shortcut_reference_links\f[R], \f[C]angle_brackets_escapable\f[R],
-\f[C]lists_without_preceding_blankline\f[R].
-.SH PRODUCING SLIDE SHOWS WITH PANDOC
-.PP
-You can use pandoc to produce an HTML + JavaScript slide presentation
-that can be viewed via a web browser.
-There are five ways to do this, using S5, DZSlides, Slidy, Slideous, or
-reveal.js.
-You can also produce a PDF slide show using LaTeX \f[C]beamer\f[R], or
-slides shows in Microsoft PowerPoint format.
-.PP
-Here\[aq]s the Markdown source for a simple slide show,
-\f[C]habits.txt\f[R]:
-.IP
-.nf
-\f[C]
-% Habits
-% John Doe
-% March 22, 2005
-
-# In the morning
-
-## Getting up
-
-- Turn off alarm
-- Get out of bed
-
-## Breakfast
-
-- Eat eggs
-- Drink coffee
-
-# In the evening
-
-## Dinner
-
-- Eat spaghetti
-- Drink wine
-
-------------------
-
-![picture of spaghetti](images/spaghetti.jpg)
-
-## Going to sleep
-
-- Get in bed
-- Count sheep
-\f[R]
-.fi
-.PP
-To produce an HTML/JavaScript slide show, simply type
-.IP
-.nf
-\f[C]
-pandoc -t FORMAT -s habits.txt -o habits.html
-\f[R]
-.fi
-.PP
-where \f[C]FORMAT\f[R] is either \f[C]s5\f[R], \f[C]slidy\f[R],
-\f[C]slideous\f[R], \f[C]dzslides\f[R], or \f[C]revealjs\f[R].
-.PP
-For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with
-the \f[C]-s/--standalone\f[R] option embeds a link to JavaScript and CSS
-files, which are assumed to be available at the relative path
-\f[C]s5/default\f[R] (for S5), \f[C]slideous\f[R] (for Slideous),
-\f[C]reveal.js\f[R] (for reveal.js), or at the Slidy website at
-\f[C]w3.org\f[R] (for Slidy).
-(These paths can be changed by setting the \f[C]slidy-url\f[R],
-\f[C]slideous-url\f[R], \f[C]revealjs-url\f[R], or \f[C]s5-url\f[R]
-variables; see Variables for HTML slides, above.) For DZSlides, the
-(relatively short) JavaScript and CSS are included in the file by
-default.
-.PP
-With all HTML slide formats, the \f[C]--self-contained\f[R] option can
-be used to produce a single file that contains all of the data necessary
-to display the slide show, including linked scripts, stylesheets,
-images, and videos.
-.PP
-To produce a PDF slide show using beamer, type
-.IP
-.nf
-\f[C]
-pandoc -t beamer habits.txt -o habits.pdf
-\f[R]
-.fi
-.PP
-Note that a reveal.js slide show can also be converted to a PDF by
-printing it to a file from the browser.
-.PP
-To produce a Powerpoint slide show, type
-.IP
-.nf
-\f[C]
-pandoc habits.txt -o habits.pptx
-\f[R]
-.fi
-.SS Structuring the slide show
-.PP
-By default, the \f[I]slide level\f[R] is the highest heading level in
-the hierarchy that is followed immediately by content, and not another
-heading, somewhere in the document.
-In the example above, level-1 headings are always followed by level-2
-headings, which are followed by content, so the slide level is 2.
-This default can be overridden using the \f[C]--slide-level\f[R] option.
-.PP
-The document is carved up into slides according to the following rules:
-.IP \[bu] 2
-A horizontal rule always starts a new slide.
-.IP \[bu] 2
-A heading at the slide level always starts a new slide.
-.IP \[bu] 2
-Headings \f[I]below\f[R] the slide level in the hierarchy create
-headings \f[I]within\f[R] a slide.
-.IP \[bu] 2
-Headings \f[I]above\f[R] the slide level in the hierarchy create
-\[dq]title slides,\[dq] which just contain the section title and help to
-break the slide show into sections.
-Non-slide content under these headings will be included on the title
-slide (for HTML slide shows) or in a subsequent slide with the same
-title (for beamer).
-.IP \[bu] 2
-A title page is constructed automatically from the document\[aq]s title
-block, if present.
-(In the case of beamer, this can be disabled by commenting out some
-lines in the default template.)
-.PP
-These rules are designed to support many different styles of slide show.
-If you don\[aq]t care about structuring your slides into sections and
-subsections, you can just use level-1 headings for all each slide.
-(In that case, level-1 will be the slide level.) But you can also
-structure the slide show into sections, as in the example above.
-.PP
-Note: in reveal.js slide shows, if slide level is 2, a two-dimensional
-layout will be produced, with level-1 headings building horizontally and
-level-2 headings building vertically.
-It is not recommended that you use deeper nesting of section levels with
-reveal.js.
-.SS Incremental lists
-.PP
-By default, these writers produce lists that display \[dq]all at
-once.\[dq] If you want your lists to display incrementally (one item at
-a time), use the \f[C]-i\f[R] option.
-If you want a particular list to depart from the default, put it in a
-\f[C]div\f[R] block with class \f[C]incremental\f[R] or
-\f[C]nonincremental\f[R].
-So, for example, using the \f[C]fenced div\f[R] syntax, the following
-would be incremental regardless of the document default:
-.IP
-.nf
-\f[C]
-::: incremental
-
-- Eat spaghetti
-- Drink wine
-
-:::
-\f[R]
-.fi
-.PP
-or
-.IP
-.nf
-\f[C]
-::: nonincremental
-
-- Eat spaghetti
-- Drink wine
-
-:::
-\f[R]
-.fi
-.PP
-While using \f[C]incremental\f[R] and \f[C]nonincremental\f[R] divs are
-the recommended method of setting incremental lists on a per-case basis,
-an older method is also supported: putting lists inside a blockquote
-will depart from the document default (that is, it will display
-incrementally without the \f[C]-i\f[R] option and all at once with the
-\f[C]-i\f[R] option):
-.IP
-.nf
-\f[C]
-> - Eat spaghetti
-> - Drink wine
-\f[R]
-.fi
-.PP
-Both methods allow incremental and nonincremental lists to be mixed in a
-single document.
-.PP
-Note: Neither the \f[C]-i/--incremental\f[R] option nor any of the
-methods described here currently works for PowerPoint output.
-.SS Inserting pauses
-.PP
-You can add \[dq]pauses\[dq] within a slide by including a paragraph
-containing three dots, separated by spaces:
-.IP
-.nf
-\f[C]
-# Slide with a pause
-
-content before the pause
-
-\&. . .
-
-content after the pause
-\f[R]
-.fi
-.PP
-Note: this feature is not yet implemented for PowerPoint output.
-.SS Styling the slides
-.PP
-You can change the style of HTML slides by putting customized CSS files
-in \f[C]$DATADIR/s5/default\f[R] (for S5), \f[C]$DATADIR/slidy\f[R] (for
-Slidy), or \f[C]$DATADIR/slideous\f[R] (for Slideous), where
-\f[C]$DATADIR\f[R] is the user data directory (see \f[C]--data-dir\f[R],
-above).
-The originals may be found in pandoc\[aq]s system data directory
-(generally \f[C]$CABALDIR/pandoc-VERSION/s5/default\f[R]).
-Pandoc will look there for any files it does not find in the user data
-directory.
-.PP
-For dzslides, the CSS is included in the HTML file itself, and may be
-modified there.
-.PP
-All reveal.js configuration options can be set through variables.
-For example, themes can be used by setting the \f[C]theme\f[R] variable:
-.IP
-.nf
-\f[C]
--V theme=moon
-\f[R]
-.fi
-.PP
-Or you can specify a custom stylesheet using the \f[C]--css\f[R] option.
-.PP
-To style beamer slides, you can specify a \f[C]theme\f[R],
-\f[C]colortheme\f[R], \f[C]fonttheme\f[R], \f[C]innertheme\f[R], and
-\f[C]outertheme\f[R], using the \f[C]-V\f[R] option:
-.IP
-.nf
-\f[C]
-pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf
-\f[R]
-.fi
-.PP
-Note that heading attributes will turn into slide attributes (on a
-\f[C]<div>\f[R] or \f[C]<section>\f[R]) in HTML slide formats, allowing
-you to style individual slides.
-In beamer, the only heading attribute that affects slides is the
-\f[C]allowframebreaks\f[R] class, which sets the
-\f[C]allowframebreaks\f[R] option, causing multiple slides to be created
-if the content overfills the frame.
-This is recommended especially for bibliographies:
-.IP
-.nf
-\f[C]
-# References {.allowframebreaks}
-\f[R]
-.fi
-.SS Speaker notes
-.PP
-Speaker notes are supported in reveal.js and PowerPoint (pptx) output.
-You can add notes to your Markdown document thus:
-.IP
-.nf
-\f[C]
-::: notes
-
-This is my note.
-
-- It can contain Markdown
-- like this list
-
-:::
-\f[R]
-.fi
-.PP
-To show the notes window in reveal.js, press \f[C]s\f[R] while viewing
-the presentation.
-Speaker notes in PowerPoint will be available, as usual, in handouts and
-presenter view.
-.PP
-Notes are not yet supported for other slide formats, but the notes will
-not appear on the slides themselves.
-.SS Columns
-.PP
-To put material in side by side columns, you can use a native div
-container with class \f[C]columns\f[R], containing two or more div
-containers with class \f[C]column\f[R] and a \f[C]width\f[R] attribute:
-.IP
-.nf
-\f[C]
-:::::::::::::: {.columns}
-::: {.column width=\[dq]40%\[dq]}
-contents...
-:::
-::: {.column width=\[dq]60%\[dq]}
-contents...
-:::
-::::::::::::::
-\f[R]
-.fi
-.SS Additional columns attributes in beamer
-.PP
-The div containers with classes \f[C]columns\f[R] and \f[C]column\f[R]
-can optionally have an \f[C]align\f[R] attribute.
-The class \f[C]columns\f[R] can optionally have a \f[C]totalwidth\f[R]
-attribute or an \f[C]onlytextwidth\f[R] class.
-.IP
-.nf
-\f[C]
-:::::::::::::: {.columns align=center totalwidth=8em}
-::: {.column width=\[dq]40%\[dq]}
-contents...
-:::
-::: {.column width=\[dq]60%\[dq] align=bottom}
-contents...
-:::
-::::::::::::::
-\f[R]
-.fi
-.PP
-The \f[C]align\f[R] attributes on \f[C]columns\f[R] and \f[C]column\f[R]
-can be used with the values \f[C]top\f[R], \f[C]top-baseline\f[R],
-\f[C]center\f[R] and \f[C]bottom\f[R] to vertically align the columns.
-It defaults to \f[C]top\f[R] in \f[C]columns\f[R].
-.PP
-The \f[C]totalwidth\f[R] attribute limits the width of the columns to
-the given value.
-.IP
-.nf
-\f[C]
-:::::::::::::: {.columns align=top .onlytextwidth}
-::: {.column width=\[dq]40%\[dq] align=center}
-contents...
-:::
-::: {.column width=\[dq]60%\[dq]}
-contents...
-:::
-::::::::::::::
-\f[R]
-.fi
-.PP
-The class \f[C]onlytextwidth\f[R] sets the \f[C]totalwidth\f[R] to
-\f[C]\[rs]textwidth\f[R].
-.PP
-See Section 12.7 of the Beamer User\[aq]s Guide for more details.
-.SS Frame attributes in beamer
-.PP
-Sometimes it is necessary to add the LaTeX \f[C][fragile]\f[R] option to
-a frame in beamer (for example, when using the \f[C]minted\f[R]
-environment).
-This can be forced by adding the \f[C]fragile\f[R] class to the heading
-introducing the slide:
-.IP
-.nf
-\f[C]
-# Fragile slide {.fragile}
-\f[R]
-.fi
-.PP
-All of the other frame attributes described in Section 8.1 of the Beamer
-User\[aq]s Guide may also be used: \f[C]allowdisplaybreaks\f[R],
-\f[C]allowframebreaks\f[R], \f[C]b\f[R], \f[C]c\f[R], \f[C]t\f[R],
-\f[C]environment\f[R], \f[C]label\f[R], \f[C]plain\f[R],
-\f[C]shrink\f[R], \f[C]standout\f[R], \f[C]noframenumbering\f[R].
-.SS Background in reveal.js and beamer
-.PP
-Background images can be added to self-contained reveal.js slideshows
-and to beamer slideshows.
-.PP
-For the same image on every slide, use the configuration option
-\f[C]background-image\f[R] either in the YAML metadata block or as a
-command-line variable.
-(There are no other options in beamer and the rest of this section
-concerns reveal.js slideshows.)
-.PP
-For reveal.js, you can instead use the reveal.js-native option
-\f[C]parallaxBackgroundImage\f[R].
-You can also set \f[C]parallaxBackgroundHorizontal\f[R] and
-\f[C]parallaxBackgroundVertical\f[R] the same way and must also set
-\f[C]parallaxBackgroundSize\f[R] to have your values take effect.
-.PP
-To set an image for a particular reveal.js slide, add
-\f[C]{data-background-image=\[dq]/path/to/image\[dq]}\f[R] to the first
-slide-level heading on the slide (which may even be empty).
-.PP
-In reveal.js\[aq]s overview mode, the parallaxBackgroundImage will show
-up only on the first slide.
-.PP
-Other reveal.js background settings also work on individual slides,
-including \f[C]data-background-size\f[R],
-\f[C]data-background-repeat\f[R], \f[C]data-background-color\f[R],
-\f[C]data-transition\f[R], and \f[C]data-transition-speed\f[R].
-.PP
-To add a background image to the automatically generated title slide,
-use the \f[C]title-slide-attributes\f[R] variable in the YAML metadata
-block.
-It must contain a map of attribute names and values.
-.PP
-See the reveal.js documentation for more details.
-.PP
-For example in reveal.js:
-.IP
-.nf
-\f[C]
----
-title: My Slideshow
-parallaxBackgroundImage: /path/to/my/background_image.png
-title-slide-attributes:
-    data-background-image: /path/to/title_image.png
-    data-background-size: contain
----
-
-## Slide One
-
-Slide 1 has background_image.png as its background.
-
-## {data-background-image=\[dq]/path/to/special_image.jpg\[dq]}
-
-Slide 2 has a special image for its background, even though the heading has no content.
-\f[R]
-.fi
-.SH CREATING EPUBS WITH PANDOC
-.SS EPUB Metadata
-.PP
-EPUB metadata may be specified using the \f[C]--epub-metadata\f[R]
-option, but if the source document is Markdown, it is better to use a
-YAML metadata block.
-Here is an example:
-.IP
-.nf
-\f[C]
----
-title:
-- type: main
-  text: My Book
-- type: subtitle
-  text: An investigation of metadata
-creator:
-- role: author
-  text: John Smith
-- role: editor
-  text: Sarah Jones
-identifier:
-- scheme: DOI
-  text: doi:10.234234.234/33
-publisher:  My Press
-rights: \[co] 2007 John Smith, CC BY-NC
-ibooks:
-  version: 1.3.4
-\&...
-\f[R]
-.fi
-.PP
-The following fields are recognized:
-.TP
-\f[B]\f[CB]identifier\f[B]\f[R]
-Either a string value or an object with fields \f[C]text\f[R] and
-\f[C]scheme\f[R].
-Valid values for \f[C]scheme\f[R] are \f[C]ISBN-10\f[R],
-\f[C]GTIN-13\f[R], \f[C]UPC\f[R], \f[C]ISMN-10\f[R], \f[C]DOI\f[R],
-\f[C]LCCN\f[R], \f[C]GTIN-14\f[R], \f[C]ISBN-13\f[R],
-\f[C]Legal deposit number\f[R], \f[C]URN\f[R], \f[C]OCLC\f[R],
-\f[C]ISMN-13\f[R], \f[C]ISBN-A\f[R], \f[C]JP\f[R], \f[C]OLCC\f[R].
-.TP
-\f[B]\f[CB]title\f[B]\f[R]
-Either a string value, or an object with fields \f[C]file-as\f[R] and
-\f[C]type\f[R], or a list of such objects.
-Valid values for \f[C]type\f[R] are \f[C]main\f[R], \f[C]subtitle\f[R],
-\f[C]short\f[R], \f[C]collection\f[R], \f[C]edition\f[R],
-\f[C]extended\f[R].
-.TP
-\f[B]\f[CB]creator\f[B]\f[R]
-Either a string value, or an object with fields \f[C]role\f[R],
-\f[C]file-as\f[R], and \f[C]text\f[R], or a list of such objects.
-Valid values for \f[C]role\f[R] are MARC relators, but pandoc will
-attempt to translate the human-readable versions (like \[dq]author\[dq]
-and \[dq]editor\[dq]) to the appropriate marc relators.
-.TP
-\f[B]\f[CB]contributor\f[B]\f[R]
-Same format as \f[C]creator\f[R].
-.TP
-\f[B]\f[CB]date\f[B]\f[R]
-A string value in \f[C]YYYY-MM-DD\f[R] format.
-(Only the year is necessary.) Pandoc will attempt to convert other
-common date formats.
-.TP
-\f[B]\f[CB]lang\f[B]\f[R] (or legacy: \f[B]\f[CB]language\f[B]\f[R])
-A string value in BCP 47 format.
-Pandoc will default to the local language if nothing is specified.
-.TP
-\f[B]\f[CB]subject\f[B]\f[R]
-A string value or a list of such values.
-.TP
-\f[B]\f[CB]description\f[B]\f[R]
-A string value.
-.TP
-\f[B]\f[CB]type\f[B]\f[R]
-A string value.
-.TP
-\f[B]\f[CB]format\f[B]\f[R]
-A string value.
-.TP
-\f[B]\f[CB]relation\f[B]\f[R]
-A string value.
-.TP
-\f[B]\f[CB]coverage\f[B]\f[R]
-A string value.
-.TP
-\f[B]\f[CB]rights\f[B]\f[R]
-A string value.
-.TP
-\f[B]\f[CB]cover-image\f[B]\f[R]
-A string value (path to cover image).
-.TP
-\f[B]\f[CB]css\f[B]\f[R] (or legacy: \f[B]\f[CB]stylesheet\f[B]\f[R])
-A string value (path to CSS stylesheet).
-.TP
-\f[B]\f[CB]page-progression-direction\f[B]\f[R]
-Either \f[C]ltr\f[R] or \f[C]rtl\f[R].
-Specifies the \f[C]page-progression-direction\f[R] attribute for the
-\f[C]spine\f[R] element.
-.TP
-\f[B]\f[CB]ibooks\f[B]\f[R]
-iBooks-specific metadata, with the following fields:
-.RS
-.IP \[bu] 2
-\f[C]version\f[R]: (string)
-.IP \[bu] 2
-\f[C]specified-fonts\f[R]: \f[C]true\f[R]|\f[C]false\f[R] (default
-\f[C]false\f[R])
-.IP \[bu] 2
-\f[C]ipad-orientation-lock\f[R]:
-\f[C]portrait-only\f[R]|\f[C]landscape-only\f[R]
-.IP \[bu] 2
-\f[C]iphone-orientation-lock\f[R]:
-\f[C]portrait-only\f[R]|\f[C]landscape-only\f[R]
-.IP \[bu] 2
-\f[C]binding\f[R]: \f[C]true\f[R]|\f[C]false\f[R] (default
-\f[C]true\f[R])
-.IP \[bu] 2
-\f[C]scroll-axis\f[R]:
-\f[C]vertical\f[R]|\f[C]horizontal\f[R]|\f[C]default\f[R]
-.RE
-.SS The \f[C]epub:type\f[R] attribute
-.PP
-For \f[C]epub3\f[R] output, you can mark up the heading that corresponds
-to an EPUB chapter using the \f[C]epub:type\f[R] attribute.
-For example, to set the attribute to the value \f[C]prologue\f[R], use
-this markdown:
-.IP
-.nf
-\f[C]
-# My chapter {epub:type=prologue}
-\f[R]
-.fi
-.PP
-Which will result in:
-.IP
-.nf
-\f[C]
-<body epub:type=\[dq]frontmatter\[dq]>
-  <section epub:type=\[dq]prologue\[dq]>
-    <h1>My chapter</h1>
-\f[R]
-.fi
-.PP
-Pandoc will output \f[C]<body epub:type=\[dq]bodymatter\[dq]>\f[R],
-unless you use one of the following values, in which case either
-\f[C]frontmatter\f[R] or \f[C]backmatter\f[R] will be output.
-.PP
-.TS
-tab(@);
-l l.
-T{
-\f[C]epub:type\f[R] of first section
-T}@T{
-\f[C]epub:type\f[R] of body
-T}
-_
-T{
-prologue
-T}@T{
-frontmatter
-T}
-T{
-abstract
-T}@T{
-frontmatter
-T}
-T{
-acknowledgments
-T}@T{
-frontmatter
-T}
-T{
-copyright-page
-T}@T{
-frontmatter
-T}
-T{
-dedication
-T}@T{
-frontmatter
-T}
-T{
-credits
-T}@T{
-frontmatter
-T}
-T{
-keywords
-T}@T{
-frontmatter
-T}
-T{
-imprint
-T}@T{
-frontmatter
-T}
-T{
-contributors
-T}@T{
-frontmatter
-T}
-T{
-other-credits
-T}@T{
-frontmatter
-T}
-T{
-errata
-T}@T{
-frontmatter
-T}
-T{
-revision-history
-T}@T{
-frontmatter
-T}
-T{
-titlepage
-T}@T{
-frontmatter
-T}
-T{
-halftitlepage
-T}@T{
-frontmatter
-T}
-T{
-seriespage
-T}@T{
-frontmatter
-T}
-T{
-foreword
-T}@T{
-frontmatter
-T}
-T{
-preface
-T}@T{
-frontmatter
-T}
-T{
-seriespage
-T}@T{
-frontmatter
-T}
-T{
-appendix
-T}@T{
-backmatter
-T}
-T{
-colophon
-T}@T{
-backmatter
-T}
-T{
-bibliography
-T}@T{
-backmatter
-T}
-T{
-index
-T}@T{
-backmatter
-T}
-.TE
-.SS Linked media
-.PP
-By default, pandoc will download media referenced from any
-\f[C]<img>\f[R], \f[C]<audio>\f[R], \f[C]<video>\f[R] or
-\f[C]<source>\f[R] element present in the generated EPUB, and include it
-in the EPUB container, yielding a completely self-contained EPUB.
-If you want to link to external media resources instead, use raw HTML in
-your source and add \f[C]data-external=\[dq]1\[dq]\f[R] to the tag with
-the \f[C]src\f[R] attribute.
-For example:
-.IP
-.nf
-\f[C]
-<audio controls=\[dq]1\[dq]>
-  <source src=\[dq]https://example.com/music/toccata.mp3\[dq]
-          data-external=\[dq]1\[dq] type=\[dq]audio/mpeg\[dq]>
-  </source>
-</audio>
-\f[R]
-.fi
-.SH CREATING JUPYTER NOTEBOOKS WITH PANDOC
-.PP
-When creating a Jupyter notebook, pandoc will try to infer the notebook
-structure.
-Code blocks with the class \f[C]code\f[R] will be taken as code cells,
-and intervening content will be taken as Markdown cells.
-Attachments will automatically be created for images in Markdown cells.
-Metadata will be taken from the \f[C]jupyter\f[R] metadata field.
-For example:
-.IP
-.nf
-\f[C]
----
-title: My notebook
-jupyter:
-  nbformat: 4
-  nbformat_minor: 5
-  kernelspec:
-     display_name: Python 2
-     language: python
-     name: python2
-  language_info:
-     codemirror_mode:
-       name: ipython
-       version: 2
-     file_extension: \[dq].py\[dq]
-     mimetype: \[dq]text/x-python\[dq]
-     name: \[dq]python\[dq]
-     nbconvert_exporter: \[dq]python\[dq]
-     pygments_lexer: \[dq]ipython2\[dq]
-     version: \[dq]2.7.15\[dq]
----
-
-# Lorem ipsum
-
-**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus
-bibendum felis dictum sodales.
-
-\[ga]\[ga]\[ga] code
-print(\[dq]hello\[dq])
-\[ga]\[ga]\[ga]
-
-## Pyout
-
-\[ga]\[ga]\[ga] code
-from IPython.display import HTML
-HTML(\[dq]\[dq]\[dq]
-<script>
-console.log(\[dq]hello\[dq]);
-</script>
-<b>HTML</b>
-\[dq]\[dq]\[dq])
-\[ga]\[ga]\[ga]
-
-## Image
-
-This image ![image](myimage.png) will be
-included as a cell attachment.
-\f[R]
-.fi
-.PP
-If you want to add cell attributes, group cells differently, or add
-output to code cells, then you need to include divs to indicate the
-structure.
-You can use either fenced divs or native divs for this.
-Here is an example:
-.IP
-.nf
-\f[C]
-:::::: {.cell .markdown}
-# Lorem
-
-**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus
-bibendum felis dictum sodales.
-::::::
-
-:::::: {.cell .code execution_count=1}
-\[ga]\[ga]\[ga] {.python}
-print(\[dq]hello\[dq])
-\[ga]\[ga]\[ga]
-
-::: {.output .stream .stdout}
-\[ga]\[ga]\[ga]
-hello
-\[ga]\[ga]\[ga]
-:::
-::::::
-
-:::::: {.cell .code execution_count=2}
-\[ga]\[ga]\[ga] {.python}
-from IPython.display import HTML
-HTML(\[dq]\[dq]\[dq]
-<script>
-console.log(\[dq]hello\[dq]);
-</script>
-<b>HTML</b>
-\[dq]\[dq]\[dq])
-\[ga]\[ga]\[ga]
-
-::: {.output .execute_result execution_count=2}
-\[ga]\[ga]\[ga]{=html}
-<script>
-console.log(\[dq]hello\[dq]);
-</script>
-<b>HTML</b>
-hello
-\[ga]\[ga]\[ga]
-:::
-::::::
-\f[R]
-.fi
-.PP
-If you include raw HTML or TeX in an output cell, use the [raw
-attribute][Extension: \f[C]fenced_attribute\f[R]], as shown in the last
-cell of the example above.
-Although pandoc can process \[dq]bare\[dq] raw HTML and TeX, the result
-is often interspersed raw elements and normal textual elements, and in
-an output cell pandoc expects a single, connected raw block.
-To avoid using raw HTML or TeX except when marked explicitly using raw
-attributes, we recommend specifying the extensions
-\f[C]-raw_html-raw_tex+raw_attribute\f[R] when translating between
-Markdown and ipynb notebooks.
-.PP
-Note that options and extensions that affect reading and writing of
-Markdown will also affect Markdown cells in ipynb notebooks.
-For example, \f[C]--wrap=preserve\f[R] will preserve soft line breaks in
-Markdown cells; \f[C]--atx-headers\f[R] will cause ATX-style headings to
-be used; and \f[C]--preserve-tabs\f[R] will prevent tabs from being
-turned to spaces.
-.SH SYNTAX HIGHLIGHTING
-.PP
-Pandoc will automatically highlight syntax in fenced code blocks that
-are marked with a language name.
-The Haskell library skylighting is used for highlighting.
-Currently highlighting is supported only for HTML, EPUB, Docx, Ms, and
-LaTeX/PDF output.
-To see a list of language names that pandoc will recognize, type
-\f[C]pandoc --list-highlight-languages\f[R].
-.PP
-The color scheme can be selected using the \f[C]--highlight-style\f[R]
-option.
-The default color scheme is \f[C]pygments\f[R], which imitates the
-default color scheme used by the Python library pygments (though
-pygments is not actually used to do the highlighting).
-To see a list of highlight styles, type
-\f[C]pandoc --list-highlight-styles\f[R].
-.PP
-If you are not satisfied with the predefined styles, you can use
-\f[C]--print-highlight-style\f[R] to generate a JSON \f[C].theme\f[R]
-file which can be modified and used as the argument to
-\f[C]--highlight-style\f[R].
-To get a JSON version of the \f[C]pygments\f[R] style, for example:
-.IP
-.nf
-\f[C]
-pandoc --print-highlight-style pygments > my.theme
-\f[R]
-.fi
-.PP
-Then edit \f[C]my.theme\f[R] and use it like this:
-.IP
-.nf
-\f[C]
-pandoc --highlight-style my.theme
-\f[R]
-.fi
-.PP
-If you are not satisfied with the built-in highlighting, or you want
-highlight a language that isn\[aq]t supported, you can use the
-\f[C]--syntax-definition\f[R] option to load a KDE-style XML syntax
-definition file.
-Before writing your own, have a look at KDE\[aq]s repository of syntax
-definitions.
-.PP
-To disable highlighting, use the \f[C]--no-highlight\f[R] option.
-.SH CUSTOM STYLES
-.PP
-Custom styles can be used in the docx and ICML formats.
-.SS Output
-.PP
-By default, pandoc\[aq]s docx and ICML output applies a predefined set
-of styles for blocks such as paragraphs and block quotes, and uses
-largely default formatting (italics, bold) for inlines.
-This will work for most purposes, especially alongside a
-\f[C]reference.docx\f[R] file.
-However, if you need to apply your own styles to blocks, or match a
-preexisting set of styles, pandoc allows you to define custom styles for
-blocks and text using \f[C]div\f[R]s and \f[C]span\f[R]s, respectively.
-.PP
-If you define a \f[C]div\f[R] or \f[C]span\f[R] with the attribute
-\f[C]custom-style\f[R], pandoc will apply your specified style to the
-contained elements (with the exception of elements whose function
-depends on a style, like headings, code blocks, block quotes, or links).
-So, for example, using the \f[C]bracketed_spans\f[R] syntax,
-.IP
-.nf
-\f[C]
-[Get out]{custom-style=\[dq]Emphatically\[dq]}, he said.
-\f[R]
-.fi
-.PP
-would produce a docx file with \[dq]Get out\[dq] styled with character
-style \f[C]Emphatically\f[R].
-Similarly, using the \f[C]fenced_divs\f[R] syntax,
-.IP
-.nf
-\f[C]
-Dickinson starts the poem simply:
-
-::: {custom-style=\[dq]Poetry\[dq]}
-| A Bird came down the Walk---
-| He did not know I saw---
-:::
-\f[R]
-.fi
-.PP
-would style the two contained lines with the \f[C]Poetry\f[R] paragraph
-style.
-.PP
-For docx output, styles will be defined in the output file as inheriting
-from normal text, if the styles are not yet in your reference.docx.
-If they are already defined, pandoc will not alter the definition.
-.PP
-This feature allows for greatest customization in conjunction with
-pandoc filters.
-If you want all paragraphs after block quotes to be indented, you can
-write a filter to apply the styles necessary.
-If you want all italics to be transformed to the \f[C]Emphasis\f[R]
-character style (perhaps to change their color), you can write a filter
-which will transform all italicized inlines to inlines within an
-\f[C]Emphasis\f[R] custom-style \f[C]span\f[R].
-.PP
-For docx output, you don\[aq]t need to enable any extensions for custom
-styles to work.
-.SS Input
-.PP
-The docx reader, by default, only reads those styles that it can convert
-into pandoc elements, either by direct conversion or interpreting the
-derivation of the input document\[aq]s styles.
-.PP
-By enabling the \f[C]styles\f[R] extension in the docx reader
-(\f[C]-f docx+styles\f[R]), you can produce output that maintains the
-styles of the input document, using the \f[C]custom-style\f[R] class.
-Paragraph styles are interpreted as divs, while character styles are
-interpreted as spans.
-.PP
-For example, using the \f[C]custom-style-reference.docx\f[R] file in the
-test directory, we have the following different outputs:
-.PP
-Without the \f[C]+styles\f[R] extension:
-.IP
-.nf
-\f[C]
-$ pandoc test/docx/custom-style-reference.docx -f docx -t markdown
-This is some text.
-
-This is text with an *emphasized* text style. And this is text with a
-**strengthened** text style.
-
-> Here is a styled paragraph that inherits from Block Text.
-\f[R]
-.fi
-.PP
-And with the extension:
-.IP
-.nf
-\f[C]
-$ pandoc test/docx/custom-style-reference.docx -f docx+styles -t markdown
-
-::: {custom-style=\[dq]First Paragraph\[dq]}
-This is some text.
-:::
-
-::: {custom-style=\[dq]Body Text\[dq]}
-This is text with an [emphasized]{custom-style=\[dq]Emphatic\[dq]} text style.
-And this is text with a [strengthened]{custom-style=\[dq]Strengthened\[dq]}
-text style.
-:::
-
-::: {custom-style=\[dq]My Block Style\[dq]}
-> Here is a styled paragraph that inherits from Block Text.
-:::
-\f[R]
-.fi
-.PP
-With these custom styles, you can use your input document as a
-reference-doc while creating docx output (see below), and maintain the
-same styles in your input and output files.
-.SH CUSTOM WRITERS
-.PP
-Pandoc can be extended with custom writers written in Lua.
-(Pandoc includes a Lua interpreter, so Lua need not be installed
-separately.)
-.PP
-To use a custom writer, simply specify the path to the Lua script in
-place of the output format.
-For example:
-.IP
-.nf
-\f[C]
-pandoc -t data/sample.lua
-\f[R]
-.fi
-.PP
-Creating a custom writer requires writing a Lua function for each
-possible element in a pandoc document.
-To get a documented example which you can modify according to your
-needs, do
-.IP
-.nf
-\f[C]
-pandoc --print-default-data-file sample.lua
-\f[R]
-.fi
-.PP
-Note that custom writers have no default template.
-If you want to use \f[C]--standalone\f[R] with a custom writer, you will
-need to specify a template manually using \f[C]--template\f[R] or add a
-new default template with the name
-\f[C]default.NAME_OF_CUSTOM_WRITER.lua\f[R] to the \f[C]templates\f[R]
-subdirectory of your user data directory (see Templates).
-.SH A NOTE ON SECURITY
-.PP
-If you use pandoc to convert user-contributed content in a web
-application, here are some things to keep in mind:
-.IP "1." 3
-Although pandoc itself will not create or modify any files other than
-those you explicitly ask it create (with the exception of temporary
-files used in producing PDFs), a filter or custom writer could in
-principle do anything on your file system.
-Please audit filters and custom writers very carefully before using
-them.
-.IP "2." 3
-If your application uses pandoc as a Haskell library (rather than
-shelling out to the executable), it is possible to use it in a mode that
-fully isolates pandoc from your file system, by running the pandoc
-operations in the \f[C]PandocPure\f[R] monad.
-See the document Using the pandoc API for more details.
-.IP "3." 3
-Pandoc\[aq]s parsers can exhibit pathological performance on some corner
-cases.
-It is wise to put any pandoc operations under a timeout, to avoid DOS
-attacks that exploit these issues.
-If you are using the pandoc executable, you can add the command line
-options \f[C]+RTS -M512M -RTS\f[R] (for example) to limit the heap size
-to 512MB.
-.IP "4." 3
-The HTML generated by pandoc is not guaranteed to be safe.
-If \f[C]raw_html\f[R] is enabled for the Markdown input, users can
-inject arbitrary HTML.
-Even if \f[C]raw_html\f[R] is disabled, users can include dangerous
-content in attributes for headings, spans, and code blocks.
-To be safe, you should run all the generated HTML through an HTML
-sanitizer.
-.SH AUTHORS
-.PP
-Copyright 2006--2020 John MacFarlane (jgm\[at]berkeley.edu).
+.\" Automatically generated by Pandoc 2.11
+.\"
+.TH "Pandoc User\[cq]s Guide" "" "July 23, 2020" "pandoc 2.11" ""
+.hy
+.SH NAME
+pandoc - general markup converter
+.SH SYNOPSIS
+.PP
+\f[C]pandoc\f[R] [\f[I]options\f[R]] [\f[I]input-file\f[R]]\&...
+.SH DESCRIPTION
+.PP
+Pandoc is a Haskell library for converting from one markup format to
+another, and a command-line tool that uses this library.
+.PP
+Pandoc can convert between numerous markup and word processing formats,
+including, but not limited to, various flavors of Markdown, HTML, LaTeX
+and Word docx.
+For the full lists of input and output formats, see the \f[C]--from\f[R]
+and \f[C]--to\f[R] options below.
+Pandoc can also produce PDF output: see creating a PDF, below.
+.PP
+Pandoc\[cq]s enhanced version of Markdown includes syntax for tables,
+definition lists, metadata blocks, footnotes, citations, math, and much
+more.
+See below under Pandoc\[cq]s Markdown.
+.PP
+Pandoc has a modular design: it consists of a set of readers, which
+parse text in a given format and produce a native representation of the
+document (an \f[I]abstract syntax tree\f[R] or AST), and a set of
+writers, which convert this native representation into a target format.
+Thus, adding an input or output format requires only adding a reader or
+writer.
+Users can also run custom pandoc filters to modify the intermediate AST.
+.PP
+Because pandoc\[cq]s intermediate representation of a document is less
+expressive than many of the formats it converts between, one should not
+expect perfect conversions between every format and every other.
+Pandoc attempts to preserve the structural elements of a document, but
+not formatting details such as margin size.
+And some document elements, such as complex tables, may not fit into
+pandoc\[cq]s simple document model.
+While conversions from pandoc\[cq]s Markdown to all formats aspire to be
+perfect, conversions from formats more expressive than pandoc\[cq]s
+Markdown can be expected to be lossy.
+.SS Using pandoc
+.PP
+If no \f[I]input-files\f[R] are specified, input is read from
+\f[I]stdin\f[R].
+Output goes to \f[I]stdout\f[R] by default.
+For output to a file, use the \f[C]-o\f[R] option:
+.IP
+.nf
+\f[C]
+pandoc -o output.html input.txt
+\f[R]
+.fi
+.PP
+By default, pandoc produces a document fragment.
+To produce a standalone document (e.g.\ a valid HTML file including
+\f[C]<head>\f[R] and \f[C]<body>\f[R]), use the \f[C]-s\f[R] or
+\f[C]--standalone\f[R] flag:
+.IP
+.nf
+\f[C]
+pandoc -s -o output.html input.txt
+\f[R]
+.fi
+.PP
+For more information on how standalone documents are produced, see
+Templates below.
+.PP
+If multiple input files are given, \f[C]pandoc\f[R] will concatenate
+them all (with blank lines between them) before parsing.
+(Use \f[C]--file-scope\f[R] to parse files individually.)
+.SS Specifying formats
+.PP
+The format of the input and output can be specified explicitly using
+command-line options.
+The input format can be specified using the \f[C]-f/--from\f[R] option,
+the output format using the \f[C]-t/--to\f[R] option.
+Thus, to convert \f[C]hello.txt\f[R] from Markdown to LaTeX, you could
+type:
+.IP
+.nf
+\f[C]
+pandoc -f markdown -t latex hello.txt
+\f[R]
+.fi
+.PP
+To convert \f[C]hello.html\f[R] from HTML to Markdown:
+.IP
+.nf
+\f[C]
+pandoc -f html -t markdown hello.html
+\f[R]
+.fi
+.PP
+Supported input and output formats are listed below under Options (see
+\f[C]-f\f[R] for input formats and \f[C]-t\f[R] for output formats).
+You can also use \f[C]pandoc --list-input-formats\f[R] and
+\f[C]pandoc --list-output-formats\f[R] to print lists of supported
+formats.
+.PP
+If the input or output format is not specified explicitly,
+\f[C]pandoc\f[R] will attempt to guess it from the extensions of the
+filenames.
+Thus, for example,
+.IP
+.nf
+\f[C]
+pandoc -o hello.tex hello.txt
+\f[R]
+.fi
+.PP
+will convert \f[C]hello.txt\f[R] from Markdown to LaTeX.
+If no output file is specified (so that output goes to
+\f[I]stdout\f[R]), or if the output file\[cq]s extension is unknown, the
+output format will default to HTML.
+If no input file is specified (so that input comes from
+\f[I]stdin\f[R]), or if the input files\[cq] extensions are unknown, the
+input format will be assumed to be Markdown.
+.SS Character encoding
+.PP
+Pandoc uses the UTF-8 character encoding for both input and output.
+If your local character encoding is not UTF-8, you should pipe input and
+output through \f[C]iconv\f[R]:
+.IP
+.nf
+\f[C]
+iconv -t utf-8 input.txt | pandoc | iconv -f utf-8
+\f[R]
+.fi
+.PP
+Note that in some output formats (such as HTML, LaTeX, ConTeXt, RTF,
+OPML, DocBook, and Texinfo), information about the character encoding is
+included in the document header, which will only be included if you use
+the \f[C]-s/--standalone\f[R] option.
+.SS Creating a PDF
+.PP
+To produce a PDF, specify an output file with a \f[C].pdf\f[R]
+extension:
+.IP
+.nf
+\f[C]
+pandoc test.txt -o test.pdf
+\f[R]
+.fi
+.PP
+By default, pandoc will use LaTeX to create the PDF, which requires that
+a LaTeX engine be installed (see \f[C]--pdf-engine\f[R] below).
+Alternatively, pandoc can use ConTeXt, roff ms, or HTML as an
+intermediate format.
+To do this, specify an output file with a \f[C].pdf\f[R] extension, as
+before, but add the \f[C]--pdf-engine\f[R] option or
+\f[C]-t context\f[R], \f[C]-t html\f[R], or \f[C]-t ms\f[R] to the
+command line.
+The tool used to generate the PDF from the intermediate format may be
+specified using \f[C]--pdf-engine\f[R].
+.PP
+You can control the PDF style using variables, depending on the
+intermediate format used: see variables for LaTeX, variables for
+ConTeXt, variables for \f[C]wkhtmltopdf\f[R], variables for ms.
+When HTML is used as an intermediate format, the output can be styled
+using \f[C]--css\f[R].
+.PP
+To debug the PDF creation, it can be useful to look at the intermediate
+representation: instead of \f[C]-o test.pdf\f[R], use for example
+\f[C]-s -o test.tex\f[R] to output the generated LaTeX.
+You can then test it with \f[C]pdflatex test.tex\f[R].
+.PP
+When using LaTeX, the following packages need to be available (they are
+included with all recent versions of TeX Live): \f[C]amsfonts\f[R],
+\f[C]amsmath\f[R], \f[C]lm\f[R], \f[C]unicode-math\f[R],
+\f[C]ifxetex\f[R], \f[C]ifluatex\f[R], \f[C]listings\f[R] (if the
+\f[C]--listings\f[R] option is used), \f[C]fancyvrb\f[R],
+\f[C]longtable\f[R], \f[C]booktabs\f[R], \f[C]graphicx\f[R] (if the
+document contains images), \f[C]hyperref\f[R], \f[C]xcolor\f[R],
+\f[C]ulem\f[R], \f[C]geometry\f[R] (with the \f[C]geometry\f[R] variable
+set), \f[C]setspace\f[R] (with \f[C]linestretch\f[R]), and
+\f[C]babel\f[R] (with \f[C]lang\f[R]).
+The use of \f[C]xelatex\f[R] or \f[C]lualatex\f[R] as the PDF engine
+requires \f[C]fontspec\f[R].
+\f[C]lualatex\f[R] uses \f[C]selnolig\f[R].
+\f[C]xelatex\f[R] uses \f[C]polyglossia\f[R] (with \f[C]lang\f[R]),
+\f[C]xecjk\f[R], and \f[C]bidi\f[R] (with the \f[C]dir\f[R] variable
+set).
+If the \f[C]mathspec\f[R] variable is set, \f[C]xelatex\f[R] will use
+\f[C]mathspec\f[R] instead of \f[C]unicode-math\f[R].
+The \f[C]upquote\f[R] and \f[C]microtype\f[R] packages are used if
+available, and \f[C]csquotes\f[R] will be used for typography if the
+\f[C]csquotes\f[R] variable or metadata field is set to a true value.
+The \f[C]natbib\f[R], \f[C]biblatex\f[R], \f[C]bibtex\f[R], and
+\f[C]biber\f[R] packages can optionally be used for citation rendering.
+The following packages will be used to improve output quality if
+present, but pandoc does not require them to be present:
+\f[C]upquote\f[R] (for straight quotes in verbatim environments),
+\f[C]microtype\f[R] (for better spacing adjustments), \f[C]parskip\f[R]
+(for better inter-paragraph spaces), \f[C]xurl\f[R] (for better line
+breaks in URLs), \f[C]bookmark\f[R] (for better PDF bookmarks), and
+\f[C]footnotehyper\f[R] or \f[C]footnote\f[R] (to allow footnotes in
+tables).
+.SS Reading from the Web
+.PP
+Instead of an input file, an absolute URI may be given.
+In this case pandoc will fetch the content using HTTP:
+.IP
+.nf
+\f[C]
+pandoc -f html -t markdown https://www.fsf.org
+\f[R]
+.fi
+.PP
+It is possible to supply a custom User-Agent string or other header when
+requesting a document from a URL:
+.IP
+.nf
+\f[C]
+pandoc -f html -t markdown --request-header User-Agent:\[dq]Mozilla/5.0\[dq] \[rs]
+  https://www.fsf.org
+\f[R]
+.fi
+.SH OPTIONS
+.SS General options
+.TP
+\f[B]\f[CB]-f\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]-r\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]--from=\f[B]\f[R]\f[I]FORMAT\f[R], \f[B]\f[CB]--read=\f[B]\f[R]\f[I]FORMAT\f[R]
+Specify input format.
+\f[I]FORMAT\f[R] can be:
+.RS
+.IP \[bu] 2
+\f[C]bibtex\f[R] (BibTeX bibliography)
+.IP \[bu] 2
+\f[C]biblatex\f[R] (BibLaTeX bibliography)
+.IP \[bu] 2
+\f[C]commonmark\f[R] (CommonMark Markdown)
+.IP \[bu] 2
+\f[C]commonmark_x\f[R] (CommonMark Markdown with extensions)
+.IP \[bu] 2
+\f[C]creole\f[R] (Creole 1.0)
+.IP \[bu] 2
+\f[C]csljson\f[R] (CSL JSON bibliography)
+.IP \[bu] 2
+\f[C]csv\f[R] (CSV table)
+.IP \[bu] 2
+\f[C]docbook\f[R] (DocBook)
+.IP \[bu] 2
+\f[C]docx\f[R] (Word docx)
+.IP \[bu] 2
+\f[C]dokuwiki\f[R] (DokuWiki markup)
+.IP \[bu] 2
+\f[C]epub\f[R] (EPUB)
+.IP \[bu] 2
+\f[C]fb2\f[R] (FictionBook2 e-book)
+.IP \[bu] 2
+\f[C]gfm\f[R] (GitHub-Flavored Markdown), or the deprecated and less
+accurate \f[C]markdown_github\f[R]; use \f[C]markdown_github\f[R] only
+if you need extensions not supported in \f[C]gfm\f[R].
+.IP \[bu] 2
+\f[C]haddock\f[R] (Haddock markup)
+.IP \[bu] 2
+\f[C]html\f[R] (HTML)
+.IP \[bu] 2
+\f[C]ipynb\f[R] (Jupyter notebook)
+.IP \[bu] 2
+\f[C]jats\f[R] (JATS XML)
+.IP \[bu] 2
+\f[C]jira\f[R] (Jira/Confluence wiki markup)
+.IP \[bu] 2
+\f[C]json\f[R] (JSON version of native AST)
+.IP \[bu] 2
+\f[C]latex\f[R] (LaTeX)
+.IP \[bu] 2
+\f[C]markdown\f[R] (Pandoc\[cq]s Markdown)
+.IP \[bu] 2
+\f[C]markdown_mmd\f[R] (MultiMarkdown)
+.IP \[bu] 2
+\f[C]markdown_phpextra\f[R] (PHP Markdown Extra)
+.IP \[bu] 2
+\f[C]markdown_strict\f[R] (original unextended Markdown)
+.IP \[bu] 2
+\f[C]mediawiki\f[R] (MediaWiki markup)
+.IP \[bu] 2
+\f[C]man\f[R] (roff man)
+.IP \[bu] 2
+\f[C]muse\f[R] (Muse)
+.IP \[bu] 2
+\f[C]native\f[R] (native Haskell)
+.IP \[bu] 2
+\f[C]odt\f[R] (ODT)
+.IP \[bu] 2
+\f[C]opml\f[R] (OPML)
+.IP \[bu] 2
+\f[C]org\f[R] (Emacs Org mode)
+.IP \[bu] 2
+\f[C]rst\f[R] (reStructuredText)
+.IP \[bu] 2
+\f[C]t2t\f[R] (txt2tags)
+.IP \[bu] 2
+\f[C]textile\f[R] (Textile)
+.IP \[bu] 2
+\f[C]tikiwiki\f[R] (TikiWiki markup)
+.IP \[bu] 2
+\f[C]twiki\f[R] (TWiki markup)
+.IP \[bu] 2
+\f[C]vimwiki\f[R] (Vimwiki)
+.PP
+Extensions can be individually enabled or disabled by appending
+\f[C]+EXTENSION\f[R] or \f[C]-EXTENSION\f[R] to the format name.
+See Extensions below, for a list of extensions and their names.
+See \f[C]--list-input-formats\f[R] and \f[C]--list-extensions\f[R],
+below.
+.RE
+.TP
+\f[B]\f[CB]-t\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]-w\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]--to=\f[B]\f[R]\f[I]FORMAT\f[R], \f[B]\f[CB]--write=\f[B]\f[R]\f[I]FORMAT\f[R]
+Specify output format.
+\f[I]FORMAT\f[R] can be:
+.RS
+.IP \[bu] 2
+\f[C]asciidoc\f[R] (AsciiDoc) or \f[C]asciidoctor\f[R] (AsciiDoctor)
+.IP \[bu] 2
+\f[C]beamer\f[R] (LaTeX beamer slide show)
+.IP \[bu] 2
+\f[C]commonmark\f[R] (CommonMark Markdown)
+.IP \[bu] 2
+\f[C]commonmark_x\f[R] (CommonMark Markdown with extensions)
+.IP \[bu] 2
+\f[C]context\f[R] (ConTeXt)
+.IP \[bu] 2
+\f[C]csljson\f[R] (CSL JSON bibliography)
+.IP \[bu] 2
+\f[C]docbook\f[R] or \f[C]docbook4\f[R] (DocBook 4)
+.IP \[bu] 2
+\f[C]docbook5\f[R] (DocBook 5)
+.IP \[bu] 2
+\f[C]docx\f[R] (Word docx)
+.IP \[bu] 2
+\f[C]dokuwiki\f[R] (DokuWiki markup)
+.IP \[bu] 2
+\f[C]epub\f[R] or \f[C]epub3\f[R] (EPUB v3 book)
+.IP \[bu] 2
+\f[C]epub2\f[R] (EPUB v2)
+.IP \[bu] 2
+\f[C]fb2\f[R] (FictionBook2 e-book)
+.IP \[bu] 2
+\f[C]gfm\f[R] (GitHub-Flavored Markdown), or the deprecated and less
+accurate \f[C]markdown_github\f[R]; use \f[C]markdown_github\f[R] only
+if you need extensions not supported in \f[C]gfm\f[R].
+.IP \[bu] 2
+\f[C]haddock\f[R] (Haddock markup)
+.IP \[bu] 2
+\f[C]html\f[R] or \f[C]html5\f[R] (HTML, i.e.\ HTML5/XHTML polyglot
+markup)
+.IP \[bu] 2
+\f[C]html4\f[R] (XHTML 1.0 Transitional)
+.IP \[bu] 2
+\f[C]icml\f[R] (InDesign ICML)
+.IP \[bu] 2
+\f[C]ipynb\f[R] (Jupyter notebook)
+.IP \[bu] 2
+\f[C]jats_archiving\f[R] (JATS XML, Archiving and Interchange Tag Set)
+.IP \[bu] 2
+\f[C]jats_articleauthoring\f[R] (JATS XML, Article Authoring Tag Set)
+.IP \[bu] 2
+\f[C]jats_publishing\f[R] (JATS XML, Journal Publishing Tag Set)
+.IP \[bu] 2
+\f[C]jats\f[R] (alias for \f[C]jats_archiving\f[R])
+.IP \[bu] 2
+\f[C]jira\f[R] (Jira/Confluence wiki markup)
+.IP \[bu] 2
+\f[C]json\f[R] (JSON version of native AST)
+.IP \[bu] 2
+\f[C]latex\f[R] (LaTeX)
+.IP \[bu] 2
+\f[C]man\f[R] (roff man)
+.IP \[bu] 2
+\f[C]markdown\f[R] (Pandoc\[cq]s Markdown)
+.IP \[bu] 2
+\f[C]markdown_mmd\f[R] (MultiMarkdown)
+.IP \[bu] 2
+\f[C]markdown_phpextra\f[R] (PHP Markdown Extra)
+.IP \[bu] 2
+\f[C]markdown_strict\f[R] (original unextended Markdown)
+.IP \[bu] 2
+\f[C]mediawiki\f[R] (MediaWiki markup)
+.IP \[bu] 2
+\f[C]ms\f[R] (roff ms)
+.IP \[bu] 2
+\f[C]muse\f[R] (Muse),
+.IP \[bu] 2
+\f[C]native\f[R] (native Haskell),
+.IP \[bu] 2
+\f[C]odt\f[R] (OpenOffice text document)
+.IP \[bu] 2
+\f[C]opml\f[R] (OPML)
+.IP \[bu] 2
+\f[C]opendocument\f[R] (OpenDocument)
+.IP \[bu] 2
+\f[C]org\f[R] (Emacs Org mode)
+.IP \[bu] 2
+\f[C]pdf\f[R] (PDF)
+.IP \[bu] 2
+\f[C]plain\f[R] (plain text),
+.IP \[bu] 2
+\f[C]pptx\f[R] (PowerPoint slide show)
+.IP \[bu] 2
+\f[C]rst\f[R] (reStructuredText)
+.IP \[bu] 2
+\f[C]rtf\f[R] (Rich Text Format)
+.IP \[bu] 2
+\f[C]texinfo\f[R] (GNU Texinfo)
+.IP \[bu] 2
+\f[C]textile\f[R] (Textile)
+.IP \[bu] 2
+\f[C]slideous\f[R] (Slideous HTML and JavaScript slide show)
+.IP \[bu] 2
+\f[C]slidy\f[R] (Slidy HTML and JavaScript slide show)
+.IP \[bu] 2
+\f[C]dzslides\f[R] (DZSlides HTML5 + JavaScript slide show),
+.IP \[bu] 2
+\f[C]revealjs\f[R] (reveal.js HTML5 + JavaScript slide show)
+.IP \[bu] 2
+\f[C]s5\f[R] (S5 HTML and JavaScript slide show)
+.IP \[bu] 2
+\f[C]tei\f[R] (TEI Simple)
+.IP \[bu] 2
+\f[C]xwiki\f[R] (XWiki markup)
+.IP \[bu] 2
+\f[C]zimwiki\f[R] (ZimWiki markup)
+.IP \[bu] 2
+the path of a custom Lua writer, see Custom writers below
+.PP
+Note that \f[C]odt\f[R], \f[C]docx\f[R], \f[C]epub\f[R], and
+\f[C]pdf\f[R] output will not be directed to \f[I]stdout\f[R] unless
+forced with \f[C]-o -\f[R].
+.PP
+Extensions can be individually enabled or disabled by appending
+\f[C]+EXTENSION\f[R] or \f[C]-EXTENSION\f[R] to the format name.
+See Extensions below, for a list of extensions and their names.
+See \f[C]--list-output-formats\f[R] and \f[C]--list-extensions\f[R],
+below.
+.RE
+.TP
+\f[B]\f[CB]-o\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--output=\f[B]\f[R]\f[I]FILE\f[R]
+Write output to \f[I]FILE\f[R] instead of \f[I]stdout\f[R].
+If \f[I]FILE\f[R] is \f[C]-\f[R], output will go to \f[I]stdout\f[R],
+even if a non-textual format (\f[C]docx\f[R], \f[C]odt\f[R],
+\f[C]epub2\f[R], \f[C]epub3\f[R]) is specified.
+.TP
+\f[B]\f[CB]--data-dir=\f[B]\f[R]\f[I]DIRECTORY\f[R]
+Specify the user data directory to search for pandoc data files.
+If this option is not specified, the default user data directory will be
+used.
+On *nix and macOS systems this will be the \f[C]pandoc\f[R] subdirectory
+of the XDG data directory (by default, \f[C]$HOME/.local/share\f[R],
+overridable by setting the \f[C]XDG_DATA_HOME\f[R] environment
+variable).
+If that directory does not exist, \f[C]$HOME/.pandoc\f[R] will be used
+(for backwards compatibility).
+In Windows the default user data directory is
+\f[C]C:\[rs]Users\[rs]USERNAME\[rs]AppData\[rs]Roaming\[rs]pandoc\f[R].
+You can find the default user data directory on your system by looking
+at the output of \f[C]pandoc --version\f[R].
+A \f[C]reference.odt\f[R], \f[C]reference.docx\f[R], \f[C]epub.css\f[R],
+\f[C]templates\f[R], \f[C]slidy\f[R], \f[C]slideous\f[R], or
+\f[C]s5\f[R] directory placed in this directory will override
+pandoc\[cq]s normal defaults.
+.TP
+\f[B]\f[CB]-d\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--defaults=\f[B]\f[R]\f[I]FILE\f[R]
+Specify a set of default option settings.
+\f[I]FILE\f[R] is a YAML file whose fields correspond to command-line
+option settings.
+All options for document conversion, including input and output files,
+can be set using a defaults file.
+The file will be searched for first in the working directory, and then
+in the \f[C]defaults\f[R] subdirectory of the user data directory (see
+\f[C]--data-dir\f[R]).
+The \f[C].yaml\f[R] extension may be omitted.
+See the section Default files for more information on the file format.
+Settings from the defaults file may be overridden or extended by
+subsequent options on the command line.
+.TP
+\f[B]\f[CB]--bash-completion\f[B]\f[R]
+Generate a bash completion script.
+To enable bash completion with pandoc, add this to your
+\f[C].bashrc\f[R]:
+.RS
+.IP
+.nf
+\f[C]
+eval \[dq]$(pandoc --bash-completion)\[dq]
+\f[R]
+.fi
+.RE
+.TP
+\f[B]\f[CB]--verbose\f[B]\f[R]
+Give verbose debugging output.
+.TP
+\f[B]\f[CB]--quiet\f[B]\f[R]
+Suppress warning messages.
+.TP
+\f[B]\f[CB]--fail-if-warnings\f[B]\f[R]
+Exit with error status if there are any warnings.
+.TP
+\f[B]\f[CB]--log=\f[B]\f[R]\f[I]FILE\f[R]
+Write log messages in machine-readable JSON format to \f[I]FILE\f[R].
+All messages above DEBUG level will be written, regardless of verbosity
+settings (\f[C]--verbose\f[R], \f[C]--quiet\f[R]).
+.TP
+\f[B]\f[CB]--list-input-formats\f[B]\f[R]
+List supported input formats, one per line.
+.TP
+\f[B]\f[CB]--list-output-formats\f[B]\f[R]
+List supported output formats, one per line.
+.TP
+\f[B]\f[CB]--list-extensions\f[B]\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]FORMAT\f[R]]
+List supported extensions for \f[I]FORMAT\f[R], one per line, preceded
+by a \f[C]+\f[R] or \f[C]-\f[R] indicating whether it is enabled by
+default in \f[I]FORMAT\f[R].
+If \f[I]FORMAT\f[R] is not specified, defaults for pandoc\[cq]s Markdown
+are given.
+.TP
+\f[B]\f[CB]--list-highlight-languages\f[B]\f[R]
+List supported languages for syntax highlighting, one per line.
+.TP
+\f[B]\f[CB]--list-highlight-styles\f[B]\f[R]
+List supported styles for syntax highlighting, one per line.
+See \f[C]--highlight-style\f[R].
+.TP
+\f[B]\f[CB]-v\f[B]\f[R], \f[B]\f[CB]--version\f[B]\f[R]
+Print version.
+.TP
+\f[B]\f[CB]-h\f[B]\f[R], \f[B]\f[CB]--help\f[B]\f[R]
+Show usage message.
+.SS Reader options
+.TP
+\f[B]\f[CB]--shift-heading-level-by=\f[B]\f[R]\f[I]NUMBER\f[R]
+Shift heading levels by a positive or negative integer.
+For example, with \f[C]--shift-heading-level-by=-1\f[R], level 2
+headings become level 1 headings, and level 3 headings become level 2
+headings.
+Headings cannot have a level less than 1, so a heading that would be
+shifted below level 1 becomes a regular paragraph.
+Exception: with a shift of -N, a level-N heading at the beginning of the
+document replaces the metadata title.
+\f[C]--shift-heading-level-by=-1\f[R] is a good choice when converting
+HTML or Markdown documents that use an initial level-1 heading for the
+document title and level-2+ headings for sections.
+\f[C]--shift-heading-level-by=1\f[R] may be a good choice for converting
+Markdown documents that use level-1 headings for sections to HTML, since
+pandoc uses a level-1 heading to render the document title.
+.TP
+\f[B]\f[CB]--base-header-level=\f[B]\f[R]\f[I]NUMBER\f[R]
+\f[I]Deprecated. Use \f[CI]--shift-heading-level-by\f[I]=X instead,
+where X = NUMBER - 1.\f[R] Specify the base level for headings (defaults
+to 1).
+.TP
+\f[B]\f[CB]--strip-empty-paragraphs\f[B]\f[R]
+\f[I]Deprecated. Use the \f[CI]+empty_paragraphs\f[I] extension
+instead.\f[R] Ignore paragraphs with no content.
+This option is useful for converting word processing documents where
+users have used empty paragraphs to create inter-paragraph space.
+.TP
+\f[B]\f[CB]--indented-code-classes=\f[B]\f[R]\f[I]CLASSES\f[R]
+Specify classes to use for indented code blocks\[en]for example,
+\f[C]perl,numberLines\f[R] or \f[C]haskell\f[R].
+Multiple classes may be separated by spaces or commas.
+.TP
+\f[B]\f[CB]--default-image-extension=\f[B]\f[R]\f[I]EXTENSION\f[R]
+Specify a default extension to use when image paths/URLs have no
+extension.
+This allows you to use the same source for formats that require
+different kinds of images.
+Currently this option only affects the Markdown and LaTeX readers.
+.TP
+\f[B]\f[CB]--file-scope\f[B]\f[R]
+Parse each file individually before combining for multifile documents.
+This will allow footnotes in different files with the same identifiers
+to work as expected.
+If this option is set, footnotes and links will not work across files.
+Reading binary files (docx, odt, epub) implies \f[C]--file-scope\f[R].
+.TP
+\f[B]\f[CB]-F\f[B]\f[R] \f[I]PROGRAM\f[R], \f[B]\f[CB]--filter=\f[B]\f[R]\f[I]PROGRAM\f[R]
+Specify an executable to be used as a filter transforming the pandoc AST
+after the input is parsed and before the output is written.
+The executable should read JSON from stdin and write JSON to stdout.
+The JSON must be formatted like pandoc\[cq]s own JSON input and output.
+The name of the output format will be passed to the filter as the first
+argument.
+Hence,
+.RS
+.IP
+.nf
+\f[C]
+pandoc --filter ./caps.py -t latex
+\f[R]
+.fi
+.PP
+is equivalent to
+.IP
+.nf
+\f[C]
+pandoc -t json | ./caps.py latex | pandoc -f json -t latex
+\f[R]
+.fi
+.PP
+The latter form may be useful for debugging filters.
+.PP
+Filters may be written in any language.
+\f[C]Text.Pandoc.JSON\f[R] exports \f[C]toJSONFilter\f[R] to facilitate
+writing filters in Haskell.
+Those who would prefer to write filters in python can use the module
+\f[C]pandocfilters\f[R], installable from PyPI.
+There are also pandoc filter libraries in PHP, perl, and
+JavaScript/node.js.
+.PP
+In order of preference, pandoc will look for filters in
+.IP "1." 3
+a specified full or relative path (executable or non-executable)
+.IP "2." 3
+\f[C]$DATADIR/filters\f[R] (executable or non-executable) where
+\f[C]$DATADIR\f[R] is the user data directory (see \f[C]--data-dir\f[R],
+above).
+.IP "3." 3
+\f[C]$PATH\f[R] (executable only)
+.PP
+Filters and Lua-filters are applied in the order specified on the
+command line.
+.RE
+.TP
+\f[B]\f[CB]-L\f[B]\f[R] \f[I]SCRIPT\f[R], \f[B]\f[CB]--lua-filter=\f[B]\f[R]\f[I]SCRIPT\f[R]
+Transform the document in a similar fashion as JSON filters (see
+\f[C]--filter\f[R]), but use pandoc\[cq]s build-in Lua filtering system.
+The given Lua script is expected to return a list of Lua filters which
+will be applied in order.
+Each Lua filter must contain element-transforming functions indexed by
+the name of the AST element on which the filter function should be
+applied.
+.RS
+.PP
+The \f[C]pandoc\f[R] Lua module provides helper functions for element
+creation.
+It is always loaded into the script\[cq]s Lua environment.
+.PP
+The following is an example Lua script for macro-expansion:
+.IP
+.nf
+\f[C]
+function expand_hello_world(inline)
+  if inline.c == \[aq]{{helloworld}}\[aq] then
+    return pandoc.Emph{ pandoc.Str \[dq]Hello, World\[dq] }
+  else
+    return inline
+  end
+end
+
+return {{Str = expand_hello_world}}
+\f[R]
+.fi
+.PP
+In order of preference, pandoc will look for Lua filters in
+.IP "1." 3
+a specified full or relative path (executable or non-executable)
+.IP "2." 3
+\f[C]$DATADIR/filters\f[R] (executable or non-executable) where
+\f[C]$DATADIR\f[R] is the user data directory (see \f[C]--data-dir\f[R],
+above).
+.RE
+.TP
+\f[B]\f[CB]-M\f[B]\f[R] \f[I]KEY\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]VAL\f[R]], \f[B]\f[CB]--metadata=\f[B]\f[R]\f[I]KEY\f[R][\f[B]\f[CB]:\f[B]\f[R]\f[I]VAL\f[R]]
+Set the metadata field \f[I]KEY\f[R] to the value \f[I]VAL\f[R].
+A value specified on the command line overrides a value specified in the
+document using YAML metadata blocks.
+Values will be parsed as YAML boolean or string values.
+If no value is specified, the value will be treated as Boolean true.
+Like \f[C]--variable\f[R], \f[C]--metadata\f[R] causes template
+variables to be set.
+But unlike \f[C]--variable\f[R], \f[C]--metadata\f[R] affects the
+metadata of the underlying document (which is accessible from filters
+and may be printed in some output formats) and metadata values will be
+escaped when inserted into the template.
+.TP
+\f[B]\f[CB]--metadata-file=\f[B]\f[R]\f[I]FILE\f[R]
+Read metadata from the supplied YAML (or JSON) file.
+This option can be used with every input format, but string scalars in
+the YAML file will always be parsed as Markdown.
+Generally, the input will be handled the same as in YAML metadata
+blocks.
+This option can be used repeatedly to include multiple metadata files;
+values in files specified later on the command line will be preferred
+over those specified in earlier files.
+Metadata values specified inside the document, or by using \f[C]-M\f[R],
+overwrite values specified with this option.
+.TP
+\f[B]\f[CB]-p\f[B]\f[R], \f[B]\f[CB]--preserve-tabs\f[B]\f[R]
+Preserve tabs instead of converting them to spaces.
+(By default, pandoc converts tabs to spaces before parsing its input.)
+Note that this will only affect tabs in literal code spans and code
+blocks.
+Tabs in regular text are always treated as spaces.
+.TP
+\f[B]\f[CB]--tab-stop=\f[B]\f[R]\f[I]NUMBER\f[R]
+Specify the number of spaces per tab (default is 4).
+.TP
+\f[B]\f[CB]--track-changes=accept\f[B]\f[R]|\f[B]\f[CB]reject\f[B]\f[R]|\f[B]\f[CB]all\f[B]\f[R]
+Specifies what to do with insertions, deletions, and comments produced
+by the MS Word \[lq]Track Changes\[rq] feature.
+\f[C]accept\f[R] (the default), inserts all insertions, and ignores all
+deletions.
+\f[C]reject\f[R] inserts all deletions and ignores insertions.
+Both \f[C]accept\f[R] and \f[C]reject\f[R] ignore comments.
+\f[C]all\f[R] puts in insertions, deletions, and comments, wrapped in
+spans with \f[C]insertion\f[R], \f[C]deletion\f[R],
+\f[C]comment-start\f[R], and \f[C]comment-end\f[R] classes,
+respectively.
+The author and time of change is included.
+\f[C]all\f[R] is useful for scripting: only accepting changes from a
+certain reviewer, say, or before a certain date.
+If a paragraph is inserted or deleted, \f[C]track-changes=all\f[R]
+produces a span with the class
+\f[C]paragraph-insertion\f[R]/\f[C]paragraph-deletion\f[R] before the
+affected paragraph break.
+This option only affects the docx reader.
+.TP
+\f[B]\f[CB]--extract-media=\f[B]\f[R]\f[I]DIR\f[R]
+Extract images and other media contained in or linked from the source
+document to the path \f[I]DIR\f[R], creating it if necessary, and adjust
+the images references in the document so they point to the extracted
+files.
+If the source format is a binary container (docx, epub, or odt), the
+media is extracted from the container and the original filenames are
+used.
+Otherwise the media is read from the file system or downloaded, and new
+filenames are constructed based on SHA1 hashes of the contents.
+.TP
+\f[B]\f[CB]--abbreviations=\f[B]\f[R]\f[I]FILE\f[R]
+Specifies a custom abbreviations file, with abbreviations one to a line.
+If this option is not specified, pandoc will read the data file
+\f[C]abbreviations\f[R] from the user data directory or fall back on a
+system default.
+To see the system default, use
+\f[C]pandoc --print-default-data-file=abbreviations\f[R].
+The only use pandoc makes of this list is in the Markdown reader.
+Strings ending in a period that are found in this list will be followed
+by a nonbreaking space, so that the period will not produce
+sentence-ending space in formats like LaTeX.
+.SS General writer options
+.TP
+\f[B]\f[CB]-s\f[B]\f[R], \f[B]\f[CB]--standalone\f[B]\f[R]
+Produce output with an appropriate header and footer (e.g.\ a standalone
+HTML, LaTeX, TEI, or RTF file, not a fragment).
+This option is set automatically for \f[C]pdf\f[R], \f[C]epub\f[R],
+\f[C]epub3\f[R], \f[C]fb2\f[R], \f[C]docx\f[R], and \f[C]odt\f[R]
+output.
+For \f[C]native\f[R] output, this option causes metadata to be included;
+otherwise, metadata is suppressed.
+.TP
+\f[B]\f[CB]--template=\f[B]\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
+Use the specified file as a custom template for the generated document.
+Implies \f[C]--standalone\f[R].
+See Templates, below, for a description of template syntax.
+If no extension is specified, an extension corresponding to the writer
+will be added, so that \f[C]--template=special\f[R] looks for
+\f[C]special.html\f[R] for HTML output.
+If the template is not found, pandoc will search for it in the
+\f[C]templates\f[R] subdirectory of the user data directory (see
+\f[C]--data-dir\f[R]).
+If this option is not used, a default template appropriate for the
+output format will be used (see \f[C]-D/--print-default-template\f[R]).
+.TP
+\f[B]\f[CB]-V\f[B]\f[R] \f[I]KEY\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]VAL\f[R]], \f[B]\f[CB]--variable=\f[B]\f[R]\f[I]KEY\f[R][\f[B]\f[CB]:\f[B]\f[R]\f[I]VAL\f[R]]
+Set the template variable \f[I]KEY\f[R] to the value \f[I]VAL\f[R] when
+rendering the document in standalone mode.
+If no \f[I]VAL\f[R] is specified, the key will be given the value
+\f[C]true\f[R].
+.TP
+\f[B]\f[CB]-D\f[B]\f[R] \f[I]FORMAT\f[R], \f[B]\f[CB]--print-default-template=\f[B]\f[R]\f[I]FORMAT\f[R]
+Print the system default template for an output \f[I]FORMAT\f[R].
+(See \f[C]-t\f[R] for a list of possible \f[I]FORMAT\f[R]s.) Templates
+in the user data directory are ignored.
+This option may be used with \f[C]-o\f[R]/\f[C]--output\f[R] to redirect
+output to a file, but \f[C]-o\f[R]/\f[C]--output\f[R] must come before
+\f[C]--print-default-template\f[R] on the command line.
+.RS
+.PP
+Note that some of the default templates use partials, for example
+\f[C]styles.html\f[R].
+To print the partials, use \f[C]--print-default-data-file\f[R]: for
+example, \f[C]--print-default-data-file=templates/styles.html\f[R].
+.RE
+.TP
+\f[B]\f[CB]--print-default-data-file=\f[B]\f[R]\f[I]FILE\f[R]
+Print a system default data file.
+Files in the user data directory are ignored.
+This option may be used with \f[C]-o\f[R]/\f[C]--output\f[R] to redirect
+output to a file, but \f[C]-o\f[R]/\f[C]--output\f[R] must come before
+\f[C]--print-default-data-file\f[R] on the command line.
+.TP
+\f[B]\f[CB]--eol=crlf\f[B]\f[R]|\f[B]\f[CB]lf\f[B]\f[R]|\f[B]\f[CB]native\f[B]\f[R]
+Manually specify line endings: \f[C]crlf\f[R] (Windows), \f[C]lf\f[R]
+(macOS/Linux/UNIX), or \f[C]native\f[R] (line endings appropriate to the
+OS on which pandoc is being run).
+The default is \f[C]native\f[R].
+.TP
+\f[B]\f[CB]--dpi\f[B]\f[R]=\f[I]NUMBER\f[R]
+Specify the default dpi (dots per inch) value for conversion from pixels
+to inch/centimeters and vice versa.
+(Technically, the correct term would be ppi: pixels per inch.) The
+default is 96dpi.
+When images contain information about dpi internally, the encoded value
+is used instead of the default specified by this option.
+.TP
+\f[B]\f[CB]--wrap=auto\f[B]\f[R]|\f[B]\f[CB]none\f[B]\f[R]|\f[B]\f[CB]preserve\f[B]\f[R]
+Determine how text is wrapped in the output (the source code, not the
+rendered version).
+With \f[C]auto\f[R] (the default), pandoc will attempt to wrap lines to
+the column width specified by \f[C]--columns\f[R] (default 72).
+With \f[C]none\f[R], pandoc will not wrap lines at all.
+With \f[C]preserve\f[R], pandoc will attempt to preserve the wrapping
+from the source document (that is, where there are nonsemantic newlines
+in the source, there will be nonsemantic newlines in the output as
+well).
+Automatic wrapping does not currently work in HTML output.
+In \f[C]ipynb\f[R] output, this option affects wrapping of the contents
+of markdown cells.
+.TP
+\f[B]\f[CB]--columns=\f[B]\f[R]\f[I]NUMBER\f[R]
+Specify length of lines in characters.
+This affects text wrapping in the generated source code (see
+\f[C]--wrap\f[R]).
+It also affects calculation of column widths for plain text tables (see
+Tables below).
+.TP
+\f[B]\f[CB]--toc\f[B]\f[R], \f[B]\f[CB]--table-of-contents\f[B]\f[R]
+Include an automatically generated table of contents (or, in the case of
+\f[C]latex\f[R], \f[C]context\f[R], \f[C]docx\f[R], \f[C]odt\f[R],
+\f[C]opendocument\f[R], \f[C]rst\f[R], or \f[C]ms\f[R], an instruction
+to create one) in the output document.
+This option has no effect unless \f[C]-s/--standalone\f[R] is used, and
+it has no effect on \f[C]man\f[R], \f[C]docbook4\f[R],
+\f[C]docbook5\f[R], or \f[C]jats\f[R] output.
+.RS
+.PP
+Note that if you are producing a PDF via \f[C]ms\f[R], the table of
+contents will appear at the beginning of the document, before the title.
+If you would prefer it to be at the end of the document, use the option
+\f[C]--pdf-engine-opt=--no-toc-relocation\f[R].
+.RE
+.TP
+\f[B]\f[CB]--toc-depth=\f[B]\f[R]\f[I]NUMBER\f[R]
+Specify the number of section levels to include in the table of
+contents.
+The default is 3 (which means that level-1, 2, and 3 headings will be
+listed in the contents).
+.TP
+\f[B]\f[CB]--strip-comments\f[B]\f[R]
+Strip out HTML comments in the Markdown or Textile source, rather than
+passing them on to Markdown, Textile or HTML output as raw HTML.
+This does not apply to HTML comments inside raw HTML blocks when the
+\f[C]markdown_in_html_blocks\f[R] extension is not set.
+.TP
+\f[B]\f[CB]--no-highlight\f[B]\f[R]
+Disables syntax highlighting for code blocks and inlines, even when a
+language attribute is given.
+.TP
+\f[B]\f[CB]--highlight-style=\f[B]\f[R]\f[I]STYLE\f[R]|\f[I]FILE\f[R]
+Specifies the coloring style to be used in highlighted source code.
+Options are \f[C]pygments\f[R] (the default), \f[C]kate\f[R],
+\f[C]monochrome\f[R], \f[C]breezeDark\f[R], \f[C]espresso\f[R],
+\f[C]zenburn\f[R], \f[C]haddock\f[R], and \f[C]tango\f[R].
+For more information on syntax highlighting in pandoc, see Syntax
+highlighting, below.
+See also \f[C]--list-highlight-styles\f[R].
+.RS
+.PP
+Instead of a \f[I]STYLE\f[R] name, a JSON file with extension
+\f[C].theme\f[R] may be supplied.
+This will be parsed as a KDE syntax highlighting theme and (if valid)
+used as the highlighting style.
+.PP
+To generate the JSON version of an existing style, use
+\f[C]--print-highlight-style\f[R].
+.RE
+.TP
+\f[B]\f[CB]--print-highlight-style=\f[B]\f[R]\f[I]STYLE\f[R]|\f[I]FILE\f[R]
+Prints a JSON version of a highlighting style, which can be modified,
+saved with a \f[C].theme\f[R] extension, and used with
+\f[C]--highlight-style\f[R].
+This option may be used with \f[C]-o\f[R]/\f[C]--output\f[R] to redirect
+output to a file, but \f[C]-o\f[R]/\f[C]--output\f[R] must come before
+\f[C]--print-highlight-style\f[R] on the command line.
+.TP
+\f[B]\f[CB]--syntax-definition=\f[B]\f[R]\f[I]FILE\f[R]
+Instructs pandoc to load a KDE XML syntax definition file, which will be
+used for syntax highlighting of appropriately marked code blocks.
+This can be used to add support for new languages or to use altered
+syntax definitions for existing languages.
+This option may be repeated to add multiple syntax definitions.
+.TP
+\f[B]\f[CB]-H\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--include-in-header=\f[B]\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
+Include contents of \f[I]FILE\f[R], verbatim, at the end of the header.
+This can be used, for example, to include special CSS or JavaScript in
+HTML documents.
+This option can be used repeatedly to include multiple files in the
+header.
+They will be included in the order specified.
+Implies \f[C]--standalone\f[R].
+.TP
+\f[B]\f[CB]-B\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--include-before-body=\f[B]\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
+Include contents of \f[I]FILE\f[R], verbatim, at the beginning of the
+document body (e.g.\ after the \f[C]<body>\f[R] tag in HTML, or the
+\f[C]\[rs]begin{document}\f[R] command in LaTeX).
+This can be used to include navigation bars or banners in HTML
+documents.
+This option can be used repeatedly to include multiple files.
+They will be included in the order specified.
+Implies \f[C]--standalone\f[R].
+.TP
+\f[B]\f[CB]-A\f[B]\f[R] \f[I]FILE\f[R], \f[B]\f[CB]--include-after-body=\f[B]\f[R]\f[I]FILE\f[R]|\f[I]URL\f[R]
+Include contents of \f[I]FILE\f[R], verbatim, at the end of the document
+body (before the \f[C]</body>\f[R] tag in HTML, or the
+\f[C]\[rs]end{document}\f[R] command in LaTeX).
+This option can be used repeatedly to include multiple files.
+They will be included in the order specified.
+Implies \f[C]--standalone\f[R].
+.TP
+\f[B]\f[CB]--resource-path=\f[B]\f[R]\f[I]SEARCHPATH\f[R]
+List of paths to search for images and other resources.
+The paths should be separated by \f[C]:\f[R] on Linux, UNIX, and macOS
+systems, and by \f[C];\f[R] on Windows.
+If \f[C]--resource-path\f[R] is not specified, the default resource path
+is the working directory.
+Note that, if \f[C]--resource-path\f[R] is specified, the working
+directory must be explicitly listed or it will not be searched.
+For example: \f[C]--resource-path=.:test\f[R] will search the working
+directory and the \f[C]test\f[R] subdirectory, in that order.
+.RS
+.PP
+\f[C]--resource-path\f[R] only has an effect if (a) the output format
+embeds images (for example, \f[C]docx\f[R], \f[C]pdf\f[R], or
+\f[C]html\f[R] with \f[C]--self-contained\f[R]) or (b) it is used
+together with \f[C]--extract-media\f[R].
+.RE
+.TP
+\f[B]\f[CB]--request-header=\f[B]\f[R]\f[I]NAME\f[R]\f[B]\f[CB]:\f[B]\f[R]\f[I]VAL\f[R]
+Set the request header \f[I]NAME\f[R] to the value \f[I]VAL\f[R] when
+making HTTP requests (for example, when a URL is given on the command
+line, or when resources used in a document must be downloaded).
+If you\[cq]re behind a proxy, you also need to set the environment
+variable \f[C]http_proxy\f[R] to \f[C]http://...\f[R].
+.TP
+\f[B]\f[CB]--no-check-certificate\f[B]\f[R]
+Disable the certificate verification to allow access to unsecure HTTP
+resources (for example when the certificate is no longer valid or self
+signed).
+.SS Options affecting specific writers
+.TP
+\f[B]\f[CB]--self-contained\f[B]\f[R]
+Produce a standalone HTML file with no external dependencies, using
+\f[C]data:\f[R] URIs to incorporate the contents of linked scripts,
+stylesheets, images, and videos.
+Implies \f[C]--standalone\f[R].
+The resulting file should be \[lq]self-contained,\[rq] in the sense that
+it needs no external files and no net access to be displayed properly by
+a browser.
+This option works only with HTML output formats, including
+\f[C]html4\f[R], \f[C]html5\f[R], \f[C]html+lhs\f[R],
+\f[C]html5+lhs\f[R], \f[C]s5\f[R], \f[C]slidy\f[R], \f[C]slideous\f[R],
+\f[C]dzslides\f[R], and \f[C]revealjs\f[R].
+Scripts, images, and stylesheets at absolute URLs will be downloaded;
+those at relative URLs will be sought relative to the working directory
+(if the first source file is local) or relative to the base URL (if the
+first source file is remote).
+Elements with the attribute \f[C]data-external=\[dq]1\[dq]\f[R] will be
+left alone; the documents they link to will not be incorporated in the
+document.
+Limitation: resources that are loaded dynamically through JavaScript
+cannot be incorporated; as a result, \f[C]--self-contained\f[R] does not
+work with \f[C]--mathjax\f[R], and some advanced features (e.g.\ zoom or
+speaker notes) may not work in an offline \[lq]self-contained\[rq]
+\f[C]reveal.js\f[R] slide show.
+.TP
+\f[B]\f[CB]--html-q-tags\f[B]\f[R]
+Use \f[C]<q>\f[R] tags for quotes in HTML.
+.TP
+\f[B]\f[CB]--ascii\f[B]\f[R]
+Use only ASCII characters in output.
+Currently supported for XML and HTML formats (which use entities instead
+of UTF-8 when this option is selected), CommonMark, gfm, and Markdown
+(which use entities), roff ms (which use hexadecimal escapes), and to a
+limited degree LaTeX (which uses standard commands for accented
+characters when possible).
+roff man output uses ASCII by default.
+.TP
+\f[B]\f[CB]--reference-links\f[B]\f[R]
+Use reference-style links, rather than inline links, in writing Markdown
+or reStructuredText.
+By default inline links are used.
+The placement of link references is affected by the
+\f[C]--reference-location\f[R] option.
+.TP
+\f[B]\f[CB]--reference-location = block\f[B]\f[R]|\f[B]\f[CB]section\f[B]\f[R]|\f[B]\f[CB]document\f[B]\f[R]
+Specify whether footnotes (and references, if \f[C]reference-links\f[R]
+is set) are placed at the end of the current (top-level) block, the
+current section, or the document.
+The default is \f[C]document\f[R].
+Currently only affects the markdown writer.
+.TP
+\f[B]\f[CB]--atx-headers\f[B]\f[R]
+Use ATX-style headings in Markdown output.
+The default is to use setext-style headings for levels 1 to 2, and then
+ATX headings.
+(Note: for \f[C]gfm\f[R] output, ATX headings are always used.) This
+option also affects markdown cells in \f[C]ipynb\f[R] output.
+.TP
+\f[B]\f[CB]--top-level-division=[default|section|chapter|part]\f[B]\f[R]
+Treat top-level headings as the given division type in LaTeX, ConTeXt,
+DocBook, and TEI output.
+The hierarchy order is part, chapter, then section; all headings are
+shifted such that the top-level heading becomes the specified type.
+The default behavior is to determine the best division type via
+heuristics: unless other conditions apply, \f[C]section\f[R] is chosen.
+When the \f[C]documentclass\f[R] variable is set to \f[C]report\f[R],
+\f[C]book\f[R], or \f[C]memoir\f[R] (unless the \f[C]article\f[R] option
+is specified), \f[C]chapter\f[R] is implied as the setting for this
+option.
+If \f[C]beamer\f[R] is the output format, specifying either
+\f[C]chapter\f[R] or \f[C]part\f[R] will cause top-level headings to
+become \f[C]\[rs]part{..}\f[R], while second-level headings remain as
+their default type.
+.TP
+\f[B]\f[CB]-N\f[B]\f[R], \f[B]\f[CB]--number-sections\f[B]\f[R]
+Number section headings in LaTeX, ConTeXt, HTML, Docx, or EPUB output.
+By default, sections are not numbered.
+Sections with class \f[C]unnumbered\f[R] will never be numbered, even if
+\f[C]--number-sections\f[R] is specified.
+.TP
+\f[B]\f[CB]--number-offset=\f[B]\f[R]\f[I]NUMBER\f[R][\f[B]\f[CB],\f[B]\f[R]\f[I]NUMBER\f[R]\f[B]\f[CB],\f[B]\f[R]\f[I]\&...\f[R]]
+Offset for section headings in HTML output (ignored in other output
+formats).
+The first number is added to the section number for top-level headings,
+the second for second-level headings, and so on.
+So, for example, if you want the first top-level heading in your
+document to be numbered \[lq]6\[rq], specify
+\f[C]--number-offset=5\f[R].
+If your document starts with a level-2 heading which you want to be
+numbered \[lq]1.5\[rq], specify \f[C]--number-offset=1,4\f[R].
+Offsets are 0 by default.
+Implies \f[C]--number-sections\f[R].
+.TP
+\f[B]\f[CB]--listings\f[B]\f[R]
+Use the \f[C]listings\f[R] package for LaTeX code blocks.
+The package does not support multi-byte encoding for source code.
+To handle UTF-8 you would need to use a custom template.
+This issue is fully documented here: Encoding issue with the listings
+package.
+.TP
+\f[B]\f[CB]-i\f[B]\f[R], \f[B]\f[CB]--incremental\f[B]\f[R]
+Make list items in slide shows display incrementally (one by one).
+The default is for lists to be displayed all at once.
+.TP
+\f[B]\f[CB]--slide-level=\f[B]\f[R]\f[I]NUMBER\f[R]
+Specifies that headings with the specified level create slides (for
+\f[C]beamer\f[R], \f[C]s5\f[R], \f[C]slidy\f[R], \f[C]slideous\f[R],
+\f[C]dzslides\f[R]).
+Headings above this level in the hierarchy are used to divide the slide
+show into sections; headings below this level create subheads within a
+slide.
+Note that content that is not contained under slide-level headings will
+not appear in the slide show.
+The default is to set the slide level based on the contents of the
+document; see Structuring the slide show.
+.TP
+\f[B]\f[CB]--section-divs\f[B]\f[R]
+Wrap sections in \f[C]<section>\f[R] tags (or \f[C]<div>\f[R] tags for
+\f[C]html4\f[R]), and attach identifiers to the enclosing
+\f[C]<section>\f[R] (or \f[C]<div>\f[R]) rather than the heading itself.
+See Heading identifiers, below.
+.TP
+\f[B]\f[CB]--email-obfuscation=none\f[B]\f[R]|\f[B]\f[CB]javascript\f[B]\f[R]|\f[B]\f[CB]references\f[B]\f[R]
+Specify a method for obfuscating \f[C]mailto:\f[R] links in HTML
+documents.
+\f[C]none\f[R] leaves \f[C]mailto:\f[R] links as they are.
+\f[C]javascript\f[R] obfuscates them using JavaScript.
+\f[C]references\f[R] obfuscates them by printing their letters as
+decimal or hexadecimal character references.
+The default is \f[C]none\f[R].
+.TP
+\f[B]\f[CB]--id-prefix=\f[B]\f[R]\f[I]STRING\f[R]
+Specify a prefix to be added to all identifiers and internal links in
+HTML and DocBook output, and to footnote numbers in Markdown and Haddock
+output.
+This is useful for preventing duplicate identifiers when generating
+fragments to be included in other pages.
+.TP
+\f[B]\f[CB]-T\f[B]\f[R] \f[I]STRING\f[R], \f[B]\f[CB]--title-prefix=\f[B]\f[R]\f[I]STRING\f[R]
+Specify \f[I]STRING\f[R] as a prefix at the beginning of the title that
+appears in the HTML header (but not in the title as it appears at the
+beginning of the HTML body).
+Implies \f[C]--standalone\f[R].
+.TP
+\f[B]\f[CB]-c\f[B]\f[R] \f[I]URL\f[R], \f[B]\f[CB]--css=\f[B]\f[R]\f[I]URL\f[R]
+Link to a CSS style sheet.
+This option can be used repeatedly to include multiple files.
+They will be included in the order specified.
+.RS
+.PP
+A stylesheet is required for generating EPUB.
+If none is provided using this option (or the \f[C]css\f[R] or
+\f[C]stylesheet\f[R] metadata fields), pandoc will look for a file
+\f[C]epub.css\f[R] in the user data directory (see
+\f[C]--data-dir\f[R]).
+If it is not found there, sensible defaults will be used.
+.RE
+.TP
+\f[B]\f[CB]--reference-doc=\f[B]\f[R]\f[I]FILE\f[R]
+Use the specified file as a style reference in producing a docx or ODT
+file.
+.RS
+.TP
+Docx
+For best results, the reference docx should be a modified version of a
+docx file produced using pandoc.
+The contents of the reference docx are ignored, but its stylesheets and
+document properties (including margins, page size, header, and footer)
+are used in the new docx.
+If no reference docx is specified on the command line, pandoc will look
+for a file \f[C]reference.docx\f[R] in the user data directory (see
+\f[C]--data-dir\f[R]).
+If this is not found either, sensible defaults will be used.
+.RS
+.PP
+To produce a custom \f[C]reference.docx\f[R], first get a copy of the
+default \f[C]reference.docx\f[R]:
+\f[C]pandoc -o custom-reference.docx --print-default-data-file reference.docx\f[R].
+Then open \f[C]custom-reference.docx\f[R] in Word, modify the styles as
+you wish, and save the file.
+For best results, do not make changes to this file other than modifying
+the styles used by pandoc:
+.PP
+Paragraph styles:
+.IP \[bu] 2
+Normal
+.IP \[bu] 2
+Body Text
+.IP \[bu] 2
+First Paragraph
+.IP \[bu] 2
+Compact
+.IP \[bu] 2
+Title
+.IP \[bu] 2
+Subtitle
+.IP \[bu] 2
+Author
+.IP \[bu] 2
+Date
+.IP \[bu] 2
+Abstract
+.IP \[bu] 2
+Bibliography
+.IP \[bu] 2
+Heading 1
+.IP \[bu] 2
+Heading 2
+.IP \[bu] 2
+Heading 3
+.IP \[bu] 2
+Heading 4
+.IP \[bu] 2
+Heading 5
+.IP \[bu] 2
+Heading 6
+.IP \[bu] 2
+Heading 7
+.IP \[bu] 2
+Heading 8
+.IP \[bu] 2
+Heading 9
+.IP \[bu] 2
+Block Text
+.IP \[bu] 2
+Footnote Text
+.IP \[bu] 2
+Definition Term
+.IP \[bu] 2
+Definition
+.IP \[bu] 2
+Caption
+.IP \[bu] 2
+Table Caption
+.IP \[bu] 2
+Image Caption
+.IP \[bu] 2
+Figure
+.IP \[bu] 2
+Captioned Figure
+.IP \[bu] 2
+TOC Heading
+.PP
+Character styles:
+.IP \[bu] 2
+Default Paragraph Font
+.IP \[bu] 2
+Body Text Char
+.IP \[bu] 2
+Verbatim Char
+.IP \[bu] 2
+Footnote Reference
+.IP \[bu] 2
+Hyperlink
+.IP \[bu] 2
+Section Number
+.PP
+Table style:
+.IP \[bu] 2
+Table
+.RE
+.TP
+ODT
+For best results, the reference ODT should be a modified version of an
+ODT produced using pandoc.
+The contents of the reference ODT are ignored, but its stylesheets are
+used in the new ODT.
+If no reference ODT is specified on the command line, pandoc will look
+for a file \f[C]reference.odt\f[R] in the user data directory (see
+\f[C]--data-dir\f[R]).
+If this is not found either, sensible defaults will be used.
+.RS
+.PP
+To produce a custom \f[C]reference.odt\f[R], first get a copy of the
+default \f[C]reference.odt\f[R]:
+\f[C]pandoc -o custom-reference.odt --print-default-data-file reference.odt\f[R].
+Then open \f[C]custom-reference.odt\f[R] in LibreOffice, modify the
+styles as you wish, and save the file.
+.RE
+.TP
+PowerPoint
+Templates included with Microsoft PowerPoint 2013 (either with
+\f[C].pptx\f[R] or \f[C].potx\f[R] extension) are known to work, as are
+most templates derived from these.
+.RS
+.PP
+The specific requirement is that the template should begin with the
+following first four layouts:
+.IP "1." 3
+Title Slide
+.IP "2." 3
+Title and Content
+.IP "3." 3
+Section Header
+.IP "4." 3
+Two Content
+.PP
+All templates included with a recent version of MS PowerPoint will fit
+these criteria.
+(You can click on \f[C]Layout\f[R] under the \f[C]Home\f[R] menu to
+check.)
+.PP
+You can also modify the default \f[C]reference.pptx\f[R]: first run
+\f[C]pandoc -o custom-reference.pptx --print-default-data-file reference.pptx\f[R],
+and then modify \f[C]custom-reference.pptx\f[R] in MS PowerPoint (pandoc
+will use the first four layout slides, as mentioned above).
+.RE
+.RE
+.TP
+\f[B]\f[CB]--epub-cover-image=\f[B]\f[R]\f[I]FILE\f[R]
+Use the specified image as the EPUB cover.
+It is recommended that the image be less than 1000px in width and
+height.
+Note that in a Markdown source document you can also specify
+\f[C]cover-image\f[R] in a YAML metadata block (see EPUB Metadata,
+below).
+.TP
+\f[B]\f[CB]--epub-metadata=\f[B]\f[R]\f[I]FILE\f[R]
+Look in the specified XML file for metadata for the EPUB.
+The file should contain a series of Dublin Core elements.
+For example:
+.RS
+.IP
+.nf
+\f[C]
+ <dc:rights>Creative Commons</dc:rights>
+ <dc:language>es-AR</dc:language>
+\f[R]
+.fi
+.PP
+By default, pandoc will include the following metadata elements:
+\f[C]<dc:title>\f[R] (from the document title), \f[C]<dc:creator>\f[R]
+(from the document authors), \f[C]<dc:date>\f[R] (from the document
+date, which should be in ISO 8601 format), \f[C]<dc:language>\f[R] (from
+the \f[C]lang\f[R] variable, or, if is not set, the locale), and
+\f[C]<dc:identifier id=\[dq]BookId\[dq]>\f[R] (a randomly generated
+UUID).
+Any of these may be overridden by elements in the metadata file.
+.PP
+Note: if the source document is Markdown, a YAML metadata block in the
+document can be used instead.
+See below under EPUB Metadata.
+.RE
+.TP
+\f[B]\f[CB]--epub-embed-font=\f[B]\f[R]\f[I]FILE\f[R]
+Embed the specified font in the EPUB.
+This option can be repeated to embed multiple fonts.
+Wildcards can also be used: for example, \f[C]DejaVuSans-*.ttf\f[R].
+However, if you use wildcards on the command line, be sure to escape
+them or put the whole filename in single quotes, to prevent them from
+being interpreted by the shell.
+To use the embedded fonts, you will need to add declarations like the
+following to your CSS (see \f[C]--css\f[R]):
+.RS
+.IP
+.nf
+\f[C]
+\[at]font-face {
+font-family: DejaVuSans;
+font-style: normal;
+font-weight: normal;
+src:url(\[dq]DejaVuSans-Regular.ttf\[dq]);
+}
+\[at]font-face {
+font-family: DejaVuSans;
+font-style: normal;
+font-weight: bold;
+src:url(\[dq]DejaVuSans-Bold.ttf\[dq]);
+}
+\[at]font-face {
+font-family: DejaVuSans;
+font-style: italic;
+font-weight: normal;
+src:url(\[dq]DejaVuSans-Oblique.ttf\[dq]);
+}
+\[at]font-face {
+font-family: DejaVuSans;
+font-style: italic;
+font-weight: bold;
+src:url(\[dq]DejaVuSans-BoldOblique.ttf\[dq]);
+}
+body { font-family: \[dq]DejaVuSans\[dq]; }
+\f[R]
+.fi
+.RE
+.TP
+\f[B]\f[CB]--epub-chapter-level=\f[B]\f[R]\f[I]NUMBER\f[R]
+Specify the heading level at which to split the EPUB into separate
+\[lq]chapter\[rq] files.
+The default is to split into chapters at level-1 headings.
+This option only affects the internal composition of the EPUB, not the
+way chapters and sections are displayed to users.
+Some readers may be slow if the chapter files are too large, so for
+large documents with few level-1 headings, one might want to use a
+chapter level of 2 or 3.
+.TP
+\f[B]\f[CB]--epub-subdirectory=\f[B]\f[R]\f[I]DIRNAME\f[R]
+Specify the subdirectory in the OCF container that is to hold the
+EPUB-specific contents.
+The default is \f[C]EPUB\f[R].
+To put the EPUB contents in the top level, use an empty string.
+.TP
+\f[B]\f[CB]--ipynb-output=all|none|best\f[B]\f[R]
+Determines how ipynb output cells are treated.
+\f[C]all\f[R] means that all of the data formats included in the
+original are preserved.
+\f[C]none\f[R] means that the contents of data cells are omitted.
+\f[C]best\f[R] causes pandoc to try to pick the richest data block in
+each output cell that is compatible with the output format.
+The default is \f[C]best\f[R].
+.TP
+\f[B]\f[CB]--pdf-engine=\f[B]\f[R]\f[I]PROGRAM\f[R]
+Use the specified engine when producing PDF output.
+Valid values are \f[C]pdflatex\f[R], \f[C]lualatex\f[R],
+\f[C]xelatex\f[R], \f[C]latexmk\f[R], \f[C]tectonic\f[R],
+\f[C]wkhtmltopdf\f[R], \f[C]weasyprint\f[R], \f[C]prince\f[R],
+\f[C]context\f[R], and \f[C]pdfroff\f[R].
+If the engine is not in your PATH, the full path of the engine may be
+specified here.
+If this option is not specified, pandoc uses the following defaults
+depending on the output format specified using \f[C]-t/--to\f[R]:
+.RS
+.IP \[bu] 2
+\f[C]-t latex\f[R] or none: \f[C]pdflatex\f[R] (other options:
+\f[C]xelatex\f[R], \f[C]lualatex\f[R], \f[C]tectonic\f[R],
+\f[C]latexmk\f[R])
+.IP \[bu] 2
+\f[C]-t context\f[R]: \f[C]context\f[R]
+.IP \[bu] 2
+\f[C]-t html\f[R]: \f[C]wkhtmltopdf\f[R] (other options:
+\f[C]prince\f[R], \f[C]weasyprint\f[R]; see print-css.rocks for a good
+introduction to PDF generation from HTML/CSS.)
+.IP \[bu] 2
+\f[C]-t ms\f[R]: \f[C]pdfroff\f[R]
+.RE
+.TP
+\f[B]\f[CB]--pdf-engine-opt=\f[B]\f[R]\f[I]STRING\f[R]
+Use the given string as a command-line argument to the
+\f[C]pdf-engine\f[R].
+For example, to use a persistent directory \f[C]foo\f[R] for
+\f[C]latexmk\f[R]\[cq]s auxiliary files, use
+\f[C]--pdf-engine-opt=-outdir=foo\f[R].
+Note that no check for duplicate options is done.
+.SS Citation rendering
+.TP
+\f[B]\f[CB]-C\f[B]\f[R], \f[B]\f[CB]--citeproc\f[B]\f[R]
+Process the citations in the file, replacing them with rendered
+citations and adding a bibliography.
+Citation processing will not take place unless bibliographic data is
+supplied, either through an external file specified using the
+\f[C]--bibliography\f[R] option or the \f[C]bibliography\f[R] field in
+metadata, or via a \f[C]references\f[R] section in metadata containing a
+list of citations in CSL YAML format with Markdown formatting.
+The style is controlled by a CSL stylesheet specified using the
+\f[C]--csl\f[R] option or the \f[C]csl\f[R] field in metadata.
+(If no stylesheet is specified, the \f[C]chicago-author-date\f[R] style
+will be used by default.) The citation processing transformation may be
+applied before or after filters or Lua filters (see \f[C]--filter\f[R],
+\f[C]--lua-filter\f[R]): these transformations are applied in the order
+they appear on the command line.
+For more information, see the section on Citations.
+.TP
+\f[B]\f[CB]--bibliography=\f[B]\f[R]\f[I]FILE\f[R]
+Set the \f[C]bibliography\f[R] field in the document\[cq]s metadata to
+\f[I]FILE\f[R], overriding any value set in the metadata.
+If you supply this argument multiple times, each \f[I]FILE\f[R] will be
+added to bibliography.
+.TP
+\f[B]\f[CB]--csl=\f[B]\f[R]\f[I]FILE\f[R]
+Set the \f[C]csl\f[R] field in the document\[cq]s metadata to
+\f[I]FILE\f[R], overriding any value set in the metadata.
+(This is equivalent to \f[C]--metadata csl=FILE\f[R].) If \f[I]FILE\f[R]
+is a URL, it will be fetched via HTTP.
+If \f[I]FILE\f[R] is not found relative to the working directory, it
+will be sought in the resource path and finally in the \f[C]csl\f[R]
+subdirectory of the pandoc user data directory.
+.TP
+\f[B]\f[CB]--citation-abbreviations=\f[B]\f[R]\f[I]FILE\f[R]
+Set the \f[C]citation-abbreviations\f[R] field in the document\[cq]s
+metadata to \f[I]FILE\f[R], overriding any value set in the metadata.
+(This is equivalent to
+\f[C]--metadata citation-abbreviations=FILE\f[R].) If \f[I]FILE\f[R] is
+a URL, it will be fetched via HTTP.
+If \f[I]FILE\f[R] is not found relative to the working directory, it
+will be sought in the resource path and finally in the \f[C]csl\f[R]
+subdirectory of the pandoc user data directory.
+.TP
+\f[B]\f[CB]--natbib\f[B]\f[R]
+Use \f[C]natbib\f[R] for citations in LaTeX output.
+This option is not for use with the \f[C]--citeproc\f[R] option or with
+PDF output.
+It is intended for use in producing a LaTeX file that can be processed
+with \f[C]bibtex\f[R].
+.TP
+\f[B]\f[CB]--biblatex\f[B]\f[R]
+Use \f[C]biblatex\f[R] for citations in LaTeX output.
+This option is not for use with the \f[C]--citeproc\f[R] option or with
+PDF output.
+It is intended for use in producing a LaTeX file that can be processed
+with \f[C]bibtex\f[R] or \f[C]biber\f[R].
+.SS Math rendering in HTML
+.PP
+The default is to render TeX math as far as possible using Unicode
+characters.
+Formulas are put inside a \f[C]span\f[R] with
+\f[C]class=\[dq]math\[dq]\f[R], so that they may be styled differently
+from the surrounding text if needed.
+However, this gives acceptable results only for basic math, usually you
+will want to use \f[C]--mathjax\f[R] or another of the following
+options.
+.TP
+\f[B]\f[CB]--mathjax\f[B]\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]URL\f[R]]
+Use MathJax to display embedded TeX math in HTML output.
+TeX math will be put between \f[C]\[rs](...\[rs])\f[R] (for inline math)
+or \f[C]\[rs][...\[rs]]\f[R] (for display math) and wrapped in
+\f[C]<span>\f[R] tags with class \f[C]math\f[R].
+Then the MathJax JavaScript will render it.
+The \f[I]URL\f[R] should point to the \f[C]MathJax.js\f[R] load script.
+If a \f[I]URL\f[R] is not provided, a link to the Cloudflare CDN will be
+inserted.
+.TP
+\f[B]\f[CB]--mathml\f[B]\f[R]
+Convert TeX math to MathML (in \f[C]epub3\f[R], \f[C]docbook4\f[R],
+\f[C]docbook5\f[R], \f[C]jats\f[R], \f[C]html4\f[R] and
+\f[C]html5\f[R]).
+This is the default in \f[C]odt\f[R] output.
+Note that currently only Firefox and Safari (and select e-book readers)
+natively support MathML.
+.TP
+\f[B]\f[CB]--webtex\f[B]\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]URL\f[R]]
+Convert TeX formulas to \f[C]<img>\f[R] tags that link to an external
+script that converts formulas to images.
+The formula will be URL-encoded and concatenated with the URL provided.
+For SVG images you can for example use
+\f[C]--webtex https://latex.codecogs.com/svg.latex?\f[R].
+If no URL is specified, the CodeCogs URL generating PNGs will be used
+(\f[C]https://latex.codecogs.com/png.latex?\f[R]).
+Note: the \f[C]--webtex\f[R] option will affect Markdown output as well
+as HTML, which is useful if you\[cq]re targeting a version of Markdown
+without native math support.
+.TP
+\f[B]\f[CB]--katex\f[B]\f[R][\f[B]\f[CB]=\f[B]\f[R]\f[I]URL\f[R]]
+Use KaTeX to display embedded TeX math in HTML output.
+The \f[I]URL\f[R] is the base URL for the KaTeX library.
+That directory should contain a \f[C]katex.min.js\f[R] and a
+\f[C]katex.min.css\f[R] file.
+If a \f[I]URL\f[R] is not provided, a link to the KaTeX CDN will be
+inserted.
+.TP
+\f[B]\f[CB]--gladtex\f[B]\f[R]
+Enclose TeX math in \f[C]<eq>\f[R] tags in HTML output.
+The resulting HTML can then be processed by GladTeX to produce images of
+the typeset formulas and an HTML file with links to these images.
+So, the procedure is:
+.RS
+.IP
+.nf
+\f[C]
+pandoc -s --gladtex input.md -o myfile.htex
+gladtex -d myfile-images myfile.htex
+# produces myfile.html and images in myfile-images
+\f[R]
+.fi
+.RE
+.SS Options for wrapper scripts
+.TP
+\f[B]\f[CB]--dump-args\f[B]\f[R]
+Print information about command-line arguments to \f[I]stdout\f[R], then
+exit.
+This option is intended primarily for use in wrapper scripts.
+The first line of output contains the name of the output file specified
+with the \f[C]-o\f[R] option, or \f[C]-\f[R] (for \f[I]stdout\f[R]) if
+no output file was specified.
+The remaining lines contain the command-line arguments, one per line, in
+the order they appear.
+These do not include regular pandoc options and their arguments, but do
+include any options appearing after a \f[C]--\f[R] separator at the end
+of the line.
+.TP
+\f[B]\f[CB]--ignore-args\f[B]\f[R]
+Ignore command-line arguments (for use in wrapper scripts).
+Regular pandoc options are not ignored.
+Thus, for example,
+.RS
+.IP
+.nf
+\f[C]
+pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
+\f[R]
+.fi
+.PP
+is equivalent to
+.IP
+.nf
+\f[C]
+pandoc -o foo.html -s
+\f[R]
+.fi
+.RE
+.SH EXIT CODES
+.PP
+If pandoc completes successfully, it will return exit code 0.
+Nonzero exit codes have the following meanings:
+.PP
+.TS
+tab(@);
+r l.
+T{
+Code
+T}@T{
+Error
+T}
+_
+T{
+3
+T}@T{
+PandocFailOnWarningError
+T}
+T{
+4
+T}@T{
+PandocAppError
+T}
+T{
+5
+T}@T{
+PandocTemplateError
+T}
+T{
+6
+T}@T{
+PandocOptionError
+T}
+T{
+21
+T}@T{
+PandocUnknownReaderError
+T}
+T{
+22
+T}@T{
+PandocUnknownWriterError
+T}
+T{
+23
+T}@T{
+PandocUnsupportedExtensionError
+T}
+T{
+24
+T}@T{
+PandocCiteprocError
+T}
+T{
+31
+T}@T{
+PandocEpubSubdirectoryError
+T}
+T{
+43
+T}@T{
+PandocPDFError
+T}
+T{
+47
+T}@T{
+PandocPDFProgramNotFoundError
+T}
+T{
+61
+T}@T{
+PandocHttpError
+T}
+T{
+62
+T}@T{
+PandocShouldNeverHappenError
+T}
+T{
+63
+T}@T{
+PandocSomeError
+T}
+T{
+64
+T}@T{
+PandocParseError
+T}
+T{
+65
+T}@T{
+PandocParsecError
+T}
+T{
+66
+T}@T{
+PandocMakePDFError
+T}
+T{
+67
+T}@T{
+PandocSyntaxMapError
+T}
+T{
+83
+T}@T{
+PandocFilterError
+T}
+T{
+91
+T}@T{
+PandocMacroLoop
+T}
+T{
+92
+T}@T{
+PandocUTF8DecodingError
+T}
+T{
+93
+T}@T{
+PandocIpynbDecodingError
+T}
+T{
+97
+T}@T{
+PandocCouldNotFindDataFileError
+T}
+T{
+99
+T}@T{
+PandocResourceNotFound
+T}
+.TE
+.SH DEFAULT FILES
+.PP
+The \f[C]--defaults\f[R] option may be used to specify a package of
+options.
+Here is a sample defaults file demonstrating all of the fields that may
+be used:
+.IP
+.nf
+\f[C]
+from: markdown+emoji
+# reader: may be used instead of from:
+to: html5
+# writer: may be used instead of to:
+
+# leave blank for output to stdout:
+output-file:
+# leave blank for input from stdin, use [] for no input:
+input-files:
+- preface.md
+- content.md
+# or you may use input-file: with a single value
+
+template: letter
+standalone: true
+self-contained: false
+
+# note that structured variables may be specified:
+variables:
+  documentclass: book
+  classoption:
+    - twosides
+    - draft
+
+# metadata values specified here are parsed as literal
+# string text, not markdown:
+metadata:
+  author:
+  - Sam Smith
+  - Julie Liu
+metadata-files:
+- boilerplate.yaml
+# or you may use metadata-file: with a single value
+
+# Note that these take files, not their contents:
+include-before-body: []
+include-after-body: []
+include-in-header: []
+resource-path: [\[dq].\[dq]]
+
+# turn on built-in citation processing.  Note that if you need
+# control over when the citeproc processing is done relative
+# to other filters, you should instead use \[ga]citeproc\[ga] in the
+# list of \[ga]filters\[ga] (see below).
+citeproc: true
+csl: ieee
+bibliography:
+- foobar.bib
+- barbaz.json
+
+# Filters will be assumed to be Lua filters if they have
+# the .lua extension, and json filters otherwise.  But
+# the filter type can also be specified explicitly, as shown.
+# Filters are run in the order specified.
+# To include the built-in citeproc filter, use either \[ga]citeproc\[ga]
+# or \[ga]{type: citeproc}\[ga].
+filters:
+- wordcount.lua
+- type: json
+  path: foo.lua
+
+file-scope: false
+
+data-dir:
+
+# ERROR, WARNING, or INFO
+verbosity: INFO
+log-file: log.json
+
+# citeproc, natbib, or biblatex
+cite-method: citeproc
+# part, chapter, section, or default:
+top-level-division: chapter
+abbreviations:
+
+pdf-engine: pdflatex
+pdf-engine-opts:
+- \[dq]-shell-escape\[dq]
+# you may also use pdf-engine-opt: with a single option
+# pdf-engine-opt: \[dq]-shell-escape\[dq]
+
+# auto, preserve, or none
+wrap: auto
+columns: 78
+dpi: 72
+
+extract-media: mediadir
+
+table-of-contents: true
+toc-depth: 2
+number-sections: false
+# a list of offsets at each heading level
+number-offset: [0,0,0,0,0,0]
+# toc: may also be used instead of table-of-contents:
+shift-heading-level-by: 1
+section-divs: true
+identifier-prefix: foo
+title-prefix: \[dq]\[dq]
+strip-empty-paragraphs: true
+# lf, crlf, or native
+eol: lf
+strip-comments: false
+indented-code-classes: []
+ascii: true
+default-image-extension: \[dq].jpg\[dq]
+
+# either a style name of a style definition file:
+highlight-style: pygments
+syntax-definitions:
+- c.xml
+# or you may use syntax-definition: with a single value
+listings: false
+
+reference-doc: myref.docx
+
+# method is plain, webtex, gladtex, mathml, mathjax, katex
+# you may specify a url with webtex, mathjax, katex
+html-math-method:
+  method: mathjax
+  url: \[dq]https://cdn.jsdelivr.net/npm/mathjax\[at]3/es5/tex-mml-chtml.js\[dq]
+# none, references, or javascript
+email-obfuscation: javascript
+
+tab-stop: 8
+preserve-tabs: true
+
+incremental: false
+slide-level: 2
+
+epub-subdirectory: EPUB
+epub-metadata: meta.xml
+epub-fonts:
+- foobar.otf
+epub-chapter-level: 1
+epub-cover-image: cover.jpg
+
+reference-links: true
+# block, section, or document
+reference-location: block
+atx-headers: false
+
+# accept, reject, or all
+track-changes: accept
+
+html-q-tags: false
+css:
+- site.css
+
+# none, all, or best
+ipynb-output: best
+
+# A list of two-element lists
+request-headers:
+- [\[dq]User-Agent\[dq], \[dq]Mozilla/5.0\[dq]]
+
+fail-if-warnings: false
+dump-args: false
+ignore-args: false
+trace: false
+\f[R]
+.fi
+.PP
+Fields that are omitted will just have their regular default values.
+So a defaults file can be as simple as one line:
+.IP
+.nf
+\f[C]
+verbosity: INFO
+\f[R]
+.fi
+.PP
+Default files can be placed in the \f[C]defaults\f[R] subdirectory of
+the user data directory and used from any directory.
+For example, one could create a file specifying defaults for writing
+letters, save it as \f[C]letter.yaml\f[R] in the \f[C]defaults\f[R]
+subdirectory of the user data directory, and then invoke these defaults
+from any directory using \f[C]pandoc --defaults letter\f[R] or
+\f[C]pandoc -dletter\f[R].
+.PP
+When multiple defaults are used, their contents will be combined.
+.PP
+Note that, where command-line arguments may be repeated
+(\f[C]--metadata-file\f[R], \f[C]--css\f[R],
+\f[C]--include-in-header\f[R], \f[C]--include-before-body\f[R],
+\f[C]--include-after-body\f[R], \f[C]--variable\f[R],
+\f[C]--metadata\f[R], \f[C]--syntax-definition\f[R]), the values
+specified on the command line will combine with values specified in the
+defaults file, rather than replacing them.
+.SH TEMPLATES
+.PP
+When the \f[C]-s/--standalone\f[R] option is used, pandoc uses a
+template to add header and footer material that is needed for a
+self-standing document.
+To see the default template that is used, just type
+.IP
+.nf
+\f[C]
+pandoc -D *FORMAT*
+\f[R]
+.fi
+.PP
+where \f[I]FORMAT\f[R] is the name of the output format.
+A custom template can be specified using the \f[C]--template\f[R]
+option.
+You can also override the system default templates for a given output
+format \f[I]FORMAT\f[R] by putting a file
+\f[C]templates/default.*FORMAT*\f[R] in the user data directory (see
+\f[C]--data-dir\f[R], above).
+\f[I]Exceptions:\f[R]
+.IP \[bu] 2
+For \f[C]odt\f[R] output, customize the \f[C]default.opendocument\f[R]
+template.
+.IP \[bu] 2
+For \f[C]pdf\f[R] output, customize the \f[C]default.latex\f[R] template
+(or the \f[C]default.context\f[R] template, if you use
+\f[C]-t context\f[R], or the \f[C]default.ms\f[R] template, if you use
+\f[C]-t ms\f[R], or the \f[C]default.html\f[R] template, if you use
+\f[C]-t html\f[R]).
+.IP \[bu] 2
+\f[C]docx\f[R] and \f[C]pptx\f[R] have no template (however, you can use
+\f[C]--reference-doc\f[R] to customize the output).
+.PP
+Templates contain \f[I]variables\f[R], which allow for the inclusion of
+arbitrary information at any point in the file.
+They may be set at the command line using the \f[C]-V/--variable\f[R]
+option.
+If a variable is not set, pandoc will look for the key in the
+document\[cq]s metadata, which can be set using either YAML metadata
+blocks or with the \f[C]-M/--metadata\f[R] option.
+In addition, some variables are given default values by pandoc.
+See Variables below for a list of variables used in pandoc\[cq]s default
+templates.
+.PP
+If you use custom templates, you may need to revise them as pandoc
+changes.
+We recommend tracking the changes in the default templates, and
+modifying your custom templates accordingly.
+An easy way to do this is to fork the pandoc-templates repository and
+merge in changes after each pandoc release.
+.SS Template syntax
+.SS Comments
+.PP
+Anything between the sequence \f[C]$--\f[R] and the end of the line will
+be treated as a comment and omitted from the output.
+.SS Delimiters
+.PP
+To mark variables and control structures in the template, either
+\f[C]$\f[R]\&...\f[C]$\f[R] or \f[C]${\f[R]\&...\f[C]}\f[R] may be used
+as delimiters.
+The styles may also be mixed in the same template, but the opening and
+closing delimiter must match in each case.
+The opening delimiter may be followed by one or more spaces or tabs,
+which will be ignored.
+The closing delimiter may be followed by one or more spaces or tabs,
+which will be ignored.
+.PP
+To include a literal \f[C]$\f[R] in the document, use \f[C]$$\f[R].
+.SS Interpolated variables
+.PP
+A slot for an interpolated variable is a variable name surrounded by
+matched delimiters.
+Variable names must begin with a letter and can contain letters,
+numbers, \f[C]_\f[R], \f[C]-\f[R], and \f[C].\f[R].
+The keywords \f[C]it\f[R], \f[C]if\f[R], \f[C]else\f[R],
+\f[C]endif\f[R], \f[C]for\f[R], \f[C]sep\f[R], and \f[C]endfor\f[R] may
+not be used as variable names.
+Examples:
+.IP
+.nf
+\f[C]
+$foo$
+$foo.bar.baz$
+$foo_bar.baz-bim$
+$ foo $
+${foo}
+${foo.bar.baz}
+${foo_bar.baz-bim}
+${ foo }
+\f[R]
+.fi
+.PP
+Variable names with periods are used to get at structured variable
+values.
+So, for example, \f[C]employee.salary\f[R] will return the value of the
+\f[C]salary\f[R] field of the object that is the value of the
+\f[C]employee\f[R] field.
+.IP \[bu] 2
+If the value of the variable is simple value, it will be rendered
+verbatim.
+(Note that no escaping is done; the assumption is that the calling
+program will escape the strings appropriately for the output format.)
+.IP \[bu] 2
+If the value is a list, the values will be concatenated.
+.IP \[bu] 2
+If the value is a map, the string \f[C]true\f[R] will be rendered.
+.IP \[bu] 2
+Every other value will be rendered as the empty string.
+.SS Conditionals
+.PP
+A conditional begins with \f[C]if(variable)\f[R] (enclosed in matched
+delimiters) and ends with \f[C]endif\f[R] (enclosed in matched
+delimiters).
+It may optionally contain an \f[C]else\f[R] (enclosed in matched
+delimiters).
+The \f[C]if\f[R] section is used if \f[C]variable\f[R] has a non-empty
+value, otherwise the \f[C]else\f[R] section is used (if present).
+Examples:
+.IP
+.nf
+\f[C]
+$if(foo)$bar$endif$
+
+$if(foo)$
+  $foo$
+$endif$
+
+$if(foo)$
+part one
+$else$
+part two
+$endif$
+
+${if(foo)}bar${endif}
+
+${if(foo)}
+  ${foo}
+${endif}
+
+${if(foo)}
+${ foo.bar }
+${else}
+no foo!
+${endif}
+\f[R]
+.fi
+.PP
+The keyword \f[C]elseif\f[R] may be used to simplify complex nested
+conditionals:
+.IP
+.nf
+\f[C]
+$if(foo)$
+XXX
+$elseif(bar)$
+YYY
+$else$
+ZZZ
+$endif$
+\f[R]
+.fi
+.SS For loops
+.PP
+A for loop begins with \f[C]for(variable)\f[R] (enclosed in matched
+delimiters) and ends with \f[C]endfor\f[R] (enclosed in matched
+delimiters.
+.IP \[bu] 2
+If \f[C]variable\f[R] is an array, the material inside the loop will be
+evaluated repeatedly, with \f[C]variable\f[R] being set to each value of
+the array in turn, and concatenated.
+.IP \[bu] 2
+If \f[C]variable\f[R] is a map, the material inside will be set to the
+map.
+.IP \[bu] 2
+If the value of the associated variable is not an array or a map, a
+single iteration will be performed on its value.
+.PP
+Examples:
+.IP
+.nf
+\f[C]
+$for(foo)$$foo$$sep$, $endfor$
+
+$for(foo)$
+  - $foo.last$, $foo.first$
+$endfor$
+
+${ for(foo.bar) }
+  - ${ foo.bar.last }, ${ foo.bar.first }
+${ endfor }
+
+$for(mymap)$
+$it.name$: $it.office$
+$endfor$
+\f[R]
+.fi
+.PP
+You may optionally specify a separator between consecutive values using
+\f[C]sep\f[R] (enclosed in matched delimiters).
+The material between \f[C]sep\f[R] and the \f[C]endfor\f[R] is the
+separator.
+.IP
+.nf
+\f[C]
+${ for(foo) }${ foo }${ sep }, ${ endfor }
+\f[R]
+.fi
+.PP
+Instead of using \f[C]variable\f[R] inside the loop, the special
+anaphoric keyword \f[C]it\f[R] may be used.
+.IP
+.nf
+\f[C]
+${ for(foo.bar) }
+  - ${ it.last }, ${ it.first }
+${ endfor }
+\f[R]
+.fi
+.SS Partials
+.PP
+Partials (subtemplates stored in different files) may be included by
+using the name of the partial, followed by \f[C]()\f[R], for example:
+.IP
+.nf
+\f[C]
+${ styles() }
+\f[R]
+.fi
+.PP
+Partials will be sought in the directory containing the main template.
+The file name will be assumed to have the same extension as the main
+template if it lacks an extension.
+When calling the partial, the full name including file extension can
+also be used:
+.IP
+.nf
+\f[C]
+${ styles.html() }
+\f[R]
+.fi
+.PP
+(If a partial is not found in the directory of the template, it will
+also be sought in the \f[C]templates\f[R] subdirectory of the user data
+directory.)
+.PP
+Partials may optionally be applied to variables using a colon:
+.IP
+.nf
+\f[C]
+${ date:fancy() }
+
+${ articles:bibentry() }
+\f[R]
+.fi
+.PP
+If \f[C]articles\f[R] is an array, this will iterate over its values,
+applying the partial \f[C]bibentry()\f[R] to each one.
+So the second example above is equivalent to
+.IP
+.nf
+\f[C]
+${ for(articles) }
+${ it:bibentry() }
+${ endfor }
+\f[R]
+.fi
+.PP
+Note that the anaphoric keyword \f[C]it\f[R] must be used when iterating
+over partials.
+In the above examples, the \f[C]bibentry\f[R] partial should contain
+\f[C]it.title\f[R] (and so on) instead of \f[C]articles.title\f[R].
+.PP
+Final newlines are omitted from included partials.
+.PP
+Partials may include other partials.
+.PP
+A separator between values of an array may be specified in square
+brackets, immediately after the variable name or partial:
+.IP
+.nf
+\f[C]
+${months[, ]}$
+
+${articles:bibentry()[; ]$
+\f[R]
+.fi
+.PP
+The separator in this case is literal and (unlike with \f[C]sep\f[R] in
+an explicit \f[C]for\f[R] loop) cannot contain interpolated variables or
+other template directives.
+.SS Nesting
+.PP
+To ensure that content is \[lq]nested,\[rq] that is, subsequent lines
+indented, use the \f[C]\[ha]\f[R] directive:
+.IP
+.nf
+\f[C]
+$item.number$  $\[ha]$$item.description$ ($item.price$)
+\f[R]
+.fi
+.PP
+In this example, if \f[C]item.description\f[R] has multiple lines, they
+will all be indented to line up with the first line:
+.IP
+.nf
+\f[C]
+00123  A fine bottle of 18-year old
+       Oban whiskey. ($148)
+\f[R]
+.fi
+.PP
+To nest multiple lines to the same level, align them with the
+\f[C]\[ha]\f[R] directive in the template.
+For example:
+.IP
+.nf
+\f[C]
+$item.number$  $\[ha]$$item.description$ ($item.price$)
+               (Available til $item.sellby$.)
+\f[R]
+.fi
+.PP
+will produce
+.IP
+.nf
+\f[C]
+00123  A fine bottle of 18-year old
+       Oban whiskey. ($148)
+       (Available til March 30, 2020.)
+\f[R]
+.fi
+.PP
+If a variable occurs by itself on a line, preceded by whitespace and not
+followed by further text or directives on the same line, and the
+variable\[cq]s value contains multiple lines, it will be nested
+automatically.
+.SS Breakable spaces
+.PP
+Normally, spaces in the template itself (as opposed to values of the
+interpolated variables) are not breakable, but they can be made
+breakable in part of the template by using the \f[C]\[ti]\f[R] keyword
+(ended with another \f[C]\[ti]\f[R]).
+.IP
+.nf
+\f[C]
+$\[ti]$This long line may break if the document is rendered
+with a short line length.$\[ti]$
+\f[R]
+.fi
+.SS Pipes
+.PP
+A pipe transforms the value of a variable or partial.
+Pipes are specified using a slash (\f[C]/\f[R]) between the variable
+name (or partial) and the pipe name.
+Example:
+.IP
+.nf
+\f[C]
+$for(name)$
+$name/uppercase$
+$endfor$
+
+$for(metadata/pairs)$
+- $it.key$: $it.value$
+$endfor$
+
+$employee:name()/uppercase$
+\f[R]
+.fi
+.PP
+Pipes may be chained:
+.IP
+.nf
+\f[C]
+$for(employees/pairs)$
+$it.key/alpha/uppercase$. $it.name$
+$endfor$
+\f[R]
+.fi
+.PP
+Some pipes take parameters:
+.IP
+.nf
+\f[C]
+|----------------------|------------|
+$for(employee)$
+$it.name.first/uppercase/left 20 \[dq]| \[dq]$$it.name.salary/right 10 \[dq] | \[dq] \[dq] |\[dq]$
+$endfor$
+|----------------------|------------|
+\f[R]
+.fi
+.PP
+Currently the following pipes are predefined:
+.IP \[bu] 2
+\f[C]pairs\f[R]: Converts a map or array to an array of maps, each with
+\f[C]key\f[R] and \f[C]value\f[R] fields.
+If the original value was an array, the \f[C]key\f[R] will be the array
+index, starting with 1.
+.IP \[bu] 2
+\f[C]uppercase\f[R]: Converts text to uppercase.
+.IP \[bu] 2
+\f[C]lowercase\f[R]: Converts text to lowercase.
+.IP \[bu] 2
+\f[C]length\f[R]: Returns the length of the value: number of characters
+for a textual value, number of elements for a map or array.
+.IP \[bu] 2
+\f[C]reverse\f[R]: Reverses a textual value or array, and has no effect
+on other values.
+.IP \[bu] 2
+\f[C]first\f[R]: Returns the first value of an array, if applied to a
+non-empty array; otherwise returns the original value.
+.IP \[bu] 2
+\f[C]last\f[R]: Returns the last value of an array, if applied to a
+non-empty array; otherwise returns the original value.
+.IP \[bu] 2
+\f[C]rest\f[R]: Returns all but the first value of an array, if applied
+to a non-empty array; otherwise returns the original value.
+.IP \[bu] 2
+\f[C]allbutlast\f[R]: Returns all but the last value of an array, if
+applied to a non-empty array; otherwise returns the original value.
+.IP \[bu] 2
+\f[C]chomp\f[R]: Removes trailing newlines (and breakable space).
+.IP \[bu] 2
+\f[C]nowrap\f[R]: Disables line wrapping on breakable spaces.
+.IP \[bu] 2
+\f[C]alpha\f[R]: Converts textual values that can be read as an integer
+into lowercase alphabetic characters \f[C]a..z\f[R] (mod 26).
+This can be used to get lettered enumeration from array indices.
+To get uppercase letters, chain with \f[C]uppercase\f[R].
+.IP \[bu] 2
+\f[C]roman\f[R]: Converts textual values that can be read as an integer
+into lowercase roman numerials.
+This can be used to get lettered enumeration from array indices.
+To get uppercase roman, chain with \f[C]uppercase\f[R].
+.IP \[bu] 2
+\f[C]left n \[dq]leftborder\[dq] \[dq]rightborder\[dq]\f[R]: Renders a
+textual value in a block of width \f[C]n\f[R], aligned to the left, with
+an optional left and right border.
+Has no effect on other values.
+This can be used to align material in tables.
+Widths are positive integers indicating the number of characters.
+Borders are strings inside double quotes; literal \f[C]\[dq]\f[R] and
+\f[C]\[rs]\f[R] characters must be backslash-escaped.
+.IP \[bu] 2
+\f[C]right n \[dq]leftborder\[dq] \[dq]rightborder\[dq]\f[R]: Renders a
+textual value in a block of width \f[C]n\f[R], aligned to the right, and
+has no effect on other values.
+.IP \[bu] 2
+\f[C]center n \[dq]leftborder\[dq] \[dq]rightborder\[dq]\f[R]: Renders a
+textual value in a block of width \f[C]n\f[R], aligned to the center,
+and has no effect on other values.
+.SS Variables
+.SS Metadata variables
+.TP
+\f[B]\f[CB]title\f[B]\f[R], \f[B]\f[CB]author\f[B]\f[R], \f[B]\f[CB]date\f[B]\f[R]
+allow identification of basic aspects of the document.
+Included in PDF metadata through LaTeX and ConTeXt.
+These can be set through a pandoc title block, which allows for multiple
+authors, or through a YAML metadata block:
+.RS
+.IP
+.nf
+\f[C]
+---
+author:
+- Aristotle
+- Peter Abelard
+\&...
+\f[R]
+.fi
+.PP
+Note that if you just want to set PDF or HTML metadata, without
+including a title block in the document itself, you can set the
+\f[C]title-meta\f[R], \f[C]author-meta\f[R], and \f[C]date-meta\f[R]
+variables.
+(By default these are set automatically, based on \f[C]title\f[R],
+\f[C]author\f[R], and \f[C]date\f[R].)
+.RE
+.TP
+\f[B]\f[CB]subtitle\f[B]\f[R]
+document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and docx
+documents
+.TP
+\f[B]\f[CB]abstract\f[B]\f[R]
+document summary, included in LaTeX, ConTeXt, AsciiDoc, and docx
+documents
+.TP
+\f[B]\f[CB]keywords\f[B]\f[R]
+list of keywords to be included in HTML, PDF, ODT, pptx, docx and
+AsciiDoc metadata; repeat as for \f[C]author\f[R], above
+.TP
+\f[B]\f[CB]subject\f[B]\f[R]
+document subject, included in ODT, PDF, docx and pptx metadata
+.TP
+\f[B]\f[CB]description\f[B]\f[R]
+document description, included in ODT, docx and pptx metadata.
+Some applications show this as \f[C]Comments\f[R] metadata.
+.TP
+\f[B]\f[CB]category\f[B]\f[R]
+document category, included in docx and pptx metadata
+.PP
+Additionally, any root-level string metadata, not included in ODT, docx
+or pptx metadata is added as a \f[I]custom property\f[R].
+The following YAML metadata block for instance:
+.IP
+.nf
+\f[C]
+---
+title:  \[aq]This is the title\[aq]
+subtitle: \[dq]This is the subtitle\[dq]
+author:
+- Author One
+- Author Two
+description: |
+    This is a long
+    description.
+
+    It consists of two paragraphs
+\&...
+\f[R]
+.fi
+.PP
+will include \f[C]title\f[R], \f[C]author\f[R] and \f[C]description\f[R]
+as standard document properties and \f[C]subtitle\f[R] as a custom
+property when converting to docx, ODT or pptx.
+.SS Language variables
+.TP
+\f[B]\f[CB]lang\f[B]\f[R]
+identifies the main language of the document using IETF language tags
+(following the BCP 47 standard), such as \f[C]en\f[R] or
+\f[C]en-GB\f[R].
+The Language subtag lookup tool can look up or verify these tags.
+This affects most formats, and controls hyphenation in PDF output when
+using LaTeX (through \f[C]babel\f[R] and \f[C]polyglossia\f[R]) or
+ConTeXt.
+.RS
+.PP
+Use native pandoc Divs and Spans with the \f[C]lang\f[R] attribute to
+switch the language:
+.IP
+.nf
+\f[C]
+---
+lang: en-GB
+\&...
+
+Text in the main document language (British English).
+
+::: {lang=fr-CA}
+> Cette citation est \['e]crite en fran\[,c]ais canadien.
+:::
+
+More text in English. [\[aq]Zitat auf Deutsch.\[aq]]{lang=de}
+\f[R]
+.fi
+.RE
+.TP
+\f[B]\f[CB]dir\f[B]\f[R]
+the base script direction, either \f[C]rtl\f[R] (right-to-left) or
+\f[C]ltr\f[R] (left-to-right).
+.RS
+.PP
+For bidirectional documents, native pandoc \f[C]span\f[R]s and
+\f[C]div\f[R]s with the \f[C]dir\f[R] attribute (value \f[C]rtl\f[R] or
+\f[C]ltr\f[R]) can be used to override the base direction in some output
+formats.
+This may not always be necessary if the final renderer (e.g.\ the
+browser, when generating HTML) supports the Unicode Bidirectional
+Algorithm.
+.PP
+When using LaTeX for bidirectional documents, only the \f[C]xelatex\f[R]
+engine is fully supported (use \f[C]--pdf-engine=xelatex\f[R]).
+.RE
+.SS Variables for HTML
+.TP
+\f[B]\f[CB]document-css\f[B]\f[R]
+Enables inclusion of most of the CSS in the \f[C]styles.html\f[R]
+partial (have a look with
+\f[C]pandoc --print-default-data-file=templates/styles.html\f[R]).
+Unless you use \f[C]--css\f[R], this variable is set to \f[C]true\f[R]
+by default.
+You can disable it with e.g.\ \f[C]pandoc -M document-css=false\f[R].
+.TP
+\f[B]\f[CB]mainfont\f[B]\f[R]
+sets the CSS \f[C]font-family\f[R] property on the \f[C]html\f[R]
+element.
+.TP
+\f[B]\f[CB]fontsize\f[B]\f[R]
+sets the base CSS \f[C]font-size\f[R], which you\[cq]d usually set to
+e.g.\ \f[C]20px\f[R], but it also accepts \f[C]pt\f[R] (12pt = 16px in
+most browsers).
+.TP
+\f[B]\f[CB]fontcolor\f[B]\f[R]
+sets the CSS \f[C]color\f[R] property on the \f[C]html\f[R] element.
+.TP
+\f[B]\f[CB]linkcolor\f[B]\f[R]
+sets the CSS \f[C]color\f[R] property on all links.
+.TP
+\f[B]\f[CB]monofont\f[B]\f[R]
+sets the CSS \f[C]font-family\f[R] property on \f[C]code\f[R] elements.
+.TP
+\f[B]\f[CB]linestretch\f[B]\f[R]
+sets the CSS \f[C]line-height\f[R] property on the \f[C]html\f[R]
+element, which is preferred to be unitless.
+.TP
+\f[B]\f[CB]backgroundcolor\f[B]\f[R]
+sets the CSS \f[C]background-color\f[R] property on the \f[C]html\f[R]
+element.
+.TP
+\f[B]\f[CB]margin-left\f[B]\f[R], \f[B]\f[CB]margin-right\f[B]\f[R], \f[B]\f[CB]margin-top\f[B]\f[R], \f[B]\f[CB]margin-bottom\f[B]\f[R]
+sets the corresponding CSS \f[C]padding\f[R] properties on the
+\f[C]body\f[R] element.
+.SS Variables for HTML math
+.TP
+\f[B]\f[CB]classoption\f[B]\f[R]
+when using KaTeX, you can render display math equations flush left using
+YAML metadata or with \f[C]-M classoption=fleqn\f[R].
+.SS Variables for HTML slides
+.PP
+These affect HTML output when [producing slide shows with pandoc].
+.PP
+All reveal.js configuration options are available as variables.
+To turn off boolean flags that default to true in reveal.js, use
+\f[C]0\f[R].
+.TP
+\f[B]\f[CB]revealjs-url\f[B]\f[R]
+base URL for reveal.js documents (defaults to
+\f[C]https://unpkg.com/reveal.js\[at]\[ha]4/\f[R])
+.TP
+\f[B]\f[CB]s5-url\f[B]\f[R]
+base URL for S5 documents (defaults to \f[C]s5/default\f[R])
+.TP
+\f[B]\f[CB]slidy-url\f[B]\f[R]
+base URL for Slidy documents (defaults to
+\f[C]https://www.w3.org/Talks/Tools/Slidy2\f[R])
+.TP
+\f[B]\f[CB]slideous-url\f[B]\f[R]
+base URL for Slideous documents (defaults to \f[C]slideous\f[R])
+.TP
+\f[B]\f[CB]title-slide-attributes\f[B]\f[R]
+additional attributes for the title slide of reveal.js slide shows.
+See background in reveal.js and beamer for an example.
+.SS Variables for Beamer slides
+.PP
+These variables change the appearance of PDF slides using
+\f[C]beamer\f[R].
+.TP
+\f[B]\f[CB]aspectratio\f[B]\f[R]
+slide aspect ratio (\f[C]43\f[R] for 4:3 [default], \f[C]169\f[R] for
+16:9, \f[C]1610\f[R] for 16:10, \f[C]149\f[R] for 14:9, \f[C]141\f[R]
+for 1.41:1, \f[C]54\f[R] for 5:4, \f[C]32\f[R] for 3:2)
+.TP
+\f[B]\f[CB]beamerarticle\f[B]\f[R]
+produce an article from Beamer slides
+.TP
+\f[B]\f[CB]beameroption\f[B]\f[R]
+add extra beamer option with \f[C]\[rs]setbeameroption{}\f[R]
+.TP
+\f[B]\f[CB]institute\f[B]\f[R]
+author affiliations: can be a list when there are multiple authors
+.TP
+\f[B]\f[CB]logo\f[B]\f[R]
+logo image for slides
+.TP
+\f[B]\f[CB]navigation\f[B]\f[R]
+controls navigation symbols (default is \f[C]empty\f[R] for no
+navigation symbols; other valid values are \f[C]frame\f[R],
+\f[C]vertical\f[R], and \f[C]horizontal\f[R])
+.TP
+\f[B]\f[CB]section-titles\f[B]\f[R]
+enables \[lq]title pages\[rq] for new sections (default is true)
+.TP
+\f[B]\f[CB]theme\f[B]\f[R], \f[B]\f[CB]colortheme\f[B]\f[R], \f[B]\f[CB]fonttheme\f[B]\f[R], \f[B]\f[CB]innertheme\f[B]\f[R], \f[B]\f[CB]outertheme\f[B]\f[R]
+beamer themes
+.TP
+\f[B]\f[CB]themeoptions\f[B]\f[R]
+options for LaTeX beamer themes (a list).
+.TP
+\f[B]\f[CB]titlegraphic\f[B]\f[R]
+image for title slide
+.SS Variables for PowerPoint
+.PP
+These variables control the visual aspects of a slide show that are not
+easily controlled via templates.
+.TP
+\f[B]\f[CB]monofont\f[B]\f[R]
+font to use for code.
+.SS Variables for LaTeX
+.PP
+Pandoc uses these variables when creating a PDF with a LaTeX engine.
+.SS Layout
+.TP
+\f[B]\f[CB]block-headings\f[B]\f[R]
+make \f[C]\[rs]paragraph\f[R] and \f[C]\[rs]subparagraph\f[R] (fourth-
+and fifth-level headings, or fifth- and sixth-level with book classes)
+free-standing rather than run-in; requires further formatting to
+distinguish from \f[C]\[rs]subsubsection\f[R] (third- or fourth-level
+headings).
+Instead of using this option, KOMA-Script can adjust headings more
+extensively:
+.RS
+.IP
+.nf
+\f[C]
+---
+documentclass: scrartcl
+header-includes: |
+  \[rs]RedeclareSectionCommand[
+    beforeskip=-10pt plus -2pt minus -1pt,
+    afterskip=1sp plus -1sp minus 1sp,
+    font=\[rs]normalfont\[rs]itshape]{paragraph}
+  \[rs]RedeclareSectionCommand[
+    beforeskip=-10pt plus -2pt minus -1pt,
+    afterskip=1sp plus -1sp minus 1sp,
+    font=\[rs]normalfont\[rs]scshape,
+    indent=0pt]{subparagraph}
+\&...
+\f[R]
+.fi
+.RE
+.TP
+\f[B]\f[CB]classoption\f[B]\f[R]
+option for document class, e.g.\ \f[C]oneside\f[R]; repeat for multiple
+options:
+.RS
+.IP
+.nf
+\f[C]
+---
+classoption:
+- twocolumn
+- landscape
+\&...
+\f[R]
+.fi
+.RE
+.TP
+\f[B]\f[CB]documentclass\f[B]\f[R]
+document class: usually one of the standard classes, \f[C]article\f[R],
+\f[C]book\f[R], and \f[C]report\f[R]; the KOMA-Script equivalents,
+\f[C]scrartcl\f[R], \f[C]scrbook\f[R], and \f[C]scrreprt\f[R], which
+default to smaller margins; or \f[C]memoir\f[R]
+.TP
+\f[B]\f[CB]geometry\f[B]\f[R]
+option for \f[C]geometry\f[R] package, e.g.\ \f[C]margin=1in\f[R];
+repeat for multiple options:
+.RS
+.IP
+.nf
+\f[C]
+---
+geometry:
+- top=30mm
+- left=20mm
+- heightrounded
+\&...
+\f[R]
+.fi
+.RE
+.TP
+\f[B]\f[CB]hyperrefoptions\f[B]\f[R]
+option for \f[C]hyperref\f[R] package, e.g.\ \f[C]linktoc=all\f[R];
+repeat for multiple options:
+.RS
+.IP
+.nf
+\f[C]
+---
+hyperrefoptions:
+- linktoc=all
+- pdfwindowui
+- pdfpagemode=FullScreen
+\&...
+\f[R]
+.fi
+.RE
+.TP
+\f[B]\f[CB]indent\f[B]\f[R]
+uses document class settings for indentation (the default LaTeX template
+otherwise removes indentation and adds space between paragraphs)
+.TP
+\f[B]\f[CB]linestretch\f[B]\f[R]
+adjusts line spacing using the \f[C]setspace\f[R] package,
+e.g.\ \f[C]1.25\f[R], \f[C]1.5\f[R]
+.TP
+\f[B]\f[CB]margin-left\f[B]\f[R], \f[B]\f[CB]margin-right\f[B]\f[R], \f[B]\f[CB]margin-top\f[B]\f[R], \f[B]\f[CB]margin-bottom\f[B]\f[R]
+sets margins if \f[C]geometry\f[R] is not used (otherwise
+\f[C]geometry\f[R] overrides these)
+.TP
+\f[B]\f[CB]pagestyle\f[B]\f[R]
+control \f[C]\[rs]pagestyle{}\f[R]: the default article class supports
+\f[C]plain\f[R] (default), \f[C]empty\f[R] (no running heads or page
+numbers), and \f[C]headings\f[R] (section titles in running heads)
+.TP
+\f[B]\f[CB]papersize\f[B]\f[R]
+paper size, e.g.\ \f[C]letter\f[R], \f[C]a4\f[R]
+.TP
+\f[B]\f[CB]secnumdepth\f[B]\f[R]
+numbering depth for sections (with \f[C]--number-sections\f[R] option or
+\f[C]numbersections\f[R] variable)
+.SS Fonts
+.TP
+\f[B]\f[CB]fontenc\f[B]\f[R]
+allows font encoding to be specified through \f[C]fontenc\f[R] package
+(with \f[C]pdflatex\f[R]); default is \f[C]T1\f[R] (see LaTeX font
+encodings guide)
+.TP
+\f[B]\f[CB]fontfamily\f[B]\f[R]
+font package for use with \f[C]pdflatex\f[R]: TeX Live includes many
+options, documented in the LaTeX Font Catalogue.
+The default is Latin Modern.
+.TP
+\f[B]\f[CB]fontfamilyoptions\f[B]\f[R]
+options for package used as \f[C]fontfamily\f[R]; repeat for multiple
+options.
+For example, to use the Libertine font with proportional lowercase
+(old-style) figures through the \f[C]libertinus\f[R] package:
+.RS
+.IP
+.nf
+\f[C]
+---
+fontfamily: libertinus
+fontfamilyoptions:
+- osf
+- p
+\&...
+\f[R]
+.fi
+.RE
+.TP
+\f[B]\f[CB]fontsize\f[B]\f[R]
+font size for body text.
+The standard classes allow 10pt, 11pt, and 12pt.
+To use another size, set \f[C]documentclass\f[R] to one of the
+KOMA-Script classes, such as \f[C]scrartcl\f[R] or \f[C]scrbook\f[R].
+.TP
+\f[B]\f[CB]mainfont\f[B]\f[R], \f[B]\f[CB]sansfont\f[B]\f[R], \f[B]\f[CB]monofont\f[B]\f[R], \f[B]\f[CB]mathfont\f[B]\f[R], \f[B]\f[CB]CJKmainfont\f[B]\f[R]
+font families for use with \f[C]xelatex\f[R] or \f[C]lualatex\f[R]: take
+the name of any system font, using the \f[C]fontspec\f[R] package.
+\f[C]CJKmainfont\f[R] uses the \f[C]xecjk\f[R] package.
+.TP
+\f[B]\f[CB]mainfontoptions\f[B]\f[R], \f[B]\f[CB]sansfontoptions\f[B]\f[R], \f[B]\f[CB]monofontoptions\f[B]\f[R], \f[B]\f[CB]mathfontoptions\f[B]\f[R], \f[B]\f[CB]CJKoptions\f[B]\f[R]
+options to use with \f[C]mainfont\f[R], \f[C]sansfont\f[R],
+\f[C]monofont\f[R], \f[C]mathfont\f[R], \f[C]CJKmainfont\f[R] in
+\f[C]xelatex\f[R] and \f[C]lualatex\f[R].
+Allow for any choices available through \f[C]fontspec\f[R]; repeat for
+multiple options.
+For example, to use the TeX Gyre version of Palatino with lowercase
+figures:
+.RS
+.IP
+.nf
+\f[C]
+---
+mainfont: TeX Gyre Pagella
+mainfontoptions:
+- Numbers=Lowercase
+- Numbers=Proportional
+\&...
+\f[R]
+.fi
+.RE
+.TP
+\f[B]\f[CB]microtypeoptions\f[B]\f[R]
+options to pass to the microtype package
+.SS Links
+.TP
+\f[B]\f[CB]colorlinks\f[B]\f[R]
+add color to link text; automatically enabled if any of
+\f[C]linkcolor\f[R], \f[C]filecolor\f[R], \f[C]citecolor\f[R],
+\f[C]urlcolor\f[R], or \f[C]toccolor\f[R] are set
+.TP
+\f[B]\f[CB]linkcolor\f[B]\f[R], \f[B]\f[CB]filecolor\f[B]\f[R], \f[B]\f[CB]citecolor\f[B]\f[R], \f[B]\f[CB]urlcolor\f[B]\f[R], \f[B]\f[CB]toccolor\f[B]\f[R]
+color for internal links, external links, citation links, linked URLs,
+and links in table of contents, respectively: uses options allowed by
+\f[C]xcolor\f[R], including the \f[C]dvipsnames\f[R],
+\f[C]svgnames\f[R], and \f[C]x11names\f[R] lists
+.TP
+\f[B]\f[CB]links-as-notes\f[B]\f[R]
+causes links to be printed as footnotes
+.SS Front matter
+.TP
+\f[B]\f[CB]lof\f[B]\f[R], \f[B]\f[CB]lot\f[B]\f[R]
+include list of figures, list of tables
+.TP
+\f[B]\f[CB]thanks\f[B]\f[R]
+contents of acknowledgments footnote after document title
+.TP
+\f[B]\f[CB]toc\f[B]\f[R]
+include table of contents (can also be set using
+\f[C]--toc/--table-of-contents\f[R])
+.TP
+\f[B]\f[CB]toc-depth\f[B]\f[R]
+level of section to include in table of contents
+.SS BibLaTeX Bibliographies
+.PP
+These variables function when using BibLaTeX for citation rendering.
+.TP
+\f[B]\f[CB]biblatexoptions\f[B]\f[R]
+list of options for biblatex
+.TP
+\f[B]\f[CB]biblio-style\f[B]\f[R]
+bibliography style, when used with \f[C]--natbib\f[R] and
+\f[C]--biblatex\f[R].
+.TP
+\f[B]\f[CB]biblio-title\f[B]\f[R]
+bibliography title, when used with \f[C]--natbib\f[R] and
+\f[C]--biblatex\f[R].
+.TP
+\f[B]\f[CB]bibliography\f[B]\f[R]
+bibliography to use for resolving references
+.TP
+\f[B]\f[CB]natbiboptions\f[B]\f[R]
+list of options for natbib
+.SS Variables for ConTeXt
+.PP
+Pandoc uses these variables when creating a PDF with ConTeXt.
+.TP
+\f[B]\f[CB]fontsize\f[B]\f[R]
+font size for body text (e.g.\ \f[C]10pt\f[R], \f[C]12pt\f[R])
+.TP
+\f[B]\f[CB]headertext\f[B]\f[R], \f[B]\f[CB]footertext\f[B]\f[R]
+text to be placed in running header or footer (see ConTeXt Headers and
+Footers); repeat up to four times for different placement
+.TP
+\f[B]\f[CB]indenting\f[B]\f[R]
+controls indentation of paragraphs, e.g.\ \f[C]yes,small,next\f[R] (see
+ConTeXt Indentation); repeat for multiple options
+.TP
+\f[B]\f[CB]interlinespace\f[B]\f[R]
+adjusts line spacing, e.g.\ \f[C]4ex\f[R] (using
+\f[C]setupinterlinespace\f[R]); repeat for multiple options
+.TP
+\f[B]\f[CB]layout\f[B]\f[R]
+options for page margins and text arrangement (see ConTeXt Layout);
+repeat for multiple options
+.TP
+\f[B]\f[CB]linkcolor\f[B]\f[R], \f[B]\f[CB]contrastcolor\f[B]\f[R]
+color for links outside and inside a page, e.g.\ \f[C]red\f[R],
+\f[C]blue\f[R] (see ConTeXt Color)
+.TP
+\f[B]\f[CB]linkstyle\f[B]\f[R]
+typeface style for links, e.g.\ \f[C]normal\f[R], \f[C]bold\f[R],
+\f[C]slanted\f[R], \f[C]boldslanted\f[R], \f[C]type\f[R], \f[C]cap\f[R],
+\f[C]small\f[R]
+.TP
+\f[B]\f[CB]lof\f[B]\f[R], \f[B]\f[CB]lot\f[B]\f[R]
+include list of figures, list of tables
+.TP
+\f[B]\f[CB]mainfont\f[B]\f[R], \f[B]\f[CB]sansfont\f[B]\f[R], \f[B]\f[CB]monofont\f[B]\f[R], \f[B]\f[CB]mathfont\f[B]\f[R]
+font families: take the name of any system font (see ConTeXt Font
+Switching)
+.TP
+\f[B]\f[CB]margin-left\f[B]\f[R], \f[B]\f[CB]margin-right\f[B]\f[R], \f[B]\f[CB]margin-top\f[B]\f[R], \f[B]\f[CB]margin-bottom\f[B]\f[R]
+sets margins, if \f[C]layout\f[R] is not used (otherwise
+\f[C]layout\f[R] overrides these)
+.TP
+\f[B]\f[CB]pagenumbering\f[B]\f[R]
+page number style and location (using \f[C]setuppagenumbering\f[R]);
+repeat for multiple options
+.TP
+\f[B]\f[CB]papersize\f[B]\f[R]
+paper size, e.g.\ \f[C]letter\f[R], \f[C]A4\f[R], \f[C]landscape\f[R]
+(see ConTeXt Paper Setup); repeat for multiple options
+.TP
+\f[B]\f[CB]pdfa\f[B]\f[R]
+adds to the preamble the setup necessary to generate PDF/A of the type
+specified, e.g.\ \f[C]1a:2005\f[R], \f[C]2a\f[R].
+If no type is specified (i.e.\ the value is set to True, by
+e.g.\ \f[C]--metadata=pdfa\f[R] or \f[C]pdfa: true\f[R] in a YAML
+metadata block), \f[C]1b:2005\f[R] will be used as default, for reasons
+of backwards compatibility.
+Using \f[C]--variable=pdfa\f[R] without specified value is not
+supported.
+To successfully generate PDF/A the required ICC color profiles have to
+be available and the content and all included files (such as images)
+have to be standard conforming.
+The ICC profiles and output intent may be specified using the variables
+\f[C]pdfaiccprofile\f[R] and \f[C]pdfaintent\f[R].
+See also ConTeXt PDFA for more details.
+.TP
+\f[B]\f[CB]pdfaiccprofile\f[B]\f[R]
+when used in conjunction with \f[C]pdfa\f[R], specifies the ICC profile
+to use in the PDF, e.g.\ \f[C]default.cmyk\f[R].
+If left unspecified, \f[C]sRGB.icc\f[R] is used as default.
+May be repeated to include multiple profiles.
+Note that the profiles have to be available on the system.
+They can be obtained from ConTeXt ICC Profiles.
+.TP
+\f[B]\f[CB]pdfaintent\f[B]\f[R]
+when used in conjunction with \f[C]pdfa\f[R], specifies the output
+intent for the colors,
+e.g.\ \f[C]ISO coated v2 300\[rs]letterpercent\[rs]space (ECI)\f[R] If
+left unspecified, \f[C]sRGB IEC61966-2.1\f[R] is used as default.
+.TP
+\f[B]\f[CB]toc\f[B]\f[R]
+include table of contents (can also be set using
+\f[C]--toc/--table-of-contents\f[R])
+.TP
+\f[B]\f[CB]whitespace\f[B]\f[R]
+spacing between paragraphs, e.g.\ \f[C]none\f[R], \f[C]small\f[R] (using
+\f[C]setupwhitespace\f[R])
+.TP
+\f[B]\f[CB]includesource\f[B]\f[R]
+include all source documents as file attachments in the PDF file
+.SS Variables for \f[C]wkhtmltopdf\f[R]
+.PP
+Pandoc uses these variables when creating a PDF with
+\f[C]wkhtmltopdf\f[R].
+The \f[C]--css\f[R] option also affects the output.
+.TP
+\f[B]\f[CB]footer-html\f[B]\f[R], \f[B]\f[CB]header-html\f[B]\f[R]
+add information to the header and footer
+.TP
+\f[B]\f[CB]margin-left\f[B]\f[R], \f[B]\f[CB]margin-right\f[B]\f[R], \f[B]\f[CB]margin-top\f[B]\f[R], \f[B]\f[CB]margin-bottom\f[B]\f[R]
+set the page margins
+.TP
+\f[B]\f[CB]papersize\f[B]\f[R]
+sets the PDF paper size
+.SS Variables for man pages
+.TP
+\f[B]\f[CB]adjusting\f[B]\f[R]
+adjusts text to left (\f[C]l\f[R]), right (\f[C]r\f[R]), center
+(\f[C]c\f[R]), or both (\f[C]b\f[R]) margins
+.TP
+\f[B]\f[CB]footer\f[B]\f[R]
+footer in man pages
+.TP
+\f[B]\f[CB]header\f[B]\f[R]
+header in man pages
+.TP
+\f[B]\f[CB]hyphenate\f[B]\f[R]
+if \f[C]true\f[R] (the default), hyphenation will be used
+.TP
+\f[B]\f[CB]section\f[B]\f[R]
+section number in man pages
+.SS Variables for ms
+.TP
+\f[B]\f[CB]fontfamily\f[B]\f[R]
+font family (e.g.\ \f[C]T\f[R] or \f[C]P\f[R])
+.TP
+\f[B]\f[CB]indent\f[B]\f[R]
+paragraph indent (e.g.\ \f[C]2m\f[R])
+.TP
+\f[B]\f[CB]lineheight\f[B]\f[R]
+line height (e.g.\ \f[C]12p\f[R])
+.TP
+\f[B]\f[CB]pointsize\f[B]\f[R]
+point size (e.g.\ \f[C]10p\f[R])
+.SS Variables set automatically
+.PP
+Pandoc sets these variables automatically in response to options or
+document contents; users can also modify them.
+These vary depending on the output format, and include the following:
+.TP
+\f[B]\f[CB]body\f[B]\f[R]
+body of document
+.TP
+\f[B]\f[CB]date-meta\f[B]\f[R]
+the \f[C]date\f[R] variable converted to ISO 8601 YYYY-MM-DD, included
+in all HTML based formats (dzslides, epub, html, html4, html5, revealjs,
+s5, slideous, slidy).
+The recognized formats for \f[C]date\f[R] are: \f[C]mm/dd/yyyy\f[R],
+\f[C]mm/dd/yy\f[R], \f[C]yyyy-mm-dd\f[R] (ISO 8601),
+\f[C]dd MM yyyy\f[R] (e.g.\ either \f[C]02 Apr 2018\f[R] or
+\f[C]02 April 2018\f[R]), \f[C]MM dd, yyyy\f[R]
+(e.g.\ \f[C]Apr. 02, 2018\f[R] or
+\f[C]April 02, 2018),\f[R]yyyy[mm[dd]]]\f[C](e.g.\f[R]20180402,
+\f[C]201804\f[R] or \f[C]2018\f[R]).
+.TP
+\f[B]\f[CB]header-includes\f[B]\f[R]
+contents specified by \f[C]-H/--include-in-header\f[R] (may have
+multiple values)
+.TP
+\f[B]\f[CB]include-before\f[B]\f[R]
+contents specified by \f[C]-B/--include-before-body\f[R] (may have
+multiple values)
+.TP
+\f[B]\f[CB]include-after\f[B]\f[R]
+contents specified by \f[C]-A/--include-after-body\f[R] (may have
+multiple values)
+.TP
+\f[B]\f[CB]meta-json\f[B]\f[R]
+JSON representation of all of the document\[cq]s metadata.
+Field values are transformed to the selected output format.
+.TP
+\f[B]\f[CB]numbersections\f[B]\f[R]
+non-null value if \f[C]-N/--number-sections\f[R] was specified
+.TP
+\f[B]\f[CB]sourcefile\f[B]\f[R], \f[B]\f[CB]outputfile\f[B]\f[R]
+source and destination filenames, as given on the command line.
+\f[C]sourcefile\f[R] can also be a list if input comes from multiple
+files, or empty if input is from stdin.
+You can use the following snippet in your template to distinguish them:
+.RS
+.IP
+.nf
+\f[C]
+$if(sourcefile)$
+$for(sourcefile)$
+$sourcefile$
+$endfor$
+$else$
+(stdin)
+$endif$
+\f[R]
+.fi
+.PP
+Similarly, \f[C]outputfile\f[R] can be \f[C]-\f[R] if output goes to the
+terminal.
+.PP
+If you need absolute paths, use e.g.\ \f[C]$curdir$/$sourcefile$\f[R].
+.RE
+.TP
+\f[B]\f[CB]curdir\f[B]\f[R]
+working directory from which pandoc is run.
+.TP
+\f[B]\f[CB]toc\f[B]\f[R]
+non-null value if \f[C]--toc/--table-of-contents\f[R] was specified
+.TP
+\f[B]\f[CB]toc-title\f[B]\f[R]
+title of table of contents (works only with EPUB, HTML, opendocument,
+odt, docx, pptx, beamer, LaTeX)
+.SH EXTENSIONS
+.PP
+The behavior of some of the readers and writers can be adjusted by
+enabling or disabling various extensions.
+.PP
+An extension can be enabled by adding \f[C]+EXTENSION\f[R] to the format
+name and disabled by adding \f[C]-EXTENSION\f[R].
+For example, \f[C]--from markdown_strict+footnotes\f[R] is strict
+Markdown with footnotes enabled, while
+\f[C]--from markdown-footnotes-pipe_tables\f[R] is pandoc\[cq]s Markdown
+without footnotes or pipe tables.
+.PP
+The markdown reader and writer make by far the most use of extensions.
+Extensions only used by them are therefore covered in the section
+Pandoc\[cq]s Markdown below (See Markdown variants for
+\f[C]commonmark\f[R] and \f[C]gfm\f[R].) In the following, extensions
+that also work for other formats are covered.
+.PP
+Note that markdown extensions added to the \f[C]ipynb\f[R] format affect
+Markdown cells in Jupyter notebooks (as do command-line options like
+\f[C]--atx-headers\f[R]).
+.SS Typography
+.SS Extension: \f[C]smart\f[R]
+.PP
+Interpret straight quotes as curly quotes, \f[C]---\f[R] as em-dashes,
+\f[C]--\f[R] as en-dashes, and \f[C]...\f[R] as ellipses.
+Nonbreaking spaces are inserted after certain abbreviations, such as
+\[lq]Mr.\[rq]
+.PP
+This extension can be enabled/disabled for the following formats:
+.TP
+input formats
+\f[C]markdown\f[R], \f[C]commonmark\f[R], \f[C]latex\f[R],
+\f[C]mediawiki\f[R], \f[C]org\f[R], \f[C]rst\f[R], \f[C]twiki\f[R]
+.TP
+output formats
+\f[C]markdown\f[R], \f[C]latex\f[R], \f[C]context\f[R], \f[C]rst\f[R]
+.TP
+enabled by default in
+\f[C]markdown\f[R], \f[C]latex\f[R], \f[C]context\f[R] (both input and
+output)
+.PP
+Note: If you are \f[I]writing\f[R] Markdown, then the \f[C]smart\f[R]
+extension has the reverse effect: what would have been curly quotes
+comes out straight.
+.PP
+In LaTeX, \f[C]smart\f[R] means to use the standard TeX ligatures for
+quotation marks (\f[C]\[ga]\[ga]\f[R] and \f[C]\[aq]\[aq]\f[R] for
+double quotes, \f[C]\[ga]\f[R] and \f[C]\[aq]\f[R] for single quotes)
+and dashes (\f[C]--\f[R] for en-dash and \f[C]---\f[R] for em-dash).
+If \f[C]smart\f[R] is disabled, then in reading LaTeX pandoc will parse
+these characters literally.
+In writing LaTeX, enabling \f[C]smart\f[R] tells pandoc to use the
+ligatures when possible; if \f[C]smart\f[R] is disabled pandoc will use
+unicode quotation mark and dash characters.
+.SS Headings and sections
+.SS Extension: \f[C]auto_identifiers\f[R]
+.PP
+A heading without an explicitly specified identifier will be
+automatically assigned a unique identifier based on the heading text.
+.PP
+This extension can be enabled/disabled for the following formats:
+.TP
+input formats
+\f[C]markdown\f[R], \f[C]latex\f[R], \f[C]rst\f[R], \f[C]mediawiki\f[R],
+\f[C]textile\f[R]
+.TP
+output formats
+\f[C]markdown\f[R], \f[C]muse\f[R]
+.TP
+enabled by default in
+\f[C]markdown\f[R], \f[C]muse\f[R]
+.PP
+The default algorithm used to derive the identifier from the heading
+text is:
+.IP \[bu] 2
+Remove all formatting, links, etc.
+.IP \[bu] 2
+Remove all footnotes.
+.IP \[bu] 2
+Remove all non-alphanumeric characters, except underscores, hyphens, and
+periods.
+.IP \[bu] 2
+Replace all spaces and newlines with hyphens.
+.IP \[bu] 2
+Convert all alphabetic characters to lowercase.
+.IP \[bu] 2
+Remove everything up to the first letter (identifiers may not begin with
+a number or punctuation mark).
+.IP \[bu] 2
+If nothing is left after this, use the identifier \f[C]section\f[R].
+.PP
+Thus, for example,
+.PP
+.TS
+tab(@);
+l l.
+T{
+Heading
+T}@T{
+Identifier
+T}
+_
+T{
+\f[C]Heading identifiers in HTML\f[R]
+T}@T{
+\f[C]heading-identifiers-in-html\f[R]
+T}
+T{
+\f[C]Ma\[^i]tre d\[aq]h\[^o]tel\f[R]
+T}@T{
+\f[C]ma\[^i]tre-dh\[^o]tel\f[R]
+T}
+T{
+\f[C]*Dogs*?--in *my* house?\f[R]
+T}@T{
+\f[C]dogs--in-my-house\f[R]
+T}
+T{
+\f[C][HTML], [S5], or [RTF]?\f[R]
+T}@T{
+\f[C]html-s5-or-rtf\f[R]
+T}
+T{
+\f[C]3. Applications\f[R]
+T}@T{
+\f[C]applications\f[R]
+T}
+T{
+\f[C]33\f[R]
+T}@T{
+\f[C]section\f[R]
+T}
+.TE
+.PP
+These rules should, in most cases, allow one to determine the identifier
+from the heading text.
+The exception is when several headings have the same text; in this case,
+the first will get an identifier as described above; the second will get
+the same identifier with \f[C]-1\f[R] appended; the third with
+\f[C]-2\f[R]; and so on.
+.PP
+(However, a different algorithm is used if
+\f[C]gfm_auto_identifiers\f[R] is enabled; see below.)
+.PP
+These identifiers are used to provide link targets in the table of
+contents generated by the \f[C]--toc|--table-of-contents\f[R] option.
+They also make it easy to provide links from one section of a document
+to another.
+A link to this section, for example, might look like this:
+.IP
+.nf
+\f[C]
+See the section on
+[heading identifiers](#heading-identifiers-in-html-latex-and-context).
+\f[R]
+.fi
+.PP
+Note, however, that this method of providing links to sections works
+only in HTML, LaTeX, and ConTeXt formats.
+.PP
+If the \f[C]--section-divs\f[R] option is specified, then each section
+will be wrapped in a \f[C]section\f[R] (or a \f[C]div\f[R], if
+\f[C]html4\f[R] was specified), and the identifier will be attached to
+the enclosing \f[C]<section>\f[R] (or \f[C]<div>\f[R]) tag rather than
+the heading itself.
+This allows entire sections to be manipulated using JavaScript or
+treated differently in CSS.
+.SS Extension: \f[C]ascii_identifiers\f[R]
+.PP
+Causes the identifiers produced by \f[C]auto_identifiers\f[R] to be pure
+ASCII.
+Accents are stripped off of accented Latin letters, and non-Latin
+letters are omitted.
+.SS Extension: \f[C]gfm_auto_identifiers\f[R]
+.PP
+Changes the algorithm used by \f[C]auto_identifiers\f[R] to conform to
+GitHub\[cq]s method.
+Spaces are converted to dashes (\f[C]-\f[R]), uppercase characters to
+lowercase characters, and punctuation characters other than \f[C]-\f[R]
+and \f[C]_\f[R] are removed.
+Emojis are replaced by their names.
+.SS Math Input
+.PP
+The extensions \f[C]tex_math_dollars\f[R],
+\f[C]tex_math_single_backslash\f[R], and
+\f[C]tex_math_double_backslash\f[R] are described in the section about
+Pandoc\[cq]s Markdown.
+.PP
+However, they can also be used with HTML input.
+This is handy for reading web pages formatted using MathJax, for
+example.
+.SS Raw HTML/TeX
+.PP
+The following extensions are described in more detail in their
+respective sections of Pandoc\[cq]s Markdown:
+.IP \[bu] 2
+\f[C]raw_html\f[R] allows HTML elements which are not representable in
+pandoc\[cq]s AST to be parsed as raw HTML.
+By default, this is disabled for HTML input.
+.IP \[bu] 2
+\f[C]raw_tex\f[R] allows raw LaTeX, TeX, and ConTeXt to be included in a
+document.
+This extension can be enabled/disabled for the following formats (in
+addition to \f[C]markdown\f[R]):
+.RS 2
+.TP
+input formats
+\f[C]latex\f[R], \f[C]org\f[R], \f[C]textile\f[R], \f[C]html\f[R]
+(environments, \f[C]\[rs]ref\f[R], and \f[C]\[rs]eqref\f[R] only),
+\f[C]ipynb\f[R]
+.TP
+output formats
+\f[C]textile\f[R], \f[C]commonmark\f[R]
+.PP
+Note: as applied to \f[C]ipynb\f[R], \f[C]raw_html\f[R] and
+\f[C]raw_tex\f[R] affect not only raw TeX in markdown cells, but data
+with mime type \f[C]text/html\f[R] in output cells.
+Since the \f[C]ipynb\f[R] reader attempts to preserve the richest
+possible outputs when several options are given, you will get best
+results if you disable \f[C]raw_html\f[R] and \f[C]raw_tex\f[R] when
+converting to formats like \f[C]docx\f[R] which don\[cq]t allow raw
+\f[C]html\f[R] or \f[C]tex\f[R].
+.RE
+.IP \[bu] 2
+\f[C]native_divs\f[R] causes HTML \f[C]div\f[R] elements to be parsed as
+native pandoc Div blocks.
+If you want them to be parsed as raw HTML, use
+\f[C]-f html-native_divs+raw_html\f[R].
+.IP \[bu] 2
+\f[C]native_spans\f[R] causes HTML \f[C]span\f[R] elements to be parsed
+as native pandoc Span inlines.
+If you want them to be parsed as raw HTML, use
+\f[C]-f html-native_spans+raw_html\f[R].
+If you want to drop all \f[C]div\f[R]s and \f[C]span\f[R]s when
+converting HTML to Markdown, you can use
+\f[C]pandoc -f html-native_divs-native_spans -t markdown\f[R].
+.SS Literate Haskell support
+.SS Extension: \f[C]literate_haskell\f[R]
+.PP
+Treat the document as literate Haskell source.
+.PP
+This extension can be enabled/disabled for the following formats:
+.TP
+input formats
+\f[C]markdown\f[R], \f[C]rst\f[R], \f[C]latex\f[R]
+.TP
+output formats
+\f[C]markdown\f[R], \f[C]rst\f[R], \f[C]latex\f[R], \f[C]html\f[R]
+.PP
+If you append \f[C]+lhs\f[R] (or \f[C]+literate_haskell\f[R]) to one of
+the formats above, pandoc will treat the document as literate Haskell
+source.
+This means that
+.IP \[bu] 2
+In Markdown input, \[lq]bird track\[rq] sections will be parsed as
+Haskell code rather than block quotations.
+Text between \f[C]\[rs]begin{code}\f[R] and \f[C]\[rs]end{code}\f[R]
+will also be treated as Haskell code.
+For ATX-style headings the character `=' will be used instead of `#'.
+.IP \[bu] 2
+In Markdown output, code blocks with classes \f[C]haskell\f[R] and
+\f[C]literate\f[R] will be rendered using bird tracks, and block
+quotations will be indented one space, so they will not be treated as
+Haskell code.
+In addition, headings will be rendered setext-style (with underlines)
+rather than ATX-style (with `#' characters).
+(This is because ghc treats `#' characters in column 1 as introducing
+line numbers.)
+.IP \[bu] 2
+In restructured text input, \[lq]bird track\[rq] sections will be parsed
+as Haskell code.
+.IP \[bu] 2
+In restructured text output, code blocks with class \f[C]haskell\f[R]
+will be rendered using bird tracks.
+.IP \[bu] 2
+In LaTeX input, text in \f[C]code\f[R] environments will be parsed as
+Haskell code.
+.IP \[bu] 2
+In LaTeX output, code blocks with class \f[C]haskell\f[R] will be
+rendered inside \f[C]code\f[R] environments.
+.IP \[bu] 2
+In HTML output, code blocks with class \f[C]haskell\f[R] will be
+rendered with class \f[C]literatehaskell\f[R] and bird tracks.
+.PP
+Examples:
+.IP
+.nf
+\f[C]
+pandoc -f markdown+lhs -t html
+\f[R]
+.fi
+.PP
+reads literate Haskell source formatted with Markdown conventions and
+writes ordinary HTML (without bird tracks).
+.IP
+.nf
+\f[C]
+pandoc -f markdown+lhs -t html+lhs
+\f[R]
+.fi
+.PP
+writes HTML with the Haskell code in bird tracks, so it can be copied
+and pasted as literate Haskell source.
+.PP
+Note that GHC expects the bird tracks in the first column, so indented
+literate code blocks (e.g.\ inside an itemized environment) will not be
+picked up by the Haskell compiler.
+.SS Other extensions
+.SS Extension: \f[C]empty_paragraphs\f[R]
+.PP
+Allows empty paragraphs.
+By default empty paragraphs are omitted.
+.PP
+This extension can be enabled/disabled for the following formats:
+.TP
+input formats
+\f[C]docx\f[R], \f[C]html\f[R]
+.TP
+output formats
+\f[C]docx\f[R], \f[C]odt\f[R], \f[C]opendocument\f[R], \f[C]html\f[R]
+.SS Extension: \f[C]native_numbering\f[R]
+.PP
+Enables native numbering of figures and tables.
+Enumeration starts at 1.
+.PP
+This extension can be enabled/disabled for the following formats:
+.TP
+output formats
+\f[C]odt\f[R], \f[C]opendocument\f[R]
+.SS Extension: \f[C]styles\f[R]
+.PP
+When converting from docx, read all docx styles as divs (for paragraph
+styles) and spans (for character styles) regardless of whether pandoc
+understands the meaning of these styles.
+This can be used with docx custom styles.
+Disabled by default.
+.TP
+input formats
+\f[C]docx\f[R]
+.SS Extension: \f[C]amuse\f[R]
+.PP
+In the \f[C]muse\f[R] input format, this enables Text::Amuse extensions
+to Emacs Muse markup.
+.SS Extension: \f[C]raw_markdown\f[R]
+.PP
+In the \f[C]ipynb\f[R] input format, this causes Markdown cells to be
+included as raw Markdown blocks (allowing lossless round-tripping)
+rather than being parsed.
+Use this only when you are targetting \f[C]ipynb\f[R] or a
+markdown-based output format.
+.SS Extension: \f[C]citations\f[R]
+.PP
+Some aspects of Pandoc\[cq]s Markdown citation syntax are also accepted
+in \f[C]org\f[R] input.
+.SS Extension: \f[C]ntb\f[R]
+.PP
+In the \f[C]context\f[R] output format this enables the use of Natural
+Tables (TABLE) instead of the default Extreme Tables (xtables).
+Natural tables allow more fine-grained global customization but come at
+a performance penalty compared to extreme tables.
+.SH PANDOC\[cq]S MARKDOWN
+.PP
+Pandoc understands an extended and slightly revised version of John
+Gruber\[cq]s Markdown syntax.
+This document explains the syntax, noting differences from standard
+Markdown.
+Except where noted, these differences can be suppressed by using the
+\f[C]markdown_strict\f[R] format instead of \f[C]markdown\f[R].
+Extensions can be enabled or disabled to specify the behavior more
+granularly.
+They are described in the following.
+See also Extensions above, for extensions that work also on other
+formats.
+.SS Philosophy
+.PP
+Markdown is designed to be easy to write, and, even more importantly,
+easy to read:
+.RS
+.PP
+A Markdown-formatted document should be publishable as-is, as plain
+text, without looking like it\[cq]s been marked up with tags or
+formatting instructions.
+\[en] John Gruber
+.RE
+.PP
+This principle has guided pandoc\[cq]s decisions in finding syntax for
+tables, footnotes, and other extensions.
+.PP
+There is, however, one respect in which pandoc\[cq]s aims are different
+from the original aims of Markdown.
+Whereas Markdown was originally designed with HTML generation in mind,
+pandoc is designed for multiple output formats.
+Thus, while pandoc allows the embedding of raw HTML, it discourages it,
+and provides other, non-HTMLish ways of representing important document
+elements like definition lists, tables, mathematics, and footnotes.
+.SS Paragraphs
+.PP
+A paragraph is one or more lines of text followed by one or more blank
+lines.
+Newlines are treated as spaces, so you can reflow your paragraphs as you
+like.
+If you need a hard line break, put two or more spaces at the end of a
+line.
+.SS Extension: \f[C]escaped_line_breaks\f[R]
+.PP
+A backslash followed by a newline is also a hard line break.
+Note: in multiline and grid table cells, this is the only way to create
+a hard line break, since trailing spaces in the cells are ignored.
+.SS Headings
+.PP
+There are two kinds of headings: Setext and ATX.
+.SS Setext-style headings
+.PP
+A setext-style heading is a line of text \[lq]underlined\[rq] with a row
+of \f[C]=\f[R] signs (for a level-one heading) or \f[C]-\f[R] signs (for
+a level-two heading):
+.IP
+.nf
+\f[C]
+A level-one heading
+===================
+
+A level-two heading
+-------------------
+\f[R]
+.fi
+.PP
+The heading text can contain inline formatting, such as emphasis (see
+Inline formatting, below).
+.SS ATX-style headings
+.PP
+An ATX-style heading consists of one to six \f[C]#\f[R] signs and a line
+of text, optionally followed by any number of \f[C]#\f[R] signs.
+The number of \f[C]#\f[R] signs at the beginning of the line is the
+heading level:
+.IP
+.nf
+\f[C]
+## A level-two heading
+
+### A level-three heading ###
+\f[R]
+.fi
+.PP
+As with setext-style headings, the heading text can contain formatting:
+.IP
+.nf
+\f[C]
+# A level-one heading with a [link](/url) and *emphasis*
+\f[R]
+.fi
+.SS Extension: \f[C]blank_before_header\f[R]
+.PP
+Standard Markdown syntax does not require a blank line before a heading.
+Pandoc does require this (except, of course, at the beginning of the
+document).
+The reason for the requirement is that it is all too easy for a
+\f[C]#\f[R] to end up at the beginning of a line by accident (perhaps
+through line wrapping).
+Consider, for example:
+.IP
+.nf
+\f[C]
+I like several of their flavors of ice cream:
+#22, for example, and #5.
+\f[R]
+.fi
+.SS Extension: \f[C]space_in_atx_header\f[R]
+.PP
+Many Markdown implementations do not require a space between the opening
+\f[C]#\f[R]s of an ATX heading and the heading text, so that
+\f[C]#5 bolt\f[R] and \f[C]#hashtag\f[R] count as headings.
+With this extension, pandoc does require the space.
+.SS Heading identifiers
+.PP
+See also the \f[C]auto_identifiers\f[R] extension above.
+.SS Extension: \f[C]header_attributes\f[R]
+.PP
+Headings can be assigned attributes using this syntax at the end of the
+line containing the heading text:
+.IP
+.nf
+\f[C]
+{#identifier .class .class key=value key=value}
+\f[R]
+.fi
+.PP
+Thus, for example, the following headings will all be assigned the
+identifier \f[C]foo\f[R]:
+.IP
+.nf
+\f[C]
+# My heading {#foo}
+
+## My heading ##    {#foo}
+
+My other heading   {#foo}
+---------------
+\f[R]
+.fi
+.PP
+(This syntax is compatible with PHP Markdown Extra.)
+.PP
+Note that although this syntax allows assignment of classes and
+key/value attributes, writers generally don\[cq]t use all of this
+information.
+Identifiers, classes, and key/value attributes are used in HTML and
+HTML-based formats such as EPUB and slidy.
+Identifiers are used for labels and link anchors in the LaTeX, ConTeXt,
+Textile, Jira markup, and AsciiDoc writers.
+.PP
+Headings with the class \f[C]unnumbered\f[R] will not be numbered, even
+if \f[C]--number-sections\f[R] is specified.
+A single hyphen (\f[C]-\f[R]) in an attribute context is equivalent to
+\f[C].unnumbered\f[R], and preferable in non-English documents.
+So,
+.IP
+.nf
+\f[C]
+# My heading {-}
+\f[R]
+.fi
+.PP
+is just the same as
+.IP
+.nf
+\f[C]
+# My heading {.unnumbered}
+\f[R]
+.fi
+.PP
+If the \f[C]unlisted\f[R] class is present in addition to
+\f[C]unnumbered\f[R], the heading will not be included in a table of
+contents.
+(Currently this feature is only implemented for certain formats: those
+based on LaTeX and HTML, PowerPoint, and RTF.)
+.SS Extension: \f[C]implicit_header_references\f[R]
+.PP
+Pandoc behaves as if reference links have been defined for each heading.
+So, to link to a heading
+.IP
+.nf
+\f[C]
+# Heading identifiers in HTML
+\f[R]
+.fi
+.PP
+you can simply write
+.IP
+.nf
+\f[C]
+[Heading identifiers in HTML]
+\f[R]
+.fi
+.PP
+or
+.IP
+.nf
+\f[C]
+[Heading identifiers in HTML][]
+\f[R]
+.fi
+.PP
+or
+.IP
+.nf
+\f[C]
+[the section on heading identifiers][heading identifiers in
+HTML]
+\f[R]
+.fi
+.PP
+instead of giving the identifier explicitly:
+.IP
+.nf
+\f[C]
+[Heading identifiers in HTML](#heading-identifiers-in-html)
+\f[R]
+.fi
+.PP
+If there are multiple headings with identical text, the corresponding
+reference will link to the first one only, and you will need to use
+explicit links to link to the others, as described above.
+.PP
+Like regular reference links, these references are case-insensitive.
+.PP
+Explicit link reference definitions always take priority over implicit
+heading references.
+So, in the following example, the link will point to \f[C]bar\f[R], not
+to \f[C]#foo\f[R]:
+.IP
+.nf
+\f[C]
+# Foo
+
+[foo]: bar
+
+See [foo]
+\f[R]
+.fi
+.SS Block quotations
+.PP
+Markdown uses email conventions for quoting blocks of text.
+A block quotation is one or more paragraphs or other block elements
+(such as lists or headings), with each line preceded by a \f[C]>\f[R]
+character and an optional space.
+(The \f[C]>\f[R] need not start at the left margin, but it should not be
+indented more than three spaces.)
+.IP
+.nf
+\f[C]
+> This is a block quote. This
+> paragraph has two lines.
+>
+> 1. This is a list inside a block quote.
+> 2. Second item.
+\f[R]
+.fi
+.PP
+A \[lq]lazy\[rq] form, which requires the \f[C]>\f[R] character only on
+the first line of each block, is also allowed:
+.IP
+.nf
+\f[C]
+> This is a block quote. This
+paragraph has two lines.
+
+> 1. This is a list inside a block quote.
+2. Second item.
+\f[R]
+.fi
+.PP
+Among the block elements that can be contained in a block quote are
+other block quotes.
+That is, block quotes can be nested:
+.IP
+.nf
+\f[C]
+> This is a block quote.
+>
+> > A block quote within a block quote.
+\f[R]
+.fi
+.PP
+If the \f[C]>\f[R] character is followed by an optional space, that
+space will be considered part of the block quote marker and not part of
+the indentation of the contents.
+Thus, to put an indented code block in a block quote, you need five
+spaces after the \f[C]>\f[R]:
+.IP
+.nf
+\f[C]
+>     code
+\f[R]
+.fi
+.SS Extension: \f[C]blank_before_blockquote\f[R]
+.PP
+Standard Markdown syntax does not require a blank line before a block
+quote.
+Pandoc does require this (except, of course, at the beginning of the
+document).
+The reason for the requirement is that it is all too easy for a
+\f[C]>\f[R] to end up at the beginning of a line by accident (perhaps
+through line wrapping).
+So, unless the \f[C]markdown_strict\f[R] format is used, the following
+does not produce a nested block quote in pandoc:
+.IP
+.nf
+\f[C]
+> This is a block quote.
+>> Nested.
+\f[R]
+.fi
+.SS Verbatim (code) blocks
+.SS Indented code blocks
+.PP
+A block of text indented four spaces (or one tab) is treated as verbatim
+text: that is, special characters do not trigger special formatting, and
+all spaces and line breaks are preserved.
+For example,
+.IP
+.nf
+\f[C]
+    if (a > 3) {
+      moveShip(5 * gravity, DOWN);
+    }
+\f[R]
+.fi
+.PP
+The initial (four space or one tab) indentation is not considered part
+of the verbatim text, and is removed in the output.
+.PP
+Note: blank lines in the verbatim text need not begin with four spaces.
+.SS Fenced code blocks
+.SS Extension: \f[C]fenced_code_blocks\f[R]
+.PP
+In addition to standard indented code blocks, pandoc supports
+\f[I]fenced\f[R] code blocks.
+These begin with a row of three or more tildes (\f[C]\[ti]\f[R]) and end
+with a row of tildes that must be at least as long as the starting row.
+Everything between these lines is treated as code.
+No indentation is necessary:
+.IP
+.nf
+\f[C]
+\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
+if (a > 3) {
+  moveShip(5 * gravity, DOWN);
+}
+\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
+\f[R]
+.fi
+.PP
+Like regular code blocks, fenced code blocks must be separated from
+surrounding text by blank lines.
+.PP
+If the code itself contains a row of tildes or backticks, just use a
+longer row of tildes or backticks at the start and end:
+.IP
+.nf
+\f[C]
+\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
+\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
+code including tildes
+\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
+\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
+\f[R]
+.fi
+.SS Extension: \f[C]backtick_code_blocks\f[R]
+.PP
+Same as \f[C]fenced_code_blocks\f[R], but uses backticks
+(\f[C]\[ga]\f[R]) instead of tildes (\f[C]\[ti]\f[R]).
+.SS Extension: \f[C]fenced_code_attributes\f[R]
+.PP
+Optionally, you may attach attributes to fenced or backtick code block
+using this syntax:
+.IP
+.nf
+\f[C]
+\[ti]\[ti]\[ti]\[ti] {#mycode .haskell .numberLines startFrom=\[dq]100\[dq]}
+qsort []     = []
+qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++
+               qsort (filter (>= x) xs)
+\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]\[ti]
+\f[R]
+.fi
+.PP
+Here \f[C]mycode\f[R] is an identifier, \f[C]haskell\f[R] and
+\f[C]numberLines\f[R] are classes, and \f[C]startFrom\f[R] is an
+attribute with value \f[C]100\f[R].
+Some output formats can use this information to do syntax highlighting.
+Currently, the only output formats that uses this information are HTML,
+LaTeX, Docx, Ms, and PowerPoint.
+If highlighting is supported for your output format and language, then
+the code block above will appear highlighted, with numbered lines.
+(To see which languages are supported, type
+\f[C]pandoc --list-highlight-languages\f[R].) Otherwise, the code block
+above will appear as follows:
+.IP
+.nf
+\f[C]
+<pre id=\[dq]mycode\[dq] class=\[dq]haskell numberLines\[dq] startFrom=\[dq]100\[dq]>
+  <code>
+  ...
+  </code>
+</pre>
+\f[R]
+.fi
+.PP
+The \f[C]numberLines\f[R] (or \f[C]number-lines\f[R]) class will cause
+the lines of the code block to be numbered, starting with \f[C]1\f[R] or
+the value of the \f[C]startFrom\f[R] attribute.
+The \f[C]lineAnchors\f[R] (or \f[C]line-anchors\f[R]) class will cause
+the lines to be clickable anchors in HTML output.
+.PP
+A shortcut form can also be used for specifying the language of the code
+block:
+.IP
+.nf
+\f[C]
+\[ga]\[ga]\[ga]haskell
+qsort [] = []
+\[ga]\[ga]\[ga]
+\f[R]
+.fi
+.PP
+This is equivalent to:
+.IP
+.nf
+\f[C]
+\[ga]\[ga]\[ga] {.haskell}
+qsort [] = []
+\[ga]\[ga]\[ga]
+\f[R]
+.fi
+.PP
+If the \f[C]fenced_code_attributes\f[R] extension is disabled, but input
+contains class attribute(s) for the code block, the first class
+attribute will be printed after the opening fence as a bare word.
+.PP
+To prevent all highlighting, use the \f[C]--no-highlight\f[R] flag.
+To set the highlighting style, use \f[C]--highlight-style\f[R].
+For more information on highlighting, see Syntax highlighting, below.
+.SS Line blocks
+.SS Extension: \f[C]line_blocks\f[R]
+.PP
+A line block is a sequence of lines beginning with a vertical bar
+(\f[C]|\f[R]) followed by a space.
+The division into lines will be preserved in the output, as will any
+leading spaces; otherwise, the lines will be formatted as Markdown.
+This is useful for verse and addresses:
+.IP
+.nf
+\f[C]
+| The limerick packs laughs anatomical
+| In space that is quite economical.
+|    But the good ones I\[aq]ve seen
+|    So seldom are clean
+| And the clean ones so seldom are comical
+
+| 200 Main St.
+| Berkeley, CA 94718
+\f[R]
+.fi
+.PP
+The lines can be hard-wrapped if needed, but the continuation line must
+begin with a space.
+.IP
+.nf
+\f[C]
+| The Right Honorable Most Venerable and Righteous Samuel L.
+  Constable, Jr.
+| 200 Main St.
+| Berkeley, CA 94718
+\f[R]
+.fi
+.PP
+This syntax is borrowed from reStructuredText.
+.SS Lists
+.SS Bullet lists
+.PP
+A bullet list is a list of bulleted list items.
+A bulleted list item begins with a bullet (\f[C]*\f[R], \f[C]+\f[R], or
+\f[C]-\f[R]).
+Here is a simple example:
+.IP
+.nf
+\f[C]
+* one
+* two
+* three
+\f[R]
+.fi
+.PP
+This will produce a \[lq]compact\[rq] list.
+If you want a \[lq]loose\[rq] list, in which each item is formatted as a
+paragraph, put spaces between the items:
+.IP
+.nf
+\f[C]
+* one
+
+* two
+
+* three
+\f[R]
+.fi
+.PP
+The bullets need not be flush with the left margin; they may be indented
+one, two, or three spaces.
+The bullet must be followed by whitespace.
+.PP
+List items look best if subsequent lines are flush with the first line
+(after the bullet):
+.IP
+.nf
+\f[C]
+* here is my first
+  list item.
+* and my second.
+\f[R]
+.fi
+.PP
+But Markdown also allows a \[lq]lazy\[rq] format:
+.IP
+.nf
+\f[C]
+* here is my first
+list item.
+* and my second.
+\f[R]
+.fi
+.SS Block content in list items
+.PP
+A list item may contain multiple paragraphs and other block-level
+content.
+However, subsequent paragraphs must be preceded by a blank line and
+indented to line up with the first non-space content after the list
+marker.
+.IP
+.nf
+\f[C]
+  * First paragraph.
+
+    Continued.
+
+  * Second paragraph. With a code block, which must be indented
+    eight spaces:
+
+        { code }
+\f[R]
+.fi
+.PP
+Exception: if the list marker is followed by an indented code block,
+which must begin 5 spaces after the list marker, then subsequent
+paragraphs must begin two columns after the last character of the list
+marker:
+.IP
+.nf
+\f[C]
+*     code
+
+  continuation paragraph
+\f[R]
+.fi
+.PP
+List items may include other lists.
+In this case the preceding blank line is optional.
+The nested list must be indented to line up with the first non-space
+character after the list marker of the containing list item.
+.IP
+.nf
+\f[C]
+* fruits
+  + apples
+    - macintosh
+    - red delicious
+  + pears
+  + peaches
+* vegetables
+  + broccoli
+  + chard
+\f[R]
+.fi
+.PP
+As noted above, Markdown allows you to write list items
+\[lq]lazily,\[rq] instead of indenting continuation lines.
+However, if there are multiple paragraphs or other blocks in a list
+item, the first line of each must be indented.
+.IP
+.nf
+\f[C]
++ A lazy, lazy, list
+item.
+
++ Another one; this looks
+bad but is legal.
+
+    Second paragraph of second
+list item.
+\f[R]
+.fi
+.SS Ordered lists
+.PP
+Ordered lists work just like bulleted lists, except that the items begin
+with enumerators rather than bullets.
+.PP
+In standard Markdown, enumerators are decimal numbers followed by a
+period and a space.
+The numbers themselves are ignored, so there is no difference between
+this list:
+.IP
+.nf
+\f[C]
+1.  one
+2.  two
+3.  three
+\f[R]
+.fi
+.PP
+and this one:
+.IP
+.nf
+\f[C]
+5.  one
+7.  two
+1.  three
+\f[R]
+.fi
+.SS Extension: \f[C]fancy_lists\f[R]
+.PP
+Unlike standard Markdown, pandoc allows ordered list items to be marked
+with uppercase and lowercase letters and roman numerals, in addition to
+Arabic numerals.
+List markers may be enclosed in parentheses or followed by a single
+right-parentheses or period.
+They must be separated from the text that follows by at least one space,
+and, if the list marker is a capital letter with a period, by at least
+two spaces.
+.PP
+The \f[C]fancy_lists\f[R] extension also allows `\f[C]#\f[R]' to be used
+as an ordered list marker in place of a numeral:
+.IP
+.nf
+\f[C]
+#. one
+#. two
+\f[R]
+.fi
+.SS Extension: \f[C]startnum\f[R]
+.PP
+Pandoc also pays attention to the type of list marker used, and to the
+starting number, and both of these are preserved where possible in the
+output format.
+Thus, the following yields a list with numbers followed by a single
+parenthesis, starting with 9, and a sublist with lowercase roman
+numerals:
+.IP
+.nf
+\f[C]
+ 9)  Ninth
+10)  Tenth
+11)  Eleventh
+       i. subone
+      ii. subtwo
+     iii. subthree
+\f[R]
+.fi
+.PP
+Pandoc will start a new list each time a different type of list marker
+is used.
+So, the following will create three lists:
+.IP
+.nf
+\f[C]
+(2) Two
+(5) Three
+1.  Four
+*   Five
+\f[R]
+.fi
+.PP
+If default list markers are desired, use \f[C]#.\f[R]:
+.IP
+.nf
+\f[C]
+#.  one
+#.  two
+#.  three
+\f[R]
+.fi
+.SS Extension: \f[C]task_lists\f[R]
+.PP
+Pandoc supports task lists, using the syntax of GitHub-Flavored
+Markdown.
+.IP
+.nf
+\f[C]
+- [ ] an unchecked task list item
+- [x] checked item
+\f[R]
+.fi
+.SS Definition lists
+.SS Extension: \f[C]definition_lists\f[R]
+.PP
+Pandoc supports definition lists, using the syntax of PHP Markdown Extra
+with some extensions.
+.IP
+.nf
+\f[C]
+Term 1
+
+:   Definition 1
+
+Term 2 with *inline markup*
+
+:   Definition 2
+
+        { some code, part of Definition 2 }
+
+    Third paragraph of definition 2.
+\f[R]
+.fi
+.PP
+Each term must fit on one line, which may optionally be followed by a
+blank line, and must be followed by one or more definitions.
+A definition begins with a colon or tilde, which may be indented one or
+two spaces.
+.PP
+A term may have multiple definitions, and each definition may consist of
+one or more block elements (paragraph, code block, list, etc.), each
+indented four spaces or one tab stop.
+The body of the definition (including the first line, aside from the
+colon or tilde) should be indented four spaces.
+However, as with other Markdown lists, you can \[lq]lazily\[rq] omit
+indentation except at the beginning of a paragraph or other block
+element:
+.IP
+.nf
+\f[C]
+Term 1
+
+:   Definition
+with lazy continuation.
+
+    Second paragraph of the definition.
+\f[R]
+.fi
+.PP
+If you leave space before the definition (as in the example above), the
+text of the definition will be treated as a paragraph.
+In some output formats, this will mean greater spacing between
+term/definition pairs.
+For a more compact definition list, omit the space before the
+definition:
+.IP
+.nf
+\f[C]
+Term 1
+  \[ti] Definition 1
+
+Term 2
+  \[ti] Definition 2a
+  \[ti] Definition 2b
+\f[R]
+.fi
+.PP
+Note that space between items in a definition list is required.
+(A variant that loosens this requirement, but disallows \[lq]lazy\[rq]
+hard wrapping, can be activated with \f[C]compact_definition_lists\f[R]:
+see Non-pandoc extensions, below.)
+.SS Numbered example lists
+.SS Extension: \f[C]example_lists\f[R]
+.PP
+The special list marker \f[C]\[at]\f[R] can be used for sequentially
+numbered examples.
+The first list item with a \f[C]\[at]\f[R] marker will be numbered `1',
+the next `2', and so on, throughout the document.
+The numbered examples need not occur in a single list; each new list
+using \f[C]\[at]\f[R] will take up where the last stopped.
+So, for example:
+.IP
+.nf
+\f[C]
+(\[at])  My first example will be numbered (1).
+(\[at])  My second example will be numbered (2).
+
+Explanation of examples.
+
+(\[at])  My third example will be numbered (3).
+\f[R]
+.fi
+.PP
+Numbered examples can be labeled and referred to elsewhere in the
+document:
+.IP
+.nf
+\f[C]
+(\[at]good)  This is a good example.
+
+As (\[at]good) illustrates, ...
+\f[R]
+.fi
+.PP
+The label can be any string of alphanumeric characters, underscores, or
+hyphens.
+.PP
+Note: continuation paragraphs in example lists must always be indented
+four spaces, regardless of the length of the list marker.
+That is, example lists always behave as if the \f[C]four_space_rule\f[R]
+extension is set.
+This is because example labels tend to be long, and indenting content to
+the first non-space character after the label would be awkward.
+.SS Ending a list
+.PP
+What if you want to put an indented code block after a list?
+.IP
+.nf
+\f[C]
+-   item one
+-   item two
+
+    { my code block }
+\f[R]
+.fi
+.PP
+Trouble! Here pandoc (like other Markdown implementations) will treat
+\f[C]{ my code block }\f[R] as the second paragraph of item two, and not
+as a code block.
+.PP
+To \[lq]cut off\[rq] the list after item two, you can insert some
+non-indented content, like an HTML comment, which won\[cq]t produce
+visible output in any format:
+.IP
+.nf
+\f[C]
+-   item one
+-   item two
+
+<!-- end of list -->
+
+    { my code block }
+\f[R]
+.fi
+.PP
+You can use the same trick if you want two consecutive lists instead of
+one big list:
+.IP
+.nf
+\f[C]
+1.  one
+2.  two
+3.  three
+
+<!-- -->
+
+1.  uno
+2.  dos
+3.  tres
+\f[R]
+.fi
+.SS Horizontal rules
+.PP
+A line containing a row of three or more \f[C]*\f[R], \f[C]-\f[R], or
+\f[C]_\f[R] characters (optionally separated by spaces) produces a
+horizontal rule:
+.IP
+.nf
+\f[C]
+*  *  *  *
+
+---------------
+\f[R]
+.fi
+.SS Tables
+.PP
+Four kinds of tables may be used.
+The first three kinds presuppose the use of a fixed-width font, such as
+Courier.
+The fourth kind can be used with proportionally spaced fonts, as it does
+not require lining up columns.
+.SS Extension: \f[C]table_captions\f[R]
+.PP
+A caption may optionally be provided with all 4 kinds of tables (as
+illustrated in the examples below).
+A caption is a paragraph beginning with the string \f[C]Table:\f[R] (or
+just \f[C]:\f[R]), which will be stripped off.
+It may appear either before or after the table.
+.SS Extension: \f[C]simple_tables\f[R]
+.PP
+Simple tables look like this:
+.IP
+.nf
+\f[C]
+  Right     Left     Center     Default
+-------     ------ ----------   -------
+     12     12        12            12
+    123     123       123          123
+      1     1          1             1
+
+Table:  Demonstration of simple table syntax.
+\f[R]
+.fi
+.PP
+The header and table rows must each fit on one line.
+Column alignments are determined by the position of the header text
+relative to the dashed line below it:
+.IP \[bu] 2
+If the dashed line is flush with the header text on the right side but
+extends beyond it on the left, the column is right-aligned.
+.IP \[bu] 2
+If the dashed line is flush with the header text on the left side but
+extends beyond it on the right, the column is left-aligned.
+.IP \[bu] 2
+If the dashed line extends beyond the header text on both sides, the
+column is centered.
+.IP \[bu] 2
+If the dashed line is flush with the header text on both sides, the
+default alignment is used (in most cases, this will be left).
+.PP
+The table must end with a blank line, or a line of dashes followed by a
+blank line.
+.PP
+The column header row may be omitted, provided a dashed line is used to
+end the table.
+For example:
+.IP
+.nf
+\f[C]
+-------     ------ ----------   -------
+     12     12        12             12
+    123     123       123           123
+      1     1          1              1
+-------     ------ ----------   -------
+\f[R]
+.fi
+.PP
+When the header row is omitted, column alignments are determined on the
+basis of the first line of the table body.
+So, in the tables above, the columns would be right, left, center, and
+right aligned, respectively.
+.SS Extension: \f[C]multiline_tables\f[R]
+.PP
+Multiline tables allow header and table rows to span multiple lines of
+text (but cells that span multiple columns or rows of the table are not
+supported).
+Here is an example:
+.IP
+.nf
+\f[C]
+-------------------------------------------------------------
+ Centered   Default           Right Left
+  Header    Aligned         Aligned Aligned
+----------- ------- --------------- -------------------------
+   First    row                12.0 Example of a row that
+                                    spans multiple lines.
+
+  Second    row                 5.0 Here\[aq]s another one. Note
+                                    the blank line between
+                                    rows.
+-------------------------------------------------------------
+
+Table: Here\[aq]s the caption. It, too, may span
+multiple lines.
+\f[R]
+.fi
+.PP
+These work like simple tables, but with the following differences:
+.IP \[bu] 2
+They must begin with a row of dashes, before the header text (unless the
+header row is omitted).
+.IP \[bu] 2
+They must end with a row of dashes, then a blank line.
+.IP \[bu] 2
+The rows must be separated by blank lines.
+.PP
+In multiline tables, the table parser pays attention to the widths of
+the columns, and the writers try to reproduce these relative widths in
+the output.
+So, if you find that one of the columns is too narrow in the output, try
+widening it in the Markdown source.
+.PP
+The header may be omitted in multiline tables as well as simple tables:
+.IP
+.nf
+\f[C]
+----------- ------- --------------- -------------------------
+   First    row                12.0 Example of a row that
+                                    spans multiple lines.
+
+  Second    row                 5.0 Here\[aq]s another one. Note
+                                    the blank line between
+                                    rows.
+----------- ------- --------------- -------------------------
+
+: Here\[aq]s a multiline table without a header.
+\f[R]
+.fi
+.PP
+It is possible for a multiline table to have just one row, but the row
+should be followed by a blank line (and then the row of dashes that ends
+the table), or the table may be interpreted as a simple table.
+.SS Extension: \f[C]grid_tables\f[R]
+.PP
+Grid tables look like this:
+.IP
+.nf
+\f[C]
+: Sample grid table.
+
++---------------+---------------+--------------------+
+| Fruit         | Price         | Advantages         |
++===============+===============+====================+
+| Bananas       | $1.34         | - built-in wrapper |
+|               |               | - bright color     |
++---------------+---------------+--------------------+
+| Oranges       | $2.10         | - cures scurvy     |
+|               |               | - tasty            |
++---------------+---------------+--------------------+
+\f[R]
+.fi
+.PP
+The row of \f[C]=\f[R]s separates the header from the table body, and
+can be omitted for a headerless table.
+The cells of grid tables may contain arbitrary block elements (multiple
+paragraphs, code blocks, lists, etc.).
+Cells that span multiple columns or rows are not supported.
+Grid tables can be created easily using Emacs\[cq] table-mode
+(\f[C]M-x table-insert\f[R]).
+.PP
+Alignments can be specified as with pipe tables, by putting colons at
+the boundaries of the separator line after the header:
+.IP
+.nf
+\f[C]
++---------------+---------------+--------------------+
+| Right         | Left          | Centered           |
++==============:+:==============+:==================:+
+| Bananas       | $1.34         | built-in wrapper   |
++---------------+---------------+--------------------+
+\f[R]
+.fi
+.PP
+For headerless tables, the colons go on the top line instead:
+.IP
+.nf
+\f[C]
++--------------:+:--------------+:------------------:+
+| Right         | Left          | Centered           |
++---------------+---------------+--------------------+
+\f[R]
+.fi
+.SS Grid Table Limitations
+.PP
+Pandoc does not support grid tables with row spans or column spans.
+This means that neither variable numbers of columns across rows nor
+variable numbers of rows across columns are supported by Pandoc.
+All grid tables must have the same number of columns in each row, and
+the same number of rows in each column.
+For example, the Docutils sample grid tables will not render as expected
+with Pandoc.
+.SS Extension: \f[C]pipe_tables\f[R]
+.PP
+Pipe tables look like this:
+.IP
+.nf
+\f[C]
+| Right | Left | Default | Center |
+|------:|:-----|---------|:------:|
+|   12  |  12  |    12   |    12  |
+|  123  |  123 |   123   |   123  |
+|    1  |    1 |     1   |     1  |
+
+  : Demonstration of pipe table syntax.
+\f[R]
+.fi
+.PP
+The syntax is identical to PHP Markdown Extra tables.
+The beginning and ending pipe characters are optional, but pipes are
+required between all columns.
+The colons indicate column alignment as shown.
+The header cannot be omitted.
+To simulate a headerless table, include a header with blank cells.
+.PP
+Since the pipes indicate column boundaries, columns need not be
+vertically aligned, as they are in the above example.
+So, this is a perfectly legal (though ugly) pipe table:
+.IP
+.nf
+\f[C]
+fruit| price
+-----|-----:
+apple|2.05
+pear|1.37
+orange|3.09
+\f[R]
+.fi
+.PP
+The cells of pipe tables cannot contain block elements like paragraphs
+and lists, and cannot span multiple lines.
+If a pipe table contains a row whose Markdown content is wider than the
+column width (see \f[C]--columns\f[R]), then the table will take up the
+full text width and the cell contents will wrap, with the relative cell
+widths determined by the number of dashes in the line separating the
+table header from the table body.
+(For example \f[C]---|-\f[R] would make the first column 3/4 and the
+second column 1/4 of the full text width.) On the other hand, if no
+lines are wider than column width, then cell contents will not be
+wrapped, and the cells will be sized to their contents.
+.PP
+Note: pandoc also recognizes pipe tables of the following form, as can
+be produced by Emacs\[cq] orgtbl-mode:
+.IP
+.nf
+\f[C]
+| One | Two   |
+|-----+-------|
+| my  | table |
+| is  | nice  |
+\f[R]
+.fi
+.PP
+The difference is that \f[C]+\f[R] is used instead of \f[C]|\f[R].
+Other orgtbl features are not supported.
+In particular, to get non-default column alignment, you\[cq]ll need to
+add colons as above.
+.SS Metadata blocks
+.SS Extension: \f[C]pandoc_title_block\f[R]
+.PP
+If the file begins with a title block
+.IP
+.nf
+\f[C]
+% title
+% author(s) (separated by semicolons)
+% date
+\f[R]
+.fi
+.PP
+it will be parsed as bibliographic information, not regular text.
+(It will be used, for example, in the title of standalone LaTeX or HTML
+output.) The block may contain just a title, a title and an author, or
+all three elements.
+If you want to include an author but no title, or a title and a date but
+no author, you need a blank line:
+.IP
+.nf
+\f[C]
+%
+% Author
+\f[R]
+.fi
+.IP
+.nf
+\f[C]
+% My title
+%
+% June 15, 2006
+\f[R]
+.fi
+.PP
+The title may occupy multiple lines, but continuation lines must begin
+with leading space, thus:
+.IP
+.nf
+\f[C]
+% My title
+  on multiple lines
+\f[R]
+.fi
+.PP
+If a document has multiple authors, the authors may be put on separate
+lines with leading space, or separated by semicolons, or both.
+So, all of the following are equivalent:
+.IP
+.nf
+\f[C]
+% Author One
+  Author Two
+\f[R]
+.fi
+.IP
+.nf
+\f[C]
+% Author One; Author Two
+\f[R]
+.fi
+.IP
+.nf
+\f[C]
+% Author One;
+  Author Two
+\f[R]
+.fi
+.PP
+The date must fit on one line.
+.PP
+All three metadata fields may contain standard inline formatting
+(italics, links, footnotes, etc.).
+.PP
+Title blocks will always be parsed, but they will affect the output only
+when the \f[C]--standalone\f[R] (\f[C]-s\f[R]) option is chosen.
+In HTML output, titles will appear twice: once in the document head
+\[en] this is the title that will appear at the top of the window in a
+browser \[en] and once at the beginning of the document body.
+The title in the document head can have an optional prefix attached
+(\f[C]--title-prefix\f[R] or \f[C]-T\f[R] option).
+The title in the body appears as an H1 element with class
+\[lq]title\[rq], so it can be suppressed or reformatted with CSS.
+If a title prefix is specified with \f[C]-T\f[R] and no title block
+appears in the document, the title prefix will be used by itself as the
+HTML title.
+.PP
+The man page writer extracts a title, man page section number, and other
+header and footer information from the title line.
+The title is assumed to be the first word on the title line, which may
+optionally end with a (single-digit) section number in parentheses.
+(There should be no space between the title and the parentheses.)
+Anything after this is assumed to be additional footer and header text.
+A single pipe character (\f[C]|\f[R]) should be used to separate the
+footer text from the header text.
+Thus,
+.IP
+.nf
+\f[C]
+% PANDOC(1)
+\f[R]
+.fi
+.PP
+will yield a man page with the title \f[C]PANDOC\f[R] and section 1.
+.IP
+.nf
+\f[C]
+% PANDOC(1) Pandoc User Manuals
+\f[R]
+.fi
+.PP
+will also have \[lq]Pandoc User Manuals\[rq] in the footer.
+.IP
+.nf
+\f[C]
+% PANDOC(1) Pandoc User Manuals | Version 4.0
+\f[R]
+.fi
+.PP
+will also have \[lq]Version 4.0\[rq] in the header.
+.SS Extension: \f[C]yaml_metadata_block\f[R]
+.PP
+A YAML metadata block is a valid YAML object, delimited by a line of
+three hyphens (\f[C]---\f[R]) at the top and a line of three hyphens
+(\f[C]---\f[R]) or three dots (\f[C]...\f[R]) at the bottom.
+A YAML metadata block may occur anywhere in the document, but if it is
+not at the beginning, it must be preceded by a blank line.
+(Note that, because of the way pandoc concatenates input files when
+several are provided, you may also keep the metadata in a separate YAML
+file and pass it to pandoc as an argument, along with your Markdown
+files:
+.IP
+.nf
+\f[C]
+pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html
+\f[R]
+.fi
+.PP
+Just be sure that the YAML file begins with \f[C]---\f[R] and ends with
+\f[C]---\f[R] or \f[C]...\f[R].) Alternatively, you can use the
+\f[C]--metadata-file\f[R] option.
+Using that approach however, you cannot reference content (like
+footnotes) from the main markdown input document.
+.PP
+Metadata will be taken from the fields of the YAML object and added to
+any existing document metadata.
+Metadata can contain lists and objects (nested arbitrarily), but all
+string scalars will be interpreted as Markdown.
+Fields with names ending in an underscore will be ignored by pandoc.
+(They may be given a role by external processors.) Field names must not
+be interpretable as YAML numbers or boolean values (so, for example,
+\f[C]yes\f[R], \f[C]True\f[R], and \f[C]15\f[R] cannot be used as field
+names).
+.PP
+A document may contain multiple metadata blocks.
+If two metadata blocks attempt to set the same field, the value from the
+second block will be taken.
+.PP
+When pandoc is used with \f[C]-t markdown\f[R] to create a Markdown
+document, a YAML metadata block will be produced only if the
+\f[C]-s/--standalone\f[R] option is used.
+All of the metadata will appear in a single block at the beginning of
+the document.
+.PP
+Note that YAML escaping rules must be followed.
+Thus, for example, if a title contains a colon, it must be quoted.
+The pipe character (\f[C]|\f[R]) can be used to begin an indented block
+that will be interpreted literally, without need for escaping.
+This form is necessary when the field contains blank lines or
+block-level formatting:
+.IP
+.nf
+\f[C]
+---
+title:  \[aq]This is the title: it contains a colon\[aq]
+author:
+- Author One
+- Author Two
+keywords: [nothing, nothingness]
+abstract: |
+  This is the abstract.
+
+  It consists of two paragraphs.
+\&...
+\f[R]
+.fi
+.PP
+Template variables will be set automatically from the metadata.
+Thus, for example, in writing HTML, the variable \f[C]abstract\f[R] will
+be set to the HTML equivalent of the Markdown in the \f[C]abstract\f[R]
+field:
+.IP
+.nf
+\f[C]
+<p>This is the abstract.</p>
+<p>It consists of two paragraphs.</p>
+\f[R]
+.fi
+.PP
+Variables can contain arbitrary YAML structures, but the template must
+match this structure.
+The \f[C]author\f[R] variable in the default templates expects a simple
+list or string, but can be changed to support more complicated
+structures.
+The following combination, for example, would add an affiliation to the
+author if one is given:
+.IP
+.nf
+\f[C]
+---
+title: The document title
+author:
+- name: Author One
+  affiliation: University of Somewhere
+- name: Author Two
+  affiliation: University of Nowhere
+\&...
+\f[R]
+.fi
+.PP
+To use the structured authors in the example above, you would need a
+custom template:
+.IP
+.nf
+\f[C]
+$for(author)$
+$if(author.name)$
+$author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$
+$else$
+$author$
+$endif$
+$endfor$
+\f[R]
+.fi
+.PP
+Raw content to include in the document\[cq]s header may be specified
+using \f[C]header-includes\f[R]; however, it is important to mark up
+this content as raw code for a particular output format, using the
+\f[C]raw_attribute\f[R] extension), or it will be interpreted as
+markdown.
+For example:
+.IP
+.nf
+\f[C]
+header-includes:
+- |
+  \[ga]\[ga]\[ga]{=latex}
+  \[rs]let\[rs]oldsection\[rs]section
+  \[rs]renewcommand{\[rs]section}[1]{\[rs]clearpage\[rs]oldsection{#1}}
+  \[ga]\[ga]\[ga]
+\f[R]
+.fi
+.SS Backslash escapes
+.SS Extension: \f[C]all_symbols_escapable\f[R]
+.PP
+Except inside a code block or inline code, any punctuation or space
+character preceded by a backslash will be treated literally, even if it
+would normally indicate formatting.
+Thus, for example, if one writes
+.IP
+.nf
+\f[C]
+*\[rs]*hello\[rs]**
+\f[R]
+.fi
+.PP
+one will get
+.IP
+.nf
+\f[C]
+<em>*hello*</em>
+\f[R]
+.fi
+.PP
+instead of
+.IP
+.nf
+\f[C]
+<strong>hello</strong>
+\f[R]
+.fi
+.PP
+This rule is easier to remember than standard Markdown\[cq]s rule, which
+allows only the following characters to be backslash-escaped:
+.IP
+.nf
+\f[C]
+\[rs]\[ga]*_{}[]()>#+-.!
+\f[R]
+.fi
+.PP
+(However, if the \f[C]markdown_strict\f[R] format is used, the standard
+Markdown rule will be used.)
+.PP
+A backslash-escaped space is parsed as a nonbreaking space.
+In TeX output, it will appear as \f[C]\[ti]\f[R].
+In HTML and XML output, it will appear as a literal unicode nonbreaking
+space character (note that it will thus actually look
+\[lq]invisible\[rq] in the generated HTML source; you can still use the
+\f[C]--ascii\f[R] command-line option to make it appear as an explicit
+entity).
+.PP
+A backslash-escaped newline (i.e.\ a backslash occurring at the end of a
+line) is parsed as a hard line break.
+It will appear in TeX output as \f[C]\[rs]\[rs]\f[R] and in HTML as
+\f[C]<br />\f[R].
+This is a nice alternative to Markdown\[cq]s \[lq]invisible\[rq] way of
+indicating hard line breaks using two trailing spaces on a line.
+.PP
+Backslash escapes do not work in verbatim contexts.
+.SS Inline formatting
+.SS Emphasis
+.PP
+To \f[I]emphasize\f[R] some text, surround it with \f[C]*\f[R]s or
+\f[C]_\f[R], like this:
+.IP
+.nf
+\f[C]
+This text is _emphasized with underscores_, and this
+is *emphasized with asterisks*.
+\f[R]
+.fi
+.PP
+Double \f[C]*\f[R] or \f[C]_\f[R] produces \f[B]strong emphasis\f[R]:
+.IP
+.nf
+\f[C]
+This is **strong emphasis** and __with underscores__.
+\f[R]
+.fi
+.PP
+A \f[C]*\f[R] or \f[C]_\f[R] character surrounded by spaces, or
+backslash-escaped, will not trigger emphasis:
+.IP
+.nf
+\f[C]
+This is * not emphasized *, and \[rs]*neither is this\[rs]*.
+\f[R]
+.fi
+.SS Extension: \f[C]intraword_underscores\f[R]
+.PP
+Because \f[C]_\f[R] is sometimes used inside words and identifiers,
+pandoc does not interpret a \f[C]_\f[R] surrounded by alphanumeric
+characters as an emphasis marker.
+If you want to emphasize just part of a word, use \f[C]*\f[R]:
+.IP
+.nf
+\f[C]
+feas*ible*, not feas*able*.
+\f[R]
+.fi
+.SS Strikeout
+.SS Extension: \f[C]strikeout\f[R]
+.PP
+To strikeout a section of text with a horizontal line, begin and end it
+with \f[C]\[ti]\[ti]\f[R].
+Thus, for example,
+.IP
+.nf
+\f[C]
+This \[ti]\[ti]is deleted text.\[ti]\[ti]
+\f[R]
+.fi
+.SS Superscripts and subscripts
+.SS Extension: \f[C]superscript\f[R], \f[C]subscript\f[R]
+.PP
+Superscripts may be written by surrounding the superscripted text by
+\f[C]\[ha]\f[R] characters; subscripts may be written by surrounding the
+subscripted text by \f[C]\[ti]\f[R] characters.
+Thus, for example,
+.IP
+.nf
+\f[C]
+H\[ti]2\[ti]O is a liquid.  2\[ha]10\[ha] is 1024.
+\f[R]
+.fi
+.PP
+The text between \f[C]\[ha]...\[ha]\f[R] or \f[C]\[ti]...\[ti]\f[R] may
+not contain spaces or newlines.
+If the superscripted or subscripted text contains spaces, these spaces
+must be escaped with backslashes.
+(This is to prevent accidental superscripting and subscripting through
+the ordinary use of \f[C]\[ti]\f[R] and \f[C]\[ha]\f[R], and also bad
+interactions with footnotes.) Thus, if you want the letter P with `a
+cat' in subscripts, use \f[C]P\[ti]a\[rs] cat\[ti]\f[R], not
+\f[C]P\[ti]a cat\[ti]\f[R].
+.SS Verbatim
+.PP
+To make a short span of text verbatim, put it inside backticks:
+.IP
+.nf
+\f[C]
+What is the difference between \[ga]>>=\[ga] and \[ga]>>\[ga]?
+\f[R]
+.fi
+.PP
+If the verbatim text includes a backtick, use double backticks:
+.IP
+.nf
+\f[C]
+Here is a literal backtick \[ga]\[ga] \[ga] \[ga]\[ga].
+\f[R]
+.fi
+.PP
+(The spaces after the opening backticks and before the closing backticks
+will be ignored.)
+.PP
+The general rule is that a verbatim span starts with a string of
+consecutive backticks (optionally followed by a space) and ends with a
+string of the same number of backticks (optionally preceded by a space).
+.PP
+Note that backslash-escapes (and other Markdown constructs) do not work
+in verbatim contexts:
+.IP
+.nf
+\f[C]
+This is a backslash followed by an asterisk: \[ga]\[rs]*\[ga].
+\f[R]
+.fi
+.SS Extension: \f[C]inline_code_attributes\f[R]
+.PP
+Attributes can be attached to verbatim text, just as with fenced code
+blocks:
+.IP
+.nf
+\f[C]
+\[ga]<$>\[ga]{.haskell}
+\f[R]
+.fi
+.SS Small caps
+.PP
+To write small caps, use the \f[C]smallcaps\f[R] class:
+.IP
+.nf
+\f[C]
+[Small caps]{.smallcaps}
+\f[R]
+.fi
+.PP
+Or, without the \f[C]bracketed_spans\f[R] extension:
+.IP
+.nf
+\f[C]
+<span class=\[dq]smallcaps\[dq]>Small caps</span>
+\f[R]
+.fi
+.PP
+For compatibility with other Markdown flavors, CSS is also supported:
+.IP
+.nf
+\f[C]
+<span style=\[dq]font-variant:small-caps;\[dq]>Small caps</span>
+\f[R]
+.fi
+.PP
+This will work in all output formats that support small caps.
+.SS Math
+.SS Extension: \f[C]tex_math_dollars\f[R]
+.PP
+Anything between two \f[C]$\f[R] characters will be treated as TeX math.
+The opening \f[C]$\f[R] must have a non-space character immediately to
+its right, while the closing \f[C]$\f[R] must have a non-space character
+immediately to its left, and must not be followed immediately by a
+digit.
+Thus, \f[C]$20,000 and $30,000\f[R] won\[cq]t parse as math.
+If for some reason you need to enclose text in literal \f[C]$\f[R]
+characters, backslash-escape them and they won\[cq]t be treated as math
+delimiters.
+.PP
+For display math, use \f[C]$$\f[R] delimiters.
+(In this case, the delimiters may be separated from the formula by
+whitespace.)
+.PP
+TeX math will be printed in all output formats.
+How it is rendered depends on the output format:
+.TP
+LaTeX
+It will appear verbatim surrounded by \f[C]\[rs](...\[rs])\f[R] (for
+inline math) or \f[C]\[rs][...\[rs]]\f[R] (for display math).
+.TP
+Markdown, Emacs Org mode, ConTeXt, ZimWiki
+It will appear verbatim surrounded by \f[C]$...$\f[R] (for inline math)
+or \f[C]$$...$$\f[R] (for display math).
+.TP
+XWiki
+It will appear verbatim surrounded by
+\f[C]{{formula}}..{{/formula}}\f[R].
+.TP
+reStructuredText
+It will be rendered using an interpreted text role \f[C]:math:\f[R].
+.TP
+AsciiDoc
+For AsciiDoc output format (\f[C]-t asciidoc\f[R]) it will appear
+verbatim surrounded by \f[C]latexmath:[$...$]\f[R] (for inline math) or
+\f[C][latexmath]++++\[rs][...\[rs]]+++\f[R] (for display math).
+For AsciiDoctor output format (\f[C]-t asciidoctor\f[R]) the LaTex
+delimiters (\f[C]$..$\f[R] and \f[C]\[rs][..\[rs]]\f[R]) are omitted.
+.TP
+Texinfo
+It will be rendered inside a \f[C]\[at]math\f[R] command.
+.TP
+roff man, Jira markup
+It will be rendered verbatim without \f[C]$\f[R]\[cq]s.
+.TP
+MediaWiki, DokuWiki
+It will be rendered inside \f[C]<math>\f[R] tags.
+.TP
+Textile
+It will be rendered inside \f[C]<span class=\[dq]math\[dq]>\f[R] tags.
+.TP
+RTF, OpenDocument
+It will be rendered, if possible, using Unicode characters, and will
+otherwise appear verbatim.
+.TP
+ODT
+It will be rendered, if possible, using MathML.
+.TP
+DocBook
+If the \f[C]--mathml\f[R] flag is used, it will be rendered using MathML
+in an \f[C]inlineequation\f[R] or \f[C]informalequation\f[R] tag.
+Otherwise it will be rendered, if possible, using Unicode characters.
+.TP
+Docx
+It will be rendered using OMML math markup.
+.TP
+FictionBook2
+If the \f[C]--webtex\f[R] option is used, formulas are rendered as
+images using CodeCogs or other compatible web service, downloaded and
+embedded in the e-book.
+Otherwise, they will appear verbatim.
+.TP
+HTML, Slidy, DZSlides, S5, EPUB
+The way math is rendered in HTML will depend on the command-line options
+selected.
+Therefore see Math rendering in HTML above.
+.SS Raw HTML
+.SS Extension: \f[C]raw_html\f[R]
+.PP
+Markdown allows you to insert raw HTML (or DocBook) anywhere in a
+document (except verbatim contexts, where \f[C]<\f[R], \f[C]>\f[R], and
+\f[C]&\f[R] are interpreted literally).
+(Technically this is not an extension, since standard Markdown allows
+it, but it has been made an extension so that it can be disabled if
+desired.)
+.PP
+The raw HTML is passed through unchanged in HTML, S5, Slidy, Slideous,
+DZSlides, EPUB, Markdown, CommonMark, Emacs Org mode, and Textile
+output, and suppressed in other formats.
+.PP
+For a more explicit way of including raw HTML in a Markdown document,
+see the \f[C]raw_attribute\f[R] extension.
+.PP
+In the CommonMark format, if \f[C]raw_html\f[R] is enabled,
+superscripts, subscripts, strikeouts and small capitals will be
+represented as HTML.
+Otherwise, plain-text fallbacks will be used.
+Note that even if \f[C]raw_html\f[R] is disabled, tables will be
+rendered with HTML syntax if they cannot use pipe syntax.
+.SS Extension: \f[C]markdown_in_html_blocks\f[R]
+.PP
+Standard Markdown allows you to include HTML \[lq]blocks\[rq]: blocks of
+HTML between balanced tags that are separated from the surrounding text
+with blank lines, and start and end at the left margin.
+Within these blocks, everything is interpreted as HTML, not Markdown; so
+(for example), \f[C]*\f[R] does not signify emphasis.
+.PP
+Pandoc behaves this way when the \f[C]markdown_strict\f[R] format is
+used; but by default, pandoc interprets material between HTML block tags
+as Markdown.
+Thus, for example, pandoc will turn
+.IP
+.nf
+\f[C]
+<table>
+<tr>
+<td>*one*</td>
+<td>[a link](https://google.com)</td>
+</tr>
+</table>
+\f[R]
+.fi
+.PP
+into
+.IP
+.nf
+\f[C]
+<table>
+<tr>
+<td><em>one</em></td>
+<td><a href=\[dq]https://google.com\[dq]>a link</a></td>
+</tr>
+</table>
+\f[R]
+.fi
+.PP
+whereas \f[C]Markdown.pl\f[R] will preserve it as is.
+.PP
+There is one exception to this rule: text between \f[C]<script>\f[R] and
+\f[C]<style>\f[R] tags is not interpreted as Markdown.
+.PP
+This departure from standard Markdown should make it easier to mix
+Markdown with HTML block elements.
+For example, one can surround a block of Markdown text with
+\f[C]<div>\f[R] tags without preventing it from being interpreted as
+Markdown.
+.SS Extension: \f[C]native_divs\f[R]
+.PP
+Use native pandoc \f[C]Div\f[R] blocks for content inside
+\f[C]<div>\f[R] tags.
+For the most part this should give the same output as
+\f[C]markdown_in_html_blocks\f[R], but it makes it easier to write
+pandoc filters to manipulate groups of blocks.
+.SS Extension: \f[C]native_spans\f[R]
+.PP
+Use native pandoc \f[C]Span\f[R] blocks for content inside
+\f[C]<span>\f[R] tags.
+For the most part this should give the same output as
+\f[C]raw_html\f[R], but it makes it easier to write pandoc filters to
+manipulate groups of inlines.
+.SS Extension: \f[C]raw_tex\f[R]
+.PP
+In addition to raw HTML, pandoc allows raw LaTeX, TeX, and ConTeXt to be
+included in a document.
+Inline TeX commands will be preserved and passed unchanged to the LaTeX
+and ConTeXt writers.
+Thus, for example, you can use LaTeX to include BibTeX citations:
+.IP
+.nf
+\f[C]
+This result was proved in \[rs]cite{jones.1967}.
+\f[R]
+.fi
+.PP
+Note that in LaTeX environments, like
+.IP
+.nf
+\f[C]
+\[rs]begin{tabular}{|l|l|}\[rs]hline
+Age & Frequency \[rs]\[rs] \[rs]hline
+18--25  & 15 \[rs]\[rs]
+26--35  & 33 \[rs]\[rs]
+36--45  & 22 \[rs]\[rs] \[rs]hline
+\[rs]end{tabular}
+\f[R]
+.fi
+.PP
+the material between the begin and end tags will be interpreted as raw
+LaTeX, not as Markdown.
+.PP
+For a more explicit and flexible way of including raw TeX in a Markdown
+document, see the \f[C]raw_attribute\f[R] extension.
+.PP
+Inline LaTeX is ignored in output formats other than Markdown, LaTeX,
+Emacs Org mode, and ConTeXt.
+.SS Generic raw attribute
+.SS Extension: \f[C]raw_attribute\f[R]
+.PP
+Inline spans and fenced code blocks with a special kind of attribute
+will be parsed as raw content with the designated format.
+For example, the following produces a raw roff \f[C]ms\f[R] block:
+.IP
+.nf
+\f[C]
+\[ga]\[ga]\[ga]{=ms}
+\&.MYMACRO
+blah blah
+\[ga]\[ga]\[ga]
+\f[R]
+.fi
+.PP
+And the following produces a raw \f[C]html\f[R] inline element:
+.IP
+.nf
+\f[C]
+This is \[ga]<a>html</a>\[ga]{=html}
+\f[R]
+.fi
+.PP
+This can be useful to insert raw xml into \f[C]docx\f[R] documents, e.g.
+a pagebreak:
+.IP
+.nf
+\f[C]
+\[ga]\[ga]\[ga]{=openxml}
+<w:p>
+  <w:r>
+    <w:br w:type=\[dq]page\[dq]/>
+  </w:r>
+</w:p>
+\[ga]\[ga]\[ga]
+\f[R]
+.fi
+.PP
+The format name should match the target format name (see
+\f[C]-t/--to\f[R], above, for a list, or use
+\f[C]pandoc --list-output-formats\f[R]).
+Use \f[C]openxml\f[R] for \f[C]docx\f[R] output, \f[C]opendocument\f[R]
+for \f[C]odt\f[R] output, \f[C]html5\f[R] for \f[C]epub3\f[R] output,
+\f[C]html4\f[R] for \f[C]epub2\f[R] output, and \f[C]latex\f[R],
+\f[C]beamer\f[R], \f[C]ms\f[R], or \f[C]html5\f[R] for \f[C]pdf\f[R]
+output (depending on what you use for \f[C]--pdf-engine\f[R]).
+.PP
+This extension presupposes that the relevant kind of inline code or
+fenced code block is enabled.
+Thus, for example, to use a raw attribute with a backtick code block,
+\f[C]backtick_code_blocks\f[R] must be enabled.
+.PP
+The raw attribute cannot be combined with regular attributes.
+.SS LaTeX macros
+.SS Extension: \f[C]latex_macros\f[R]
+.PP
+When this extension is enabled, pandoc will parse LaTeX macro
+definitions and apply the resulting macros to all LaTeX math and raw
+LaTeX.
+So, for example, the following will work in all output formats, not just
+LaTeX:
+.IP
+.nf
+\f[C]
+\[rs]newcommand{\[rs]tuple}[1]{\[rs]langle #1 \[rs]rangle}
+
+$\[rs]tuple{a, b, c}$
+\f[R]
+.fi
+.PP
+Note that LaTeX macros will not be applied if they occur inside a raw
+span or block marked with the \f[C]raw_attribute\f[R] extension.
+.PP
+When \f[C]latex_macros\f[R] is disabled, the raw LaTeX and math will not
+have macros applied.
+This is usually a better approach when you are targeting LaTeX or PDF.
+.PP
+Macro definitions in LaTeX will be passed through as raw LaTeX only if
+\f[C]latex_macros\f[R] is not enabled.
+Macro definitions in Markdown source (or other formats allowing
+\f[C]raw_tex\f[R]) will be passed through regardless of whether
+\f[C]latex_macros\f[R] is enabled.
+.SS Links
+.PP
+Markdown allows links to be specified in several ways.
+.SS Automatic links
+.PP
+If you enclose a URL or email address in pointy brackets, it will become
+a link:
+.IP
+.nf
+\f[C]
+<https://google.com>
+<sam\[at]green.eggs.ham>
+\f[R]
+.fi
+.SS Inline links
+.PP
+An inline link consists of the link text in square brackets, followed by
+the URL in parentheses.
+(Optionally, the URL can be followed by a link title, in quotes.)
+.IP
+.nf
+\f[C]
+This is an [inline link](/url), and here\[aq]s [one with
+a title](https://fsf.org \[dq]click here for a good time!\[dq]).
+\f[R]
+.fi
+.PP
+There can be no space between the bracketed part and the parenthesized
+part.
+The link text can contain formatting (such as emphasis), but the title
+cannot.
+.PP
+Email addresses in inline links are not autodetected, so they have to be
+prefixed with \f[C]mailto\f[R]:
+.IP
+.nf
+\f[C]
+[Write me!](mailto:sam\[at]green.eggs.ham)
+\f[R]
+.fi
+.SS Reference links
+.PP
+An \f[I]explicit\f[R] reference link has two parts, the link itself and
+the link definition, which may occur elsewhere in the document (either
+before or after the link).
+.PP
+The link consists of link text in square brackets, followed by a label
+in square brackets.
+(There cannot be space between the two unless the
+\f[C]spaced_reference_links\f[R] extension is enabled.) The link
+definition consists of the bracketed label, followed by a colon and a
+space, followed by the URL, and optionally (after a space) a link title
+either in quotes or in parentheses.
+The label must not be parseable as a citation (assuming the
+\f[C]citations\f[R] extension is enabled): citations take precedence
+over link labels.
+.PP
+Here are some examples:
+.IP
+.nf
+\f[C]
+[my label 1]: /foo/bar.html  \[dq]My title, optional\[dq]
+[my label 2]: /foo
+[my label 3]: https://fsf.org (The free software foundation)
+[my label 4]: /bar#special  \[aq]A title in single quotes\[aq]
+\f[R]
+.fi
+.PP
+The URL may optionally be surrounded by angle brackets:
+.IP
+.nf
+\f[C]
+[my label 5]: <http://foo.bar.baz>
+\f[R]
+.fi
+.PP
+The title may go on the next line:
+.IP
+.nf
+\f[C]
+[my label 3]: https://fsf.org
+  \[dq]The free software foundation\[dq]
+\f[R]
+.fi
+.PP
+Note that link labels are not case sensitive.
+So, this will work:
+.IP
+.nf
+\f[C]
+Here is [my link][FOO]
+
+[Foo]: /bar/baz
+\f[R]
+.fi
+.PP
+In an \f[I]implicit\f[R] reference link, the second pair of brackets is
+empty:
+.IP
+.nf
+\f[C]
+See [my website][].
+
+[my website]: http://foo.bar.baz
+\f[R]
+.fi
+.PP
+Note: In \f[C]Markdown.pl\f[R] and most other Markdown implementations,
+reference link definitions cannot occur in nested constructions such as
+list items or block quotes.
+Pandoc lifts this arbitrary seeming restriction.
+So the following is fine in pandoc, though not in most other
+implementations:
+.IP
+.nf
+\f[C]
+> My block [quote].
+>
+> [quote]: /foo
+\f[R]
+.fi
+.SS Extension: \f[C]shortcut_reference_links\f[R]
+.PP
+In a \f[I]shortcut\f[R] reference link, the second pair of brackets may
+be omitted entirely:
+.IP
+.nf
+\f[C]
+See [my website].
+
+[my website]: http://foo.bar.baz
+\f[R]
+.fi
+.SS Internal links
+.PP
+To link to another section of the same document, use the automatically
+generated identifier (see Heading identifiers).
+For example:
+.IP
+.nf
+\f[C]
+See the [Introduction](#introduction).
+\f[R]
+.fi
+.PP
+or
+.IP
+.nf
+\f[C]
+See the [Introduction].
+
+[Introduction]: #introduction
+\f[R]
+.fi
+.PP
+Internal links are currently supported for HTML formats (including HTML
+slide shows and EPUB), LaTeX, and ConTeXt.
+.SS Images
+.PP
+A link immediately preceded by a \f[C]!\f[R] will be treated as an
+image.
+The link text will be used as the image\[cq]s alt text:
+.IP
+.nf
+\f[C]
+![la lune](lalune.jpg \[dq]Voyage to the moon\[dq])
+
+![movie reel]
+
+[movie reel]: movie.gif
+\f[R]
+.fi
+.SS Extension: \f[C]implicit_figures\f[R]
+.PP
+An image with nonempty alt text, occurring by itself in a paragraph,
+will be rendered as a figure with a caption.
+The image\[cq]s alt text will be used as the caption.
+.IP
+.nf
+\f[C]
+![This is the caption](/url/of/image.png)
+\f[R]
+.fi
+.PP
+How this is rendered depends on the output format.
+Some output formats (e.g.\ RTF) do not yet support figures.
+In those formats, you\[cq]ll just get an image in a paragraph by itself,
+with no caption.
+.PP
+If you just want a regular inline image, just make sure it is not the
+only thing in the paragraph.
+One way to do this is to insert a nonbreaking space after the image:
+.IP
+.nf
+\f[C]
+![This image won\[aq]t be a figure](/url/of/image.png)\[rs]
+\f[R]
+.fi
+.PP
+Note that in reveal.js slide shows, an image in a paragraph by itself
+that has the \f[C]stretch\f[R] class will fill the screen, and the
+caption and figure tags will be omitted.
+.SS Extension: \f[C]link_attributes\f[R]
+.PP
+Attributes can be set on links and images:
+.IP
+.nf
+\f[C]
+An inline ![image](foo.jpg){#id .class width=30 height=20px}
+and a reference ![image][ref] with attributes.
+
+[ref]: foo.jpg \[dq]optional title\[dq] {#id .class key=val key2=\[dq]val 2\[dq]}
+\f[R]
+.fi
+.PP
+(This syntax is compatible with PHP Markdown Extra when only
+\f[C]#id\f[R] and \f[C].class\f[R] are used.)
+.PP
+For HTML and EPUB, all known HTML5 attributes except \f[C]width\f[R] and
+\f[C]height\f[R] (but including \f[C]srcset\f[R] and \f[C]sizes\f[R])
+are passed through as is.
+Unknown attributes are passed through as custom attributes, with
+\f[C]data-\f[R] prepended.
+The other writers ignore attributes that are not specifically supported
+by their output format.
+.PP
+The \f[C]width\f[R] and \f[C]height\f[R] attributes on images are
+treated specially.
+When used without a unit, the unit is assumed to be pixels.
+However, any of the following unit identifiers can be used:
+\f[C]px\f[R], \f[C]cm\f[R], \f[C]mm\f[R], \f[C]in\f[R], \f[C]inch\f[R]
+and \f[C]%\f[R].
+There must not be any spaces between the number and the unit.
+For example:
+.IP
+.nf
+\f[C]
+![](file.jpg){ width=50% }
+\f[R]
+.fi
+.IP \[bu] 2
+Dimensions may be converted to a form that is compatible with the output
+format (for example, dimensions given in pixels will be converted to
+inches when converting HTML to LaTeX).
+Conversion between pixels and physical measurements is affected by the
+\f[C]--dpi\f[R] option (by default, 96 dpi is assumed, unless the image
+itself contains dpi information).
+.IP \[bu] 2
+The \f[C]%\f[R] unit is generally relative to some available space.
+For example the above example will render to the following.
+.RS 2
+.IP \[bu] 2
+HTML:
+\f[C]<img href=\[dq]file.jpg\[dq] style=\[dq]width: 50%;\[dq] />\f[R]
+.IP \[bu] 2
+LaTeX:
+\f[C]\[rs]includegraphics[width=0.5\[rs]textwidth,height=\[rs]textheight]{file.jpg}\f[R]
+(If you\[cq]re using a custom template, you need to configure
+\f[C]graphicx\f[R] as in the default template.)
+.IP \[bu] 2
+ConTeXt:
+\f[C]\[rs]externalfigure[file.jpg][width=0.5\[rs]textwidth]\f[R]
+.RE
+.IP \[bu] 2
+Some output formats have a notion of a class (ConTeXt) or a unique
+identifier (LaTeX \f[C]\[rs]caption\f[R]), or both (HTML).
+.IP \[bu] 2
+When no \f[C]width\f[R] or \f[C]height\f[R] attributes are specified,
+the fallback is to look at the image resolution and the dpi metadata
+embedded in the image file.
+.SS Divs and Spans
+.PP
+Using the \f[C]native_divs\f[R] and \f[C]native_spans\f[R] extensions
+(see above), HTML syntax can be used as part of markdown to create
+native \f[C]Div\f[R] and \f[C]Span\f[R] elements in the pandoc AST (as
+opposed to raw HTML).
+However, there is also nicer syntax available:
+.SS Extension: \f[C]fenced_divs\f[R]
+.PP
+Allow special fenced syntax for native \f[C]Div\f[R] blocks.
+A Div starts with a fence containing at least three consecutive colons
+plus some attributes.
+The attributes may optionally be followed by another string of
+consecutive colons.
+The attribute syntax is exactly as in fenced code blocks (see Extension:
+\f[C]fenced_code_attributes\f[R]).
+As with fenced code blocks, one can use either attributes in curly
+braces or a single unbraced word, which will be treated as a class name.
+The Div ends with another line containing a string of at least three
+consecutive colons.
+The fenced Div should be separated by blank lines from preceding and
+following blocks.
+.PP
+Example:
+.IP
+.nf
+\f[C]
+::::: {#special .sidebar}
+Here is a paragraph.
+
+And another.
+:::::
+\f[R]
+.fi
+.PP
+Fenced divs can be nested.
+Opening fences are distinguished because they \f[I]must\f[R] have
+attributes:
+.IP
+.nf
+\f[C]
+::: Warning ::::::
+This is a warning.
+
+::: Danger
+This is a warning within a warning.
+:::
+::::::::::::::::::
+\f[R]
+.fi
+.PP
+Fences without attributes are always closing fences.
+Unlike with fenced code blocks, the number of colons in the closing
+fence need not match the number in the opening fence.
+However, it can be helpful for visual clarity to use fences of different
+lengths to distinguish nested divs from their parents.
+.SS Extension: \f[C]bracketed_spans\f[R]
+.PP
+A bracketed sequence of inlines, as one would use to begin a link, will
+be treated as a \f[C]Span\f[R] with attributes if it is followed
+immediately by attributes:
+.IP
+.nf
+\f[C]
+[This is *some text*]{.class key=\[dq]val\[dq]}
+\f[R]
+.fi
+.SS Footnotes
+.SS Extension: \f[C]footnotes\f[R]
+.PP
+Pandoc\[cq]s Markdown allows footnotes, using the following syntax:
+.IP
+.nf
+\f[C]
+Here is a footnote reference,[\[ha]1] and another.[\[ha]longnote]
+
+[\[ha]1]: Here is the footnote.
+
+[\[ha]longnote]: Here\[aq]s one with multiple blocks.
+
+    Subsequent paragraphs are indented to show that they
+belong to the previous footnote.
+
+        { some.code }
+
+    The whole paragraph can be indented, or just the first
+    line.  In this way, multi-paragraph footnotes work like
+    multi-paragraph list items.
+
+This paragraph won\[aq]t be part of the note, because it
+isn\[aq]t indented.
+\f[R]
+.fi
+.PP
+The identifiers in footnote references may not contain spaces, tabs, or
+newlines.
+These identifiers are used only to correlate the footnote reference with
+the note itself; in the output, footnotes will be numbered sequentially.
+.PP
+The footnotes themselves need not be placed at the end of the document.
+They may appear anywhere except inside other block elements (lists,
+block quotes, tables, etc.).
+Each footnote should be separated from surrounding content (including
+other footnotes) by blank lines.
+.SS Extension: \f[C]inline_notes\f[R]
+.PP
+Inline footnotes are also allowed (though, unlike regular notes, they
+cannot contain multiple paragraphs).
+The syntax is as follows:
+.IP
+.nf
+\f[C]
+Here is an inline note.\[ha][Inlines notes are easier to write, since
+you don\[aq]t have to pick an identifier and move down to type the
+note.]
+\f[R]
+.fi
+.PP
+Inline and regular footnotes may be mixed freely.
+.SS Citation syntax
+.SS Extension: \f[C]citations\f[R]
+.PP
+Markdown citations go inside square brackets and are separated by
+semicolons.
+Each citation must have a key, composed of `\[at]' + the citation
+identifier from the database, and may optionally have a prefix, a
+locator, and a suffix.
+The citation key must begin with a letter, digit, or \f[C]_\f[R], and
+may contain alphanumerics, \f[C]_\f[R], and internal punctuation
+characters (\f[C]:.#$%&-+?<>\[ti]/\f[R]).
+Here are some examples:
+.IP
+.nf
+\f[C]
+Blah blah [see \[at]doe99, pp. 33-35; also \[at]smith04, chap. 1].
+
+Blah blah [\[at]doe99, pp. 33-35, 38-39 and *passim*].
+
+Blah blah [\[at]smith04; \[at]doe99].
+\f[R]
+.fi
+.PP
+\f[C]pandoc\f[R] detects locator terms in the CSL locale files.
+Either abbreviated or unabbreviated forms are accepted.
+In the \f[C]en-US\f[R] locale, locator terms can be written in either
+singular or plural forms, as \f[C]book\f[R],
+\f[C]bk.\f[R]/\f[C]bks.\f[R]; \f[C]chapter\f[R],
+\f[C]chap.\f[R]/\f[C]chaps.\f[R]; \f[C]column\f[R],
+\f[C]col.\f[R]/\f[C]cols.\f[R]; \f[C]figure\f[R],
+\f[C]fig.\f[R]/\f[C]figs.\f[R]; \f[C]folio\f[R],
+\f[C]fol.\f[R]/\f[C]fols.\f[R]; \f[C]number\f[R],
+\f[C]no.\f[R]/\f[C]nos.\f[R]; \f[C]line\f[R],
+\f[C]l.\f[R]/\f[C]ll.\f[R]; \f[C]note\f[R], \f[C]n.\f[R]/\f[C]nn.\f[R];
+\f[C]opus\f[R], \f[C]op.\f[R]/\f[C]opp.\f[R]; \f[C]page\f[R],
+\f[C]p.\f[R]/\f[C]pp.\f[R]; \f[C]paragraph\f[R],
+\f[C]para.\f[R]/\f[C]paras.\f[R]; \f[C]part\f[R],
+\f[C]pt.\f[R]/\f[C]pts.\f[R]; \f[C]section\f[R],
+\f[C]sec.\f[R]/\f[C]secs.\f[R]; \f[C]sub verbo\f[R],
+\f[C]s.v.\f[R]/\f[C]s.vv.\f[R]; \f[C]verse\f[R],
+\f[C]v.\f[R]/\f[C]vv.\f[R]; \f[C]volume\f[R],
+\f[C]vol.\f[R]/\f[C]vols.\f[R]; \f[C]\[ps]\f[R]/\f[C]\[ps]\[ps]\f[R];
+\f[C]\[sc]\f[R]/\f[C]\[sc]\[sc]\f[R].
+If no locator term is used, \[lq]page\[rq] is assumed.
+.PP
+\f[C]pandoc\f[R] will use heuristics to distinguish the locator from the
+suffix.
+In complex cases, the locator can be enclosed in curly braces:
+.IP
+.nf
+\f[C]
+[\[at]smith{ii, A, D-Z}, with a suffix]
+[\[at]smith, {pp. iv, vi-xi, (xv)-(xvii)} with suffix here]
+\f[R]
+.fi
+.PP
+A minus sign (\f[C]-\f[R]) before the \f[C]\[at]\f[R] will suppress
+mention of the author in the citation.
+This can be useful when the author is already mentioned in the text:
+.IP
+.nf
+\f[C]
+Smith says blah [-\[at]smith04].
+\f[R]
+.fi
+.PP
+You can also write an in-text citation, as follows:
+.IP
+.nf
+\f[C]
+\[at]smith04 says blah.
+
+\[at]smith04 [p. 33] says blah.
+\f[R]
+.fi
+.SS Non-pandoc extensions
+.PP
+The following Markdown syntax extensions are not enabled by default in
+pandoc, but may be enabled by adding \f[C]+EXTENSION\f[R] to the format
+name, where \f[C]EXTENSION\f[R] is the name of the extension.
+Thus, for example, \f[C]markdown+hard_line_breaks\f[R] is Markdown with
+hard line breaks.
+.SS Extension: \f[C]attributes\f[R]
+.PP
+Allows attributes to be attached to any inline or block-level element.
+The syntax for the attributes is the same as that used in
+\f[C]header_attributes\f[R].
+.IP \[bu] 2
+Attributes that occur immediately after an inline element affect that
+element.
+If they follow a space, then they belong to the space.
+(Hence, this option subsumes \f[C]inline_code_attributes\f[R] and
+\f[C]link_attributes\f[R].)
+.IP \[bu] 2
+Attributes that occur immediately before a block element, on a line by
+themselves, affect that element.
+.IP \[bu] 2
+Consecutive attribute specifiers may be used, either for blocks or for
+inlines.
+Their attributes will be combined.
+.IP \[bu] 2
+Attributes that occur at the end of the text of a Setext or ATX heading
+(separated by whitespace from the text) affect the heading element.
+(Hence, this option subsumes \f[C]header_attributes\f[R].)
+.IP \[bu] 2
+Attributes that occur after the opening fence in a fenced code block
+affect the code block element.
+(Hence, this option subsumes \f[C]fenced_code_attributes\f[R].)
+.IP \[bu] 2
+Attributes that occur at the end of a reference link definition affect
+links that refer to that definition.
+.PP
+Note that pandoc\[cq]s AST does not currently allow attributes to be
+attached to arbitrary elements.
+Hence a Span or Div container will be added if needed.
+.SS Extension: \f[C]old_dashes\f[R]
+.PP
+Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes:
+\f[C]-\f[R] before a numeral is an en-dash, and \f[C]--\f[R] is an
+em-dash.
+This option only has an effect if \f[C]smart\f[R] is enabled.
+It is selected automatically for \f[C]textile\f[R] input.
+.SS Extension: \f[C]angle_brackets_escapable\f[R]
+.PP
+Allow \f[C]<\f[R] and \f[C]>\f[R] to be backslash-escaped, as they can
+be in GitHub flavored Markdown but not original Markdown.
+This is implied by pandoc\[cq]s default \f[C]all_symbols_escapable\f[R].
+.SS Extension: \f[C]lists_without_preceding_blankline\f[R]
+.PP
+Allow a list to occur right after a paragraph, with no intervening blank
+space.
+.SS Extension: \f[C]four_space_rule\f[R]
+.PP
+Selects the pandoc <= 2.0 behavior for parsing lists, so that four
+spaces indent are needed for list item continuation paragraphs.
+.SS Extension: \f[C]spaced_reference_links\f[R]
+.PP
+Allow whitespace between the two components of a reference link, for
+example,
+.IP
+.nf
+\f[C]
+[foo] [bar].
+\f[R]
+.fi
+.SS Extension: \f[C]hard_line_breaks\f[R]
+.PP
+Causes all newlines within a paragraph to be interpreted as hard line
+breaks instead of spaces.
+.SS Extension: \f[C]ignore_line_breaks\f[R]
+.PP
+Causes newlines within a paragraph to be ignored, rather than being
+treated as spaces or as hard line breaks.
+This option is intended for use with East Asian languages where spaces
+are not used between words, but text is divided into lines for
+readability.
+.SS Extension: \f[C]east_asian_line_breaks\f[R]
+.PP
+Causes newlines within a paragraph to be ignored, rather than being
+treated as spaces or as hard line breaks, when they occur between two
+East Asian wide characters.
+This is a better choice than \f[C]ignore_line_breaks\f[R] for texts that
+include a mix of East Asian wide characters and other characters.
+.SS Extension: \f[C]emoji\f[R]
+.PP
+Parses textual emojis like \f[C]:smile:\f[R] as Unicode emoticons.
+.SS Extension: \f[C]tex_math_single_backslash\f[R]
+.PP
+Causes anything between \f[C]\[rs](\f[R] and \f[C]\[rs])\f[R] to be
+interpreted as inline TeX math, and anything between \f[C]\[rs][\f[R]
+and \f[C]\[rs]]\f[R] to be interpreted as display TeX math.
+Note: a drawback of this extension is that it precludes escaping
+\f[C](\f[R] and \f[C][\f[R].
+.SS Extension: \f[C]tex_math_double_backslash\f[R]
+.PP
+Causes anything between \f[C]\[rs]\[rs](\f[R] and \f[C]\[rs]\[rs])\f[R]
+to be interpreted as inline TeX math, and anything between
+\f[C]\[rs]\[rs][\f[R] and \f[C]\[rs]\[rs]]\f[R] to be interpreted as
+display TeX math.
+.SS Extension: \f[C]markdown_attribute\f[R]
+.PP
+By default, pandoc interprets material inside block-level tags as
+Markdown.
+This extension changes the behavior so that Markdown is only parsed
+inside block-level tags if the tags have the attribute
+\f[C]markdown=1\f[R].
+.SS Extension: \f[C]mmd_title_block\f[R]
+.PP
+Enables a MultiMarkdown style title block at the top of the document,
+for example:
+.IP
+.nf
+\f[C]
+Title:   My title
+Author:  John Doe
+Date:    September 1, 2008
+Comment: This is a sample mmd title block, with
+         a field spanning multiple lines.
+\f[R]
+.fi
+.PP
+See the MultiMarkdown documentation for details.
+If \f[C]pandoc_title_block\f[R] or \f[C]yaml_metadata_block\f[R] is
+enabled, it will take precedence over \f[C]mmd_title_block\f[R].
+.SS Extension: \f[C]abbreviations\f[R]
+.PP
+Parses PHP Markdown Extra abbreviation keys, like
+.IP
+.nf
+\f[C]
+*[HTML]: Hypertext Markup Language
+\f[R]
+.fi
+.PP
+Note that the pandoc document model does not support abbreviations, so
+if this extension is enabled, abbreviation keys are simply skipped (as
+opposed to being parsed as paragraphs).
+.SS Extension: \f[C]autolink_bare_uris\f[R]
+.PP
+Makes all absolute URIs into links, even when not surrounded by pointy
+braces \f[C]<...>\f[R].
+.SS Extension: \f[C]mmd_link_attributes\f[R]
+.PP
+Parses multimarkdown style key-value attributes on link and image
+references.
+This extension should not be confused with the \f[C]link_attributes\f[R]
+extension.
+.IP
+.nf
+\f[C]
+This is a reference ![image][ref] with multimarkdown attributes.
+
+[ref]: https://path.to/image \[dq]Image title\[dq] width=20px height=30px
+       id=myId class=\[dq]myClass1 myClass2\[dq]
+\f[R]
+.fi
+.SS Extension: \f[C]mmd_header_identifiers\f[R]
+.PP
+Parses multimarkdown style heading identifiers (in square brackets,
+after the heading but before any trailing \f[C]#\f[R]s in an ATX
+heading).
+.SS Extension: \f[C]compact_definition_lists\f[R]
+.PP
+Activates the definition list syntax of pandoc 1.12.x and earlier.
+This syntax differs from the one described above under Definition lists
+in several respects:
+.IP \[bu] 2
+No blank line is required between consecutive items of the definition
+list.
+.IP \[bu] 2
+To get a \[lq]tight\[rq] or \[lq]compact\[rq] list, omit space between
+consecutive items; the space between a term and its definition does not
+affect anything.
+.IP \[bu] 2
+Lazy wrapping of paragraphs is not allowed: the entire definition must
+be indented four spaces.
+.SS Extension: \f[C]gutenberg\f[R]
+.PP
+Use Project Gutenberg conventions for \f[C]plain\f[R] output: all-caps
+for strong emphasis, surround by underscores for regular emphasis, add
+extra blank space around headings.
+.SS Markdown variants
+.PP
+In addition to pandoc\[cq]s extended Markdown, the following Markdown
+variants are supported:
+.IP \[bu] 2
+\f[C]markdown_phpextra\f[R] (PHP Markdown Extra)
+.IP \[bu] 2
+\f[C]markdown_github\f[R] (deprecated GitHub-Flavored Markdown)
+.IP \[bu] 2
+\f[C]markdown_mmd\f[R] (MultiMarkdown)
+.IP \[bu] 2
+\f[C]markdown_strict\f[R] (Markdown.pl)
+.IP \[bu] 2
+\f[C]commonmark\f[R] (CommonMark)
+.IP \[bu] 2
+\f[C]gfm\f[R] (Github-Flavored Markdown)
+.IP \[bu] 2
+\f[C]commonmark_x\f[R] (CommonMark with many pandoc extensions)
+.PP
+To see which extensions are supported for a given format, and which are
+enabled by default, you can use the command
+.IP
+.nf
+\f[C]
+pandoc --list-extensions=FORMAT
+\f[R]
+.fi
+.PP
+where \f[C]FORMAT\f[R] is replaced with the name of the format.
+.PP
+Note that the list of extensions for \f[C]commonmark\f[R],
+\f[C]gfm\f[R], and \f[C]commonmark_x\f[R] are defined relative to
+default commonmark.
+So, for example, \f[C]backtick_code_blocks\f[R] does not appear as an
+extension, since it is enabled by default and cannot be disabled.
+.SH CITATIONS
+.PP
+When the \f[C]--citeproc\f[R] option is used, pandoc can automatically
+generate citations and a bibliography in a number of styles.
+Basic usage is
+.IP
+.nf
+\f[C]
+pandoc --citeproc myinput.txt
+\f[R]
+.fi
+.PP
+To use this feature, you will need to have
+.IP \[bu] 2
+a document containing citations (see Extension: \f[C]citations\f[R]);
+.IP \[bu] 2
+a source of bibliographic data: either an external bibliography file or
+a list of \f[C]references\f[R] in the document\[cq]s YAML metadata
+.IP \[bu] 2
+optionally, a CSL citation style.
+.SS Specifying bibliographic data
+.PP
+You can specify an external bibliography using the
+\f[C]bibliography\f[R] metadata field in a YAML metadata section or the
+\f[C]--bibliography\f[R] command line argument.
+If you want to use multiple bibliography files, you can supply multiple
+\f[C]--bibliography\f[R] arguments or set \f[C]bibliography\f[R]
+metadata field to YAML array.
+A bibliography may have any of these formats:
+.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{
+CSL JSON
+T}@T{
+\&.json
+T}
+T{
+CSL YAML
+T}@T{
+\&.yaml
+T}
+.TE
+.PP
+Note that \f[C].bib\f[R] can be used with both BibTeX and BibLaTeX
+files; use the extension \f[C].bibtex\f[R] to force interpretation as
+BibTeX.
+.PP
+In BibTeX and BibLaTeX databases, pandoc parses LaTeX markup inside
+fields such as \f[C]title\f[R]; in CSL YAML databases, pandoc Markdown;
+and in CSL JSON databases, an HTML-like markup:
+.TP
+\f[B]\f[CB]<i>...</i>\f[B]\f[R]
+italics
+.TP
+\f[B]\f[CB]<b>...</b>\f[B]\f[R]
+bold
+.TP
+\f[B]\f[CB]<span style=\[dq]font-variant:small-caps;\[dq]>...</span>\f[B]\f[R] or \f[B]\f[CB]<sc>...</sc>\f[B]\f[R]
+small capitals
+.TP
+\f[B]\f[CB]<sub>...</sub>\f[B]\f[R]
+subscript
+.TP
+\f[B]\f[CB]<sup>...</sup>\f[B]\f[R]
+superscript
+.TP
+\f[B]\f[CB]<span class=\[dq]nocase\[dq]>...</span>\f[B]\f[R]
+prevent a phrase from being capitalized as title case
+.PP
+As an alternative to specifying a bibliography file using
+\f[C]--bibliography\f[R] or the YAML metadata field
+\f[C]bibliography\f[R], you can include the citation data directly in
+the \f[C]references\f[R] field of the document\[cq]s YAML metadata.
+The field should contain an array of YAML-encoded references, for
+example:
+.IP
+.nf
+\f[C]
+---
+references:
+- type: article-journal
+  id: WatsonCrick1953
+  author:
+  - family: Watson
+    given: J. D.
+  - family: Crick
+    given: F. H. C.
+  issued:
+    date-parts:
+    - - 1953
+      - 4
+      - 25
+  title: \[aq]Molecular structure of nucleic acids: a structure for
+    deoxyribose nucleic acid\[aq]
+  title-short: Molecular structure of nucleic acids
+  container-title: Nature
+  volume: 171
+  issue: 4356
+  page: 737-738
+  DOI: 10.1038/171737a0
+  URL: https://www.nature.com/articles/171737a0
+  language: en-GB
+\&...
+\f[R]
+.fi
+.PP
+Note that \f[C]pandoc\f[R] can be used to produce such a YAML metadata
+section from a BibTeX, BibLaTeX, or CSL JSON bibliography:
+.IP
+.nf
+\f[C]
+pandoc chem.bib -s -t markdown
+pandoc chem.json -s -t markdown
+\f[R]
+.fi
+.PP
+\f[C]pandoc\f[R] can also be used to produce CSL JSON bibliography from
+BibTeX, BibLaTeX, or markdown YAML:
+.IP
+.nf
+\f[C]
+pandoc chem.bib -s -t csljson
+pandoc chem.yaml -s -t csljson
+\f[R]
+.fi
+.PP
+Running pandoc on a bibliography file with the \f[C]--citeproc\f[R]
+option will create a formatted bibliography in the format of your
+choice:
+.IP
+.nf
+\f[C]
+pandoc chem.bib -s --citeproc -o chem.html
+pandoc chem.bib -s --citeproc -o chem.pdf
+\f[R]
+.fi
+.SS Capitalization in titles
+.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 <span class=\[dq]nocase\[dq]>nm</span> 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.
+.SS Specifying a citation style
+.PP
+Citations and references can be formatted using any style supported by
+the Citation Style Language, listed in the Zotero Style Repository.
+These files are specified using the \f[C]--csl\f[R] option or the
+\f[C]csl\f[R] (or \f[C]citation-style\f[R]) metadata field.
+By default, pandoc will use the Chicago Manual of Style author-date
+format.
+(You can override this default by copying a CSL style of your choice to
+\f[C]default.csl\f[R] in your user data directory.) The CSL project
+provides further information on finding and editing styles.
+.PP
+The \f[C]--citation-abbreviations\f[R] option (or the
+\f[C]citation-abbreviations\f[R] metadata field) may be used to specify
+a JSON file containing abbreviations of journals that should be used in
+formatted bibliographies when \f[C]form=\[dq]short\[dq]\f[R] is
+specified.
+The format of the file can be illustrated with an 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
+.SS Raw content in a style
+.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}}&lt;ref&gt;{{/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.
+.SS Placement of the bibliography
+.PP
+If the style calls for a list of works cited, it will be placed in a div
+with id \f[C]refs\f[R], if one exists:
+.IP
+.nf
+\f[C]
+::: {#refs}
+:::
+\f[R]
+.fi
+.PP
+Otherwise, it will be placed at the end of the document.
+Generation of the bibliography can be suppressed by setting
+\f[C]suppress-bibliography: true\f[R] in the YAML metadata.
+.PP
+If you wish the bibliography to have a section heading, you can set
+\f[C]reference-section-title\f[R] in the metadata, or put the heading at
+the beginning of the div with id \f[C]refs\f[R] (if you are using it) or
+at the end of your document:
+.IP
+.nf
+\f[C]
+last paragraph...
+
+# References
+\f[R]
+.fi
+.PP
+The bibliography will be inserted after this heading.
+Note that the \f[C]unnumbered\f[R] class will be added to this heading,
+so that the section will not be numbered.
+.SS Including uncited items in the bibliography
+.PP
+If you want to include items in the bibliography without actually citing
+them in the body text, you can define a dummy \f[C]nocite\f[R] metadata
+field and put the citations there:
+.IP
+.nf
+\f[C]
+---
+nocite: |
+  \[at]item1, \[at]item2
+\&...
+
+\[at]item3
+\f[R]
+.fi
+.PP
+In this example, the document will contain a citation for
+\f[C]item3\f[R] only, but the bibliography will contain entries for
+\f[C]item1\f[R], \f[C]item2\f[R], and \f[C]item3\f[R].
+.PP
+It is possible to create a bibliography with all the citations, whether
+or not they appear in the document, by using a wildcard:
+.IP
+.nf
+\f[C]
+---
+nocite: |
+  \[at]*
+\&...
+\f[R]
+.fi
+.PP
+For LaTeX output, you can also use \f[C]natbib\f[R] or
+\f[C]biblatex\f[R] to render the bibliography.
+In order to do so, specify bibliography files as outlined above, and add
+\f[C]--natbib\f[R] or \f[C]--biblatex\f[R] argument to \f[C]pandoc\f[R]
+invocation.
+Bear in mind that bibliography files have to be in either BibTeX (for
+\f[C]--natbib\f[R]) or BibLaTeX (for \f[C]--biblatex\f[R]) format.
+.SS Other relevant metadata fields
+.PP
+A few other metadata fields affect bibliography formatting:
+.TP
+\f[B]\f[CB]link-citation\f[B]\f[R]
+If true, citations will be hyperlinked to the corresponding bibliography
+entries (for author-date and numerical styles only).
+.TP
+\f[B]\f[CB]lang\f[B]\f[R]
+The \f[C]lang\f[R] field will affect how the style is localized, for
+example in the translation of labels and the use of quotation marks.
+(For backwards compatibility, \f[C]locale\f[R] may be used instead of
+\f[C]lang\f[R], but this use is deprecated.)
+.TP
+\f[B]\f[CB]notes-after-punctuation\f[B]\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.
+.SH SLIDE SHOWS
+.PP
+You can use pandoc to produce an HTML + JavaScript slide presentation
+that can be viewed via a web browser.
+There are five ways to do this, using S5, DZSlides, Slidy, Slideous, or
+reveal.js.
+You can also produce a PDF slide show using LaTeX \f[C]beamer\f[R], or
+slides shows in Microsoft PowerPoint format.
+.PP
+Here\[cq]s the Markdown source for a simple slide show,
+\f[C]habits.txt\f[R]:
+.IP
+.nf
+\f[C]
+% Habits
+% John Doe
+% March 22, 2005
+
+# In the morning
+
+## Getting up
+
+- Turn off alarm
+- Get out of bed
+
+## Breakfast
+
+- Eat eggs
+- Drink coffee
+
+# In the evening
+
+## Dinner
+
+- Eat spaghetti
+- Drink wine
+
+------------------
+
+![picture of spaghetti](images/spaghetti.jpg)
+
+## Going to sleep
+
+- Get in bed
+- Count sheep
+\f[R]
+.fi
+.PP
+To produce an HTML/JavaScript slide show, simply type
+.IP
+.nf
+\f[C]
+pandoc -t FORMAT -s habits.txt -o habits.html
+\f[R]
+.fi
+.PP
+where \f[C]FORMAT\f[R] is either \f[C]s5\f[R], \f[C]slidy\f[R],
+\f[C]slideous\f[R], \f[C]dzslides\f[R], or \f[C]revealjs\f[R].
+.PP
+For Slidy, Slideous, reveal.js, and S5, the file produced by pandoc with
+the \f[C]-s/--standalone\f[R] option embeds a link to JavaScript and CSS
+files, which are assumed to be available at the relative path
+\f[C]s5/default\f[R] (for S5), \f[C]slideous\f[R] (for Slideous),
+\f[C]reveal.js\f[R] (for reveal.js), or at the Slidy website at
+\f[C]w3.org\f[R] (for Slidy).
+(These paths can be changed by setting the \f[C]slidy-url\f[R],
+\f[C]slideous-url\f[R], \f[C]revealjs-url\f[R], or \f[C]s5-url\f[R]
+variables; see Variables for HTML slides, above.) For DZSlides, the
+(relatively short) JavaScript and CSS are included in the file by
+default.
+.PP
+With all HTML slide formats, the \f[C]--self-contained\f[R] option can
+be used to produce a single file that contains all of the data necessary
+to display the slide show, including linked scripts, stylesheets,
+images, and videos.
+.PP
+To produce a PDF slide show using beamer, type
+.IP
+.nf
+\f[C]
+pandoc -t beamer habits.txt -o habits.pdf
+\f[R]
+.fi
+.PP
+Note that a reveal.js slide show can also be converted to a PDF by
+printing it to a file from the browser.
+.PP
+To produce a Powerpoint slide show, type
+.IP
+.nf
+\f[C]
+pandoc habits.txt -o habits.pptx
+\f[R]
+.fi
+.SS Structuring the slide show
+.PP
+By default, the \f[I]slide level\f[R] is the highest heading level in
+the hierarchy that is followed immediately by content, and not another
+heading, somewhere in the document.
+In the example above, level-1 headings are always followed by level-2
+headings, which are followed by content, so the slide level is 2.
+This default can be overridden using the \f[C]--slide-level\f[R] option.
+.PP
+The document is carved up into slides according to the following rules:
+.IP \[bu] 2
+A horizontal rule always starts a new slide.
+.IP \[bu] 2
+A heading at the slide level always starts a new slide.
+.IP \[bu] 2
+Headings \f[I]below\f[R] the slide level in the hierarchy create
+headings \f[I]within\f[R] a slide.
+.IP \[bu] 2
+Headings \f[I]above\f[R] the slide level in the hierarchy create
+\[lq]title slides,\[rq] which just contain the section title and help to
+break the slide show into sections.
+Non-slide content under these headings will be included on the title
+slide (for HTML slide shows) or in a subsequent slide with the same
+title (for beamer).
+.IP \[bu] 2
+A title page is constructed automatically from the document\[cq]s title
+block, if present.
+(In the case of beamer, this can be disabled by commenting out some
+lines in the default template.)
+.PP
+These rules are designed to support many different styles of slide show.
+If you don\[cq]t care about structuring your slides into sections and
+subsections, you can just use level-1 headings for all each slide.
+(In that case, level-1 will be the slide level.) But you can also
+structure the slide show into sections, as in the example above.
+.PP
+Note: in reveal.js slide shows, if slide level is 2, a two-dimensional
+layout will be produced, with level-1 headings building horizontally and
+level-2 headings building vertically.
+It is not recommended that you use deeper nesting of section levels with
+reveal.js.
+.SS Incremental lists
+.PP
+By default, these writers produce lists that display \[lq]all at
+once.\[rq] If you want your lists to display incrementally (one item at
+a time), use the \f[C]-i\f[R] option.
+If you want a particular list to depart from the default, put it in a
+\f[C]div\f[R] block with class \f[C]incremental\f[R] or
+\f[C]nonincremental\f[R].
+So, for example, using the \f[C]fenced div\f[R] syntax, the following
+would be incremental regardless of the document default:
+.IP
+.nf
+\f[C]
+::: incremental
+
+- Eat spaghetti
+- Drink wine
+
+:::
+\f[R]
+.fi
+.PP
+or
+.IP
+.nf
+\f[C]
+::: nonincremental
+
+- Eat spaghetti
+- Drink wine
+
+:::
+\f[R]
+.fi
+.PP
+While using \f[C]incremental\f[R] and \f[C]nonincremental\f[R] divs are
+the recommended method of setting incremental lists on a per-case basis,
+an older method is also supported: putting lists inside a blockquote
+will depart from the document default (that is, it will display
+incrementally without the \f[C]-i\f[R] option and all at once with the
+\f[C]-i\f[R] option):
+.IP
+.nf
+\f[C]
+> - Eat spaghetti
+> - Drink wine
+\f[R]
+.fi
+.PP
+Both methods allow incremental and nonincremental lists to be mixed in a
+single document.
+.PP
+Note: Neither the \f[C]-i/--incremental\f[R] option nor any of the
+methods described here currently works for PowerPoint output.
+.SS Inserting pauses
+.PP
+You can add \[lq]pauses\[rq] within a slide by including a paragraph
+containing three dots, separated by spaces:
+.IP
+.nf
+\f[C]
+# Slide with a pause
+
+content before the pause
+
+\&. . .
+
+content after the pause
+\f[R]
+.fi
+.PP
+Note: this feature is not yet implemented for PowerPoint output.
+.SS Styling the slides
+.PP
+You can change the style of HTML slides by putting customized CSS files
+in \f[C]$DATADIR/s5/default\f[R] (for S5), \f[C]$DATADIR/slidy\f[R] (for
+Slidy), or \f[C]$DATADIR/slideous\f[R] (for Slideous), where
+\f[C]$DATADIR\f[R] is the user data directory (see \f[C]--data-dir\f[R],
+above).
+The originals may be found in pandoc\[cq]s system data directory
+(generally \f[C]$CABALDIR/pandoc-VERSION/s5/default\f[R]).
+Pandoc will look there for any files it does not find in the user data
+directory.
+.PP
+For dzslides, the CSS is included in the HTML file itself, and may be
+modified there.
+.PP
+All reveal.js configuration options can be set through variables.
+For example, themes can be used by setting the \f[C]theme\f[R] variable:
+.IP
+.nf
+\f[C]
+-V theme=moon
+\f[R]
+.fi
+.PP
+Or you can specify a custom stylesheet using the \f[C]--css\f[R] option.
+.PP
+To style beamer slides, you can specify a \f[C]theme\f[R],
+\f[C]colortheme\f[R], \f[C]fonttheme\f[R], \f[C]innertheme\f[R], and
+\f[C]outertheme\f[R], using the \f[C]-V\f[R] option:
+.IP
+.nf
+\f[C]
+pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf
+\f[R]
+.fi
+.PP
+Note that heading attributes will turn into slide attributes (on a
+\f[C]<div>\f[R] or \f[C]<section>\f[R]) in HTML slide formats, allowing
+you to style individual slides.
+In beamer, the only heading attribute that affects slides is the
+\f[C]allowframebreaks\f[R] class, which sets the
+\f[C]allowframebreaks\f[R] option, causing multiple slides to be created
+if the content overfills the frame.
+This is recommended especially for bibliographies:
+.IP
+.nf
+\f[C]
+# References {.allowframebreaks}
+\f[R]
+.fi
+.SS Speaker notes
+.PP
+Speaker notes are supported in reveal.js and PowerPoint (pptx) output.
+You can add notes to your Markdown document thus:
+.IP
+.nf
+\f[C]
+::: notes
+
+This is my note.
+
+- It can contain Markdown
+- like this list
+
+:::
+\f[R]
+.fi
+.PP
+To show the notes window in reveal.js, press \f[C]s\f[R] while viewing
+the presentation.
+Speaker notes in PowerPoint will be available, as usual, in handouts and
+presenter view.
+.PP
+Notes are not yet supported for other slide formats, but the notes will
+not appear on the slides themselves.
+.SS Columns
+.PP
+To put material in side by side columns, you can use a native div
+container with class \f[C]columns\f[R], containing two or more div
+containers with class \f[C]column\f[R] and a \f[C]width\f[R] attribute:
+.IP
+.nf
+\f[C]
+:::::::::::::: {.columns}
+::: {.column width=\[dq]40%\[dq]}
+contents...
+:::
+::: {.column width=\[dq]60%\[dq]}
+contents...
+:::
+::::::::::::::
+\f[R]
+.fi
+.SS Additional columns attributes in beamer
+.PP
+The div containers with classes \f[C]columns\f[R] and \f[C]column\f[R]
+can optionally have an \f[C]align\f[R] attribute.
+The class \f[C]columns\f[R] can optionally have a \f[C]totalwidth\f[R]
+attribute or an \f[C]onlytextwidth\f[R] class.
+.IP
+.nf
+\f[C]
+:::::::::::::: {.columns align=center totalwidth=8em}
+::: {.column width=\[dq]40%\[dq]}
+contents...
+:::
+::: {.column width=\[dq]60%\[dq] align=bottom}
+contents...
+:::
+::::::::::::::
+\f[R]
+.fi
+.PP
+The \f[C]align\f[R] attributes on \f[C]columns\f[R] and \f[C]column\f[R]
+can be used with the values \f[C]top\f[R], \f[C]top-baseline\f[R],
+\f[C]center\f[R] and \f[C]bottom\f[R] to vertically align the columns.
+It defaults to \f[C]top\f[R] in \f[C]columns\f[R].
+.PP
+The \f[C]totalwidth\f[R] attribute limits the width of the columns to
+the given value.
+.IP
+.nf
+\f[C]
+:::::::::::::: {.columns align=top .onlytextwidth}
+::: {.column width=\[dq]40%\[dq] align=center}
+contents...
+:::
+::: {.column width=\[dq]60%\[dq]}
+contents...
+:::
+::::::::::::::
+\f[R]
+.fi
+.PP
+The class \f[C]onlytextwidth\f[R] sets the \f[C]totalwidth\f[R] to
+\f[C]\[rs]textwidth\f[R].
+.PP
+See Section 12.7 of the Beamer User\[cq]s Guide for more details.
+.SS Frame attributes in beamer
+.PP
+Sometimes it is necessary to add the LaTeX \f[C][fragile]\f[R] option to
+a frame in beamer (for example, when using the \f[C]minted\f[R]
+environment).
+This can be forced by adding the \f[C]fragile\f[R] class to the heading
+introducing the slide:
+.IP
+.nf
+\f[C]
+# Fragile slide {.fragile}
+\f[R]
+.fi
+.PP
+All of the other frame attributes described in Section 8.1 of the Beamer
+User\[cq]s Guide may also be used: \f[C]allowdisplaybreaks\f[R],
+\f[C]allowframebreaks\f[R], \f[C]b\f[R], \f[C]c\f[R], \f[C]t\f[R],
+\f[C]environment\f[R], \f[C]label\f[R], \f[C]plain\f[R],
+\f[C]shrink\f[R], \f[C]standout\f[R], \f[C]noframenumbering\f[R].
+.SS Background in reveal.js and beamer
+.PP
+Background images can be added to self-contained reveal.js slideshows
+and to beamer slideshows.
+.PP
+For the same image on every slide, use the configuration option
+\f[C]background-image\f[R] either in the YAML metadata block or as a
+command-line variable.
+(There are no other options in beamer and the rest of this section
+concerns reveal.js slideshows.)
+.PP
+For reveal.js, you can instead use the reveal.js-native option
+\f[C]parallaxBackgroundImage\f[R].
+You can also set \f[C]parallaxBackgroundHorizontal\f[R] and
+\f[C]parallaxBackgroundVertical\f[R] the same way and must also set
+\f[C]parallaxBackgroundSize\f[R] to have your values take effect.
+.PP
+To set an image for a particular reveal.js slide, add
+\f[C]{data-background-image=\[dq]/path/to/image\[dq]}\f[R] to the first
+slide-level heading on the slide (which may even be empty).
+.PP
+In reveal.js\[cq]s overview mode, the parallaxBackgroundImage will show
+up only on the first slide.
+.PP
+Other reveal.js background settings also work on individual slides,
+including \f[C]data-background-size\f[R],
+\f[C]data-background-repeat\f[R], \f[C]data-background-color\f[R],
+\f[C]data-transition\f[R], and \f[C]data-transition-speed\f[R].
+.PP
+To add a background image to the automatically generated title slide,
+use the \f[C]title-slide-attributes\f[R] variable in the YAML metadata
+block.
+It must contain a map of attribute names and values.
+.PP
+See the reveal.js documentation for more details.
+.PP
+For example in reveal.js:
+.IP
+.nf
+\f[C]
+---
+title: My Slideshow
+parallaxBackgroundImage: /path/to/my/background_image.png
+title-slide-attributes:
+    data-background-image: /path/to/title_image.png
+    data-background-size: contain
+---
+
+## Slide One
+
+Slide 1 has background_image.png as its background.
+
+## {data-background-image=\[dq]/path/to/special_image.jpg\[dq]}
+
+Slide 2 has a special image for its background, even though the heading has no content.
+\f[R]
+.fi
+.SH EPUBS
+.SS EPUB Metadata
+.PP
+EPUB metadata may be specified using the \f[C]--epub-metadata\f[R]
+option, but if the source document is Markdown, it is better to use a
+YAML metadata block.
+Here is an example:
+.IP
+.nf
+\f[C]
+---
+title:
+- type: main
+  text: My Book
+- type: subtitle
+  text: An investigation of metadata
+creator:
+- role: author
+  text: John Smith
+- role: editor
+  text: Sarah Jones
+identifier:
+- scheme: DOI
+  text: doi:10.234234.234/33
+publisher:  My Press
+rights: \[co] 2007 John Smith, CC BY-NC
+ibooks:
+  version: 1.3.4
+\&...
+\f[R]
+.fi
+.PP
+The following fields are recognized:
+.TP
+\f[B]\f[CB]identifier\f[B]\f[R]
+Either a string value or an object with fields \f[C]text\f[R] and
+\f[C]scheme\f[R].
+Valid values for \f[C]scheme\f[R] are \f[C]ISBN-10\f[R],
+\f[C]GTIN-13\f[R], \f[C]UPC\f[R], \f[C]ISMN-10\f[R], \f[C]DOI\f[R],
+\f[C]LCCN\f[R], \f[C]GTIN-14\f[R], \f[C]ISBN-13\f[R],
+\f[C]Legal deposit number\f[R], \f[C]URN\f[R], \f[C]OCLC\f[R],
+\f[C]ISMN-13\f[R], \f[C]ISBN-A\f[R], \f[C]JP\f[R], \f[C]OLCC\f[R].
+.TP
+\f[B]\f[CB]title\f[B]\f[R]
+Either a string value, or an object with fields \f[C]file-as\f[R] and
+\f[C]type\f[R], or a list of such objects.
+Valid values for \f[C]type\f[R] are \f[C]main\f[R], \f[C]subtitle\f[R],
+\f[C]short\f[R], \f[C]collection\f[R], \f[C]edition\f[R],
+\f[C]extended\f[R].
+.TP
+\f[B]\f[CB]creator\f[B]\f[R]
+Either a string value, or an object with fields \f[C]role\f[R],
+\f[C]file-as\f[R], and \f[C]text\f[R], or a list of such objects.
+Valid values for \f[C]role\f[R] are MARC relators, but pandoc will
+attempt to translate the human-readable versions (like \[lq]author\[rq]
+and \[lq]editor\[rq]) to the appropriate marc relators.
+.TP
+\f[B]\f[CB]contributor\f[B]\f[R]
+Same format as \f[C]creator\f[R].
+.TP
+\f[B]\f[CB]date\f[B]\f[R]
+A string value in \f[C]YYYY-MM-DD\f[R] format.
+(Only the year is necessary.) Pandoc will attempt to convert other
+common date formats.
+.TP
+\f[B]\f[CB]lang\f[B]\f[R] (or legacy: \f[B]\f[CB]language\f[B]\f[R])
+A string value in BCP 47 format.
+Pandoc will default to the local language if nothing is specified.
+.TP
+\f[B]\f[CB]subject\f[B]\f[R]
+A string value or a list of such values.
+.TP
+\f[B]\f[CB]description\f[B]\f[R]
+A string value.
+.TP
+\f[B]\f[CB]type\f[B]\f[R]
+A string value.
+.TP
+\f[B]\f[CB]format\f[B]\f[R]
+A string value.
+.TP
+\f[B]\f[CB]relation\f[B]\f[R]
+A string value.
+.TP
+\f[B]\f[CB]coverage\f[B]\f[R]
+A string value.
+.TP
+\f[B]\f[CB]rights\f[B]\f[R]
+A string value.
+.TP
+\f[B]\f[CB]cover-image\f[B]\f[R]
+A string value (path to cover image).
+.TP
+\f[B]\f[CB]css\f[B]\f[R] (or legacy: \f[B]\f[CB]stylesheet\f[B]\f[R])
+A string value (path to CSS stylesheet).
+.TP
+\f[B]\f[CB]page-progression-direction\f[B]\f[R]
+Either \f[C]ltr\f[R] or \f[C]rtl\f[R].
+Specifies the \f[C]page-progression-direction\f[R] attribute for the
+\f[C]spine\f[R] element.
+.TP
+\f[B]\f[CB]ibooks\f[B]\f[R]
+iBooks-specific metadata, with the following fields:
+.RS
+.IP \[bu] 2
+\f[C]version\f[R]: (string)
+.IP \[bu] 2
+\f[C]specified-fonts\f[R]: \f[C]true\f[R]|\f[C]false\f[R] (default
+\f[C]false\f[R])
+.IP \[bu] 2
+\f[C]ipad-orientation-lock\f[R]:
+\f[C]portrait-only\f[R]|\f[C]landscape-only\f[R]
+.IP \[bu] 2
+\f[C]iphone-orientation-lock\f[R]:
+\f[C]portrait-only\f[R]|\f[C]landscape-only\f[R]
+.IP \[bu] 2
+\f[C]binding\f[R]: \f[C]true\f[R]|\f[C]false\f[R] (default
+\f[C]true\f[R])
+.IP \[bu] 2
+\f[C]scroll-axis\f[R]:
+\f[C]vertical\f[R]|\f[C]horizontal\f[R]|\f[C]default\f[R]
+.RE
+.SS The \f[C]epub:type\f[R] attribute
+.PP
+For \f[C]epub3\f[R] output, you can mark up the heading that corresponds
+to an EPUB chapter using the \f[C]epub:type\f[R] attribute.
+For example, to set the attribute to the value \f[C]prologue\f[R], use
+this markdown:
+.IP
+.nf
+\f[C]
+# My chapter {epub:type=prologue}
+\f[R]
+.fi
+.PP
+Which will result in:
+.IP
+.nf
+\f[C]
+<body epub:type=\[dq]frontmatter\[dq]>
+  <section epub:type=\[dq]prologue\[dq]>
+    <h1>My chapter</h1>
+\f[R]
+.fi
+.PP
+Pandoc will output \f[C]<body epub:type=\[dq]bodymatter\[dq]>\f[R],
+unless you use one of the following values, in which case either
+\f[C]frontmatter\f[R] or \f[C]backmatter\f[R] will be output.
+.PP
+.TS
+tab(@);
+l l.
+T{
+\f[C]epub:type\f[R] of first section
+T}@T{
+\f[C]epub:type\f[R] of body
+T}
+_
+T{
+prologue
+T}@T{
+frontmatter
+T}
+T{
+abstract
+T}@T{
+frontmatter
+T}
+T{
+acknowledgments
+T}@T{
+frontmatter
+T}
+T{
+copyright-page
+T}@T{
+frontmatter
+T}
+T{
+dedication
+T}@T{
+frontmatter
+T}
+T{
+credits
+T}@T{
+frontmatter
+T}
+T{
+keywords
+T}@T{
+frontmatter
+T}
+T{
+imprint
+T}@T{
+frontmatter
+T}
+T{
+contributors
+T}@T{
+frontmatter
+T}
+T{
+other-credits
+T}@T{
+frontmatter
+T}
+T{
+errata
+T}@T{
+frontmatter
+T}
+T{
+revision-history
+T}@T{
+frontmatter
+T}
+T{
+titlepage
+T}@T{
+frontmatter
+T}
+T{
+halftitlepage
+T}@T{
+frontmatter
+T}
+T{
+seriespage
+T}@T{
+frontmatter
+T}
+T{
+foreword
+T}@T{
+frontmatter
+T}
+T{
+preface
+T}@T{
+frontmatter
+T}
+T{
+appendix
+T}@T{
+backmatter
+T}
+T{
+colophon
+T}@T{
+backmatter
+T}
+T{
+bibliography
+T}@T{
+backmatter
+T}
+T{
+index
+T}@T{
+backmatter
+T}
+.TE
+.SS Linked media
+.PP
+By default, pandoc will download media referenced from any
+\f[C]<img>\f[R], \f[C]<audio>\f[R], \f[C]<video>\f[R] or
+\f[C]<source>\f[R] element present in the generated EPUB, and include it
+in the EPUB container, yielding a completely self-contained EPUB.
+If you want to link to external media resources instead, use raw HTML in
+your source and add \f[C]data-external=\[dq]1\[dq]\f[R] to the tag with
+the \f[C]src\f[R] attribute.
+For example:
+.IP
+.nf
+\f[C]
+<audio controls=\[dq]1\[dq]>
+  <source src=\[dq]https://example.com/music/toccata.mp3\[dq]
+          data-external=\[dq]1\[dq] type=\[dq]audio/mpeg\[dq]>
+  </source>
+</audio>
+\f[R]
+.fi
+.SH JUPYTER NOTEBOOKS
+.PP
+When creating a Jupyter notebook, pandoc will try to infer the notebook
+structure.
+Code blocks with the class \f[C]code\f[R] will be taken as code cells,
+and intervening content will be taken as Markdown cells.
+Attachments will automatically be created for images in Markdown cells.
+Metadata will be taken from the \f[C]jupyter\f[R] metadata field.
+For example:
+.IP
+.nf
+\f[C]
+---
+title: My notebook
+jupyter:
+  nbformat: 4
+  nbformat_minor: 5
+  kernelspec:
+     display_name: Python 2
+     language: python
+     name: python2
+  language_info:
+     codemirror_mode:
+       name: ipython
+       version: 2
+     file_extension: \[dq].py\[dq]
+     mimetype: \[dq]text/x-python\[dq]
+     name: \[dq]python\[dq]
+     nbconvert_exporter: \[dq]python\[dq]
+     pygments_lexer: \[dq]ipython2\[dq]
+     version: \[dq]2.7.15\[dq]
+---
+
+# Lorem ipsum
+
+**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus
+bibendum felis dictum sodales.
+
+\[ga]\[ga]\[ga] code
+print(\[dq]hello\[dq])
+\[ga]\[ga]\[ga]
+
+## Pyout
+
+\[ga]\[ga]\[ga] code
+from IPython.display import HTML
+HTML(\[dq]\[dq]\[dq]
+<script>
+console.log(\[dq]hello\[dq]);
+</script>
+<b>HTML</b>
+\[dq]\[dq]\[dq])
+\[ga]\[ga]\[ga]
+
+## Image
+
+This image ![image](myimage.png) will be
+included as a cell attachment.
+\f[R]
+.fi
+.PP
+If you want to add cell attributes, group cells differently, or add
+output to code cells, then you need to include divs to indicate the
+structure.
+You can use either fenced divs or native divs for this.
+Here is an example:
+.IP
+.nf
+\f[C]
+:::::: {.cell .markdown}
+# Lorem
+
+**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus
+bibendum felis dictum sodales.
+::::::
+
+:::::: {.cell .code execution_count=1}
+\[ga]\[ga]\[ga] {.python}
+print(\[dq]hello\[dq])
+\[ga]\[ga]\[ga]
+
+::: {.output .stream .stdout}
+\[ga]\[ga]\[ga]
+hello
+\[ga]\[ga]\[ga]
+:::
+::::::
+
+:::::: {.cell .code execution_count=2}
+\[ga]\[ga]\[ga] {.python}
+from IPython.display import HTML
+HTML(\[dq]\[dq]\[dq]
+<script>
+console.log(\[dq]hello\[dq]);
+</script>
+<b>HTML</b>
+\[dq]\[dq]\[dq])
+\[ga]\[ga]\[ga]
+
+::: {.output .execute_result execution_count=2}
+\[ga]\[ga]\[ga]{=html}
+<script>
+console.log(\[dq]hello\[dq]);
+</script>
+<b>HTML</b>
+hello
+\[ga]\[ga]\[ga]
+:::
+::::::
+\f[R]
+.fi
+.PP
+If you include raw HTML or TeX in an output cell, use the [raw
+attribute][Extension: \f[C]fenced_attribute\f[R]], as shown in the last
+cell of the example above.
+Although pandoc can process \[lq]bare\[rq] raw HTML and TeX, the result
+is often interspersed raw elements and normal textual elements, and in
+an output cell pandoc expects a single, connected raw block.
+To avoid using raw HTML or TeX except when marked explicitly using raw
+attributes, we recommend specifying the extensions
+\f[C]-raw_html-raw_tex+raw_attribute\f[R] when translating between
+Markdown and ipynb notebooks.
+.PP
+Note that options and extensions that affect reading and writing of
+Markdown will also affect Markdown cells in ipynb notebooks.
+For example, \f[C]--wrap=preserve\f[R] will preserve soft line breaks in
+Markdown cells; \f[C]--atx-headers\f[R] will cause ATX-style headings to
+be used; and \f[C]--preserve-tabs\f[R] will prevent tabs from being
+turned to spaces.
+.SH SYNTAX HIGHLIGHTING
+.PP
+Pandoc will automatically highlight syntax in fenced code blocks that
+are marked with a language name.
+The Haskell library skylighting is used for highlighting.
+Currently highlighting is supported only for HTML, EPUB, Docx, Ms, and
+LaTeX/PDF output.
+To see a list of language names that pandoc will recognize, type
+\f[C]pandoc --list-highlight-languages\f[R].
+.PP
+The color scheme can be selected using the \f[C]--highlight-style\f[R]
+option.
+The default color scheme is \f[C]pygments\f[R], which imitates the
+default color scheme used by the Python library pygments (though
+pygments is not actually used to do the highlighting).
+To see a list of highlight styles, type
+\f[C]pandoc --list-highlight-styles\f[R].
+.PP
+If you are not satisfied with the predefined styles, you can use
+\f[C]--print-highlight-style\f[R] to generate a JSON \f[C].theme\f[R]
+file which can be modified and used as the argument to
+\f[C]--highlight-style\f[R].
+To get a JSON version of the \f[C]pygments\f[R] style, for example:
+.IP
+.nf
+\f[C]
+pandoc --print-highlight-style pygments > my.theme
+\f[R]
+.fi
+.PP
+Then edit \f[C]my.theme\f[R] and use it like this:
+.IP
+.nf
+\f[C]
+pandoc --highlight-style my.theme
+\f[R]
+.fi
+.PP
+If you are not satisfied with the built-in highlighting, or you want
+highlight a language that isn\[cq]t supported, you can use the
+\f[C]--syntax-definition\f[R] option to load a KDE-style XML syntax
+definition file.
+Before writing your own, have a look at KDE\[cq]s repository of syntax
+definitions.
+.PP
+To disable highlighting, use the \f[C]--no-highlight\f[R] option.
+.SH CUSTOM STYLES
+.PP
+Custom styles can be used in the docx and ICML formats.
+.SS Output
+.PP
+By default, pandoc\[cq]s docx and ICML output applies a predefined set
+of styles for blocks such as paragraphs and block quotes, and uses
+largely default formatting (italics, bold) for inlines.
+This will work for most purposes, especially alongside a
+\f[C]reference.docx\f[R] file.
+However, if you need to apply your own styles to blocks, or match a
+preexisting set of styles, pandoc allows you to define custom styles for
+blocks and text using \f[C]div\f[R]s and \f[C]span\f[R]s, respectively.
+.PP
+If you define a \f[C]div\f[R] or \f[C]span\f[R] with the attribute
+\f[C]custom-style\f[R], pandoc will apply your specified style to the
+contained elements (with the exception of elements whose function
+depends on a style, like headings, code blocks, block quotes, or links).
+So, for example, using the \f[C]bracketed_spans\f[R] syntax,
+.IP
+.nf
+\f[C]
+[Get out]{custom-style=\[dq]Emphatically\[dq]}, he said.
+\f[R]
+.fi
+.PP
+would produce a docx file with \[lq]Get out\[rq] styled with character
+style \f[C]Emphatically\f[R].
+Similarly, using the \f[C]fenced_divs\f[R] syntax,
+.IP
+.nf
+\f[C]
+Dickinson starts the poem simply:
+
+::: {custom-style=\[dq]Poetry\[dq]}
+| A Bird came down the Walk---
+| He did not know I saw---
+:::
+\f[R]
+.fi
+.PP
+would style the two contained lines with the \f[C]Poetry\f[R] paragraph
+style.
+.PP
+For docx output, styles will be defined in the output file as inheriting
+from normal text, if the styles are not yet in your reference.docx.
+If they are already defined, pandoc will not alter the definition.
+.PP
+This feature allows for greatest customization in conjunction with
+pandoc filters.
+If you want all paragraphs after block quotes to be indented, you can
+write a filter to apply the styles necessary.
+If you want all italics to be transformed to the \f[C]Emphasis\f[R]
+character style (perhaps to change their color), you can write a filter
+which will transform all italicized inlines to inlines within an
+\f[C]Emphasis\f[R] custom-style \f[C]span\f[R].
+.PP
+For docx output, you don\[cq]t need to enable any extensions for custom
+styles to work.
+.SS Input
+.PP
+The docx reader, by default, only reads those styles that it can convert
+into pandoc elements, either by direct conversion or interpreting the
+derivation of the input document\[cq]s styles.
+.PP
+By enabling the \f[C]styles\f[R] extension in the docx reader
+(\f[C]-f docx+styles\f[R]), you can produce output that maintains the
+styles of the input document, using the \f[C]custom-style\f[R] class.
+Paragraph styles are interpreted as divs, while character styles are
+interpreted as spans.
+.PP
+For example, using the \f[C]custom-style-reference.docx\f[R] file in the
+test directory, we have the following different outputs:
+.PP
+Without the \f[C]+styles\f[R] extension:
+.IP
+.nf
+\f[C]
+$ pandoc test/docx/custom-style-reference.docx -f docx -t markdown
+This is some text.
+
+This is text with an *emphasized* text style. And this is text with a
+**strengthened** text style.
+
+> Here is a styled paragraph that inherits from Block Text.
+\f[R]
+.fi
+.PP
+And with the extension:
+.IP
+.nf
+\f[C]
+$ pandoc test/docx/custom-style-reference.docx -f docx+styles -t markdown
+
+::: {custom-style=\[dq]First Paragraph\[dq]}
+This is some text.
+:::
+
+::: {custom-style=\[dq]Body Text\[dq]}
+This is text with an [emphasized]{custom-style=\[dq]Emphatic\[dq]} text style.
+And this is text with a [strengthened]{custom-style=\[dq]Strengthened\[dq]}
+text style.
+:::
+
+::: {custom-style=\[dq]My Block Style\[dq]}
+> Here is a styled paragraph that inherits from Block Text.
+:::
+\f[R]
+.fi
+.PP
+With these custom styles, you can use your input document as a
+reference-doc while creating docx output (see below), and maintain the
+same styles in your input and output files.
+.SH CUSTOM WRITERS
+.PP
+Pandoc can be extended with custom writers written in Lua.
+(Pandoc includes a Lua interpreter, so Lua need not be installed
+separately.)
+.PP
+To use a custom writer, simply specify the path to the Lua script in
+place of the output format.
+For example:
+.IP
+.nf
+\f[C]
+pandoc -t data/sample.lua
+\f[R]
+.fi
+.PP
+Creating a custom writer requires writing a Lua function for each
+possible element in a pandoc document.
+To get a documented example which you can modify according to your
+needs, do
+.IP
+.nf
+\f[C]
+pandoc --print-default-data-file sample.lua
+\f[R]
+.fi
+.PP
+Note that custom writers have no default template.
+If you want to use \f[C]--standalone\f[R] with a custom writer, you will
+need to specify a template manually using \f[C]--template\f[R] or add a
+new default template with the name
+\f[C]default.NAME_OF_CUSTOM_WRITER.lua\f[R] to the \f[C]templates\f[R]
+subdirectory of your user data directory (see Templates).
+.SH A NOTE ON SECURITY
+.PP
+If you use pandoc to convert user-contributed content in a web
+application, here are some things to keep in mind:
+.IP "1." 3
+Although pandoc itself will not create or modify any files other than
+those you explicitly ask it create (with the exception of temporary
+files used in producing PDFs), a filter or custom writer could in
+principle do anything on your file system.
+Please audit filters and custom writers very carefully before using
+them.
+.IP "2." 3
+If your application uses pandoc as a Haskell library (rather than
+shelling out to the executable), it is possible to use it in a mode that
+fully isolates pandoc from your file system, by running the pandoc
+operations in the \f[C]PandocPure\f[R] monad.
+See the document Using the pandoc API for more details.
+.IP "3." 3
+Pandoc\[cq]s parsers can exhibit pathological performance on some corner
+cases.
+It is wise to put any pandoc operations under a timeout, to avoid DOS
+attacks that exploit these issues.
+If you are using the pandoc executable, you can add the command line
+options \f[C]+RTS -M512M -RTS\f[R] (for example) to limit the heap size
+to 512MB.
+.IP "4." 3
+The HTML generated by pandoc is not guaranteed to be safe.
+If \f[C]raw_html\f[R] is enabled for the Markdown input, users can
+inject arbitrary HTML.
+Even if \f[C]raw_html\f[R] is disabled, users can include dangerous
+content in attributes for headings, spans, and code blocks.
+To be safe, you should run all the generated HTML through an HTML
+sanitizer.
+.SH AUTHORS
+.PP
+Copyright 2006\[en]2020 John MacFarlane (jgm\[at]berkeley.edu).
 Released under the GPL, version 2 or greater.
 This software carries no warranty of any kind.
 (See COPYRIGHT for full copyright and warranty notices.) For a full list
diff --git a/pandoc.cabal b/pandoc.cabal
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -1,6 +1,6 @@
 cabal-version:   2.2
 name:            pandoc
-version:         2.10.1
+version:         2.11
 build-type:      Simple
 license:         GPL-2.0-or-later
 license-file:    COPYING.md
@@ -12,7 +12,7 @@
 homepage:        https://pandoc.org
 category:        Text
 tested-with:     GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5,
-                 GHC == 8.8.3, GHC == 8.10.1
+                 GHC == 8.8.4, GHC == 8.10.2
 synopsis:        Conversion between markup formats
 description:     Pandoc is a Haskell library for converting from one markup
                  format to another, and a command-line tool that uses
@@ -22,14 +22,15 @@
                  TikiWiki markup, Jira markup, Creole 1.0, Haddock markup,
                  OPML, Emacs Org-Mode, Emacs Muse, txt2tags, ipynb (Jupyter
                  notebooks), Vimwiki, Word Docx, ODT, EPUB, FictionBook2,
-                 roff man, Textile, and CSV, and it can write Markdown,
+                 roff man, Textile, BibTeX, BibLaTeX, CSL JSON,
+                 , and CSV, and it can write Markdown,
                  reStructuredText, XHTML, HTML 5, LaTeX, ConTeXt, DocBook,
                  JATS, OPML, TEI, OpenDocument, ODT, Word docx,
                  PowerPoint pptx, RTF, MediaWiki, DokuWiki, XWiki,
                  ZimWiki, Textile, Jira, roff man, roff ms, plain text,
                  Emacs Org-Mode, AsciiDoc, Haddock markup,
                  EPUB (v2 and v3), ipynb, FictionBook2,
-                 InDesign ICML, Muse, LaTeX beamer slides,
+                 InDesign ICML, Muse, CSL JSON, LaTeX beamer slides,
                  and several kinds of HTML/JavaScript slide shows
                  (S5, Slidy, Slideous, DZSlides, reveal.js).
                  .
@@ -180,6 +181,9 @@
                  data/bash_completion.tpl
                  -- jats csl
                  data/jats.csl
+                 -- citeproc
+                 data/default.csl
+                 citeproc/biblatex-localization/*.lbx.strings
                  -- documentation
                  MANUAL.txt, COPYRIGHT
 extra-source-files:
@@ -201,6 +205,9 @@
                  test/bodybg.gif
                  test/*.native
                  test/command/*.md
+                 test/command/*.csl
+                 test/command/biblio.bib
+                 test/command/biblatex-examples.bib
                  test/command/A.txt
                  test/command/B.txt
                  test/command/C.txt
@@ -288,6 +295,9 @@
                  test/tables.muse
                  test/tables.custom
                  test/tables.xwiki
+                 test/tables/*.html4
+                 test/tables/*.html5
+                 test/tables/*.native
                  test/testsuite.txt
                  test/writer.latex
                  test/writer.context
@@ -379,67 +389,69 @@
   Default:       False
 
 library
-  build-depends: base >= 4.9 && < 5,
-                 syb >= 0.1 && < 0.8,
-                 containers >= 0.4.2.1 && < 0.7,
-                 unordered-containers >= 0.2 && < 0.3,
-                 parsec >= 3.1 && < 3.2,
-                 mtl >= 2.2 && < 2.3,
-                 exceptions >= 0.8 && < 0.11,
-                 filepath >= 1.1 && < 1.5,
-                 process >= 1.2.3 && < 1.7,
-                 directory >= 1.2.3 && < 1.4,
-                 bytestring >= 0.9 && < 0.11,
-                 text >= 1.1.1.0 && < 1.3,
-                 time >= 1.5 && < 1.10,
-                 safe >= 0.3 && < 0.4,
-                 zip-archive >= 0.2.3.4 && < 0.5,
-                 HTTP >= 4000.0.5 && < 4000.4,
-                 texmath >= 0.12.0.2 && < 0.13,
-                 xml >= 1.3.12 && < 1.4,
-                 split >= 0.2 && < 0.3,
-                 random >= 1 && < 1.2,
-                 pandoc-types >= 1.21 && < 1.22,
-                 aeson >= 0.7 && < 1.6,
-                 scientific >= 0.3 && < 0.4,
-                 aeson-pretty >= 0.8.5 && < 0.9,
-                 tagsoup >= 0.14.6 && < 0.15,
-                 base64-bytestring >= 0.1 && < 1.2,
-                 zlib >= 0.5 && < 0.7,
-                 skylighting >= 0.8.5 && < 0.9,
-                 skylighting-core >= 0.8.5 && < 0.9,
-                 data-default >= 0.4 && < 0.8,
-                 temporary >= 1.1 && < 1.4,
-                 blaze-html >= 0.9 && < 0.10,
-                 blaze-markup >= 0.8 && < 0.9,
-                 jira-wiki-markup >= 1.3.2 && < 1.4,
-                 hslua >= 1.1 && < 1.2,
-                 hslua-module-system >= 0.2 && < 0.3,
-                 hslua-module-text >= 0.2.1 && < 0.3,
-                 binary >= 0.5 && < 0.11,
-                 SHA >= 1.6 && < 1.7,
-                 haddock-library >= 1.8 && < 1.10,
-                 deepseq >= 1.3 && < 1.5,
-                 JuicyPixels >= 3.1.6.1 && < 3.4,
-                 Glob >= 0.7 && < 0.11,
-                 doctemplates >= 0.8.2 && < 0.9,
-                 commonmark-pandoc >= 0.2 && < 0.3,
-                 commonmark >= 0.1.0.1 && < 0.2,
-                 commonmark-extensions >= 0.2 && < 0.3,
-                 network-uri >= 2.6 && < 2.7,
-                 network >= 2.6,
-                 connection >= 0.3.1,
-                 http-client >= 0.4.30 && < 0.8,
-                 http-client-tls >= 0.2.4 && < 0.4,
-                 http-types >= 0.8 && < 0.13,
-                 case-insensitive >= 1.2 && < 1.3,
-                 unicode-transforms >= 0.3 && < 0.4,
-                 HsYAML >= 0.2 && < 0.3,
-                 doclayout >= 0.3 && < 0.4,
-                 ipynb >= 0.1 && < 0.2,
-                 attoparsec >= 0.12 && < 0.14,
-                 text-conversions >= 0.3 && < 0.4,
-                 emojis >= 0.1 && < 0.2
+  build-depends: base                  >= 4.9      && < 5,
+                 Glob                  >= 0.7      && < 0.11,
+                 HTTP                  >= 4000.0.5 && < 4000.4,
+                 HsYAML                >= 0.2      && < 0.3,
+                 JuicyPixels           >= 3.1.6.1  && < 3.4,
+                 SHA                   >= 1.6      && < 1.7,
+                 aeson                 >= 0.7      && < 1.6,
+                 aeson-pretty          >= 0.8.5    && < 0.9,
+                 attoparsec            >= 0.12     && < 0.14,
+                 base64-bytestring     >= 0.1      && < 1.2,
+                 binary                >= 0.5      && < 0.11,
+                 blaze-html            >= 0.9      && < 0.10,
+                 blaze-markup          >= 0.8      && < 0.9,
+                 bytestring            >= 0.9      && < 0.12,
+                 case-insensitive      >= 1.2      && < 1.3,
+                 citeproc              >= 0.1      && < 0.2,
+                 commonmark            >= 0.1.0.2  && < 0.2,
+                 commonmark-extensions >= 0.2      && < 0.3,
+                 commonmark-pandoc     >= 0.2      && < 0.3,
+                 connection            >= 0.3.1,
+                 containers            >= 0.4.2.1  && < 0.7,
+                 data-default          >= 0.4      && < 0.8,
+                 deepseq               >= 1.3      && < 1.5,
+                 directory             >= 1.2.3    && < 1.4,
+                 doclayout             >= 0.3      && < 0.4,
+                 doctemplates          >= 0.8.2    && < 0.9,
+                 emojis                >= 0.1      && < 0.2,
+                 exceptions            >= 0.8      && < 0.11,
+                 file-embed            >= 0.0      && < 0.1,
+                 filepath              >= 1.1      && < 1.5,
+                 haddock-library       >= 1.8      && < 1.10,
+                 hslua                 >= 1.1      && < 1.3,
+                 hslua-module-system   >= 0.2      && < 0.3,
+                 hslua-module-text     >= 0.2.1    && < 0.4,
+                 http-client           >= 0.4.30   && < 0.8,
+                 http-client-tls       >= 0.2.4    && < 0.4,
+                 http-types            >= 0.8      && < 0.13,
+                 ipynb                 >= 0.1      && < 0.2,
+                 jira-wiki-markup      >= 1.3.2    && < 1.4,
+                 mtl                   >= 2.2      && < 2.3,
+                 network               >= 2.6,
+                 network-uri           >= 2.6      && < 2.7,
+                 pandoc-types          >= 1.22     && < 1.23,
+                 parsec                >= 3.1      && < 3.2,
+                 process               >= 1.2.3    && < 1.7,
+                 random                >= 1        && < 1.2,
+                 safe                  >= 0.3      && < 0.4,
+                 scientific            >= 0.3      && < 0.4,
+                 skylighting           >= 0.10     && < 0.11,
+                 skylighting-core      >= 0.10     && < 0.11,
+                 split                 >= 0.2      && < 0.3,
+                 syb                   >= 0.1      && < 0.8,
+                 tagsoup               >= 0.14.6   && < 0.15,
+                 temporary             >= 1.1      && < 1.4,
+                 texmath               >= 0.12.0.2 && < 0.13,
+                 text                  >= 1.1.1.0  && < 1.3,
+                 text-conversions      >= 0.3      && < 0.4,
+                 time                  >= 1.5      && < 1.10,
+                 unicode-transforms    >= 0.3      && < 0.4,
+                 unordered-containers  >= 0.2      && < 0.3,
+                 xml                   >= 1.3.12   && < 1.4,
+                 zip-archive           >= 0.2.3.4  && < 0.5,
+                 zlib                  >= 0.5      && < 0.7
   if os(windows) && arch(i386)
      build-depends: basement >= 0.0.10,
                     foundation >= 0.0.23
@@ -454,7 +466,6 @@
     build-depends:  unix >= 2.4 && < 2.8
   if flag(embed_data_files)
      cpp-options:   -DEMBED_DATA_FILES
-     build-depends: file-embed >= 0.0 && < 0.1
      other-modules: Text.Pandoc.Data
   if os(windows)
     cpp-options:      -D_WINDOWS
@@ -492,6 +503,8 @@
                    Text.Pandoc.Readers.Markdown,
                    Text.Pandoc.Readers.CommonMark,
                    Text.Pandoc.Readers.Creole,
+                   Text.Pandoc.Readers.BibTeX,
+                   Text.Pandoc.Readers.CslJson,
                    Text.Pandoc.Readers.MediaWiki,
                    Text.Pandoc.Readers.Vimwiki,
                    Text.Pandoc.Readers.RST,
@@ -550,9 +563,11 @@
                    Text.Pandoc.Writers.FB2,
                    Text.Pandoc.Writers.TEI,
                    Text.Pandoc.Writers.Muse,
+                   Text.Pandoc.Writers.CslJson,
                    Text.Pandoc.Writers.Math,
                    Text.Pandoc.Writers.Shared,
                    Text.Pandoc.Writers.OOXML,
+                   Text.Pandoc.Writers.AnnotatedTable,
                    Text.Pandoc.Lua,
                    Text.Pandoc.PDF,
                    Text.Pandoc.UTF8,
@@ -568,7 +583,8 @@
                    Text.Pandoc.Emoji,
                    Text.Pandoc.ImageSize,
                    Text.Pandoc.BCP47,
-                   Text.Pandoc.Class
+                   Text.Pandoc.Class,
+                   Text.Pandoc.Citeproc
   other-modules:   Text.Pandoc.App.CommandLineOptions,
                    Text.Pandoc.App.FormatHeuristics,
                    Text.Pandoc.App.Opt,
@@ -589,6 +605,7 @@
                    Text.Pandoc.Readers.Docx.Fields,
                    Text.Pandoc.Readers.LaTeX.Parsing,
                    Text.Pandoc.Readers.LaTeX.Lang,
+                   Text.Pandoc.Readers.LaTeX.SIunitx,
                    Text.Pandoc.Readers.Odt.Base,
                    Text.Pandoc.Readers.Odt.Namespaces,
                    Text.Pandoc.Readers.Odt.StyleReader,
@@ -628,6 +645,7 @@
                    Text.Pandoc.Lua.Marshaling.MediaBag,
                    Text.Pandoc.Lua.Marshaling.PandocError,
                    Text.Pandoc.Lua.Marshaling.ReaderOptions,
+                   Text.Pandoc.Lua.Marshaling.SimpleTable,
                    Text.Pandoc.Lua.Marshaling.Version,
                    Text.Pandoc.Lua.Module.MediaBag,
                    Text.Pandoc.Lua.Module.Pandoc,
@@ -645,6 +663,12 @@
                    Text.Pandoc.Translations,
                    Text.Pandoc.Slides,
                    Text.Pandoc.Image,
+                   Text.Pandoc.Citeproc.BibTeX,
+                   Text.Pandoc.Citeproc.CslJson,
+                   Text.Pandoc.Citeproc.Data,
+                   Text.Pandoc.Citeproc.Locator,
+                   Text.Pandoc.Citeproc.MetaValue,
+                   Text.Pandoc.Citeproc.Util,
                    Paths_pandoc
   autogen-modules: Paths_pandoc
   buildable:       True
@@ -707,10 +731,10 @@
   main-is:         weigh-pandoc.hs
   hs-source-dirs:  benchmark
   build-depends:   pandoc,
-                   base >= 4.8 && < 5,
+                   base    >= 4.8 && < 5,
+                   mtl     >= 2.2 && < 2.3,
                    text,
-                   weigh >= 0.0 && < 0.1,
-                   mtl >= 2.2 && < 2.3
+                   weigh   >= 0.0 && < 0.1,
   if impl(ghc < 8.4)
      hs-source-dirs: prelude
      other-modules:  Prelude
@@ -734,34 +758,33 @@
   type:           exitcode-stdio-1.0
   main-is:        test-pandoc.hs
   hs-source-dirs: test
-  build-depends:  base >= 4.8 && < 5,
-                  pandoc,
-                  pandoc-types >= 1.21 && < 1.22,
-                  mtl >= 2.2 && < 2.3,
-                  bytestring >= 0.9 && < 0.11,
-                  base64-bytestring >= 0.1 && < 1.2,
-                  exceptions >= 0.8 && < 0.11,
-                  text >= 1.1.1.0 && < 1.3,
-                  time >= 1.5 && < 1.10,
-                  directory >= 1.2.3 && < 1.4,
-                  exceptions >= 0.8 && < 0.11,
-                  filepath >= 1.1 && < 1.5,
-                  hslua >= 1.1 && < 1.2,
-                  process >= 1.2.3 && < 1.7,
-                  temporary >= 1.1 && < 1.4,
-                  Diff >= 0.2 && < 0.5,
-                  tasty >= 0.11 && < 1.4,
-                  tasty-hunit >= 0.9 && < 0.11,
-                  tasty-lua >= 0.2 && < 0.3,
-                  tasty-quickcheck >= 0.8 && < 0.11,
-                  tasty-golden >= 2.3 && < 2.4,
-                  QuickCheck >= 2.4 && < 2.15,
-                  containers >= 0.4.2.1 && < 0.7,
-                  executable-path >= 0.0 && < 0.1,
-                  zip-archive >= 0.2.3.4 && < 0.5,
-                  xml >= 1.3.12 && < 1.4,
-                  doctemplates >= 0.8.2 && < 0.9,
-                  Glob >= 0.7 && < 0.11
+  build-depends:  pandoc,
+                  base              >= 4.8     && < 5,
+                  Diff              >= 0.2     && < 0.5,
+                  Glob              >= 0.7     && < 0.11,
+                  QuickCheck        >= 2.4     && < 2.15,
+                  base64-bytestring >= 0.1     && < 1.2,
+                  bytestring        >= 0.9     && < 0.12,
+                  containers        >= 0.4.2.1 && < 0.7,
+                  directory         >= 1.2.3   && < 1.4,
+                  doctemplates      >= 0.8.2   && < 0.9,
+                  exceptions        >= 0.8     && < 0.11,
+                  executable-path   >= 0.0     && < 0.1,
+                  filepath          >= 1.1     && < 1.5,
+                  hslua             >= 1.1     && < 1.3,
+                  mtl               >= 2.2     && < 2.3,
+                  pandoc-types      >= 1.22    && < 1.23,
+                  process           >= 1.2.3   && < 1.7,
+                  tasty             >= 0.11    && < 1.4,
+                  tasty-golden      >= 2.3     && < 2.4,
+                  tasty-hunit       >= 0.9     && < 0.11,
+                  tasty-lua         >= 0.2     && < 0.3,
+                  tasty-quickcheck  >= 0.8     && < 0.11,
+                  temporary         >= 1.1     && < 1.4,
+                  text              >= 1.1.1.0 && < 1.3,
+                  time              >= 1.5     && < 1.10,
+                  xml               >= 1.3.12  && < 1.4,
+                  zip-archive       >= 0.2.3.4 && < 0.5
   if impl(ghc < 8.4)
      hs-source-dirs: prelude
      other-modules:  Prelude
@@ -820,6 +843,7 @@
                   Tests.Writers.Powerpoint
                   Tests.Writers.OOXML
                   Tests.Writers.Ms
+                  Tests.Writers.AnnotatedTable
   if os(windows)
     cpp-options:      -D_WINDOWS
   default-language: Haskell2010
@@ -842,11 +866,13 @@
   main-is:         benchmark-pandoc.hs
   hs-source-dirs:  benchmark
   build-depends:   pandoc,
-                   time, bytestring, containers,
-                   base >= 4.8 && < 5,
-                   text >= 1.1.1.0 && < 1.3,
-                   mtl >= 2.2 && < 2.3,
-                   criterion >= 1.0 && < 1.6
+                   base        >= 4.8     && < 5,
+                   bytestring,
+                   containers,
+                   criterion   >= 1.0     && < 1.6,
+                   mtl         >= 2.2     && < 2.3,
+                   text        >= 1.1.1.0 && < 1.3,
+                   time
   if impl(ghc < 8.4)
      hs-source-dirs: prelude
      other-modules:  Prelude
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs
--- a/src/Text/Pandoc/App.hs
+++ b/src/Text/Pandoc/App.hs
@@ -76,15 +76,6 @@
        mapM_ (UTF8.hPutStrLn stdout) (fromMaybe ["-"] $ optInputFiles opts)
        exitSuccess
 
-  let isPandocCiteproc (JSONFilter f) = takeBaseName f == "pandoc-citeproc"
-      isPandocCiteproc _              = False
-  -- --bibliography implies -F pandoc-citeproc for backwards compatibility:
-  let needsCiteproc = isJust (lookupMeta "bibliography"
-                                (optMetadata opts)) &&
-                      optCiteMethod opts `notElem` [Natbib, Biblatex] &&
-                      not (any isPandocCiteproc filters)
-  let filters' = filters ++ [ JSONFilter "pandoc-citeproc" | needsCiteproc ]
-
   let sources = case optInputFiles opts of
                      Just xs | not (optIgnoreArgs opts) -> xs
                      _ -> ["-"]
@@ -170,8 +161,15 @@
     let writerName = outputWriterName outputSettings
     let writerOptions = outputWriterOptions outputSettings
 
-    let standalone = optStandalone opts || not (isTextFormat format) || pdfOutput
+    let bibOutput = writerName == "bibtex" ||
+                    writerName == "biblatex" ||
+                    writerName == "csljson"
 
+    let standalone = optStandalone opts ||
+                     not (isTextFormat format) ||
+                     pdfOutput ||
+                     bibOutput
+
     -- We don't want to send output to the terminal if the user
     -- does 'pandoc -t docx input.txt'; though we allow them to
     -- force this with '-o -'.  On posix systems, we detect
@@ -223,8 +221,9 @@
     metadataFromFile <-
       case optMetadataFiles opts of
         []    -> return mempty
-        paths -> mapM readFileLazy paths >>=
-                    fmap mconcat . mapM (yamlToMeta readerOpts)
+        paths -> mconcat <$>
+           mapM (\path -> do raw <- readFileLazy path
+                             yamlToMeta readerOpts (Just path) raw) paths
 
     let transforms = (case optShiftHeadingLevelBy opts of
                           0             -> id
@@ -272,6 +271,13 @@
 
     setNoCheckCertificate (optNoCheckCertificate opts)
 
+    let isPandocCiteproc (JSONFilter f) = takeBaseName f == "pandoc-citeproc"
+        isPandocCiteproc _              = False
+
+    when (any isPandocCiteproc filters) $
+      report $ Deprecated "pandoc-citeproc filter"
+               "Use --citeproc instead."
+
     doc <- sourceToDoc sources >>=
               (   (if isJust (optExtractMedia opts)
                       then fillMediaBag
@@ -279,7 +285,7 @@
               >=> return . adjustMetadata (metadataFromFile <>)
               >=> return . adjustMetadata (<> metadata)
               >=> applyTransforms transforms
-              >=> applyFilters readerOpts filters' [T.unpack format]
+              >=> applyFilters readerOpts filters [T.unpack format]
               >=> maybe return extractMedia (optExtractMedia opts)
               )
 
diff --git a/src/Text/Pandoc/App/CommandLineOptions.hs b/src/Text/Pandoc/App/CommandLineOptions.hs
--- a/src/Text/Pandoc/App/CommandLineOptions.hs
+++ b/src/Text/Pandoc/App/CommandLineOptions.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE CPP                 #-}
+{-# LANGUAGE LambdaCase          #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE TupleSections       #-}
 {-# LANGUAGE OverloadedStrings   #-}
@@ -282,21 +283,24 @@
     , Option "H" ["include-in-header"]
                  (ReqArg
                   (\arg opt -> return opt{ optIncludeInHeader =
-                                             optIncludeInHeader opt ++ [arg] })
+                                             optIncludeInHeader opt ++
+                                             [normalizePath arg] })
                   "FILE")
                  "" -- "File to include at end of header (implies -s)"
 
     , Option "B" ["include-before-body"]
                  (ReqArg
                   (\arg opt -> return opt{ optIncludeBeforeBody =
-                                            optIncludeBeforeBody opt ++ [arg] })
+                                            optIncludeBeforeBody opt ++
+                                            [normalizePath arg] })
                   "FILE")
                  "" -- "File to include before document body"
 
     , Option "A" ["include-after-body"]
                  (ReqArg
                   (\arg opt -> return opt{ optIncludeAfterBody =
-                                            optIncludeAfterBody opt ++ [arg] })
+                                            optIncludeAfterBody opt ++
+                                            [normalizePath arg] })
                   "FILE")
                  "" -- "File to include after document body"
 
@@ -308,7 +312,8 @@
     , Option "" ["highlight-style"]
                 (ReqArg
                  (\arg opt ->
-                     return opt{ optHighlightStyle = Just $ T.pack arg })
+                     return opt{ optHighlightStyle = Just $
+                                 T.pack $ normalizePath arg })
                  "STYLE|FILE")
                  "" -- "Style for highlighted code"
 
@@ -396,7 +401,7 @@
     , Option "" ["reference-doc"]
                  (ReqArg
                   (\arg opt ->
-                    return opt { optReferenceDoc = Just arg })
+                    return opt { optReferenceDoc = Just $ normalizePath arg })
                   "FILE")
                  "" -- "Path of custom reference doc"
 
@@ -421,7 +426,8 @@
 
     , Option "" ["abbreviations"]
                 (ReqArg
-                 (\arg opt -> return opt { optAbbreviations = Just arg })
+                 (\arg opt -> return opt { optAbbreviations =
+                                            Just $ normalizePath arg })
                 "FILE")
                 "" -- "Specify file for custom abbreviations"
 
@@ -606,21 +612,24 @@
                  (ReqArg
                   (\arg opt ->
                      return opt { optVariables =
-                       setVariable "epub-cover-image" (T.pack arg) $
+                       setVariable "epub-cover-image"
+                         (T.pack $ normalizePath arg) $
                          optVariables opt })
                   "FILE")
                  "" -- "Path of epub cover image"
 
     , Option "" ["epub-metadata"]
                  (ReqArg
-                  (\arg opt -> return opt { optEpubMetadata = Just arg })
+                  (\arg opt -> return opt { optEpubMetadata = Just $
+                                             normalizePath arg })
                   "FILE")
                  "" -- "Path of epub metadata file"
 
     , Option "" ["epub-embed-font"]
                  (ReqArg
                   (\arg opt ->
-                     return opt{ optEpubFonts = arg : optEpubFonts opt })
+                     return opt{ optEpubFonts = normalizePath arg :
+                                                optEpubFonts opt })
                   "FILE")
                  "" -- "Directory of fonts to embed"
 
@@ -647,10 +656,17 @@
                  "all|none|best")
                  "" -- "Starting number for sections, subsections, etc."
 
+    , Option "C" ["citeproc"]
+                 (NoArg
+                  (\opt -> return opt { optFilters =
+                      optFilters opt ++ [CiteprocFilter] }))
+                 "" -- "Process citations"
+
     , Option "" ["bibliography"]
                  (ReqArg
                   (\arg opt -> return opt{ optMetadata =
-                                            addMeta "bibliography" arg $
+                                            addMeta "bibliography"
+                                              (normalizePath arg) $
                                               optMetadata opt })
                    "FILE")
                  ""
@@ -659,7 +675,8 @@
                  (ReqArg
                   (\arg opt ->
                      return opt{ optMetadata =
-                                   addMeta "csl" arg $ optMetadata opt })
+                                   addMeta "csl" (normalizePath arg) $
+                                   optMetadata opt })
                    "FILE")
                  ""
 
@@ -667,8 +684,8 @@
                  (ReqArg
                   (\arg opt ->
                      return opt{ optMetadata =
-                                  addMeta "citation-abbreviations" arg $
-                                    optMetadata opt })
+                                  addMeta "citation-abbreviations"
+                                    (normalizePath arg) $ optMetadata opt })
                    "FILE")
                  ""
 
@@ -699,8 +716,7 @@
     , Option "" ["mathjax"]
                  (OptArg
                   (\arg opt -> do
-                      let url' = maybe (defaultMathJaxURL <>
-                                  "tex-mml-chtml.js") T.pack arg
+                      let url' = maybe defaultMathJaxURL T.pack arg
                       return opt { optHTMLMathMethod = MathJax url'})
                   "URL")
                  "" -- "Use MathJax for HTML math"
@@ -752,7 +768,8 @@
 
     , Option "" ["log"]
                  (ReqArg
-                  (\arg opt -> return opt{ optLogFile = Just arg })
+                  (\arg opt -> return opt{ optLogFile = Just $
+                                            normalizePath arg })
                 "FILE")
                 "" -- "Log messages in JSON format to this file."
 
@@ -823,7 +840,7 @@
                                  , sShortname s `notElem`
                                     [T.pack "Alert", T.pack "Alert_indent"]
                                  ]
-                     mapM_ (UTF8.hPutStrLn stdout) langs
+                     mapM_ (UTF8.hPutStrLn stdout) (sort langs)
                      exitSuccess ))
                  ""
 
@@ -869,9 +886,7 @@
     , Option "" ["print-highlight-style"]
                  (ReqArg
                   (\arg opt -> do
-                     let write = case optOutputFile opt of
-                                        Just f  -> B.writeFile f
-                                        Nothing -> B.putStr
+                     let write = maybe B.putStr B.writeFile $ optOutputFile opt
                      sty <- runIOorExplode $ lookupHighlightStyle arg
                      write $ encodePretty'
                        defConfig{confIndent = Spaces 4
@@ -1018,7 +1033,7 @@
 deprecatedOption :: String -> String -> IO ()
 deprecatedOption o msg =
   runIO (report $ Deprecated (T.pack o) (T.pack msg)) >>=
-    \r -> case r of
+    \case
        Right () -> return ()
        Left e   -> E.throwIO e
 
diff --git a/src/Text/Pandoc/App/FormatHeuristics.hs b/src/Text/Pandoc/App/FormatHeuristics.hs
--- a/src/Text/Pandoc/App/FormatHeuristics.hs
+++ b/src/Text/Pandoc/App/FormatHeuristics.hs
@@ -74,5 +74,6 @@
     ".xhtml"    -> Just "html"
     ".ipynb"    -> Just "ipynb"
     ".csv"      -> Just "csv"
+    ".bib"      -> Just "biblatex"
     ['.',y]     | y `elem` ['1'..'9'] -> Just "man"
     _           -> Nothing
diff --git a/src/Text/Pandoc/App/Opt.hs b/src/Text/Pandoc/App/Opt.hs
--- a/src/Text/Pandoc/App/Opt.hs
+++ b/src/Text/Pandoc/App/Opt.hs
@@ -294,6 +294,11 @@
       parseYAML v >>= \x -> return (\o -> o{ optColumns = x })
     "filters" ->
       parseYAML v >>= \x -> return (\o -> o{ optFilters = optFilters o <> x })
+    "citeproc" ->
+      parseYAML v >>= \x ->
+        if x
+           then return (\o -> o{ optFilters = CiteprocFilter : optFilters o })
+           else return id
     "email-obfuscation" ->
       parseYAML v >>= \x -> return (\o -> o{ optEmailObfuscation = x })
     "identifier-prefix" ->
diff --git a/src/Text/Pandoc/Citeproc.hs b/src/Text/Pandoc/Citeproc.hs
new file mode 100644
--- /dev/null
+++ b/src/Text/Pandoc/Citeproc.hs
@@ -0,0 +1,537 @@
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE ViewPatterns #-}
+{-# LANGUAGE StrictData #-}
+{-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveTraversable #-}
+module Text.Pandoc.Citeproc
+  ( processCitations )
+where
+
+import Citeproc as Citeproc
+import Citeproc.Pandoc ()
+import Text.Pandoc.Citeproc.Locator (parseLocator)
+import Text.Pandoc.Citeproc.CslJson (cslJsonToReferences)
+import Text.Pandoc.Citeproc.BibTeX (readBibtexString, Variant(..))
+import Text.Pandoc.Citeproc.MetaValue (metaValueToReference, metaValueToText)
+import Text.Pandoc.Readers.Markdown (yamlToRefs)
+import Text.Pandoc.Class (setResourcePath, getResourcePath, getUserDataDir)
+import Data.ByteString (ByteString)
+import qualified Data.ByteString.Lazy as L
+import Text.Pandoc.Definition as Pandoc
+import Text.Pandoc.Walk
+import Text.Pandoc.Builder as B
+import Text.Pandoc (PandocMonad(..), PandocError(..),
+                    readDataFile, ReaderOptions(..), pandocExtensions,
+                    report, LogMessage(..), fetchItem)
+import Text.Pandoc.Shared (stringify, ordNub, blocksToInlines)
+import qualified Text.Pandoc.UTF8 as UTF8
+import Data.Aeson (eitherDecode)
+import Data.Default
+import Data.Ord ()
+import qualified Data.Map as M
+import qualified Data.Set as Set
+import Data.Char (isPunctuation)
+import Data.Text (Text)
+import qualified Data.Text as T
+import Control.Monad.State
+import qualified Data.Sequence as Seq
+import qualified Data.Foldable as Foldable
+import System.FilePath
+import Control.Applicative
+import Control.Monad.Except
+import Data.Maybe (mapMaybe, fromMaybe)
+import Safe (lastMay, initSafe)
+-- import Debug.Trace as Trace (trace, traceShowId)
+
+
+processCitations :: PandocMonad m => Pandoc -> m Pandoc
+processCitations (Pandoc meta bs) = do
+  let cslfile = (lookupMeta "csl" meta <|> lookupMeta "citation-style" meta)
+                >>= metaValueToText
+
+  let getFile defaultExtension fp = do
+        oldRp <- getResourcePath
+        mbUdd <- getUserDataDir
+        setResourcePath $ oldRp ++ maybe []
+                                   (\u -> [u <> "/csl",
+                                           u <> "/csl/dependent"]) mbUdd
+        let fp' = if T.any (=='.') fp
+                     then fp
+                     else fp <> defaultExtension
+        (result, _) <- fetchItem fp'
+        setResourcePath oldRp
+        return result
+
+  let getCslDefault = readDataFile "default.csl"
+
+  cslContents <- UTF8.toText <$> maybe getCslDefault (getFile ".csl") cslfile
+
+  let abbrevFile = lookupMeta "citation-abbreviations" meta >>= metaValueToText
+
+  mbAbbrevs <- case abbrevFile of
+                 Nothing -> return Nothing
+                 Just fp -> do
+                   rawAbbr <- getFile ".json" fp
+                   case eitherDecode (L.fromStrict rawAbbr) of
+                     Left err -> throwError $ PandocCiteprocError $
+                                 CiteprocParseError $
+                                 "Could not parse abbreviations file " <> fp
+                                 <> "\n" <> T.pack err
+                     Right abbr -> return $ Just abbr
+
+  let getParentStyle url = do
+        -- first, try to retrieve the style locally, then use HTTP.
+        let basename = T.takeWhileEnd (/='/') url
+        UTF8.toText <$>
+          catchError (getFile ".csl" basename) (\_ -> fst <$> fetchItem url)
+
+  -- TODO check .csl directory if not found
+  styleRes <- Citeproc.parseStyle getParentStyle cslContents
+  style <-
+    case styleRes of
+       Left err    -> throwError $ PandocAppError $ prettyCiteprocError err
+       Right style -> return style{ styleAbbreviations = mbAbbrevs }
+  let mblang = parseLang <$>
+         ((lookupMeta "lang" meta <|> lookupMeta "locale" meta) >>= metaValueToText)
+  let locale = Citeproc.mergeLocales mblang style
+  let getCiteId (Cite cs _) = Set.fromList $ map B.citationId cs
+      getCiteId _ = mempty
+  let metanocites = lookupMeta "nocite" meta
+  let meta' = deleteMeta "nocite" meta
+  let nocites = maybe mempty (query getCiteId) metanocites
+  let citeIds = query getCiteId (Pandoc meta bs)
+  let idpred = if "*" `Set.member` nocites
+                  then const True
+                  else (\c -> c `Set.member` citeIds ||
+                              c `Set.member` nocites)
+  refs <- map (linkifyVariables . legacyDateRanges) <$>
+          case lookupMeta "references" meta of
+            Just (MetaList rs) -> return $ mapMaybe metaValueToReference rs
+            _                  ->
+              case lookupMeta "bibliography" meta of
+                 Just (MetaList xs) ->
+                   mconcat <$>
+                     mapM (getRefsFromBib locale idpred)
+                       (mapMaybe metaValueToText xs)
+                 Just x ->
+                   case metaValueToText x of
+                     Just fp -> getRefsFromBib locale idpred fp
+                     Nothing -> return []
+                 Nothing -> return []
+  let otherIdsMap = foldr (\ref m ->
+                             case T.words . extractText <$>
+                                  M.lookup "other-ids"
+                                      (referenceVariables ref) of
+                                Nothing  -> m
+                                Just ids -> foldr
+                                  (\id' ->
+                                    M.insert id' (referenceId ref)) m ids)
+                          M.empty refs
+  -- TODO: issue warning if no refs defined
+  let citations = getCitations locale otherIdsMap $ Pandoc meta' bs
+  let linkCites = maybe False truish $ lookupMeta "link-citations" meta
+  let opts = defaultCiteprocOptions{ linkCitations = linkCites }
+  let result = Citeproc.citeproc opts style (localeLanguage locale)
+                  refs citations
+  mapM_ (report . CiteprocWarning) (resultWarnings result)
+  let sopts = styleOptions style
+  let classes = "references" : -- TODO remove this or keep for compatibility?
+                "csl-bib-body" :
+                ["hanging-indent" | styleHangingIndent sopts]
+  let refkvs = (case styleEntrySpacing sopts of
+                   Just es | es > 0 -> (("entry-spacing",T.pack $ show es):)
+                   _ -> id) .
+               (case styleLineSpacing sopts of
+                   Just ls | ls > 1 -> (("line-spacing",T.pack $ show ls):)
+                   _ -> id) $ []
+  let bibs = mconcat $ map (\(ident, out) ->
+                     B.divWith ("ref-" <> ident,["csl-entry"],[]) . B.para .
+                       walk (convertQuotes locale) .  insertSpace $ out)
+                      (resultBibliography result)
+  let moveNotes = maybe True truish $
+                        lookupMeta "notes-after-punctuation" meta
+  let cits = map (walk fixLinks . walk (convertQuotes locale)) $
+               resultCitations result
+
+  let fixQuotes = case localePunctuationInQuote locale of
+                    Just True ->
+                      B.toList . movePunctuationInsideQuotes .  B.fromList
+                    _ -> id
+
+  let Pandoc meta'' bs' =
+         maybe id (setMeta "nocite") metanocites $
+         walk (fixQuotes .  mvPunct moveNotes locale) $ walk deNote $
+         evalState (walkM insertResolvedCitations $ Pandoc meta' bs)
+         $ cits
+  return $ Pandoc meta''
+         $ insertRefs refkvs classes meta''
+            (walk fixLinks $ B.toList bibs) bs'
+
+-- If we have a span.csl-left-margin followed by span.csl-right-inline,
+-- we insert a space. This ensures that they will be separated by a space,
+-- even in formats that don't have special handling for the display spans.
+insertSpace :: Inlines -> Inlines
+insertSpace ils =
+  case Seq.viewl (unMany ils) of
+    (Span ("",["csl-left-margin"],[]) xs) Seq.:< rest ->
+      case Seq.lookup 0 rest of
+        Just (Span ("",["csl-right-inline"],[]) _) ->
+          Many $
+            Span ("",["csl-left-margin"],[]) (xs ++ case lastMay xs of
+                                                      Just Space -> []
+                                                      _          -> [Space])
+            Seq.<| rest
+        _ -> ils
+    _ -> ils
+
+getRefsFromBib :: PandocMonad m
+               => Locale -> (Text -> Bool) -> Text -> m [Reference Inlines]
+getRefsFromBib locale idpred t = do
+  let fp = T.unpack t
+  raw <- readFileStrict fp
+  case formatFromExtension fp of
+    Just f -> getRefs locale f idpred (Just fp) raw
+    Nothing -> throwError $ PandocAppError $
+                 "Could not deterine bibliography format for " <> t
+
+getRefs :: PandocMonad m
+        => Locale
+        -> BibFormat
+        -> (Text -> Bool)
+        -> Maybe FilePath
+        -> ByteString
+        -> m [Reference Inlines]
+getRefs locale format idpred mbfp raw =
+  case format of
+    Format_bibtex ->
+      either (throwError . PandocAppError . T.pack . show) return .
+        readBibtexString Bibtex locale idpred . UTF8.toText $ raw
+    Format_biblatex ->
+      either (throwError . PandocAppError . T.pack . show) return .
+        readBibtexString Biblatex locale idpred . UTF8.toText $ raw
+    Format_json ->
+      either (throwError . PandocAppError . T.pack)
+             (return . filter (idpred . unItemId . referenceId)) .
+        cslJsonToReferences $ raw
+    Format_yaml -> do
+      rs <- yamlToRefs idpred
+              def{ readerExtensions = pandocExtensions }
+              mbfp
+              (L.fromStrict raw)
+      return $ mapMaybe metaValueToReference rs
+
+-- localized quotes
+convertQuotes :: Locale -> Inline -> Inline
+convertQuotes locale (Quoted qt ils) =
+  case (M.lookup openterm terms, M.lookup closeterm terms) of
+    (Just ((_,oq):_), Just ((_,cq):_)) ->
+         Span ("",[],[]) (Str oq : ils ++ [Str cq])
+    _ -> Quoted qt ils
+  where
+   terms = localeTerms locale
+   openterm = case qt of
+                DoubleQuote -> "open-quote"
+                SingleQuote -> "open-inner-quote"
+   closeterm = case qt of
+                 DoubleQuote -> "close-quote"
+                 SingleQuote -> "close-inner-quote"
+convertQuotes _ x = x
+
+-- assumes we walk in same order as query
+insertResolvedCitations :: Inline -> State [Inlines] Inline
+insertResolvedCitations (Cite cs ils) = do
+  resolved <- get
+  case resolved of
+    [] -> return (Cite cs ils)
+    (x:xs) -> do
+      put xs
+      return $ Cite cs (B.toList x)
+insertResolvedCitations x = return x
+
+getCitations :: Locale
+             -> M.Map Text ItemId
+             -> Pandoc
+             -> [Citeproc.Citation Inlines]
+getCitations locale otherIdsMap = Foldable.toList . query getCitation
+ where
+  getCitation (Cite cs _fallback) = Seq.singleton $
+    Citeproc.Citation { Citeproc.citationId = Nothing
+                      , Citeproc.citationNoteNumber =
+                          case cs of
+                            []    -> Nothing
+                            (Pandoc.Citation{ Pandoc.citationNoteNum = n }:
+                               _) | n > 0     -> Just n
+                                  | otherwise -> Nothing
+                      , Citeproc.citationItems =
+                           fromPandocCitations locale otherIdsMap cs
+                      }
+  getCitation _ = mempty
+
+fromPandocCitations :: Locale
+                    -> M.Map Text ItemId
+                    -> [Pandoc.Citation]
+                    -> [CitationItem Inlines]
+fromPandocCitations locale otherIdsMap = concatMap go
+ where
+  go c =
+    let (loclab, suffix) = parseLocator locale (citationSuffix c)
+        (mblab, mbloc) = case loclab of
+                           Just (loc, lab) -> (Just loc, Just lab)
+                           Nothing         -> (Nothing, Nothing)
+        cit = CitationItem
+               { citationItemId = fromMaybe
+                   (ItemId $ Pandoc.citationId c)
+                   (M.lookup (Pandoc.citationId c) otherIdsMap)
+               , citationItemLabel = mblab
+               , citationItemLocator = mbloc
+               , citationItemType = NormalCite
+               , citationItemPrefix = case citationPrefix c of
+                                        [] -> Nothing
+                                        ils -> Just $ B.fromList ils <>
+                                                      B.space
+               , citationItemSuffix = case suffix of
+                                        [] -> Nothing
+                                        ils -> Just $ B.fromList ils
+               }
+     in if Pandoc.citationId c == "*"
+           then []
+           else
+             case citationMode c of
+                  AuthorInText   -> [ cit{ citationItemType = AuthorOnly
+                                         , citationItemSuffix = Nothing }
+                                    , cit{ citationItemType =
+                                              Citeproc.SuppressAuthor
+                                         , citationItemPrefix = Nothing } ]
+                  NormalCitation -> [ cit ]
+                  Pandoc.SuppressAuthor
+                                 -> [ cit{ citationItemType =
+                                              Citeproc.SuppressAuthor } ]
+
+
+
+data BibFormat =
+    Format_biblatex
+  | Format_bibtex
+  | Format_json
+  | Format_yaml
+  deriving (Show, Eq, Ord)
+
+formatFromExtension :: FilePath -> Maybe BibFormat
+formatFromExtension fp = case dropWhile (== '.') $ takeExtension fp of
+                           "biblatex" -> Just Format_biblatex
+                           "bibtex"   -> Just Format_bibtex
+                           "bib"      -> Just Format_biblatex
+                           "json"     -> Just Format_json
+                           "yaml"     -> Just Format_yaml
+                           _          -> Nothing
+
+
+isNote :: Inline -> Bool
+isNote (Note _)          = True
+isNote (Cite _ [Note _]) = True
+ -- the following allows citation styles that are "in-text" but use superscript
+ -- references to be treated as if they are "notes" for the purposes of moving
+ -- the citations after trailing punctuation (see <https://github.com/jgm/pandoc-citeproc/issues/382>):
+isNote (Cite _ [Superscript _]) = True
+isNote _                 = False
+
+isSpacy :: Inline -> Bool
+isSpacy Space     = True
+isSpacy SoftBreak = True
+isSpacy _         = False
+
+
+mvPunct :: Bool -> Locale -> [Inline] -> [Inline]
+mvPunct moveNotes locale (x : xs)
+  | isSpacy x = x : mvPunct moveNotes locale xs
+-- 'x [^1],' -> 'x,[^1]'
+mvPunct moveNotes locale (q : s : x : ys)
+  | isSpacy s
+  , isNote x
+  = let spunct = T.takeWhile isPunctuation $ stringify ys
+    in  if moveNotes
+           then if T.null spunct
+                   then q : x : mvPunct moveNotes locale ys
+                   else q : Str spunct : x : mvPunct moveNotes locale
+                        (B.toList
+                          (dropTextWhile isPunctuation (B.fromList ys)))
+           else q : x : mvPunct moveNotes locale ys
+-- 'x[^1],' -> 'x,[^1]'
+mvPunct moveNotes locale (Cite cs ils : ys)
+   | not (null ils)
+   , isNote (last ils)
+   , startWithPunct ys
+   , moveNotes
+   = let s = stringify ys
+         spunct = T.takeWhile isPunctuation s
+     in  Cite cs (init ils
+                  ++ [Str spunct | not (endWithPunct False (init ils))]
+                  ++ [last ils]) :
+         mvPunct moveNotes locale
+           (B.toList (dropTextWhile isPunctuation (B.fromList ys)))
+mvPunct moveNotes locale (s : x : ys) | isSpacy s, isNote x =
+  x : mvPunct moveNotes locale ys
+mvPunct moveNotes locale (s : x@(Cite _ (Superscript _ : _)) : ys)
+  | isSpacy s = x : mvPunct moveNotes locale ys
+mvPunct moveNotes locale (Cite cs ils : Str "." : ys)
+  | "." `T.isSuffixOf` (stringify ils)
+  = Cite cs ils : mvPunct moveNotes locale ys
+mvPunct moveNotes locale (x:xs) = x : mvPunct moveNotes locale xs
+mvPunct _ _ [] = []
+
+-- move https://doi.org etc. prefix inside link text (#6723):
+fixLinks :: [Inline] -> [Inline]
+fixLinks (Str t : Link attr [Str u1] (u2,tit) : xs)
+  | t <> u1 == u2
+  = Link attr [Str (t <> u1)] (u2,tit) : fixLinks xs
+fixLinks (x:xs) = x : fixLinks xs
+fixLinks [] = []
+
+
+endWithPunct :: Bool -> [Inline] -> Bool
+endWithPunct _ [] = False
+endWithPunct onlyFinal xs@(_:_) =
+  case reverse (T.unpack $ stringify xs) of
+       []                       -> True
+       -- covers .), .", etc.:
+       (d:c:_) | isPunctuation d
+                 && not onlyFinal
+                 && isEndPunct c -> True
+       (c:_) | isEndPunct c      -> True
+             | otherwise         -> False
+  where isEndPunct c = c `elem` (".,;:!?" :: String)
+
+
+
+startWithPunct :: [Inline] -> Bool
+startWithPunct ils =
+  case T.uncons (stringify ils) of
+    Just (c,_) -> c `elem` (".,;:!?" :: [Char])
+    Nothing -> False
+
+truish :: MetaValue -> Bool
+truish (MetaBool t) = t
+truish (MetaString s) = isYesValue (T.toLower s)
+truish (MetaInlines ils) = isYesValue (T.toLower (stringify ils))
+truish (MetaBlocks [Plain ils]) = isYesValue (T.toLower (stringify ils))
+truish _ = False
+
+isYesValue :: Text -> Bool
+isYesValue "t" = True
+isYesValue "true" = True
+isYesValue "yes" = True
+isYesValue _ = False
+
+-- if document contains a Div with id="refs", insert
+-- references as its contents.  Otherwise, insert references
+-- at the end of the document in a Div with id="refs"
+insertRefs :: [(Text,Text)] -> [Text] -> Meta -> [Block] -> [Block] -> [Block]
+insertRefs _ _ _  []   bs = bs
+insertRefs refkvs refclasses meta refs bs =
+  if isRefRemove meta
+     then bs
+     else case runState (walkM go bs) False of
+               (bs', True) -> bs'
+               (_, False)
+                 -> case refTitle meta of
+                      Nothing ->
+                        case reverse bs of
+                          Header lev (id',classes,kvs) ys : xs ->
+                            reverse xs ++
+                            [Header lev (id',addUnNumbered classes,kvs) ys,
+                             Div ("refs",refclasses,refkvs) refs]
+                          _ -> bs ++ [refDiv]
+                      Just ils -> bs ++
+                        [Header 1 ("bibliography", ["unnumbered"], []) ils,
+                         refDiv]
+  where
+   refDiv = Div ("refs", refclasses, refkvs) refs
+   addUnNumbered cs = "unnumbered" : [c | c <- cs, c /= "unnumbered"]
+   go :: Block -> State Bool Block
+   go (Div ("refs",cs,kvs) xs) = do
+     put True
+     -- refHeader isn't used if you have an explicit references div
+     let cs' = ordNub $ cs ++ refclasses
+     return $ Div ("refs",cs',kvs) (xs ++ refs)
+   go x = return x
+
+refTitle :: Meta -> Maybe [Inline]
+refTitle meta =
+  case lookupMeta "reference-section-title" meta of
+    Just (MetaString s)           -> Just [Str s]
+    Just (MetaInlines ils)        -> Just ils
+    Just (MetaBlocks [Plain ils]) -> Just ils
+    Just (MetaBlocks [Para ils])  -> Just ils
+    _                             -> Nothing
+
+isRefRemove :: Meta -> Bool
+isRefRemove meta =
+  maybe False truish $ lookupMeta "suppress-bibliography" meta
+
+legacyDateRanges :: Reference Inlines -> Reference Inlines
+legacyDateRanges ref =
+  ref{ referenceVariables = M.map go $ referenceVariables ref }
+ where
+  go (DateVal d)
+    | null (dateParts d)
+    , Just lit <- dateLiteral d
+    = case T.splitOn "_" lit of
+        [x,y] -> case Citeproc.rawDateEDTF (x <> "/" <> y) of
+                   Just d' -> DateVal d'
+                   Nothing -> DateVal d
+        _ -> DateVal d
+  go x = x
+
+linkifyVariables :: Reference Inlines -> Reference Inlines
+linkifyVariables ref =
+  ref{ referenceVariables = M.mapWithKey go $ referenceVariables ref }
+ where
+  go "URL" x    = tolink "https://" x
+  go "DOI" x    = tolink "https://doi.org/" (fixShortDOI x)
+  go "ISBN" x   = tolink "https://worldcat.org/isbn/" x
+  go "PMID" x   = tolink "https://www.ncbi.nlm.nih.gov/pubmed/" x
+  go "PMCID" x  = tolink "https://www.ncbi.nlm.nih.gov/pmc/articles/" x
+  go _ x        = x
+  fixShortDOI x = let x' = extractText x
+                  in  if "10/" `T.isPrefixOf` x'
+                         then TextVal $ T.drop 3 x'
+                              -- see http://shortdoi.org
+                         else TextVal x'
+  tolink pref x = let x' = extractText x
+                      x'' = if "://" `T.isInfixOf` x'
+                               then x'
+                               else pref <> x'
+                  in  FancyVal (B.link x'' "" (B.str x'))
+
+extractText :: Val Inlines -> Text
+extractText (TextVal x)  = x
+extractText (FancyVal x) = toText x
+extractText (NumVal n)   = T.pack (show n)
+extractText _            = mempty
+
+deNote :: Inline -> Inline
+deNote (Note bs) = Note $ walk go bs
+ where
+  go (Note bs')
+       = Span ("",[],[]) (Space : Str "(" :
+                          (removeFinalPeriod
+                            (blocksToInlines bs')) ++ [Str ")"])
+  go x = x
+deNote x = x
+
+-- Note: we can't use dropTextWhileEnd because this would
+-- remove the final period on abbreviations like Ibid.
+-- But removing a final Str "." is safe.
+removeFinalPeriod :: [Inline] -> [Inline]
+removeFinalPeriod ils =
+  case lastMay ils of
+    Just (Str ".") -> initSafe ils
+    _              -> ils
+
+
+
diff --git a/src/Text/Pandoc/Citeproc/BibTeX.hs b/src/Text/Pandoc/Citeproc/BibTeX.hs
new file mode 100644
--- /dev/null
+++ b/src/Text/Pandoc/Citeproc/BibTeX.hs
@@ -0,0 +1,1236 @@
+{-# LANGUAGE ViewPatterns      #-}
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE ScopedTypeVariables #-}
+{-# LANGUAGE FlexibleContexts #-}
+{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
+-----------------------------------------------------------------------------
+-- |
+-- Module      :  Text.CSL.Input.Bibtex
+-- Copyright   :  (c) John MacFarlane
+-- License     :  BSD-style (see LICENSE)
+--
+-- Maintainer  :  John MacFarlane <fiddlosopher@gmail.com>
+-- Stability   :  unstable-- Portability :  unportable
+--
+-----------------------------------------------------------------------------
+
+module Text.Pandoc.Citeproc.BibTeX
+    ( Variant(..)
+    , readBibtexString
+    )
+    where
+
+import Text.Pandoc.Definition
+import Text.Pandoc.Builder as B
+import Text.Pandoc.Readers.LaTeX (readLaTeX)
+import Text.Pandoc.Extensions (Extension(..), extensionsFromList)
+import Text.Pandoc.Options (ReaderOptions(..))
+import Text.Pandoc.Class (runPure)
+import Text.Pandoc.Error (PandocError)
+import Text.Pandoc.Shared (stringify)
+import qualified Text.Pandoc.Walk       as Walk
+import Citeproc.Types
+import Citeproc.Pandoc ()
+import Text.Pandoc.Citeproc.Util (toIETF)
+import Text.Pandoc.Citeproc.Data (biblatexStringMap)
+import Data.Default
+import           Data.Text              (Text)
+import qualified Data.Text              as T
+import qualified Data.Map               as Map
+import           Data.Maybe
+import           Text.Pandoc.Parsing hiding ((<|>), many)
+import           Control.Applicative
+import           Data.List.Split        (splitOn, splitWhen, wordsBy)
+import           Control.Monad.RWS      hiding ((<>))
+import qualified Data.Sequence          as Seq
+import           Data.Char              (isAlphaNum, isDigit, isLetter,
+                                         isUpper, toLower, toUpper,
+                                         isLower, isPunctuation)
+import           Data.List              (foldl', intercalate)
+import           Safe                   (readMay)
+
+data Variant = Bibtex | Biblatex
+  deriving (Show, Eq, Ord)
+
+-- | Parse BibTeX or BibLaTeX into a list of 'Reference's.
+readBibtexString :: Variant           -- ^ bibtex or biblatex
+                 -> Locale            -- ^ Locale
+                 -> (Text -> Bool)    -- ^ Filter on citation ids
+                 -> Text              -- ^ bibtex/biblatex text
+                 -> Either ParseError [Reference Inlines]
+readBibtexString variant locale idpred contents = do
+  case runParser (((resolveCrossRefs variant <$> bibEntries) <* eof) >>=
+                   mapM (itemToReference locale variant) .
+                      filter (idpred . identifier))
+           (fromMaybe defaultLang $ localeLanguage locale, Map.empty)
+           "" contents of
+          Left err -> Left err
+          Right xs -> return xs
+
+defaultLang :: Lang
+defaultLang = Lang "en" (Just "US")
+
+-- a map of bibtex "string" macros
+type StringMap = Map.Map Text Text
+
+type BibParser = Parser Text (Lang, StringMap)
+
+data Item = Item{ identifier :: Text
+                , sourcePos  :: SourcePos
+                , entryType  :: Text
+                , fields     :: Map.Map Text Text
+                }
+                deriving (Show, Ord, Eq)
+
+itemToReference :: Locale -> Variant -> Item -> BibParser (Reference Inlines)
+itemToReference locale variant item = do
+  setPosition (sourcePos item)
+  bib item $ do
+    let lang = fromMaybe defaultLang $ localeLanguage locale
+    modify $ \st -> st{ localeLang = lang,
+                        untitlecase = case lang of
+                                           (Lang "en" _) -> True
+                                           _             -> False }
+
+    id' <- asks identifier
+    otherIds <- (Just <$> getRawField "ids")
+                  <|> return Nothing
+    (reftype, genre) <- getTypeAndGenre
+    -- hyphenation:
+    let getLangId = do
+             langid <- T.strip . T.toLower <$> getRawField "langid"
+             idopts <- T.strip . T.toLower . stringify <$>
+                           getField "langidopts" <|> return ""
+             case (langid, idopts) of
+                  ("english","variant=british")    -> return "british"
+                  ("english","variant=american")   -> return "american"
+                  ("english","variant=us")         -> return "american"
+                  ("english","variant=usmax")      -> return "american"
+                  ("english","variant=uk")         -> return "british"
+                  ("english","variant=australian") -> return "australian"
+                  ("english","variant=newzealand") -> return "newzealand"
+                  (x,_)                            -> return x
+    hyphenation <- (Just . toIETF . T.toLower <$>
+                     (getLangId <|> getRawField "hyphenation"))
+                  <|> return Nothing
+    modify $ \s -> s{ untitlecase = untitlecase s &&
+                                      case hyphenation of
+                                        Just x -> "en-" `T.isPrefixOf` x
+                                        _ -> True }
+
+
+    opts <- (parseOptions <$> getRawField "options") <|> return []
+
+    et <- asks entryType
+
+    -- titles
+    let isArticle = et `elem`
+                     ["article", "periodical", "suppperiodical", "review"]
+    let isPeriodical = et == "periodical"
+    let isChapterlike = et `elem`
+           ["inbook","incollection","inproceedings","inreference","bookinbook"]
+
+    let getFieldMaybe f = (Just <$> getField f) <|> return Nothing
+
+    -- names
+    let getNameList' f = Just <$>
+         getNameList (("bibtex", case variant of
+                                      Bibtex   -> "true"
+                                      Biblatex -> "false") : opts) f
+
+    author' <- getNameList' "author" <|> return Nothing
+    containerAuthor' <- getNameList' "bookauthor" <|> return Nothing
+    translator' <- getNameList' "translator" <|> return Nothing
+    editortype <- getRawField "editortype" <|> return mempty
+    editor'' <- getNameList' "editor" <|> return Nothing
+    director'' <- getNameList' "director" <|> return Nothing
+    let (editor', director') = case editortype of
+                                    "director" -> (Nothing, editor'')
+                                    _          -> (editor'', director'')
+    -- FIXME: add same for editora, editorb, editorc
+
+    -- dates
+    issued' <- (Just <$> (getDate "date" <|> getOldDate mempty)) <|>
+               return Nothing
+    eventDate' <- (Just <$> (getDate "eventdate" <|> getOldDate "event")) <|>
+                   return Nothing
+    origDate' <- (Just <$> (getDate "origdate" <|> getOldDate "orig")) <|>
+                   return Nothing
+    accessed' <- (Just <$> (getDate "urldate" <|> getOldDate "url")) <|>
+                    return Nothing
+
+    -- locators
+    pages' <- getFieldMaybe "pages"
+    volume' <- getFieldMaybe "volume"
+    part' <- getFieldMaybe "part"
+    volumes' <- getFieldMaybe "volumes"
+    pagetotal' <- getFieldMaybe "pagetotal"
+    chapter' <- getFieldMaybe "chapter"
+    edition' <- getFieldMaybe "edition"
+    version' <- getFieldMaybe "version"
+    (number', collectionNumber', issue') <-
+       (getField "number" >>= \x ->
+         if et `elem` ["book","collection","proceedings","reference",
+                       "mvbook","mvcollection","mvproceedings", "mvreference",
+                       "bookinbook","inbook", "incollection","inproceedings",
+                       "inreference", "suppbook","suppcollection"]
+         then return (Nothing, Just x, Nothing)
+         else if isArticle
+              then (getField "issue" >>= \y ->
+                      return (Nothing, Nothing, Just $ concatWith ',' [x,y]))
+                 <|> return (Nothing, Nothing, Just x)
+              else return (Just x, Nothing, Nothing))
+        <|> return (Nothing, Nothing, Nothing)
+
+    -- titles
+    hasMaintitle <- (True <$ getRawField "maintitle") <|> return False
+
+    title' <- Just <$>
+              ((guard isPeriodical >> getTitle "issuetitle")
+              <|> (guard hasMaintitle >>
+                   guard (not isChapterlike) >>
+                   getTitle "maintitle")
+              <|> getTitle "title")
+              <|> return Nothing
+
+    subtitle' <- (guard isPeriodical >> getTitle "issuesubtitle")
+                  <|> (guard hasMaintitle >>
+                       guard (not isChapterlike) >>
+                       getTitle "mainsubtitle")
+                  <|> getTitle "subtitle"
+                  <|> return mempty
+    titleaddon' <- (guard hasMaintitle >>
+                     guard (not isChapterlike) >>
+                     getTitle "maintitleaddon")
+                    <|> getTitle "titleaddon"
+                    <|> return mempty
+
+    volumeTitle' <- Just <$>
+                    ((guard hasMaintitle >>
+                      guard (not isChapterlike) >>
+                      getTitle "title")
+                     <|> (guard hasMaintitle >>
+                          guard isChapterlike >>
+                          getTitle "booktitle"))
+                    <|> return Nothing
+    volumeSubtitle' <- (guard hasMaintitle >>
+                        guard (not isChapterlike) >>
+                        getTitle "subtitle")
+                       <|> (guard hasMaintitle >>
+                            guard isChapterlike >>
+                            getTitle "booksubtitle")
+                       <|> return mempty
+    volumeTitleAddon' <- (guard hasMaintitle >>
+                          guard (not isChapterlike) >>
+                          getTitle "titleaddon")
+                         <|> (guard hasMaintitle >>
+                              guard isChapterlike >>
+                              getTitle "booktitleaddon")
+                         <|> return mempty
+
+    containerTitle' <- Just <$>
+                       ((guard isPeriodical >> getPeriodicalTitle "title")
+                       <|> (guard isChapterlike >> getTitle "maintitle")
+                       <|> (guard isChapterlike >> getTitle "booktitle")
+                       <|> getPeriodicalTitle "journaltitle"
+                       <|> getPeriodicalTitle "journal")
+                       <|> return Nothing
+    containerSubtitle' <- (guard isPeriodical >> getPeriodicalTitle "subtitle")
+                          <|> (guard isChapterlike >> getTitle "mainsubtitle")
+                          <|> (guard isChapterlike >> getTitle "booksubtitle")
+                          <|> getPeriodicalTitle "journalsubtitle"
+                          <|> return mempty
+    containerTitleAddon' <- (guard isPeriodical >>
+                             getPeriodicalTitle "titleaddon")
+                            <|> (guard isChapterlike >>
+                                 getTitle "maintitleaddon")
+                            <|> (guard isChapterlike >>
+                                 getTitle "booktitleaddon")
+                            <|> return mempty
+    containerTitleShort' <- Just <$>
+                            ((guard isPeriodical >>
+                              guard (not hasMaintitle) >>
+                              getField "shorttitle")
+                            <|> getPeriodicalTitle "shortjournal")
+                           <|> return Nothing
+
+    -- change numerical series title to e.g. 'series 3'
+    let fixSeriesTitle [Str xs] | isNumber xs =
+          [Str (ordinalize locale xs), Space, Str (resolveKey' lang "jourser")]
+        fixSeriesTitle xs = xs
+    seriesTitle' <- (Just . B.fromList . fixSeriesTitle .
+                     B.toList . resolveKey lang <$>
+                        getTitle "series") <|>
+                    return Nothing
+    shortTitle' <- (Just <$> (guard (not hasMaintitle || isChapterlike) >>
+                              getTitle "shorttitle"))
+                 <|> (if (subtitle' /= mempty || titleaddon' /= mempty) &&
+                          not hasMaintitle
+                          then getShortTitle False "title"
+                          else getShortTitle True  "title")
+                 <|> return Nothing
+
+    eventTitle' <- Just <$> getTitle "eventtitle" <|> return Nothing
+    origTitle' <- Just <$> getTitle "origtitle" <|> return Nothing
+
+    -- publisher
+    pubfields <- mapM (\f -> Just `fmap`
+                         (if variant == Bibtex || f == "howpublished"
+                          then getField f
+                          else getLiteralList' f)
+                        <|> return Nothing)
+           ["school","institution","organization", "howpublished","publisher"]
+    let publisher' = case catMaybes pubfields of
+                       [] -> Nothing
+                       xs -> Just $ concatWith ';' xs
+    origpublisher' <- (Just <$> getField "origpublisher") <|> return Nothing
+
+    -- places
+    venue' <- (Just <$> getField "venue") <|> return Nothing
+    address' <- Just <$>
+                  (if variant == Bibtex
+                      then getField "address"
+                      else getLiteralList' "address"
+                         <|> (guard (et /= "patent") >>
+                              getLiteralList' "location"))
+                <|> return Nothing
+    origLocation' <- Just <$>
+                  (if variant == Bibtex
+                      then getField "origlocation"
+                      else getLiteralList' "origlocation")
+                    <|> return Nothing
+    jurisdiction' <- if reftype == "patent"
+                     then Just <$>
+                        (concatWith ';' . map (resolveKey lang) <$>
+                             getLiteralList "location") <|> return Nothing
+                     else return Nothing
+
+    -- url, doi, isbn, etc.:
+    -- note that with eprinttype = arxiv, we take eprint to be a partial url
+    -- archivePrefix is an alias for eprinttype
+    url' <- (guard (et == "online" || lookup "url" opts /= Just "false")
+             >> Just <$> getRawField "url")
+         <|> (do etype <- getRawField "eprinttype"
+                 eprint <- getRawField "eprint"
+                 let baseUrl =
+                       case T.toLower etype of
+                         "arxiv"       -> "http://arxiv.org/abs/"
+                         "jstor"       -> "http://www.jstor.org/stable/"
+                         "pubmed"      -> "http://www.ncbi.nlm.nih.gov/pubmed/"
+                         "googlebooks" -> "http://books.google.com?id="
+                         _             -> ""
+                 if T.null baseUrl
+                    then mzero
+                    else return $ Just $ baseUrl <> eprint)
+         <|> return Nothing
+    doi' <- (guard (lookup "doi" opts /= Just "false") >>
+             Just <$> getRawField "doi")
+           <|> return Nothing
+    isbn' <- Just <$> getRawField "isbn" <|> return Nothing
+    issn' <- Just <$> getRawField "issn" <|> return Nothing
+    pmid' <- Just <$> getRawField  "pmid" <|> return Nothing
+    pmcid' <- Just <$> getRawField "pmcid" <|> return Nothing
+    callNumber' <- Just <$> getRawField "library" <|> return Nothing
+
+    -- notes
+    annotation' <- Just <$>
+                   (getField "annotation" <|> getField "annote")
+                     <|> return Nothing
+    abstract' <- Just <$> getField "abstract" <|> return Nothing
+    keywords' <- Just <$> getField "keywords" <|> return Nothing
+    note' <- if et == "periodical"
+             then return Nothing
+             else Just <$> getField "note" <|> return Nothing
+    addendum' <- if variant == Bibtex
+                    then return Nothing
+                    else Just <$> getField "addendum"
+                 <|> return Nothing
+    pubstate' <- (  (Just . resolveKey lang <$> getField "pubstate")
+                  <|> case dateLiteral <$> issued' of
+                           Just (Just "forthcoming") ->
+                             return $ Just $ B.str "forthcoming"
+                           _ -> return Nothing
+                   )
+
+
+
+
+    let addField (_, Nothing) = id
+        addField (f, Just x)  = Map.insert f x
+    let vars = foldr addField mempty
+                [ ("other-ids", TextVal <$> otherIds)
+                , ("genre", TextVal <$> genre)
+                , ("language", TextVal <$> hyphenation)
+                -- dates
+                , ("accessed", DateVal <$> accessed')
+                , ("event-date", DateVal <$> eventDate')
+                , ("issued", DateVal <$> issued')
+                , ("original-date", DateVal <$> origDate')
+                -- names
+                , ("author", NamesVal <$> author')
+                , ("editor", NamesVal <$> editor')
+                , ("translator", NamesVal <$> translator')
+                , ("director", NamesVal <$> director')
+                , ("container-author", NamesVal <$> containerAuthor')
+                -- locators
+                , ("page", FancyVal . Walk.walk convertEnDash <$> pages')
+                , ("number-of-pages", FancyVal <$> pagetotal')
+                , ("volume", case (volume', part') of
+                               (Nothing, Nothing) -> Nothing
+                               (Just v, Nothing) -> Just $ FancyVal v
+                               (Nothing, Just p) -> Just $ FancyVal p
+                               (Just v, Just p)  ->
+                                 Just $ FancyVal $ v <> B.str "." <> p)
+                , ("number-of-volumes", FancyVal <$> volumes')
+                , ("chapter-number", FancyVal <$> chapter')
+                , ("edition", FancyVal <$> edition')
+                , ("version", FancyVal <$> version')
+                , ("number", FancyVal <$> number')
+                , ("collection-number", FancyVal <$> collectionNumber')
+                , ("issue", FancyVal <$> issue')
+                -- title
+                , ("original-title", FancyVal <$> origTitle')
+                , ("event", FancyVal <$> eventTitle')
+                , ("title", case title' of
+                              Just t -> Just $ FancyVal $
+                                         concatWith '.' [
+                                             concatWith ':' [t, subtitle']
+                                           , titleaddon' ]
+                              Nothing -> Nothing)
+                , ("volume-title",
+                            case volumeTitle' of
+                              Just t -> Just $ FancyVal $
+                                         concatWith '.' [
+                                             concatWith ':' [t, volumeSubtitle']
+                                           , volumeTitleAddon' ]
+                              Nothing -> Nothing)
+                , ("container-title",
+                            case containerTitle' of
+                              Just t -> Just $ FancyVal $
+                                         concatWith '.' [
+                                             concatWith ':' [t,
+                                               containerSubtitle']
+                                           , containerTitleAddon' ]
+                              Nothing -> Nothing)
+                , ("container-title-short", FancyVal <$> containerTitleShort')
+                , ("collection-title", FancyVal <$> seriesTitle')
+                , ("title-short", FancyVal <$> shortTitle')
+                -- publisher
+                , ("publisher", FancyVal <$> publisher')
+                , ("original-publisher", FancyVal <$> origpublisher')
+                -- places
+                , ("jurisdiction", FancyVal <$> jurisdiction')
+                , ("event-place",  FancyVal <$> venue')
+                , ("publisher-place", FancyVal <$> address')
+                , ("original-publisher-place", FancyVal <$> origLocation')
+                -- urls
+                , ("url", TextVal <$> url')
+                , ("doi", TextVal <$> doi')
+                , ("isbn", TextVal <$> isbn')
+                , ("issn", TextVal <$> issn')
+                , ("pmcid", TextVal <$> pmcid')
+                , ("pmid", TextVal <$> pmid')
+                , ("call-number", TextVal <$> callNumber')
+                -- notes
+                , ("note", case catMaybes [note', addendum'] of
+                             [] -> Nothing
+                             xs -> return $ FancyVal $ concatWith '.' xs)
+                , ("annote", FancyVal <$> annotation')
+                , ("abstract", FancyVal <$> abstract')
+                , ("keyword", FancyVal <$> keywords')
+                , ("status", FancyVal <$> pubstate')
+                ]
+    return $ Reference
+      { referenceId             = ItemId id'
+      , referenceType           = reftype
+      , referenceDisambiguation = Nothing
+      , referenceVariables      = vars }
+
+
+bib :: Item -> Bib a -> BibParser a
+bib entry m = fst <$> evalRWST m entry (BibState True (Lang "en" (Just "US")))
+
+resolveCrossRefs :: Variant -> [Item] -> [Item]
+resolveCrossRefs variant entries =
+  map (resolveCrossRef variant entries) entries
+
+resolveCrossRef :: Variant -> [Item] -> Item -> Item
+resolveCrossRef variant entries entry =
+  Map.foldrWithKey go entry (fields entry)
+  where go key val entry' =
+          if key == "crossref" || key == "xdata"
+          then entry'{ fields = fields entry' <>
+                          Map.fromList (getXrefFields variant
+                                        entry entries val) }
+          else entry'
+
+getXrefFields :: Variant -> Item -> [Item] -> Text -> [(Text, Text)]
+getXrefFields variant baseEntry entries keys = do
+  let keys' = splitKeys keys
+  xrefEntry <- [e | e <- entries, identifier e `elem` keys']
+  (k, v) <- Map.toList $ fields xrefEntry
+  if k == "crossref" || k == "xdata"
+     then do
+       xs <- mapM (getXrefFields variant baseEntry entries)
+                   (splitKeys v)
+       (x, y) <- xs
+       guard $ isNothing $ Map.lookup x $ fields xrefEntry
+       return (x, y)
+     else do
+       k' <- case variant of
+               Bibtex -> return k
+               Biblatex -> transformKey
+                            (entryType xrefEntry) (entryType baseEntry) k
+       guard $ isNothing $ Map.lookup k' $ fields baseEntry
+       return (k',v)
+
+
+
+data BibState = BibState{
+           untitlecase    :: Bool
+         , localeLang     :: Lang
+         }
+
+type Bib = RWST Item () BibState BibParser
+
+blocksToInlines :: [Block] -> Inlines
+blocksToInlines bs =
+  case bs of
+       [Plain xs] -> B.fromList xs
+       [Para  xs] -> B.fromList xs
+       _          -> B.fromList $ Walk.query (:[]) bs
+
+adjustSpans :: Lang -> Inline -> Inline
+adjustSpans lang (RawInline (Format "latex") s)
+  | s == "\\hyphen" || s == "\\hyphen " = Str "-"
+  | otherwise = parseRawLaTeX lang s
+adjustSpans _ SoftBreak = Space
+adjustSpans _ x = x
+
+parseRawLaTeX :: Lang -> Text -> Inline
+parseRawLaTeX lang t@(T.stripPrefix "\\" -> Just xs) =
+  case parseLaTeX lang contents of
+          Right [Para ys]  -> f command ys
+          Right [Plain ys] -> f command ys
+          Right []         -> f command []
+          _                -> RawInline (Format "latex") t
+   where (command', contents') = T.break (\c -> c =='{' || c =='\\') xs
+         command  = T.strip command'
+         contents = T.drop 1 $ T.dropEnd 1 contents'
+         f "mkbibquote"    ils = Span nullAttr [Quoted DoubleQuote ils]
+         f "mkbibemph"     ils = Span nullAttr [Emph ils]
+         f "mkbibitalic"   ils = Span nullAttr [Emph ils]
+         f "mkbibbold"     ils = Span nullAttr [Strong ils]
+         f "mkbibparens"   ils = Span nullAttr $
+                                  [Str "("] ++ ils ++ [Str ")"]
+         f "mkbibbrackets" ils = Span nullAttr $
+                                  [Str "["] ++ ils ++ [Str "]"]
+         -- ... both should be nestable & should work in year fields
+         f "autocap"    ils    = Span nullAttr ils
+           -- TODO: should work in year fields
+         f "textnormal" ils    = Span ("",["nodecor"],[]) ils
+         f "bibstring" [Str s] = Str $ resolveKey' lang s
+         f "adddot"    []      = Str "."
+         f "adddotspace" []    = Span nullAttr [Str ".", Space]
+         f "addabbrvspace" []  = Space
+         f _            ils    = Span nullAttr ils
+parseRawLaTeX _ t = RawInline (Format "latex") t
+
+latex' :: Text -> Bib [Block]
+latex' t = do
+  lang <- gets localeLang
+  case parseLaTeX lang t of
+    Left _   -> mzero
+    Right bs -> return bs
+
+parseLaTeX :: Lang -> Text -> Either PandocError [Block]
+parseLaTeX lang t =
+  case runPure (readLaTeX
+                def{ readerExtensions =
+                      extensionsFromList [Ext_raw_tex, Ext_smart] } t) of
+    Left e              -> Left e
+    Right (Pandoc _ bs) -> Right $ Walk.walk (adjustSpans lang) bs
+
+latex :: Text -> Bib Inlines
+latex = fmap blocksToInlines . latex' . T.strip
+
+type Options = [(Text, Text)]
+
+parseOptions :: Text -> Options
+parseOptions = map breakOpt . T.splitOn ","
+  where breakOpt x = case T.break (=='=') x of
+                          (w,v) -> (T.toLower $ T.strip w,
+                                    T.toLower $ T.strip $ T.drop 1 v)
+
+bibEntries :: BibParser [Item]
+bibEntries = do
+  skipMany nonEntry
+  many (bibItem <* skipMany nonEntry)
+ where nonEntry = bibSkip <|>
+                  try (char '@' >>
+                       (bibComment <|> bibPreamble <|> bibString))
+
+bibSkip :: BibParser ()
+bibSkip = () <$ take1WhileP (/='@')
+
+bibComment :: BibParser ()
+bibComment = do
+  cistring "comment"
+  spaces
+  void inBraces <|> bibSkip <|> return ()
+
+bibPreamble :: BibParser ()
+bibPreamble = do
+  cistring "preamble"
+  spaces
+  void inBraces
+
+bibString :: BibParser ()
+bibString = do
+  cistring "string"
+  spaces
+  char '{'
+  spaces
+  (k,v) <- entField
+  char '}'
+  updateState (\(l,m) -> (l, Map.insert k v m))
+  return ()
+
+inBraces :: BibParser Text
+inBraces = do
+  char '{'
+  res <- manyTill
+         (  (T.pack <$> many1 (noneOf "{}\\"))
+        <|> (char '\\' >> (  (char '{' >> return "\\{")
+                         <|> (char '}' >> return "\\}")
+                         <|> return "\\"))
+        <|> (braced <$> inBraces)
+         ) (char '}')
+  return $ T.concat res
+
+braced :: Text -> Text
+braced = T.cons '{' . flip T.snoc '}'
+
+inQuotes :: BibParser Text
+inQuotes = do
+  char '"'
+  T.concat <$> manyTill
+             (  (T.pack <$> many1 (noneOf "\"\\{"))
+               <|> (char '\\' >> T.cons '\\' . T.singleton <$> anyChar)
+               <|> braced <$> inBraces
+            ) (char '"')
+
+fieldName :: BibParser Text
+fieldName = resolveAlias . T.toLower
+  <$> take1WhileP (\c ->
+         isAlphaNum c || c == '-' || c == '_' || c == ':' || c == '+')
+
+isBibtexKeyChar :: Char -> Bool
+isBibtexKeyChar c =
+  isAlphaNum c || c `elem` (".:;?!`'()/*@_+=-[]*&" :: [Char])
+
+bibItem :: BibParser Item
+bibItem = do
+  char '@'
+  pos <- getPosition
+  enttype <- T.toLower <$> take1WhileP isLetter
+  spaces
+  char '{'
+  spaces
+  entid <- take1WhileP isBibtexKeyChar
+  spaces
+  char ','
+  spaces
+  entfields <- entField `sepEndBy` (char ',' >> spaces)
+  spaces
+  char '}'
+  return $ Item entid pos enttype (Map.fromList entfields)
+
+entField :: BibParser (Text, Text)
+entField = do
+  k <- fieldName
+  spaces
+  char '='
+  spaces
+  vs <- (expandString <|> inQuotes <|> inBraces <|> rawWord) `sepBy`
+            try (spaces >> char '#' >> spaces)
+  spaces
+  return (k, T.concat vs)
+
+resolveAlias :: Text -> Text
+resolveAlias "archiveprefix" = "eprinttype"
+resolveAlias "primaryclass" = "eprintclass"
+resolveAlias s = s
+
+rawWord :: BibParser Text
+rawWord = take1WhileP isAlphaNum
+
+expandString :: BibParser Text
+expandString = do
+  k <- fieldName
+  (lang, strs) <- getState
+  case Map.lookup k strs of
+       Just v  -> return v
+       Nothing -> return $ resolveKey' lang k
+
+cistring :: Text -> BibParser Text
+cistring s = try (go s)
+ where go t = case T.uncons t of
+         Nothing     -> return ""
+         Just (c,cs) -> do
+           x <- char (toLower c) <|> char (toUpper c)
+           xs <- go cs
+           return (T.cons x xs)
+
+splitKeys :: Text -> [Text]
+splitKeys = filter (not . T.null) . T.split (\c -> c == ' ' || c == ',')
+
+-- Biblatex Localization Keys (see Biblatex manual)
+-- Currently we only map a subset likely to be used in Biblatex *databases*
+-- (in fields such as `type`, and via `\bibstring{}` commands).
+
+parseMonth :: Text -> Maybe Int
+parseMonth s =
+  case T.toLower s of
+         "jan" -> Just 1
+         "feb" -> Just 2
+         "mar" -> Just 3
+         "apr" -> Just 4
+         "may" -> Just 5
+         "jun" -> Just 6
+         "jul" -> Just 7
+         "aug" -> Just 8
+         "sep" -> Just 9
+         "oct" -> Just 10
+         "nov" -> Just 11
+         "dec" -> Just 12
+         _     -> readMay (T.unpack s)
+
+notFound :: Text -> Bib a
+notFound f = Prelude.fail $ T.unpack f ++ " not found"
+
+getField :: Text -> Bib Inlines
+getField f = do
+  fs <- asks fields
+  case Map.lookup f fs of
+       Just x  -> latex x
+       Nothing -> notFound f
+
+
+getPeriodicalTitle :: Text -> Bib Inlines
+getPeriodicalTitle f = do
+  ils <- getField f
+  return ils
+
+protectCase :: (Inlines -> Inlines) -> (Inlines -> Inlines)
+protectCase f = Walk.walk unprotect . f . Walk.walk protect
+ where
+  protect (Span ("",[],[]) xs) = Span ("",["nocase"],[]) xs
+  protect  x = x
+  unprotect (Span ("",["nocase"],[]) xs)
+    | hasLowercaseWord xs = Span ("",["nocase"],[]) xs
+    | otherwise           = Span ("",[],[]) xs
+  unprotect x = x
+  hasLowercaseWord = any startsWithLowercase . splitStrWhen isPunctuation
+  startsWithLowercase (Str (T.uncons -> Just (x,_))) = isLower x
+  startsWithLowercase _           = False
+
+unTitlecase :: Maybe Lang -> Inlines -> Inlines
+unTitlecase mblang = protectCase (addTextCase mblang SentenceCase)
+
+getTitle :: Text -> Bib Inlines
+getTitle f = do
+  ils <- getField f
+  utc <- gets untitlecase
+  lang <- gets localeLang
+  let processTitle = if utc then unTitlecase (Just lang) else id
+  return $ processTitle ils
+
+getShortTitle :: Bool -> Text -> Bib (Maybe Inlines)
+getShortTitle requireColon f = do
+  ils <- splitStrWhen (==':') . B.toList <$> getTitle f
+  if not requireColon || containsColon ils
+     then return $ Just $ B.fromList $ upToColon ils
+     else return Nothing
+
+containsColon :: [Inline] -> Bool
+containsColon xs = Str ":" `elem` xs
+
+upToColon :: [Inline] -> [Inline]
+upToColon xs = takeWhile (/= Str ":") xs
+
+isNumber :: Text -> Bool
+isNumber t = case T.uncons t of
+  Just ('-', ds) -> T.all isDigit ds
+  Just _         -> T.all isDigit t
+  Nothing        -> False
+
+getDate :: Text -> Bib Date
+getDate f = do
+  -- the ~ can used for approx dates, but the latex reader
+  -- parses this as a nonbreaking space, so we need to convert it back!
+  let nbspToTilde '\160' = '~'
+      nbspToTilde c      = c
+  mbd <- rawDateEDTF . T.map nbspToTilde <$> getRawField f
+  case mbd of
+    Nothing -> Prelude.fail "expected date"
+    Just d  -> return d
+
+-- A negative (BC) year might be written with -- or --- in bibtex:
+fixLeadingDash :: Text -> Text
+fixLeadingDash t = case T.uncons t of
+  Just (c, ds) | (c == '–' || c == '—') && firstIsDigit ds -> T.cons '–' ds
+  _ -> t
+ where firstIsDigit = maybe False (isDigit . fst) . T.uncons
+
+getOldDate :: Text -> Bib Date
+getOldDate prefix = do
+  year' <- (readMay . T.unpack . fixLeadingDash . stringify
+              <$> getField (prefix <> "year")) <|> return Nothing
+  month' <- (parseMonth <$> getRawField (prefix <> "month"))
+            <|> return Nothing
+  day' <- (readMay . T.unpack <$> getRawField (prefix <> "day"))
+          <|> return Nothing
+  endyear' <- (readMay . T.unpack . fixLeadingDash . stringify
+              <$> getField (prefix <> "endyear")) <|> return Nothing
+  endmonth' <- (parseMonth . stringify
+                 <$> getField (prefix <> "endmonth")) <|> return Nothing
+  endday' <- (readMay . T.unpack . stringify <$>
+                 getField (prefix <> "endday")) <|> return Nothing
+  let toDateParts (y', m', d') =
+              DateParts $
+                 case y' of
+                   Nothing -> []
+                   Just y  ->
+                     case m' of
+                       Nothing -> [y]
+                       Just m  ->
+                         case d' of
+                           Nothing -> [y,m]
+                           Just d  -> [y,m,d]
+  let dateparts = filter (\x -> x /= DateParts [])
+                  $ map toDateParts [(year',month',day'),
+                                     (endyear',endmonth',endday')]
+  literal <- if null dateparts
+                then Just <$> getRawField (prefix <> "year")
+                else return Nothing
+  return $
+    Date { dateParts = dateparts
+         , dateCirca = False
+         , dateSeason = Nothing
+         , dateLiteral = literal }
+
+getRawField :: Text -> Bib Text
+getRawField f =
+  (stringify <$> getField f)
+  <|> do fs <- asks fields
+         case Map.lookup f fs of
+              Just x  -> return x
+              Nothing -> notFound f
+
+getLiteralList :: Text -> Bib [Inlines]
+getLiteralList f = do
+  fs <- asks fields
+  case Map.lookup f fs of
+       Just x  -> latex' x >>= toLiteralList
+       Nothing -> notFound f
+
+-- separates items with semicolons
+getLiteralList' :: Text -> Bib Inlines
+getLiteralList' f = do
+  fs <- asks fields
+  case Map.lookup f fs of
+    Just x    -> do
+      x' <- latex' x
+      case x' of
+        [Para xs]  ->
+          return $ B.fromList
+                 $ intercalate [Str ";", Space]
+                 $ splitByAnd xs
+        [Plain xs] ->
+          return $ B.fromList
+                 $ intercalate [Str ";", Space]
+                 $ splitByAnd xs
+        _          -> mzero
+    Nothing   -> notFound f
+
+splitByAnd :: [Inline] -> [[Inline]]
+splitByAnd = splitOn [Space, Str "and", Space]
+
+toLiteralList :: [Block] -> Bib [Inlines]
+toLiteralList [Para xs] =
+  return $ map B.fromList $ splitByAnd xs
+toLiteralList [Plain xs] = toLiteralList [Para xs]
+toLiteralList _ = mzero
+
+concatWith :: Char -> [Inlines] -> Inlines
+concatWith sep = foldl' go mempty
+  where go :: Inlines -> Inlines -> Inlines
+        go accum s
+          | s == mempty = accum
+          | otherwise   =
+              case Seq.viewr (B.unMany accum) of
+                     Seq.EmptyR -> s
+                     _ Seq.:> Str x
+                       | not (T.null x) &&
+                         T.last x `elem` ("!?.,:;" :: String)
+                                    -> accum <> B.space <> s
+                     _ -> accum <> B.str (T.singleton sep) <>
+                                                B.space <> s
+
+
+getNameList :: Options -> Text -> Bib [Name]
+getNameList opts  f = do
+  fs <- asks fields
+  case Map.lookup f fs of
+       Just x  -> latexNames opts x
+       Nothing -> notFound f
+
+toNameList :: Options -> [Block] -> Bib [Name]
+toNameList opts [Para xs] =
+  filter (/= emptyName) <$> mapM (toName opts . addSpaceAfterPeriod)
+                                    (splitByAnd xs)
+toNameList opts [Plain xs] = toNameList opts [Para xs]
+toNameList _ _ = mzero
+
+latexNames :: Options -> Text -> Bib [Name]
+latexNames opts t = latex' (T.strip t) >>= toNameList opts
+
+-- see issue 392 for motivation.  We want to treat
+-- "J.G. Smith" and "J. G. Smith" the same.
+addSpaceAfterPeriod :: [Inline] -> [Inline]
+addSpaceAfterPeriod = go . splitStrWhen (=='.')
+  where
+    go [] = []
+    go (Str (T.unpack -> [c]):Str ".":Str (T.unpack -> [d]):xs)
+      | isLetter d
+      , isLetter c
+      , isUpper c
+      , isUpper d
+        = Str (T.singleton c):Str ".":Space:go (Str (T.singleton d):xs)
+    go (x:xs) = x:go xs
+
+emptyName :: Name
+emptyName =
+    Name {  nameFamily              = Nothing
+          , nameGiven               = Nothing
+          , nameDroppingParticle    = Nothing
+          , nameNonDroppingParticle = Nothing
+          , nameSuffix              = Nothing
+          , nameLiteral             = Nothing
+          , nameCommaSuffix         = False
+          , nameStaticOrdering      = False
+          }
+
+toName :: Options -> [Inline] -> Bib Name
+toName _ [Str "others"] =
+  return emptyName{ nameLiteral = Just "others" }
+toName _ [Span ("",[],[]) ils] = -- corporate author
+  return emptyName{ nameLiteral = Just $ stringify ils }
+ -- extended BibLaTeX name format - see #266
+toName _ ils@(Str ys:_) | T.any (== '=') ys = do
+  let commaParts = splitWhen (== Str ",")
+                   . splitStrWhen (\c -> c == ',' || c == '=' || c == '\160')
+                   $ ils
+  let addPart ag (Str "given" : Str "=" : xs) =
+        ag{ nameGiven = case nameGiven ag of
+                          Nothing -> Just $ stringify xs
+                          Just t  -> Just $ t <> " " <> stringify xs }
+      addPart ag (Str "family" : Str "=" : xs) =
+        ag{ nameFamily = Just $ stringify xs }
+      addPart ag (Str "prefix" : Str "=" : xs) =
+        ag{ nameDroppingParticle =  Just $ stringify xs }
+      addPart ag (Str "useprefix" : Str "=" : Str "true" : _) =
+        ag{ nameNonDroppingParticle = nameDroppingParticle ag
+          , nameDroppingParticle    = Nothing }
+      addPart ag (Str "suffix" : Str "=" : xs) =
+        ag{ nameSuffix = Just $ stringify xs }
+      addPart ag (Space : xs) = addPart ag xs
+      addPart ag _ = ag
+  return $ foldl' addPart emptyName commaParts
+-- First von Last
+-- von Last, First
+-- von Last, Jr ,First
+-- NOTE: biblatex and bibtex differ on:
+-- Drummond de Andrade, Carlos
+-- bibtex takes "Drummond de" as the von;
+-- biblatex takes the whole as a last name.
+-- See https://github.com/plk/biblatex/issues/236
+-- Here we implement the more sensible biblatex behavior.
+toName opts ils = do
+  let useprefix = optionSet "useprefix" opts
+  let usecomma  = optionSet "juniorcomma" opts
+  let bibtex    = optionSet "bibtex" opts
+  let words' = wordsBy (\x -> x == Space || x == Str "\160")
+  let commaParts = map words' $ splitWhen (== Str ",")
+                              $ splitStrWhen
+                                   (\c -> c == ',' || c == '\160') ils
+  let (first, vonlast, jr) =
+          case commaParts of
+               --- First is the longest sequence of white-space separated
+               -- words starting with an uppercase and that is not the
+               -- whole string. von is the longest sequence of whitespace
+               -- separated words whose last word starts with lower case
+               -- and that is not the whole string.
+               [fvl]      -> let (caps', rest') = span isCapitalized fvl
+                             in  if null rest' && not (null caps')
+                                 then (init caps', [last caps'], [])
+                                 else (caps', rest', [])
+               [vl,f]     -> (f, vl, [])
+               (vl:j:f:_) -> (f, vl, j )
+               []         -> ([], [], [])
+
+  let (von, lastname) =
+         if bibtex
+            then case span isCapitalized $ reverse vonlast of
+                        ([],w:ws) -> (reverse ws, [w])
+                        (vs, ws)    -> (reverse ws, reverse vs)
+            else case break isCapitalized vonlast of
+                        (vs@(_:_), []) -> (init vs, [last vs])
+                        (vs, ws)       -> (vs, ws)
+  let prefix = T.unwords $ map stringify von
+  let family = T.unwords $ map stringify lastname
+  let suffix = T.unwords $ map stringify jr
+  let given = T.unwords $ map stringify first
+  return
+    Name {  nameFamily              = if T.null family
+                                         then Nothing
+                                         else Just family
+          , nameGiven               = if T.null given
+                                         then Nothing
+                                         else Just given
+          , nameDroppingParticle    = if useprefix || T.null prefix
+                                         then Nothing
+                                         else Just prefix
+          , nameNonDroppingParticle = if useprefix && not (T.null prefix)
+                                         then Just prefix
+                                         else Nothing
+          , nameSuffix              = if T.null suffix
+                                         then Nothing
+                                         else Just suffix
+          , nameLiteral             = Nothing
+          , nameCommaSuffix         = usecomma
+          , nameStaticOrdering      = False
+          }
+
+splitStrWhen :: (Char -> Bool) -> [Inline] -> [Inline]
+splitStrWhen _ [] = []
+splitStrWhen p (Str xs : ys) = map Str (go xs) ++ splitStrWhen p ys
+  where go s =
+          let (w,z) = T.break p s
+           in if T.null z
+                 then if T.null w
+                         then []
+                         else [w]
+                 else if T.null w
+                         then (T.take 1 z : go (T.drop 1 z))
+                         else (w : T.take 1 z : go (T.drop 1 z))
+splitStrWhen p (x : ys) = x : splitStrWhen p ys
+
+ordinalize :: Locale -> Text -> Text
+ordinalize locale n =
+  let terms = localeTerms locale
+      pad0 t = case T.length t of
+                 0 -> "00"
+                 1 -> "0" <> t
+                 _ -> t
+   in case Map.lookup ("ordinal-" <> pad0 n) terms <|>
+           Map.lookup "ordinal" terms of
+        Nothing    -> n
+        Just []    -> n
+        Just (t:_) -> n <> snd t
+
+isCapitalized :: [Inline] -> Bool
+isCapitalized (Str (T.uncons -> Just (c,cs)) : rest)
+  | isUpper c = True
+  | isDigit c = isCapitalized (Str cs : rest)
+  | otherwise = False
+isCapitalized (_:rest) = isCapitalized rest
+isCapitalized [] = True
+
+optionSet :: Text -> Options -> Bool
+optionSet key opts = case lookup key opts of
+                      Just "true" -> True
+                      Just s      -> s == mempty
+                      _           -> False
+
+getTypeAndGenre :: Bib (Text, Maybe Text)
+getTypeAndGenre = do
+  lang <- gets localeLang
+  et <- asks entryType
+  guard $ et /= "xdata"
+  reftype' <- resolveKey' lang <$> getRawField "type"
+         <|> return mempty
+  st <- getRawField "entrysubtype" <|> return mempty
+  isEvent <- (True <$ (getRawField "eventdate"
+                     <|> getRawField "eventtitle"
+                     <|> getRawField "venue")) <|> return False
+  let reftype =
+        case et of
+           "article"
+             | st == "magazine"  -> "article-magazine"
+             | st == "newspaper" -> "article-newspaper"
+             | otherwise         -> "article-journal"
+           "book"                -> "book"
+           "booklet"             -> "pamphlet"
+           "bookinbook"          -> "chapter"
+           "collection"          -> "book"
+           "dataset"             -> "dataset"
+           "electronic"          -> "webpage"
+           "inbook"              -> "chapter"
+           "incollection"        -> "chapter"
+           "inreference"         -> "entry-encyclopedia"
+           "inproceedings"       -> "paper-conference"
+           "manual"              -> "book"
+           "mastersthesis"       -> "thesis"
+           "misc"                -> ""
+           "mvbook"              -> "book"
+           "mvcollection"        -> "book"
+           "mvproceedings"       -> "book"
+           "mvreference"         -> "book"
+           "online"              -> "webpage"
+           "patent"              -> "patent"
+           "periodical"
+             | st == "magazine"  -> "article-magazine"
+             | st == "newspaper" -> "article-newspaper"
+             | otherwise         -> "article-journal"
+           "phdthesis"           -> "thesis"
+           "proceedings"         -> "book"
+           "reference"           -> "book"
+           "report"              -> "report"
+           "software"            -> "book"    -- no "software" type in CSL
+           "suppbook"            -> "chapter"
+           "suppcollection"      -> "chapter"
+           "suppperiodical"
+             | st == "magazine"  -> "article-magazine"
+             | st == "newspaper" -> "article-newspaper"
+             | otherwise         -> "article-journal"
+           "techreport"          -> "report"
+           "thesis"              -> "thesis"
+           "unpublished"         -> if isEvent then "speech" else "manuscript"
+           "www"                 -> "webpage"
+           -- biblatex, "unsupported"
+           "artwork"             -> "graphic"
+           "audio"               -> "song"    -- for audio *recordings*
+           "commentary"          -> "book"
+           "image"               -> "graphic"   -- or "figure" ?
+           "jurisdiction"        -> "legal_case"
+           "legislation"         -> "legislation"  -- or "bill" ?
+           "legal"               -> "treaty"
+           "letter"              -> "personal_communication"
+           "movie"               -> "motion_picture"
+           "music"               -> "song"        -- for musical *recordings*
+           "performance"         -> "speech"
+           "review"              -> "review"      -- or "review-book" ?
+           "standard"            -> "legislation"
+           "video"               -> "motion_picture"
+           -- biblatex-apa:
+           "data"                -> "dataset"
+           "letters"             -> "personal_communication"
+           "newsarticle"         -> "article-newspaper"
+           _                     -> ""
+
+  let refgenre =
+        case et of
+          "mastersthesis"  -> if T.null reftype'
+                                 then Just $ resolveKey' lang "mathesis"
+                                 else Just reftype'
+          "phdthesis"      -> if T.null reftype'
+                                 then Just $ resolveKey' lang "phdthesis"
+                                 else Just reftype'
+          _                -> if T.null reftype'
+                                 then Nothing
+                                 else Just reftype'
+  return (reftype, refgenre)
+
+
+-- transformKey source target key
+-- derived from Appendix C of bibtex manual
+transformKey :: Text -> Text -> Text -> [Text]
+transformKey _ _ "ids"            = []
+transformKey _ _ "crossref"       = []
+transformKey _ _ "xref"           = []
+transformKey _ _ "entryset"       = []
+transformKey _ _ "entrysubtype"   = []
+transformKey _ _ "execute"        = []
+transformKey _ _ "label"          = []
+transformKey _ _ "options"        = []
+transformKey _ _ "presort"        = []
+transformKey _ _ "related"        = []
+transformKey _ _ "relatedoptions" = []
+transformKey _ _ "relatedstring"  = []
+transformKey _ _ "relatedtype"    = []
+transformKey _ _ "shorthand"      = []
+transformKey _ _ "shorthandintro" = []
+transformKey _ _ "sortkey"        = []
+transformKey x y "author"
+  | x `elem` ["mvbook", "book"] &&
+    y `elem` ["inbook", "bookinbook", "suppbook"] = ["bookauthor", "author"]
+-- note: this next clause is not in the biblatex manual, but it makes
+-- sense in the context of CSL conversion:
+transformKey x y "author"
+  | x == "mvbook" && y == "book" = ["bookauthor", "author"]
+transformKey "mvbook" y z
+  | y `elem` ["book", "inbook", "bookinbook", "suppbook"] = standardTrans z
+transformKey x y z
+  | x `elem` ["mvcollection", "mvreference"] &&
+    y `elem` ["collection", "reference", "incollection", "inreference",
+               "suppcollection"] = standardTrans z
+transformKey "mvproceedings" y z
+  | y `elem` ["proceedings", "inproceedings"] = standardTrans z
+transformKey "book" y z
+  | y `elem` ["inbook", "bookinbook", "suppbook"] = bookTrans z
+transformKey x y z
+  | x `elem` ["collection", "reference"] &&
+    y `elem` ["incollection", "inreference", "suppcollection"] = bookTrans z
+transformKey "proceedings" "inproceedings" z = bookTrans z
+transformKey "periodical" y z
+  | y `elem` ["article", "suppperiodical"] =
+  case z of
+       "title"          -> ["journaltitle"]
+       "subtitle"       -> ["journalsubtitle"]
+       "shorttitle"     -> []
+       "sorttitle"      -> []
+       "indextitle"     -> []
+       "indexsorttitle" -> []
+       _                -> [z]
+transformKey _ _ x                = [x]
+
+standardTrans :: Text -> [Text]
+standardTrans z =
+  case z of
+       "title"          -> ["maintitle"]
+       "subtitle"       -> ["mainsubtitle"]
+       "titleaddon"     -> ["maintitleaddon"]
+       "shorttitle"     -> []
+       "sorttitle"      -> []
+       "indextitle"     -> []
+       "indexsorttitle" -> []
+       _                -> [z]
+
+bookTrans :: Text -> [Text]
+bookTrans z =
+  case z of
+       "title"          -> ["booktitle"]
+       "subtitle"       -> ["booksubtitle"]
+       "titleaddon"     -> ["booktitleaddon"]
+       "shorttitle"     -> []
+       "sorttitle"      -> []
+       "indextitle"     -> []
+       "indexsorttitle" -> []
+       _                -> [z]
+
+resolveKey :: Lang -> Inlines -> Inlines
+resolveKey lang ils = Walk.walk go ils
+  where go (Str s) = Str $ resolveKey' lang s
+        go x       = x
+
+resolveKey' :: Lang -> Text -> Text
+resolveKey' lang@(Lang l _) k =
+  case Map.lookup l biblatexStringMap >>= Map.lookup (T.toLower k) of
+    Nothing     -> k
+    Just (x, _) -> either (const k) stringify $ parseLaTeX lang x
+
+convertEnDash :: Inline -> Inline
+convertEnDash (Str s) = Str (T.map (\c -> if c == '–' then '-' else c) s)
+convertEnDash x       = x
diff --git a/src/Text/Pandoc/Citeproc/CslJson.hs b/src/Text/Pandoc/Citeproc/CslJson.hs
new file mode 100644
--- /dev/null
+++ b/src/Text/Pandoc/Citeproc/CslJson.hs
@@ -0,0 +1,37 @@
+{-# LANGUAGE OverloadedStrings #-}
+module Text.Pandoc.Citeproc.CslJson
+  ( cslJsonToReferences )
+where
+
+import Citeproc.CslJson
+import Citeproc.Types
+import Control.Monad.Identity (runIdentity)
+import Data.Aeson (eitherDecodeStrict')
+import Data.ByteString (ByteString)
+import Text.Pandoc.Builder as B
+import Data.Text (Text)
+
+fromCslJson :: CslJson Text -> Inlines
+fromCslJson (CslText t) = B.text t
+fromCslJson CslEmpty = mempty
+fromCslJson (CslConcat x y) = fromCslJson x <> fromCslJson y
+fromCslJson (CslQuoted x) = B.doubleQuoted (fromCslJson x)
+fromCslJson (CslItalic x) = B.emph (fromCslJson x)
+fromCslJson (CslNormal x) = fromCslJson x  -- TODO?
+fromCslJson (CslBold x) = B.strong (fromCslJson x)
+fromCslJson (CslUnderline x) = B.underline (fromCslJson x)
+fromCslJson (CslNoDecoration x) =
+  B.spanWith ("",["nodecoration"],[]) (fromCslJson x)
+fromCslJson (CslSmallCaps x) = B.smallcaps (fromCslJson x)
+fromCslJson (CslBaseline x) = fromCslJson x
+fromCslJson (CslSub x) = B.subscript (fromCslJson x)
+fromCslJson (CslSup x) = B.superscript (fromCslJson x)
+fromCslJson (CslNoCase x) = B.spanWith ("",["nocase"],[]) (fromCslJson x)
+fromCslJson (CslDiv t x) = B.spanWith ("",["csl-" <> t],[]) (fromCslJson x)
+
+cslJsonToReferences :: ByteString -> Either String [Reference Inlines]
+cslJsonToReferences raw =
+  case eitherDecodeStrict' raw of
+    Left e        -> Left e
+    Right cslrefs -> Right $
+      map (runIdentity . traverse (return . fromCslJson)) cslrefs
diff --git a/src/Text/Pandoc/Citeproc/Data.hs b/src/Text/Pandoc/Citeproc/Data.hs
new file mode 100644
--- /dev/null
+++ b/src/Text/Pandoc/Citeproc/Data.hs
@@ -0,0 +1,31 @@
+{-# LANGUAGE OverloadedStrings #-}
+{-# LANGUAGE TemplateHaskell #-}
+module Text.Pandoc.Citeproc.Data
+  (biblatexStringMap)
+where
+import Data.FileEmbed
+import Data.ByteString (ByteString)
+import qualified Data.Map as M
+import qualified Data.Text.Encoding as TE
+import qualified Data.Text as T
+import Data.Text (Text)
+import Text.Pandoc.Citeproc.Util (toIETF)
+import Citeproc (Lang(..), parseLang)
+
+biblatexLocalizations :: [(FilePath, ByteString)]
+biblatexLocalizations = $(embedDir "citeproc/biblatex-localization")
+
+-- biblatex localization keys, from files at
+-- http://github.com/plk/biblatex/tree/master/tex/latex/biblatex/lbx
+biblatexStringMap :: M.Map Text (M.Map Text (Text, Text))
+biblatexStringMap = foldr go mempty biblatexLocalizations
+ where
+  go (fp, bs) =
+    let Lang lang _ = parseLang (toIETF $ T.takeWhile (/= '.') $ T.pack fp)
+        ls = T.lines $ TE.decodeUtf8 bs
+     in if length ls > 4
+           then M.insert lang (toStringMap $ map (T.splitOn "|") ls)
+           else id
+  toStringMap = foldr go' mempty
+  go' [term, x, y] = M.insert term (x, y)
+  go' _ = id
diff --git a/src/Text/Pandoc/Citeproc/Locator.hs b/src/Text/Pandoc/Citeproc/Locator.hs
new file mode 100644
--- /dev/null
+++ b/src/Text/Pandoc/Citeproc/Locator.hs
@@ -0,0 +1,279 @@
+{-# LANGUAGE TupleSections #-}
+{-# LANGUAGE ViewPatterns #-}
+{-# LANGUAGE OverloadedStrings #-}
+module Text.Pandoc.Citeproc.Locator
+  ( parseLocator )
+where
+import Citeproc.Types
+import Data.Text (Text)
+import qualified Data.Text as T
+import Text.Parsec
+import Text.Pandoc.Definition
+import Text.Pandoc.Parsing (romanNumeral)
+import Text.Pandoc.Shared (stringify)
+import Control.Monad (mzero)
+import qualified Data.Map as M
+import Data.Char (isSpace, isPunctuation, isDigit)
+
+parseLocator :: Locale -> [Inline] -> (Maybe (Text, Text), [Inline])
+parseLocator locale inp =
+  case parse (pLocatorWords (toLocatorMap locale)) "suffix" $ splitInp inp of
+       Right r -> r
+       Left _  -> (Nothing, inp)
+
+splitInp :: [Inline] -> [Inline]
+splitInp = splitStrWhen (\c -> isSpace c || (isPunctuation c && c /= ':'))
+
+--
+-- Locator parsing
+--
+
+type LocatorParser = Parsec [Inline] ()
+
+pLocatorWords :: LocatorMap
+              -> LocatorParser (Maybe (Text, Text), [Inline])
+pLocatorWords locMap = do
+  optional $ pMatchChar "," (== ',')
+  optional pSpace
+  (la, lo) <- pLocatorDelimited locMap <|> pLocatorIntegrated locMap
+  s <- getInput -- rest is suffix
+  -- need to trim, otherwise "p. 9" and "9" will have 'different' locators later on
+  -- i.e. the first one will be " 9"
+  return $
+    if T.null la && T.null lo
+       then (Nothing, s)
+       else (Just (la, T.strip lo), s)
+
+pLocatorDelimited :: LocatorMap -> LocatorParser (Text, Text)
+pLocatorDelimited locMap = try $ do
+  _ <- pMatchChar "{" (== '{')
+  skipMany pSpace -- gobble pre-spaces so label doesn't try to include them
+  (la, _) <- pLocatorLabelDelimited locMap
+  -- we only care about balancing {} and [] (because of the outer [] scope);
+  -- the rest can be anything
+  let inner = do { t <- anyToken; return (True, stringify t) }
+  gs <- many (pBalancedBraces [('{','}'), ('[',']')] inner)
+  _ <- pMatchChar "}" (== '}')
+  let lo = T.concat $ map snd gs
+  return (la, lo)
+
+pLocatorLabelDelimited :: LocatorMap -> LocatorParser (Text, Bool)
+pLocatorLabelDelimited locMap
+  = pLocatorLabel' locMap lim <|> return ("page", True)
+    where
+        lim = stringify <$> anyToken
+
+pLocatorIntegrated :: LocatorMap -> LocatorParser (Text, Text)
+pLocatorIntegrated locMap = try $ do
+  (la, wasImplicit) <- pLocatorLabelIntegrated locMap
+  -- if we got the label implicitly, we have presupposed the first one is
+  -- going to have a digit, so guarantee that. You _can_ have p. (a)
+  -- because you specified it.
+  let modifier = if wasImplicit
+                    then requireDigits
+                    else requireRomansOrDigits
+  g <- try $ pLocatorWordIntegrated (not wasImplicit) >>= modifier
+  gs <- many (try $ pLocatorWordIntegrated False >>= modifier)
+  let lo = T.concat (g:gs)
+  return (la, lo)
+
+pLocatorLabelIntegrated :: LocatorMap -> LocatorParser (Text, Bool)
+pLocatorLabelIntegrated locMap
+  = pLocatorLabel' locMap lim <|> (lookAhead digital >> return ("page", True))
+    where
+      lim = try $ pLocatorWordIntegrated True >>= requireRomansOrDigits
+      digital = try $ pLocatorWordIntegrated True >>= requireDigits
+
+pLocatorLabel' :: LocatorMap -> LocatorParser Text
+               -> LocatorParser (Text, Bool)
+pLocatorLabel' locMap lim = go ""
+    where
+      -- grow the match string until we hit the end
+      -- trying to find the largest match for a label
+      go acc = try $ do
+          -- advance at least one token each time
+          -- the pathological case is "p.3"
+          t <- anyToken
+          ts <- manyTill anyToken (try $ lookAhead lim)
+          let s = acc <> stringify (t:ts)
+          case M.lookup (T.strip s) locMap of
+            -- try to find a longer one, or return this one
+            Just l -> go s <|> return (l, False)
+            Nothing -> go s
+
+-- hard requirement for a locator to have some real digits in it
+requireDigits :: (Bool, Text) -> LocatorParser Text
+requireDigits (_, s) = if not (T.any isDigit s)
+                          then Prelude.fail "requireDigits"
+                          else return s
+
+-- soft requirement for a sequence with some roman or arabic parts
+-- (a)(iv) -- because iv is roman
+-- 1(a)  -- because 1 is an actual digit
+-- NOT: a, (a)-(b), hello, (some text in brackets)
+requireRomansOrDigits :: (Bool, Text) -> LocatorParser Text
+requireRomansOrDigits (d, s) = if not d
+                                  then Prelude.fail "requireRomansOrDigits"
+                                  else return s
+
+pLocatorWordIntegrated :: Bool -> LocatorParser (Bool, Text)
+pLocatorWordIntegrated isFirst = try $ do
+  punct <- if isFirst
+              then return ""
+              else (stringify <$> pLocatorSep) <|> return ""
+  sp <- option "" (pSpace >> return " ")
+  (dig, s) <- pBalancedBraces [('(',')'), ('[',']'), ('{','}')] pPageSeq
+  return (dig, punct <> sp <> s)
+
+-- we want to capture:  123, 123A, C22, XVII, 33-44, 22-33; 22-11
+--                      34(1), 34A(A), 34(1)(i)(i), (1)(a)
+--                      [17], [17]-[18], '591 [84]'
+--                      (because CSL cannot pull out individual pages/sections
+--                      to wrap in braces on a per-style basis)
+pBalancedBraces :: [(Char, Char)]
+                -> LocatorParser (Bool, Text)
+                -> LocatorParser (Bool, Text)
+pBalancedBraces braces p = try $ do
+  ss <- many1 surround
+  return $ anyWereDigitLike ss
+  where
+      except = notFollowedBy pBraces >> p
+      -- outer and inner
+      surround = foldl (\a (open, close) -> sur open close except <|> a)
+                       except
+                       braces
+
+      isc c = stringify <$> pMatchChar [c] (== c)
+
+      sur c c' m = try $ do
+          (d, mid) <- between (isc c) (isc c') (option (False, "") m)
+          return (d, T.cons c . flip T.snoc c' $  mid)
+
+      flattened = concatMap (\(o, c) -> [o, c]) braces
+      pBraces = pMatchChar "braces" (`elem` flattened)
+
+
+-- YES 1, 1.2, 1.2.3
+-- NO  1., 1.2. a.6
+-- can't use sepBy because we want to leave trailing .s
+pPageSeq :: LocatorParser (Bool, Text)
+pPageSeq = oneDotTwo <|> withPeriod
+  where
+      oneDotTwo = do
+          u <- pPageUnit
+          us <- many withPeriod
+          return $ anyWereDigitLike (u:us)
+      withPeriod = try $ do
+          -- .2
+          p <- pMatchChar "." (== '.')
+          u <- try pPageUnit
+          return (fst u, stringify p <> snd u)
+
+anyWereDigitLike :: [(Bool, Text)] -> (Bool, Text)
+anyWereDigitLike as = (any fst as, T.concat $ map snd as)
+
+pPageUnit :: LocatorParser (Bool, Text)
+pPageUnit = roman <|> plainUnit
+  where
+      -- roman is a 'digit'
+      roman = (True,) <$> pRoman
+      plainUnit = do
+          ts <- many1 (notFollowedBy pSpace >>
+                       notFollowedBy pLocatorPunct >>
+                       anyToken)
+          let s = stringify ts
+          -- otherwise look for actual digits or -s
+          return (T.any isDigit s, s)
+
+pRoman :: LocatorParser Text
+pRoman = try $ do
+  tok <- anyToken
+  case tok of
+       Str t -> case parse (romanNumeral True *> eof)
+                   "roman numeral" (T.toUpper t) of
+                      Left _    -> mzero
+                      Right ()  -> return t
+       _      -> mzero
+
+pLocatorPunct :: LocatorParser Inline
+pLocatorPunct = pMatchChar "punctuation" isLocatorPunct
+
+pLocatorSep :: LocatorParser Inline
+pLocatorSep = pMatchChar "locator separator" isLocatorSep
+
+pMatchChar :: String -> (Char -> Bool) -> LocatorParser Inline
+pMatchChar msg f = satisfyTok f' <?> msg
+    where
+        f' (Str (T.unpack -> [c])) = f c
+        f' _                       = False
+
+pSpace :: LocatorParser Inline
+pSpace = satisfyTok (\t -> isSpacey t || t == Str "\160") <?> "space"
+
+satisfyTok :: (Inline -> Bool) -> LocatorParser Inline
+satisfyTok f = tokenPrim show (\sp _ _ -> sp) (\tok -> if f tok
+                                                          then Just tok
+                                                          else Nothing)
+
+isSpacey :: Inline -> Bool
+isSpacey Space     = True
+isSpacey SoftBreak = True
+isSpacey _         = False
+
+isLocatorPunct :: Char -> Bool
+isLocatorPunct '-' = False -- page range
+isLocatorPunct '–' = False -- page range, en dash
+isLocatorPunct ':' = False -- vol:page-range hack
+isLocatorPunct c   = isPunctuation c -- includes [{()}]
+
+isLocatorSep :: Char -> Bool
+isLocatorSep ',' = True
+isLocatorSep ';' = True
+isLocatorSep _   = False
+
+splitStrWhen :: (Char -> Bool) -> [Inline] -> [Inline]
+splitStrWhen _ [] = []
+splitStrWhen p (Str xs : ys) = go (T.unpack xs) ++ splitStrWhen p ys
+  where
+   go [] = []
+   go s = case break p s of
+             ([],[])     -> []
+             (zs,[])     -> [Str $ T.pack zs]
+             ([],w:ws) -> Str (T.singleton w) : go ws
+             (zs,w:ws) -> Str (T.pack zs) : Str (T.singleton w) : go ws
+splitStrWhen p (x : ys) = x : splitStrWhen p ys
+
+--
+-- Locator Map
+--
+
+type LocatorMap = M.Map Text Text
+
+toLocatorMap :: Locale -> LocatorMap
+toLocatorMap locale =
+  foldr go mempty locatorTerms
+ where
+  go tname locmap =
+    case M.lookup tname (localeTerms locale) of
+      Nothing -> locmap
+      Just ts -> foldr (\x -> M.insert (snd x) tname) locmap ts
+
+locatorTerms :: [Text]
+locatorTerms =
+  [ "book"
+  , "chapter"
+  , "column"
+  , "figure"
+  , "folio"
+  , "issue"
+  , "line"
+  , "note"
+  , "opus"
+  , "page"
+  , "number-of-pages"
+  , "paragraph"
+  , "part"
+  , "section"
+  , "sub verbo"
+  , "verse"
+  , "volume" ]
diff --git a/src/Text/Pandoc/Citeproc/MetaValue.hs b/src/Text/Pandoc/Citeproc/MetaValue.hs
new file mode 100644
--- /dev/null
+++ b/src/Text/Pandoc/Citeproc/MetaValue.hs
@@ -0,0 +1,254 @@
+{-# LANGUAGE OverloadedStrings #-}
+module Text.Pandoc.Citeproc.MetaValue
+  ( referenceToMetaValue
+  , metaValueToReference
+  , metaValueToText
+  , metaValueToPath
+  )
+where
+
+import Citeproc.Types
+import Text.Pandoc.Definition
+import Text.Pandoc.Builder as B
+import Text.Pandoc.Walk (query)
+import Text.Pandoc.Shared (stringify)
+import Data.Maybe
+import Safe
+import qualified Data.Set as Set
+import qualified Data.Map as M
+import qualified Data.Text as T
+import Data.Text (Text)
+import Text.Printf (printf)
+import Control.Applicative ((<|>))
+
+metaValueToText :: MetaValue -> Maybe Text
+metaValueToText (MetaString t) = Just t
+metaValueToText (MetaInlines ils) = Just $ stringify ils
+metaValueToText (MetaBlocks bls) = Just $ stringify bls
+metaValueToText (MetaList xs) = T.unwords <$> mapM metaValueToText xs
+metaValueToText _ = Nothing
+
+metaValueToPath :: MetaValue -> Maybe FilePath
+metaValueToPath = fmap T.unpack . metaValueToText
+
+metaValueToBool :: MetaValue -> Maybe Bool
+metaValueToBool (MetaBool b) = Just b
+metaValueToBool (MetaString "true") = Just True
+metaValueToBool (MetaString "false") = Just False
+metaValueToBool (MetaInlines ils) =
+  metaValueToBool (MetaString (stringify ils))
+metaValueToBool _ = Nothing
+
+referenceToMetaValue :: Reference Inlines -> MetaValue
+referenceToMetaValue ref =
+  let ItemId id' = referenceId ref
+      type' = referenceType ref
+   in MetaMap $ M.insert "id" (MetaString id')
+              $ M.insert "type" (MetaString type')
+              $ M.map valToMetaValue
+              $ M.mapKeys fromVariable
+              $ referenceVariables ref
+
+
+valToMetaValue :: Val Inlines -> MetaValue
+valToMetaValue (TextVal t) = MetaString t
+valToMetaValue (FancyVal ils) = MetaInlines (B.toList ils)
+valToMetaValue (NumVal n) = MetaString (T.pack $ show n)
+valToMetaValue (NamesVal ns) = MetaList $ map nameToMetaValue ns
+valToMetaValue (DateVal d) = dateToMetaValue d
+
+nameToMetaValue :: Name -> MetaValue
+nameToMetaValue name =
+  MetaMap $
+    (maybe id (M.insert "family" . MetaString) (nameFamily name)) .
+    (maybe id (M.insert "given" . MetaString) (nameGiven name)) .
+    (maybe id (M.insert "dropping-particle" . MetaString)
+       (nameDroppingParticle name)) .
+    (maybe id (M.insert "non-dropping-particle" . MetaString)
+       (nameNonDroppingParticle name)) .
+    (maybe id (M.insert "suffix" . MetaString) (nameSuffix name)) .
+    (maybe id (M.insert "literal" . MetaString) (nameLiteral name)) .
+    (if nameCommaSuffix name
+        then M.insert "comma-suffix" (MetaBool True)
+        else id) .
+    (if nameStaticOrdering name
+        then M.insert "static-ordering" (MetaBool True)
+        else id)
+    $ mempty
+
+dateToMetaValue :: Date -> MetaValue
+dateToMetaValue date =
+  MetaString $
+    (case dateLiteral date of
+       Just l  -> l
+       Nothing -> T.intercalate "/" $ map datePartsToEDTF $ dateParts date)
+    <> (if dateCirca date then "~" else "")
+ where
+  datePartsToEDTF (DateParts dps) =
+    T.pack $
+     (case dps of
+        (y:_) | y > 9999 || y < -10000 -> ('y':)
+        _ -> id) $
+    case dps of
+      (y:m:d:_)
+       | y < -1     -> printf "%05d-%02d-%02d" (y+1) m d
+       | otherwise  -> printf "%04d-%02d-%02d" y m d
+      (y:m:[])
+       | y < -1     -> printf "%05d-%02d" (y+1) m
+       | otherwise  -> printf "%04d-%02d" y m
+      (y:[])
+       | y == 0     -> printf "" -- used for open range
+       | y < -1     -> printf "%05d" (y+1)
+       | otherwise  -> printf "%04d" y
+      _             -> mempty
+
+metaValueToReference :: MetaValue
+                     -> Maybe (Reference Inlines)
+metaValueToReference (MetaMap m) = do
+  let m' = M.mapKeys normalizeKey m
+  id' <- M.lookup "id" m' >>= metaValueToText
+  type' <- (M.lookup "type" m' >>= metaValueToText) <|> pure ""
+  let m'' = M.delete "id" $ M.delete "type" m'
+  let vars = M.mapKeys toVariable $ M.mapWithKey metaValueToVal m''
+  return $ Reference { referenceId = ItemId id'
+                     , referenceType = type'
+                     , referenceDisambiguation = Nothing
+                     , referenceVariables = vars }
+metaValueToReference _ = Nothing
+
+metaValueToVal :: Text -> MetaValue -> Val Inlines
+metaValueToVal k v
+  | k `Set.member` dateVariables
+       = DateVal $ metaValueToDate v
+  | k `Set.member` nameVariables
+       = NamesVal $ metaValueToNames v
+  | k == "other-ids"
+       = TextVal $ fromMaybe mempty $ metaValueToText v
+         -- will create space-separated list
+  | otherwise =
+    case v of
+      MetaString t -> TextVal t
+      MetaInlines ils -> FancyVal (B.fromList ils)
+      MetaBlocks bs   -> FancyVal (B.fromList $ query id bs)
+      MetaBool b   -> TextVal (if b then "true" else "false")
+      MetaList _   -> TextVal mempty
+      MetaMap  _   -> TextVal mempty
+
+metaValueToDate :: MetaValue -> Date
+metaValueToDate (MetaMap m) =
+  Date
+   { dateParts = dateparts
+   , dateCirca = circa
+   , dateSeason = season
+   , dateLiteral = literal }
+ where
+  dateparts = case M.lookup "date-parts" m of
+                Just (MetaList xs) ->
+                  mapMaybe metaValueToDateParts xs
+                Just _ -> []
+                Nothing ->
+                  maybe [] (:[]) $ metaValueToDateParts (MetaMap m)
+  circa = fromMaybe False $
+            M.lookup "circa" m >>= metaValueToBool
+  season = M.lookup "season" m >>= metaValueToInt
+  literal = M.lookup "literal" m >>= metaValueToText
+metaValueToDate (MetaList xs) =
+  Date{ dateParts = mapMaybe metaValueToDateParts xs
+      , dateCirca = False
+      , dateSeason = Nothing
+      , dateLiteral = Nothing }
+metaValueToDate x =
+  fromMaybe emptyDate $ metaValueToText x >>= rawDateEDTF
+
+
+metaValueToInt :: MetaValue -> Maybe Int
+metaValueToInt x = metaValueToText x >>= readMay . T.unpack
+
+metaValueToDateParts :: MetaValue -> Maybe DateParts
+metaValueToDateParts (MetaList xs) =
+  Just $ DateParts $ map (fromMaybe 0 . metaValueToInt) xs
+metaValueToDateParts (MetaMap m) =
+  case (M.lookup "year" m >>= metaValueToInt,
+        ((M.lookup "month" m >>= metaValueToInt)
+          <|>
+        ((+ 20) <$> (M.lookup "season" m >>= metaValueToInt))),
+        M.lookup "day" m >>= metaValueToInt) of
+    (Just y, Just mo, Just d)  -> Just $ DateParts [y, mo, d]
+    (Just y, Just mo, Nothing) -> Just $ DateParts [y, mo]
+    (Just y, Nothing, _)       -> Just $ DateParts [y]
+    _                          -> Nothing
+metaValueToDateParts _ = Nothing
+
+emptyDate :: Date
+emptyDate = Date { dateParts = []
+                 , dateCirca = False
+                 , dateSeason = Nothing
+                 , dateLiteral = Nothing }
+
+metaValueToNames :: MetaValue -> [Name]
+metaValueToNames (MetaList xs) = mapMaybe metaValueToName xs
+metaValueToNames x = maybeToList $ metaValueToName x
+
+metaValueToName :: MetaValue -> Maybe Name
+metaValueToName (MetaMap m) = extractParticles <$>
+  Just Name
+    { nameFamily = family
+    , nameGiven = given
+    , nameDroppingParticle = dropping
+    , nameNonDroppingParticle = nondropping
+    , nameSuffix = suffix
+    , nameCommaSuffix = commasuffix
+    , nameStaticOrdering = staticordering
+    , nameLiteral = literal
+    }
+ where
+  family = M.lookup "family" m >>= metaValueToText
+  given  = M.lookup "given" m >>= metaValueToText
+  dropping = M.lookup "dropping-particle" m
+                >>= metaValueToText
+  nondropping = M.lookup "non-dropping-particle" m
+                >>= metaValueToText
+  suffix = M.lookup "suffix" m >>= metaValueToText
+  commasuffix = fromMaybe False $
+    M.lookup "comma-suffix" m >>= metaValueToBool
+  staticordering = fromMaybe False $
+    M.lookup "static-ordering" m >>= metaValueToBool
+  literal = M.lookup "literal" m >>= metaValueToText
+metaValueToName x = extractParticles <$>
+  case metaValueToText x of
+    Nothing -> Nothing
+    Just lit -> Just Name
+                     { nameFamily = Nothing
+                     , nameGiven = Nothing
+                     , nameDroppingParticle = Nothing
+                     , nameNonDroppingParticle = Nothing
+                     , nameSuffix = Nothing
+                     , nameCommaSuffix = False
+                     , nameStaticOrdering = False
+                     , nameLiteral = Just lit }
+
+dateVariables :: Set.Set Text
+dateVariables = Set.fromList
+  [ "accessed", "container", "event-date", "issued",
+    "original-date", "submitted" ]
+
+nameVariables :: Set.Set Text
+nameVariables = Set.fromList
+  [ "author", "collection-editor", "composer",
+    "container-author", "director", "editor",
+    "editorial-director", "illustrator",
+    "interviewer", "original-author",
+    "recipient", "reviewed-author",
+    "translator" ]
+
+normalizeKey :: Text -> Text
+normalizeKey k =
+  case T.toLower k of
+    "doi"   -> "DOI"
+    "isbn"  -> "ISBN"
+    "issn"  -> "ISSN"
+    "pmcid" -> "PMCID"
+    "pmid"  -> "PMID"
+    "url"   -> "URL"
+    x       -> x
+
diff --git a/src/Text/Pandoc/Citeproc/Util.hs b/src/Text/Pandoc/Citeproc/Util.hs
new file mode 100644
--- /dev/null
+++ b/src/Text/Pandoc/Citeproc/Util.hs
@@ -0,0 +1,70 @@
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE OverloadedStrings #-}
+module Text.Pandoc.Citeproc.Util
+ ( toIETF )
+where
+import Data.Text (Text)
+
+toIETF :: Text -> Text
+toIETF "english"         = "en-US" -- "en-EN" unavailable in CSL
+toIETF "usenglish"       = "en-US"
+toIETF "american"        = "en-US"
+toIETF "british"         = "en-GB"
+toIETF "ukenglish"       = "en-GB"
+toIETF "canadian"        = "en-US" -- "en-CA" unavailable in CSL
+toIETF "australian"      = "en-GB" -- "en-AU" unavailable in CSL
+toIETF "newzealand"      = "en-GB" -- "en-NZ" unavailable in CSL
+toIETF "afrikaans"       = "af-ZA"
+toIETF "arabic"          = "ar"
+toIETF "basque"          = "eu"
+toIETF "bulgarian"       = "bg-BG"
+toIETF "catalan"         = "ca-AD"
+toIETF "croatian"        = "hr-HR"
+toIETF "czech"           = "cs-CZ"
+toIETF "danish"          = "da-DK"
+toIETF "dutch"           = "nl-NL"
+toIETF "estonian"        = "et-EE"
+toIETF "finnish"         = "fi-FI"
+toIETF "canadien"        = "fr-CA"
+toIETF "acadian"         = "fr-CA"
+toIETF "french"          = "fr-FR"
+toIETF "francais"        = "fr-FR"
+toIETF "austrian"        = "de-AT"
+toIETF "naustrian"       = "de-AT"
+toIETF "german"          = "de-DE"
+toIETF "germanb"         = "de-DE"
+toIETF "ngerman"         = "de-DE"
+toIETF "greek"           = "el-GR"
+toIETF "polutonikogreek" = "el-GR"
+toIETF "hebrew"          = "he-IL"
+toIETF "hungarian"       = "hu-HU"
+toIETF "icelandic"       = "is-IS"
+toIETF "italian"         = "it-IT"
+toIETF "japanese"        = "ja-JP"
+toIETF "latvian"         = "lv-LV"
+toIETF "lithuanian"      = "lt-LT"
+toIETF "magyar"          = "hu-HU"
+toIETF "mongolian"       = "mn-MN"
+toIETF "norsk"           = "nb-NO"
+toIETF "nynorsk"         = "nn-NO"
+toIETF "farsi"           = "fa-IR"
+toIETF "polish"          = "pl-PL"
+toIETF "brazil"          = "pt-BR"
+toIETF "brazilian"       = "pt-BR"
+toIETF "portugues"       = "pt-PT"
+toIETF "portuguese"      = "pt-PT"
+toIETF "romanian"        = "ro-RO"
+toIETF "russian"         = "ru-RU"
+toIETF "serbian"         = "sr-RS"
+toIETF "serbianc"        = "sr-RS"
+toIETF "slovak"          = "sk-SK"
+toIETF "slovene"         = "sl-SL"
+toIETF "spanish"         = "es-ES"
+toIETF "swedish"         = "sv-SE"
+toIETF "thai"            = "th-TH"
+toIETF "turkish"         = "tr-TR"
+toIETF "ukrainian"       = "uk-UA"
+toIETF "vietnamese"      = "vi-VN"
+toIETF "latin"           = "la"
+toIETF x                 = x
+
diff --git a/src/Text/Pandoc/Class/PandocMonad.hs b/src/Text/Pandoc/Class/PandocMonad.hs
--- a/src/Text/Pandoc/Class/PandocMonad.hs
+++ b/src/Text/Pandoc/Class/PandocMonad.hs
@@ -433,7 +433,7 @@
                "word/theme/theme1.xml"]
   let toLazy = BL.fromChunks . (:[])
   let pathToEntry path = do
-        epochtime <- (floor . utcTimeToPOSIXSeconds) <$> getCurrentTime
+        epochtime <- floor . utcTimeToPOSIXSeconds <$> getCurrentTime
         contents <- toLazy <$> readDataFile ("docx/" ++ path)
         return $ toEntry path epochtime contents
   datadir <- getUserDataDir
@@ -536,7 +536,7 @@
               ]
   let toLazy = BL.fromChunks . (:[])
   let pathToEntry path = do
-        epochtime <- (floor . utcTimeToPOSIXSeconds) <$> getCurrentTime
+        epochtime <- floor . utcTimeToPOSIXSeconds <$> getCurrentTime
         contents <- toLazy <$> readDataFile ("pptx/" ++ path)
         return $ toEntry path epochtime contents
   datadir <- getUserDataDir
@@ -553,7 +553,7 @@
                      mapM pathToEntry paths
 
 -- | Read file from user data directory or,
--- if not found there, from Cabal data directory.
+-- if not found there, from the default data files.
 readDataFile :: PandocMonad m => FilePath -> m B.ByteString
 readDataFile fname = do
   datadir <- getUserDataDir
@@ -565,14 +565,14 @@
             then readFileStrict (userDir </> fname)
             else readDefaultDataFile fname
 
--- | Read file from from Cabal data directory.
+-- | Read file from from the default data files.
 readDefaultDataFile :: PandocMonad m => FilePath -> m B.ByteString
 readDefaultDataFile "reference.docx" =
-  (B.concat . BL.toChunks . fromArchive) <$> getDefaultReferenceDocx
+  B.concat . BL.toChunks . fromArchive <$> getDefaultReferenceDocx
 readDefaultDataFile "reference.pptx" =
-  (B.concat . BL.toChunks . fromArchive) <$> getDefaultReferencePptx
+  B.concat . BL.toChunks . fromArchive <$> getDefaultReferencePptx
 readDefaultDataFile "reference.odt" =
-  (B.concat . BL.toChunks . fromArchive) <$> getDefaultReferenceODT
+  B.concat . BL.toChunks . fromArchive <$> getDefaultReferenceODT
 readDefaultDataFile fname =
 #ifdef EMBED_DATA_FILES
   case lookup (makeCanonical fname) dataFiles of
diff --git a/src/Text/Pandoc/Error.hs b/src/Text/Pandoc/Error.hs
--- a/src/Text/Pandoc/Error.hs
+++ b/src/Text/Pandoc/Error.hs
@@ -31,6 +31,8 @@
 import Text.Printf (printf)
 import Text.Parsec.Error
 import Text.Parsec.Pos hiding (Line)
+import Text.Pandoc.Shared (tshow)
+import Citeproc (CiteprocError, prettyCiteprocError)
 
 type Input = Text
 
@@ -59,6 +61,7 @@
                  | PandocUnknownReaderError Text
                  | PandocUnknownWriterError Text
                  | PandocUnsupportedExtensionError Text Text
+                 | PandocCiteprocError CiteprocError
                  deriving (Show, Typeable, Generic)
 
 instance Exception PandocError
@@ -138,12 +141,11 @@
     PandocUnsupportedExtensionError ext f -> err 23 $
       "The extension " <> ext <> " is not supported " <>
       "for " <> f
+    PandocCiteprocError e' -> err 24 $
+      prettyCiteprocError e'
 
 err :: Int -> Text -> IO a
 err exitCode msg = do
   UTF8.hPutStrLn stderr (T.unpack msg)
   exitWith $ ExitFailure exitCode
   return undefined
-
-tshow :: Show a => a -> Text
-tshow = T.pack . show
diff --git a/src/Text/Pandoc/Extensions.hs b/src/Text/Pandoc/Extensions.hs
--- a/src/Text/Pandoc/Extensions.hs
+++ b/src/Text/Pandoc/Extensions.hs
@@ -253,6 +253,8 @@
   , Ext_strikeout
   , Ext_task_lists
   , Ext_emoji
+  , Ext_fenced_code_blocks
+  , Ext_backtick_code_blocks
   ]
 
 -- | Extensions to be used with multimarkdown.
@@ -337,7 +339,17 @@
                                            [Ext_amuse,
                                             Ext_auto_identifiers]
 getDefaultExtensions "plain"           = plainExtensions
-getDefaultExtensions "gfm"             = githubMarkdownExtensions
+getDefaultExtensions "gfm"             = extensionsFromList
+  [ Ext_pipe_tables
+  , Ext_raw_html
+  , Ext_native_divs
+  , Ext_auto_identifiers
+  , Ext_gfm_auto_identifiers
+  , Ext_autolink_bare_uris
+  , Ext_strikeout
+  , Ext_task_lists
+  , Ext_emoji
+  ]
 getDefaultExtensions "commonmark"      = extensionsFromList
                                           [Ext_raw_html]
 getDefaultExtensions "commonmark_x"    = extensionsFromList
@@ -362,6 +374,7 @@
   , Ext_raw_attribute
   , Ext_implicit_header_references
   , Ext_attributes
+  , Ext_fenced_code_attributes
   ]
 getDefaultExtensions "org"             = extensionsFromList
                                           [Ext_citations,
@@ -445,7 +458,7 @@
   getAll "markdown"          = allMarkdownExtensions
   getAll "ipynb"             = allMarkdownExtensions <> extensionsFromList
     [ Ext_raw_markdown ]
-  getAll "docx"            = extensionsFromList
+  getAll "docx"            = autoIdExtensions <> extensionsFromList
     [ Ext_empty_paragraphs
     , Ext_styles
     ]
@@ -484,7 +497,9 @@
     , Ext_raw_attribute
     , Ext_implicit_header_references
     , Ext_attributes
+    , Ext_fenced_code_attributes
     ]
+  getAll "commonmark_x"    = getAll "commonmark"
   getAll "org"             = autoIdExtensions <>
     extensionsFromList
     [ Ext_citations
diff --git a/src/Text/Pandoc/Filter.hs b/src/Text/Pandoc/Filter.hs
--- a/src/Text/Pandoc/Filter.hs
+++ b/src/Text/Pandoc/Filter.hs
@@ -26,6 +26,7 @@
 import Text.Pandoc.Definition (Pandoc)
 import Text.Pandoc.Options (ReaderOptions)
 import Text.Pandoc.Logging
+import Text.Pandoc.Citeproc (processCitations)
 import qualified Text.Pandoc.Filter.JSON as JSONFilter
 import qualified Text.Pandoc.Filter.Lua as LuaFilter
 import qualified Text.Pandoc.Filter.Path as Path
@@ -39,6 +40,7 @@
 -- | Type of filter and path to filter file.
 data Filter = LuaFilter FilePath
             | JSONFilter FilePath
+            | CiteprocFilter -- built-in citeproc
             deriving (Show, Generic)
 
 instance FromYAML Filter where
@@ -47,15 +49,19 @@
     ty <- m .: "type"
     fp <- m .: "path"
     case ty of
+      "citeproc" -> return CiteprocFilter
       "lua"  -> return $ LuaFilter $ T.unpack fp
       "json" -> return $ JSONFilter $ T.unpack fp
       _      -> fail $ "Unknown filter type " ++ show (ty :: T.Text)) node
   <|>
   (withStr "Filter" $ \t -> do
     let fp = T.unpack t
-    case takeExtension fp of
-      ".lua"  -> return $ LuaFilter fp
-      _       -> return $ JSONFilter fp) node
+    if fp == "citeproc"
+       then return CiteprocFilter
+       else return $
+         case takeExtension fp of
+           ".lua"  -> LuaFilter fp
+           _       -> JSONFilter fp) node
 
 -- | Modify the given document using a filter.
 applyFilters :: ReaderOptions
@@ -71,6 +77,8 @@
     withMessages f $ JSONFilter.apply ropts args f doc
   applyFilter doc (LuaFilter f)  =
     withMessages f $ LuaFilter.apply ropts args f doc
+  applyFilter doc CiteprocFilter =
+    processCitations doc
   withMessages f action = do
     verbosity <- getVerbosity
     when (verbosity == INFO) $ report $ RunningFilter f
@@ -85,5 +93,6 @@
 expandFilterPath :: Filter -> PandocIO Filter
 expandFilterPath (LuaFilter fp) = LuaFilter <$> Path.expandFilterPath fp
 expandFilterPath (JSONFilter fp) = JSONFilter <$> Path.expandFilterPath fp
+expandFilterPath CiteprocFilter = return CiteprocFilter
 
 $(deriveJSON defaultOptions ''Filter)
diff --git a/src/Text/Pandoc/Image.hs b/src/Text/Pandoc/Image.hs
--- a/src/Text/Pandoc/Image.hs
+++ b/src/Text/Pandoc/Image.hs
@@ -1,5 +1,4 @@
 {-# LANGUAGE OverloadedStrings, ScopedTypeVariables, CPP #-}
-{-# LANGUAGE ViewPatterns      #-}
 {- |
 Module      : Text.Pandoc.Image
 Copyright   : Copyright (C) 2020 John MacFarlane
diff --git a/src/Text/Pandoc/Logging.hs b/src/Text/Pandoc/Logging.hs
--- a/src/Text/Pandoc/Logging.hs
+++ b/src/Text/Pandoc/Logging.hs
@@ -1,5 +1,6 @@
 {-# LANGUAGE DeriveDataTypeable #-}
 {-# LANGUAGE DeriveGeneric      #-}
+{-# LANGUAGE LambdaCase         #-}
 {-# LANGUAGE OverloadedStrings  #-}
 {- |
    Module      : Text.Pandoc.Logging
@@ -51,8 +52,7 @@
   parseJSON _      =  mzero
 
 instance FromYAML Verbosity where
-  parseYAML = withStr "Verbosity" $ \t ->
-    case t of
+  parseYAML = withStr "Verbosity" $ \case
          "ERROR"   -> return ERROR
          "WARNING" -> return WARNING
          "INFO"    -> return INFO
@@ -61,7 +61,6 @@
 data LogMessage =
     SkippedContent Text.Text SourcePos
   | IgnoredElement Text.Text
-  | CouldNotParseYamlMetadata Text.Text SourcePos
   | DuplicateLinkReference Text.Text SourcePos
   | DuplicateNoteReference Text.Text SourcePos
   | NoteDefinedButNotUsed Text.Text SourcePos
@@ -98,6 +97,7 @@
   | CouldNotDeduceFormat [Text.Text] Text.Text
   | RunningFilter FilePath
   | FilterCompleted FilePath Integer
+  | CiteprocWarning Text.Text
   deriving (Show, Eq, Data, Ord, Typeable, Generic)
 
 instance ToJSON LogMessage where
@@ -112,11 +112,6 @@
             "column" .= sourceColumn pos]
       IgnoredElement s ->
            ["contents" .= s]
-      CouldNotParseYamlMetadata s pos ->
-           ["message" .= s,
-            "source" .= sourceName pos,
-            "line" .= toJSON (sourceLine pos),
-            "column" .= toJSON (sourceColumn pos)]
       DuplicateLinkReference s pos ->
            ["contents" .= s,
             "source" .= sourceName pos,
@@ -227,6 +222,8 @@
       FilterCompleted fp ms ->
            ["path" .= Text.pack fp
            ,"milliseconds" .= Text.pack (show ms) ]
+      CiteprocWarning msg ->
+           ["message" .= msg]
 
 showPos :: SourcePos -> Text.Text
 showPos pos = Text.pack $ sn ++ "line " ++
@@ -248,9 +245,6 @@
          "Skipped '" <> s <> "' at " <> showPos pos
        IgnoredElement s ->
          "Ignored element " <> s
-       CouldNotParseYamlMetadata s pos ->
-         "Could not parse YAML metadata at " <> showPos pos <>
-           if Text.null s then "" else ": " <> s
        DuplicateLinkReference s pos ->
          "Duplicate link reference '" <> s <> "' at " <> showPos pos
        DuplicateNoteReference s pos ->
@@ -338,13 +332,13 @@
        RunningFilter fp -> "Running filter " <> Text.pack fp
        FilterCompleted fp ms -> "Completed filter " <> Text.pack fp <>
           " in " <> Text.pack (show ms) <> " ms"
+       CiteprocWarning ms -> "Citeproc: " <> ms
 
 messageVerbosity :: LogMessage -> Verbosity
 messageVerbosity msg =
   case msg of
        SkippedContent{}              -> INFO
        IgnoredElement{}              -> INFO
-       CouldNotParseYamlMetadata{}   -> WARNING
        DuplicateLinkReference{}      -> WARNING
        DuplicateNoteReference{}      -> WARNING
        NoteDefinedButNotUsed{}       -> WARNING
@@ -383,3 +377,4 @@
        CouldNotDeduceFormat{}        -> WARNING
        RunningFilter{}               -> INFO
        FilterCompleted{}             -> INFO
+       CiteprocWarning{}             -> WARNING
diff --git a/src/Text/Pandoc/Lua/Init.hs b/src/Text/Pandoc/Lua/Init.hs
--- a/src/Text/Pandoc/Lua/Init.hs
+++ b/src/Text/Pandoc/Lua/Init.hs
@@ -80,6 +80,7 @@
   putInReg "Attr"  -- used for Attr type alias
   putInReg "ListAttributes"  -- used for ListAttributes type alias
   putInReg "List"  -- pandoc.List
+  putInReg "SimpleTable"  -- helper for backward-compatible table handling
  where
   constrsToReg :: Data a => a -> Lua ()
   constrsToReg = mapM_ (putInReg . showConstr) . dataTypeConstrs . dataTypeOf
diff --git a/src/Text/Pandoc/Lua/Marshaling/AST.hs b/src/Text/Pandoc/Lua/Marshaling/AST.hs
--- a/src/Text/Pandoc/Lua/Marshaling/AST.hs
+++ b/src/Text/Pandoc/Lua/Marshaling/AST.hs
@@ -170,7 +170,7 @@
   Plain blcks              -> pushViaConstructor "Plain" blcks
   RawBlock f cs            -> pushViaConstructor "RawBlock" f cs
   Table attr blkCapt specs thead tbody tfoot ->
-    pushViaConstructor "Table" attr blkCapt specs thead tbody tfoot
+    pushViaConstructor "Table" blkCapt specs thead tbody tfoot attr
 
 -- | Return the value at the given index as block if possible.
 peekBlock :: StackIndex -> Lua Block
@@ -230,9 +230,7 @@
 instance Peekable ColWidth where
   peek idx = do
     width <- Lua.fromOptional <$> Lua.peek idx
-    return $ case width of
-      Nothing -> ColWidthDefault
-      Just w  -> ColWidth w
+    return $ maybe ColWidthDefault ColWidth width
 
 instance Pushable ColWidth where
   push = \case
@@ -262,7 +260,7 @@
     return $ TableBody attr (RowHeadColumns rowHeadColumns) head' body
 
 instance Pushable TableHead where
-  push (TableHead attr cells) = Lua.push (attr, cells)
+  push (TableHead attr rows) = Lua.push (attr, rows)
 
 instance Peekable TableHead where
   peek = fmap (uncurry TableHead) . Lua.peek
diff --git a/src/Text/Pandoc/Lua/Marshaling/SimpleTable.hs b/src/Text/Pandoc/Lua/Marshaling/SimpleTable.hs
new file mode 100644
--- /dev/null
+++ b/src/Text/Pandoc/Lua/Marshaling/SimpleTable.hs
@@ -0,0 +1,59 @@
+{- |
+   Module      : Text.Pandoc.Lua.Marshaling.SimpleTable
+   Copyright   : © 2020 Albert Krewinkel
+   License     : GNU GPL, version 2 or above
+
+   Maintainer  : Albert Krewinkel <tarleb+pandoc@moltkeplatz.de>
+   Stability   : alpha
+
+Definition and marshaling of the 'SimpleTable' data type used as a
+convenience type when dealing with tables.
+-}
+module Text.Pandoc.Lua.Marshaling.SimpleTable
+  ( SimpleTable (..)
+  , peekSimpleTable
+  , pushSimpleTable
+  )
+  where
+
+import Foreign.Lua (Lua, Peekable, Pushable, StackIndex)
+import Text.Pandoc.Definition
+import Text.Pandoc.Lua.Util (defineHowTo, pushViaConstructor, rawField)
+import Text.Pandoc.Lua.Marshaling.AST ()
+
+import qualified Foreign.Lua as Lua
+
+-- | A simple (legacy-style) table.
+data SimpleTable = SimpleTable
+  { simpleTableCaption :: [Inline]
+  , simpleTableAlignments :: [Alignment]
+  , simpleTableColumnWidths :: [Double]
+  , simpleTableHeader :: [[Block]]
+  , simpleTableBody :: [[[Block]]]
+  }
+
+instance Pushable SimpleTable where
+  push = pushSimpleTable
+
+instance Peekable SimpleTable where
+  peek = peekSimpleTable
+
+-- | Push a simple table to the stack by calling the
+-- @pandoc.SimpleTable@ constructor.
+pushSimpleTable :: SimpleTable -> Lua ()
+pushSimpleTable tbl = pushViaConstructor "SimpleTable"
+  (simpleTableCaption tbl)
+  (simpleTableAlignments tbl)
+  (simpleTableColumnWidths tbl)
+  (simpleTableHeader tbl)
+  (simpleTableBody tbl)
+
+-- | Retrieve a simple table from the stack.
+peekSimpleTable :: StackIndex -> Lua SimpleTable
+peekSimpleTable idx = defineHowTo "get SimpleTable" $
+  SimpleTable
+    <$> rawField idx "caption"
+    <*> rawField idx "aligns"
+    <*> rawField idx "widths"
+    <*> rawField idx "headers"
+    <*> rawField idx "rows"
diff --git a/src/Text/Pandoc/Lua/Module/Utils.hs b/src/Text/Pandoc/Lua/Module/Utils.hs
--- a/src/Text/Pandoc/Lua/Module/Utils.hs
+++ b/src/Text/Pandoc/Lua/Module/Utils.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE LambdaCase #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {- |
    Module      : Text.Pandoc.Lua.Module.Utils
@@ -7,7 +8,7 @@
    Maintainer  : Albert Krewinkel <tarleb+pandoc@moltkeplatz.de>
    Stability   : alpha
 
-Utility module for lua, exposing internal helper functions.
+Utility module for Lua, exposing internal helper functions.
 -}
 module Text.Pandoc.Lua.Module.Utils
   ( pushModule
@@ -15,13 +16,17 @@
 
 import Control.Applicative ((<|>))
 import Control.Monad.Catch (try)
+import Data.Data (showConstr, toConstr)
 import Data.Default (def)
 import Data.Version (Version)
-import Foreign.Lua (Peekable, Lua, NumResults)
-import Text.Pandoc.Definition ( Pandoc, Meta, MetaValue (..), Block, Inline
-                              , Citation, Attr, ListAttributes)
+import Foreign.Lua (Peekable, Lua, NumResults (..))
+import Text.Pandoc.Definition
 import Text.Pandoc.Error (PandocError)
 import Text.Pandoc.Lua.Marshaling ()
+import Text.Pandoc.Lua.Marshaling.SimpleTable
+  ( SimpleTable (..)
+  , pushSimpleTable
+  )
 import Text.Pandoc.Lua.PandocLua (PandocLua, addFunction, liftPandocLua)
 
 import qualified Data.Digest.Pure.SHA as SHA
@@ -31,28 +36,30 @@
 import qualified Text.Pandoc.Builder as B
 import qualified Text.Pandoc.Filter.JSON as JSONFilter
 import qualified Text.Pandoc.Shared as Shared
+import qualified Text.Pandoc.Writers.Shared as Shared
 
--- | Push the "pandoc.utils" module to the lua stack.
+-- | Push the "pandoc.utils" module to the Lua stack.
 pushModule :: PandocLua NumResults
 pushModule = do
   liftPandocLua Lua.newtable
   addFunction "blocks_to_inlines" blocksToInlines
   addFunction "equals" equals
+  addFunction "from_simple_table" from_simple_table
   addFunction "make_sections" makeSections
   addFunction "normalize_date" normalizeDate
   addFunction "run_json_filter" runJSONFilter
   addFunction "sha1" sha1
   addFunction "stringify" stringify
   addFunction "to_roman_numeral" toRomanNumeral
+  addFunction "to_simple_table" to_simple_table
   addFunction "Version" (return :: Version -> Lua Version)
   return 1
 
 -- | Squashes a list of blocks into inlines.
 blocksToInlines :: [Block] -> Lua.Optional [Inline] -> PandocLua [Inline]
 blocksToInlines blks optSep = liftPandocLua $ do
-  let sep = case Lua.fromOptional optSep of
-              Just x -> B.fromList x
-              Nothing -> Shared.defaultBlocksSeparator
+  let sep = maybe Shared.defaultBlocksSeparator B.fromList
+            $ Lua.fromOptional optSep
   return $ B.toList (Shared.blocksToInlinesWithSep sep blks)
 
 -- | Convert list of Pandoc blocks into sections using Divs.
@@ -131,6 +138,37 @@
       Right x -> return x
       Left (_ :: PandocError) -> Lua.throwMessage
         "Expected an AST element, but could not parse value as such."
+
+-- | Converts an old/simple table into a normal table block element.
+from_simple_table :: SimpleTable -> Lua NumResults
+from_simple_table (SimpleTable capt aligns widths head' body) = do
+  Lua.push $ Table
+    nullAttr
+    (Caption Nothing [Plain capt])
+    (zipWith (\a w -> (a, toColWidth w)) aligns widths)
+    (TableHead nullAttr [blockListToRow head'])
+    [TableBody nullAttr 0 [] $ map blockListToRow body]
+    (TableFoot nullAttr [])
+  return (NumResults 1)
+  where
+    blockListToRow :: [[Block]] -> Row
+    blockListToRow = Row nullAttr . map (B.simpleCell . B.fromList)
+
+    toColWidth :: Double -> ColWidth
+    toColWidth 0 = ColWidthDefault
+    toColWidth w = ColWidth w
+
+-- | Converts a table into an old/simple table.
+to_simple_table :: Block -> Lua NumResults
+to_simple_table = \case
+  Table _attr caption specs thead tbodies tfoot -> do
+    let (capt, aligns, widths, headers, rows) =
+          Shared.toLegacyTable caption specs thead tbodies tfoot
+    pushSimpleTable $ SimpleTable capt aligns widths headers rows
+    return (NumResults 1)
+  blk ->
+    Lua.throwMessage $
+      "Expected Table, got " <> showConstr (toConstr blk) <> "."
 
 -- | Convert a number < 4000 to uppercase roman numeral.
 toRomanNumeral :: Lua.Integer -> PandocLua T.Text
diff --git a/src/Text/Pandoc/Lua/Util.hs b/src/Text/Pandoc/Lua/Util.hs
--- a/src/Text/Pandoc/Lua/Util.hs
+++ b/src/Text/Pandoc/Lua/Util.hs
@@ -80,7 +80,7 @@
 pushViaCall :: PushViaCall a => String -> a
 pushViaCall fn = pushViaCall' fn (return ()) 0
 
--- | Call a pandoc element constructor within lua, passing all given arguments.
+-- | Call a pandoc element constructor within Lua, passing all given arguments.
 pushViaConstructor :: PushViaCall a => String -> a
 pushViaConstructor pandocFn = pushViaCall ("pandoc." ++ pandocFn)
 
diff --git a/src/Text/Pandoc/Options.hs b/src/Text/Pandoc/Options.hs
--- a/src/Text/Pandoc/Options.hs
+++ b/src/Text/Pandoc/Options.hs
@@ -1,8 +1,9 @@
 {-# LANGUAGE CPP                #-}
 {-# LANGUAGE DeriveDataTypeable #-}
 {-# LANGUAGE DeriveGeneric      #-}
-{-# LANGUAGE TemplateHaskell    #-}
+{-# LANGUAGE LambdaCase         #-}
 {-# LANGUAGE OverloadedStrings  #-}
+{-# LANGUAGE TemplateHaskell    #-}
 {- |
    Module      : Text.Pandoc.Options
    Copyright   : Copyright (C) 2012-2020 John MacFarlane
@@ -308,7 +309,7 @@
 isEnabled ext opts = ext `extensionEnabled` getExtensions opts
 
 defaultMathJaxURL :: Text
-defaultMathJaxURL = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/"
+defaultMathJaxURL = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js"
 
 defaultKaTeXURL :: Text
 defaultKaTeXURL = "https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/"
@@ -327,7 +328,7 @@
                            } ''CiteMethod)
 
 $(deriveJSON defaultOptions{ constructorTagModifier =
-                            \t -> case t of
+                            \case
                                     "NoObfuscation"         -> "none"
                                     "ReferenceObfuscation"  -> "references"
                                     "JavascriptObfuscation" -> "javascript"
diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs
--- a/src/Text/Pandoc/PDF.hs
+++ b/src/Text/Pandoc/PDF.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE CPP                 #-}
+{-# LANGUAGE LambdaCase          #-}
 {-# LANGUAGE OverloadedStrings   #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {- |
@@ -201,8 +202,7 @@
       (\(e :: E.SomeException) -> return $ Left $
           "check that rsvg-convert is in path.\n" <>
           tshow e)
-    _ -> JP.readImage fname >>= \res ->
-          case res of
+    _ -> JP.readImage fname >>= \case
                Left e    -> return $ Left $ T.pack e
                Right img ->
                  E.catch (Right pngOut <$ JP.savePngImage pngOut img) $
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs
--- a/src/Text/Pandoc/Parsing.hs
+++ b/src/Text/Pandoc/Parsing.hs
@@ -179,9 +179,12 @@
                              setSourceColumn,
                              setSourceLine,
                              incSourceColumn,
+                             incSourceLine,
                              newPos,
+                             initialPos,
                              Line,
-                             Column
+                             Column,
+                             ParseError
                              )
 where
 
@@ -574,15 +577,15 @@
     let fivehundred = rchar 'D'
     let thousand    = rchar 'M'
     lookAhead $ choice [one, five, ten, fifty, hundred, fivehundred, thousand]
-    thousands <- ((1000 *) . length) <$> many thousand
+    thousands <- (1000 *) . length <$> many thousand
     ninehundreds <- option 0 $ try $ hundred >> thousand >> return 900
     fivehundreds <- option 0 $ 500 <$ fivehundred
     fourhundreds <- option 0 $ try $ hundred >> fivehundred >> return 400
-    hundreds <- ((100 *) . length) <$> many hundred
+    hundreds <- (100 *) . length <$> many hundred
     nineties <- option 0 $ try $ ten >> hundred >> return 90
     fifties <- option 0 (50 <$ fifty)
     forties <- option 0 $ try $ ten >> fifty >> return 40
-    tens <- ((10 *) . length) <$> many ten
+    tens <- (10 *) . length <$> many ten
     nines <- option 0 $ try $ one >> ten >> return 9
     fives <- option 0 (5 <$ five)
     fours <- option 0 $ try $ one >> five >> return 4
@@ -951,7 +954,7 @@
                     then replicate (length aligns) 0.0
                     else widthsFromIndices numColumns indices
     let toRow =  Row nullAttr . map B.simpleCell
-        toHeaderRow l = if null l then [] else [toRow l]
+        toHeaderRow l = [toRow l | not (null l)]
     return (aligns, widths, toHeaderRow <$> heads, map toRow <$> lines')
 
 -- Calculate relative widths of table columns, based on indices
@@ -1136,6 +1139,8 @@
       stateNotes             :: NoteTable,     -- ^ List of notes (raw bodies)
       stateNotes'            :: NoteTable',    -- ^ List of notes (parsed bodies)
       stateNoteRefs          :: Set.Set Text, -- ^ List of note references used
+      stateInNote            :: Bool,          -- ^ True if parsing note contents
+      stateNoteNumber        :: Int,           -- ^ Last note number for citations
       stateMeta              :: Meta,          -- ^ Document metadata
       stateMeta'             :: F Meta,        -- ^ Document metadata
       stateCitations         :: M.Map Text Text, -- ^ RST-style citations
@@ -1170,7 +1175,7 @@
   extractReaderOptions :: st -> ReaderOptions
   getOption            :: (Stream s m t) => (ReaderOptions -> b) -> ParserT s st m b
   -- default
-  getOption  f         = (f . extractReaderOptions) <$> getState
+  getOption  f         = f . extractReaderOptions <$> getState
 
 instance HasReaderOptions ParserState where
   extractReaderOptions = stateOptions
@@ -1247,6 +1252,8 @@
                   stateNotes           = [],
                   stateNotes'          = M.empty,
                   stateNoteRefs        = Set.empty,
+                  stateInNote          = False,
+                  stateNoteNumber      = 0,
                   stateMeta            = nullMeta,
                   stateMeta'           = return nullMeta,
                   stateCitations       = M.empty,
@@ -1492,10 +1499,8 @@
 extractIdClass (ident, cls, kvs) = (ident', cls', kvs')
   where
     ident' = fromMaybe ident (lookup "id" kvs)
-    cls'   = case lookup "class" kvs of
-               Just cl -> T.words cl
-               Nothing -> cls
-    kvs'  = filter (\(k,_) -> k /= "id" || k /= "class") kvs
+    cls'   = maybe cls T.words $ lookup "class" kvs
+    kvs'   = filter (\(k,_) -> k /= "id" || k /= "class") kvs
 
 insertIncludedFile' :: (PandocMonad m, HasIncludeFiles st)
                     => ParserT a st m (mf Blocks)
diff --git a/src/Text/Pandoc/Readers.hs b/src/Text/Pandoc/Readers.hs
--- a/src/Text/Pandoc/Readers.hs
+++ b/src/Text/Pandoc/Readers.hs
@@ -51,6 +51,9 @@
   , readFB2
   , readIpynb
   , readCSV
+  , readCslJson
+  , readBibTeX
+  , readBibLaTeX
   -- * Miscellaneous
   , getReader
   , getDefaultExtensions
@@ -95,6 +98,8 @@
 import Text.Pandoc.Readers.Vimwiki
 import Text.Pandoc.Readers.Man
 import Text.Pandoc.Readers.CSV
+import Text.Pandoc.Readers.CslJson
+import Text.Pandoc.Readers.BibTeX
 import qualified Text.Pandoc.UTF8 as UTF8
 import Text.Parsec.Error
 
@@ -138,6 +143,9 @@
            ,("fb2"          , TextReader readFB2)
            ,("ipynb"        , TextReader readIpynb)
            ,("csv"          , TextReader readCSV)
+           ,("csljson"      , TextReader readCslJson)
+           ,("bibtex"       , TextReader readBibTeX)
+           ,("biblatex"     , TextReader readBibLaTeX)
            ]
 
 -- | Retrieve reader, extensions based on formatSpec (format+extensions).
diff --git a/src/Text/Pandoc/Readers/BibTeX.hs b/src/Text/Pandoc/Readers/BibTeX.hs
new file mode 100644
--- /dev/null
+++ b/src/Text/Pandoc/Readers/BibTeX.hs
@@ -0,0 +1,70 @@
+{-# LANGUAGE OverloadedStrings #-}
+{- |
+   Module      : Text.Pandoc.Readers.BibTeX
+   Copyright   : Copyright (C) 2020 John MacFarlane
+   License     : GNU GPL, version 2 or above
+
+   Maintainer  : John MacFarlane <jgm@berkeley.edu>
+   Stability   : alpha
+   Portability : portable
+
+Parses BibTeX or BibLaTeX bibliographies into a Pandoc document
+with empty body and `references` and `nocite` fields
+in the metadata.  A wildcard `nocite` is used so that
+if the document is rendered in another format, the
+entire bibliography will be printed.
+-}
+module Text.Pandoc.Readers.BibTeX
+  ( readBibTeX
+  , readBibLaTeX
+  )
+where
+
+import Text.Pandoc.Options
+import Text.Pandoc.Definition
+import Text.Pandoc.Builder (setMeta, cite, str)
+import Data.Text (Text)
+import Citeproc (Lang(..), parseLang)
+import Citeproc.Locale (getLocale)
+import Data.Maybe (fromMaybe)
+import Text.Pandoc.Error (PandocError(..))
+import Text.Pandoc.Class (PandocMonad, lookupEnv)
+import Text.Pandoc.Citeproc.BibTeX as BibTeX
+import Text.Pandoc.Citeproc.MetaValue (referenceToMetaValue)
+import Control.Monad.Except (throwError)
+
+-- | Read BibTeX from an input string and return a Pandoc document.
+-- The document will have only metadata, with an empty body.
+-- The metadata will contain a `references` field with the
+-- bibliography entries, and a `nocite` field with the wildcard `[@*]`.
+readBibTeX :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
+readBibTeX = readBibTeX' BibTeX.Bibtex
+
+-- | Read BibLaTeX from an input string and return a Pandoc document.
+-- The document will have only metadata, with an empty body.
+-- The metadata will contain a `references` field with the
+-- bibliography entries, and a `nocite` field with the wildcard `[@*]`.
+readBibLaTeX :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
+readBibLaTeX = readBibTeX' BibTeX.Biblatex
+
+readBibTeX' :: PandocMonad m => Variant -> ReaderOptions -> Text -> m Pandoc
+readBibTeX' variant _opts t = do
+  lang <- fromMaybe (Lang "en" (Just "US")) . fmap parseLang
+             <$> lookupEnv "LANG"
+  locale <- case getLocale lang of
+               Left e  -> throwError $ PandocCiteprocError e
+               Right l -> return l
+  case BibTeX.readBibtexString variant locale (const True) t of
+    Left e -> throwError $ PandocParsecError t e
+    Right refs -> return $ setMeta "references"
+                              (map referenceToMetaValue refs)
+                         . setMeta "nocite"
+                            (cite [Citation {citationId = "*"
+                                            , citationPrefix = []
+                                            , citationSuffix = []
+                                            , citationMode = NormalCitation
+                                            , citationNoteNum = 0
+                                            , citationHash = 0}]
+                                            (str "[@*]"))
+                        $ Pandoc nullMeta []
+
diff --git a/src/Text/Pandoc/Readers/CSV.hs b/src/Text/Pandoc/Readers/CSV.hs
--- a/src/Text/Pandoc/Readers/CSV.hs
+++ b/src/Text/Pandoc/Readers/CSV.hs
@@ -39,7 +39,7 @@
              numcols = length r
              toplain = B.simpleCell . B.plain . B.text . T.strip
              toRow = Row nullAttr . map toplain
-             toHeaderRow l = if null l then [] else [toRow l]
+             toHeaderRow l = [toRow l | not (null l)]
              hdrs = toHeaderRow r
              rows = map toRow rs
              aligns = replicate numcols AlignDefault
diff --git a/src/Text/Pandoc/Readers/CommonMark.hs b/src/Text/Pandoc/Readers/CommonMark.hs
--- a/src/Text/Pandoc/Readers/CommonMark.hs
+++ b/src/Text/Pandoc/Readers/CommonMark.hs
@@ -1,6 +1,5 @@
 {-# LANGUAGE OverloadedStrings #-}
 {-# LANGUAGE ScopedTypeVariables #-}
-{-# LANGUAGE ViewPatterns      #-}
 {- |
    Module      : Text.Pandoc.Readers.CommonMark
    Copyright   : Copyright (C) 2015-2020 John MacFarlane
diff --git a/src/Text/Pandoc/Readers/CslJson.hs b/src/Text/Pandoc/Readers/CslJson.hs
new file mode 100644
--- /dev/null
+++ b/src/Text/Pandoc/Readers/CslJson.hs
@@ -0,0 +1,53 @@
+{-# LANGUAGE OverloadedStrings #-}
+{- |
+   Module      : Text.Pandoc.Readers.CslJson
+   Copyright   : Copyright (C) 2020 John MacFarlane
+   License     : GNU GPL, version 2 or above
+
+   Maintainer  : John MacFarlane <jgm@berkeley.edu>
+   Stability   : alpha
+   Portability : portable
+
+Parses CSL JSON bibliographies into a Pandoc document
+with empty body and `references` and `nocite` fields
+in the metadata.  A wildcard `nocite` is used so that
+if the document is rendered in another format, the
+entire bibliography will be printed.
+
+<https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html>.
+-}
+module Text.Pandoc.Readers.CslJson
+  ( readCslJson )
+where
+
+import Text.Pandoc.Options
+import Text.Pandoc.Definition
+import Text.Pandoc.Builder (setMeta, cite, str)
+import qualified Text.Pandoc.UTF8 as UTF8
+import Data.Text (Text)
+import qualified Data.Text as T
+import Text.Pandoc.Error (PandocError(..))
+import Text.Pandoc.Class (PandocMonad)
+import Text.Pandoc.Citeproc.CslJson (cslJsonToReferences)
+import Text.Pandoc.Citeproc.MetaValue (referenceToMetaValue)
+import Control.Monad.Except (throwError)
+
+-- | Read CSL JSON from an input string and return a Pandoc document.
+-- The document will have only metadata, with an empty body.
+-- The metadata will contain a `references` field with the
+-- bibliography entries, and a `nocite` field with the wildcard `[@*]`.
+readCslJson :: PandocMonad m => ReaderOptions -> Text -> m Pandoc
+readCslJson _opts t =
+  case cslJsonToReferences (UTF8.fromText t) of
+    Left e -> throwError $ PandocParseError $ T.pack e
+    Right refs -> return $ setMeta "references"
+                              (map referenceToMetaValue refs)
+                         . setMeta "nocite"
+                            (cite [Citation {citationId = "*"
+                                            , citationPrefix = []
+                                            , citationSuffix = []
+                                            , citationMode = NormalCitation
+                                            , citationNoteNum = 0
+                                            , citationHash = 0}]
+                                            (str "[@*]"))
+                         $ Pandoc nullMeta []
diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs
--- a/src/Text/Pandoc/Readers/DocBook.hs
+++ b/src/Text/Pandoc/Readers/DocBook.hs
@@ -17,8 +17,8 @@
 import Data.Either (rights)
 import Data.Foldable (asum)
 import Data.Generics
-import Data.List (intersperse)
-import Data.Maybe (fromMaybe)
+import Data.List (intersperse,elemIndex)
+import Data.Maybe (fromMaybe,mapMaybe)
 import Data.Text (Text)
 import qualified Data.Text as T
 import Text.HTML.TagSoup.Entity (lookupEntity)
@@ -26,7 +26,7 @@
 import Text.Pandoc.Class.PandocMonad (PandocMonad, report)
 import Text.Pandoc.Options
 import Text.Pandoc.Logging (LogMessage(..))
-import Text.Pandoc.Shared (crFilter, safeRead)
+import Text.Pandoc.Shared (crFilter, safeRead, extractSpaces)
 import Text.TeXMath (readMathML, writeTeX)
 import Text.XML.Light
 
@@ -628,16 +628,89 @@
 isBlockElement _ = False
 
 blockTags :: [String]
-blockTags = ["toc","index","para","formalpara","simpara",
-           "ackno","epigraph","blockquote","bibliography","bibliodiv",
-           "biblioentry","glossee","glosseealso","glossary",
-           "glossdiv","glosslist","chapter","appendix","preface","bridgehead",
-           "sect1","sect2","sect3","sect4","sect5","section","simplesect",
-           "refsect1","refsect2","refsect3","refsection", "qandadiv",
-           "question","answer","abstract","itemizedlist","orderedlist",
-           "variablelist","article","book","table","informaltable",
-           "informalexample", "linegroup","procedure","substeps",
-           "screen","programlisting","example","calloutlist"] ++ admonitionTags
+blockTags =
+  [ "abstract"
+  , "ackno"
+  , "answer"
+  , "appendix"
+  , "appendixinfo"
+  , "area"
+  , "areaset"
+  , "areaspec"
+  , "article"
+  , "articleinfo"
+  , "attribution"
+  , "authorinitials"
+  , "bibliodiv"
+  , "biblioentry"
+  , "bibliography"
+  , "bibliomixed"
+  , "blockquote"
+  , "book"
+  , "bookinfo"
+  , "bridgehead"
+  , "calloutlist"
+  , "caption"
+  , "chapter"
+  , "chapterinfo"
+  , "epigraph"
+  , "example"
+  , "figure"
+  , "formalpara"
+  , "glossary"
+  , "glossaryinfo"
+  , "glossdiv"
+  , "glossee"
+  , "glosseealso"
+  , "glosslist"
+  , "glosssee"
+  , "glossseealso"
+  , "index"
+  , "info"
+  , "informalexample"
+  , "informaltable"
+  , "itemizedlist"
+  , "linegroup"
+  , "literallayout"
+  , "mediaobject"
+  , "orderedlist"
+  , "para"
+  , "preface"
+  , "procedure"
+  , "programlisting"
+  , "qandadiv"
+  , "question"
+  , "refsect1"
+  , "refsect1info"
+  , "refsect2"
+  , "refsect2info"
+  , "refsect3"
+  , "refsect3info"
+  , "refsection"
+  , "refsectioninfo"
+  , "screen"
+  , "sect1"
+  , "sect1info"
+  , "sect2"
+  , "sect2info"
+  , "sect3"
+  , "sect3info"
+  , "sect4"
+  , "sect4info"
+  , "sect5"
+  , "sect5info"
+  , "section"
+  , "sectioninfo"
+  , "simpara"
+  , "simplesect"
+  , "substeps"
+  , "subtitle"
+  , "table"
+  , "title"
+  , "titleabbrev"
+  , "toc"
+  , "variablelist"
+  ] ++ admonitionTags
 
 admonitionTags :: [String]
 admonitionTags = ["important","caution","note","tip","warning"]
@@ -685,7 +758,7 @@
                         Nothing -> return mempty
                         Just z  -> mconcat <$>
                                          mapM parseInline (elContent z)
-  let (capt, title) = if isNull figTitle
+  let (capt, title) = if null figTitle
                          then (getCaption e, "")
                          else (return figTitle, "fig:")
   fmap (imageWith attr imageUrl title) capt
@@ -708,7 +781,7 @@
         "para"  -> parseMixed para (elContent e)
         "formalpara" -> do
            tit <- case filterChild (named "title") e of
-                        Just t  -> (para . strong . (<> str ".")) <$>
+                        Just t  -> para . strong . (<> str ".") <$>
                                      getInlines t
                         Nothing -> return mempty
            (tit <>) <$> parseMixed para (elContent e)
@@ -815,16 +888,6 @@
            lift $ report $ IgnoredElement $ T.pack $ qName (elName e)
            return mempty
 
-         parseMixed container conts = do
-           let (ils,rest) = break isBlockElement conts
-           ils' <- (trimInlines . mconcat) <$> mapM parseInline ils
-           let p = if ils' == mempty then mempty else container ils'
-           case rest of
-                 []     -> return p
-                 (r:rs) -> do
-                    b <- parseBlock r
-                    x <- parseMixed container rs
-                    return $ p <> b <> x
          codeBlockWithLang = do
            let classes' = case attrValue "language" e of
                                 "" -> []
@@ -834,7 +897,7 @@
          parseBlockquote = do
             attrib <- case filterChild (named "attribution") e of
                              Nothing  -> return mempty
-                             Just z   -> (para . (str "— " <>) . mconcat)
+                             Just z   -> para . (str "— " <>) . mconcat
                                          <$>
                                               mapM parseInline (elContent z)
             contents <- getBlocks e
@@ -866,22 +929,20 @@
                       let colspecs = case filterChild (named "colgroup") e' of
                                            Just c -> filterChildren isColspec c
                                            _      -> filterChildren isColspec e'
+                      let colnames = case colspecs of
+                                       [] -> []
+                                       cs -> mapMaybe (findAttr (unqual "colname" )) cs
                       let isRow x = named "row" x || named "tr" x
                       headrows <- case filterChild (named "thead") e' of
                                        Just h  -> case filterChild isRow h of
-                                                       Just x  -> parseRow x
+                                                       Just x  -> parseRow colnames x
                                                        Nothing -> return []
                                        Nothing -> return []
                       bodyrows <- case filterChild (named "tbody") e' of
-                                       Just b  -> mapM parseRow
+                                       Just b  -> mapM (parseRow colnames)
                                                   $ filterChildren isRow b
-                                       Nothing -> mapM parseRow
+                                       Nothing -> mapM (parseRow colnames)
                                                   $ filterChildren isRow e'
-                      let toAlignment c = case findAttr (unqual "align") c of
-                                                Just "left"   -> AlignLeft
-                                                Just "right"  -> AlignRight
-                                                Just "center" -> AlignCenter
-                                                _             -> AlignDefault
                       let toWidth c = do
                             w <- findAttr (unqual "colwidth") c
                             n <- safeRead $ "0" <> T.filter (\x ->
@@ -901,15 +962,13 @@
                                                 Just ws' -> let tot = sum ws'
                                                             in  ColWidth . (/ tot) <$> ws'
                                                 Nothing  -> replicate numrows ColWidthDefault
-                      let toRow = Row nullAttr . map simpleCell
-                          toHeaderRow l = if null l then [] else [toRow l]
+                      let toRow = Row nullAttr
+                          toHeaderRow l = [toRow l | not (null l)]
                       return $ table (simpleCaption $ plain capt)
                                      (zip aligns widths)
                                      (TableHead nullAttr $ toHeaderRow headrows)
                                      [TableBody nullAttr 0 [] $ map toRow bodyrows]
                                      (TableFoot nullAttr [])
-         isEntry x  = named "entry" x || named "td" x || named "th" x
-         parseRow = mapM (parseMixed plain . elContent) . filterChildren isEntry
          sect n = sectWith (attrValue "id" e,[],[]) n
          sectWith attr n = do
            isbook <- gets dbBook
@@ -941,8 +1000,51 @@
            -- we also attach the label as a class, so it can be styled properly
            return $ divWith (attrValue "id" e,[label],[]) (title <> b)
 
+toAlignment :: Element -> Alignment
+toAlignment c = case findAttr (unqual "align") c of
+                  Just "left"   -> AlignLeft
+                  Just "right"  -> AlignRight
+                  Just "center" -> AlignCenter
+                  _             -> AlignDefault
+
+
+parseMixed :: PandocMonad m => (Inlines -> Blocks) -> [Content] -> DB m Blocks
+parseMixed container conts = do
+  let (ils,rest) = break isBlockElement conts
+  ils' <- trimInlines . mconcat <$> mapM parseInline ils
+  let p = if ils' == mempty then mempty else container ils'
+  case rest of
+    [] -> return p
+    (r:rs) -> do
+      b <- parseBlock r
+      x <- parseMixed container rs
+      return $ p <> b <> x
+
+parseRow :: PandocMonad m => [String] -> Element -> DB m [Cell]
+parseRow cn = do
+  let isEntry x  = named "entry" x || named "td" x || named "th" x
+  mapM (parseEntry cn) . filterChildren isEntry
+
+parseEntry :: PandocMonad m => [String] -> Element -> DB m Cell
+parseEntry cn el = do
+  let colDistance sa ea = do
+        let iStrt = elemIndex sa cn
+        let iEnd = elemIndex ea cn
+        case (iStrt, iEnd) of
+          (Just start, Just end) -> ColSpan $ end - start + 1
+          _ -> 1
+  let toColSpan en = do
+        let mStrt = findAttr (unqual "namest") en
+        let mEnd = findAttr (unqual "nameend") en
+        case (mStrt, mEnd) of
+          (Just start, Just end) -> colDistance start end
+          _ -> 1
+  let colSpan = toColSpan el
+  let align = toAlignment el
+  (fmap (cell align 1 colSpan) . (parseMixed plain) . elContent) el
+
 getInlines :: PandocMonad m => Element -> DB m Inlines
-getInlines e' = (trimInlines . mconcat) <$>
+getInlines e' = trimInlines . mconcat <$>
                  mapM parseInline (elContent e')
 
 strContentRecursive :: Element -> String
@@ -963,19 +1065,19 @@
           let ident = attrValue "id" e
           let classes = T.words $ attrValue "class" e
           if ident /= "" || classes /= []
-            then spanWith (ident,classes,[]) <$> innerInlines
-            else innerInlines
+            then innerInlines (spanWith (ident,classes,[]))
+            else innerInlines id
         "equation" -> equation e displayMath
         "informalequation" -> equation e displayMath
         "inlineequation" -> equation e math
-        "subscript" -> subscript <$> innerInlines
-        "superscript" -> superscript <$> innerInlines
+        "subscript" -> innerInlines subscript
+        "superscript" -> innerInlines superscript
         "inlinemediaobject" -> getMediaobject e
         "quote" -> do
             qt <- gets dbQuoteType
             let qt' = if qt == SingleQuote then DoubleQuote else SingleQuote
             modify $ \st -> st{ dbQuoteType = qt' }
-            contents <- innerInlines
+            contents <- innerInlines id
             modify $ \st -> st{ dbQuoteType = qt }
             return $ if qt == SingleQuote
                         then singleQuoted contents
@@ -996,7 +1098,7 @@
         "replaceable" -> do x <- getInlines e
                             return $ str "<" <> x <> str ">"
         "markup" -> codeWithLang
-        "wordasword" -> emph <$> innerInlines
+        "wordasword" -> innerInlines emph
         "command" -> codeWithLang
         "varname" -> codeWithLang
         "function" -> codeWithLang
@@ -1024,22 +1126,22 @@
         "email" -> return $ link ("mailto:" <> T.pack (strContent e)) ""
                           $ str $ T.pack $ strContent e
         "uri" -> return $ link (T.pack $ strContent e) "" $ str $ T.pack $ strContent e
-        "ulink" -> link (attrValue "url" e) "" <$> innerInlines
+        "ulink" -> innerInlines (link (attrValue "url" e) "")
         "link" -> do
-             ils <- innerInlines
+             ils <- innerInlines id
              let href = case findAttr (QName "href" (Just "http://www.w3.org/1999/xlink") Nothing) e of
                                Just h -> T.pack h
                                _      -> "#" <> attrValue "linkend" e
              let ils' = if ils == mempty then str href else ils
              let attr = (attrValue "id" e, T.words $ attrValue "role" e, [])
              return $ linkWith attr href "" ils'
-        "foreignphrase" -> emph <$> innerInlines
+        "foreignphrase" -> innerInlines emph
         "emphasis" -> case attrValue "role" e of
-                             "bold"          -> strong <$> innerInlines
-                             "strong"        -> strong <$> innerInlines
-                             "strikethrough" -> strikeout <$> innerInlines
-                             _               -> emph <$> innerInlines
-        "footnote" -> (note . mconcat) <$>
+                             "bold"          -> innerInlines strong
+                             "strong"        -> innerInlines strong
+                             "strikethrough" -> innerInlines strikeout
+                             _               -> innerInlines emph
+        "footnote" -> note . mconcat <$>
                          mapM parseBlock (elContent e)
         "title" -> return mempty
         "affiliation" -> skip
@@ -1047,19 +1149,19 @@
         -- <?asciidor-br?> to in handleInstructions, above.  A kludge to
         -- work around xml-light's inability to parse an instruction.
         "br" -> return linebreak
-        _          -> skip >> innerInlines
+        _          -> skip >> innerInlines id
    where skip = do
            lift $ report $ IgnoredElement $ T.pack $ qName (elName e)
            return mempty
 
-         innerInlines = (trimInlines . mconcat) <$>
+         innerInlines f = extractSpaces f . mconcat <$>
                           mapM parseInline (elContent e)
          codeWithLang = do
            let classes' = case attrValue "language" e of
                                "" -> []
                                l  -> [l]
            return $ codeWith (attrValue "id" e,classes',[]) $ T.pack $ strContentRecursive e
-         simpleList = (mconcat . intersperse (str "," <> space)) <$> mapM getInlines
+         simpleList = mconcat . intersperse (str "," <> space) <$> mapM getInlines
                          (filterChildren (named "member") e)
          segmentedList = do
            tit <- maybe (return mempty) getInlines $ filterChild (named "title") e
diff --git a/src/Text/Pandoc/Readers/Docx.hs b/src/Text/Pandoc/Readers/Docx.hs
--- a/src/Text/Pandoc/Readers/Docx.hs
+++ b/src/Text/Pandoc/Readers/Docx.hs
@@ -91,9 +91,9 @@
          => ReaderOptions
          -> B.ByteString
          -> m Pandoc
-readDocx opts bytes = do
+readDocx opts bytes =
   case toArchiveOrFail bytes of
-    Right archive -> do
+    Right archive ->
       case archiveToDocxWithWarnings archive of
         Right (docx, parserWarnings) -> do
           mapM_ (P.report . DocxParserWarning) parserWarnings
@@ -291,9 +291,9 @@
             spanWith ("",[],[("dir","ltr")]) . go rPr{isRTL = Nothing}
         | Just SupScrpt <- rVertAlign rPr =
             superscript . go rPr{rVertAlign = Nothing}
-        | Just SubScrpt <- rVertAlign rPr = do
+        | Just SubScrpt <- rVertAlign rPr =
             subscript . go rPr{rVertAlign = Nothing}
-        | Just "single" <- rUnderline rPr = do
+        | Just "single" <- rUnderline rPr =
             Pandoc.underline . go rPr{rUnderline = Nothing}
         | otherwise = id
   return $ go rPr'
@@ -365,7 +365,7 @@
     RejectChanges -> return mempty
     AllChanges    -> do
       ils <- smushInlines <$> mapM runToInlines runs
-      let attr = ("", ["insertion"], [("author", author), ("date", date)])
+      let attr = ("", ["insertion"], addAuthorAndDate author date)
       return $ spanWith attr ils
 parPartToInlines' (ChangedRuns (TrackedChange Deletion (ChangeInfo _ author date)) runs) = do
   opts <- asks docxOptions
@@ -374,7 +374,7 @@
     RejectChanges -> smushInlines <$> mapM runToInlines runs
     AllChanges    -> do
       ils <- smushInlines <$> mapM runToInlines runs
-      let attr = ("", ["deletion"], [("author", author), ("date", date)])
+      let attr = ("", ["deletion"], addAuthorAndDate author date)
       return $ spanWith attr ils
 parPartToInlines' (CommentStart cmtId author date bodyParts) = do
   opts <- asks docxOptions
@@ -382,7 +382,7 @@
     AllChanges -> do
       blks <- smushBlocks <$> mapM bodyPartToBlocks bodyParts
       ils <- blocksToInlinesWarn cmtId blks
-      let attr = ("", ["comment-start"], [("id", cmtId), ("author", author), ("date", date)])
+      let attr = ("", ["comment-start"], ("id", cmtId) : addAuthorAndDate author date)
       return $ spanWith attr ils
     _ -> return mempty
 parPartToInlines' (CommentEnd cmtId) = do
@@ -576,7 +576,7 @@
       then do modify $ \s -> s { docxDropCap = ils' }
               return mempty
       else do modify $ \s -> s { docxDropCap = mempty }
-              let ils'' = (if isNull prevParaIls then mempty
+              let ils'' = (if null prevParaIls then mempty
                           else prevParaIls <> space) <> ils'
                   handleInsertion = do
                     modify $ \s -> s {docxPrevPara = mempty}
@@ -584,7 +584,7 @@
                     return $ transform $ paraOrPlain ils''
               opts <- asks docxOptions
               case (pChange pPr', readerTrackChanges opts) of
-                  _ | isNull ils'', not (isEnabled Ext_empty_paragraphs opts) ->
+                  _ | null ils'', not (isEnabled Ext_empty_paragraphs opts) ->
                     return mempty
                   (Just (TrackedChange Insertion _), AcceptChanges) ->
                       handleInsertion
@@ -593,7 +593,7 @@
                       return mempty
                   (Just (TrackedChange Insertion (ChangeInfo _ cAuthor cDate))
                    , AllChanges) -> do
-                      let attr = ("", ["paragraph-insertion"], [("author", cAuthor), ("date", cDate)])
+                      let attr = ("", ["paragraph-insertion"], addAuthorAndDate cAuthor cDate)
                           insertMark = spanWith attr mempty
                       transform <- parStyleToTransform pPr'
                       return $ transform $
@@ -605,7 +605,7 @@
                       handleInsertion
                   (Just (TrackedChange Deletion (ChangeInfo _ cAuthor cDate))
                    , AllChanges) -> do
-                      let attr = ("", ["paragraph-deletion"], [("author", cAuthor), ("date", cDate)])
+                      let attr = ("", ["paragraph-deletion"], addAuthorAndDate cAuthor cDate)
                           insertMark = spanWith attr mempty
                       transform <- parStyleToTransform pPr'
                       return $ transform $
@@ -658,7 +658,7 @@
       rowLength (Docx.Row c) = length c
 
   let toRow = Pandoc.Row nullAttr . map simpleCell
-      toHeaderRow l = if null l then [] else [toRow l]
+      toHeaderRow l = [toRow l | not (null l)]
 
   -- pad cells.  New Text.Pandoc.Builder will do that for us,
   -- so this is for compatibility while we switch over.
@@ -732,3 +732,8 @@
 docxToOutput opts (Docx (Document _ body)) =
   let dEnv   = def { docxOptions  = opts} in
    evalDocxContext (bodyToOutput body) dEnv def
+
+addAuthorAndDate :: T.Text -> Maybe T.Text -> [(T.Text, T.Text)]
+addAuthorAndDate author mdate =
+  ("author", author) : maybe [] (\date -> [("date", date)]) mdate
+
diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs
--- a/src/Text/Pandoc/Readers/Docx/Parse.hs
+++ b/src/Text/Pandoc/Readers/Docx/Parse.hs
@@ -213,7 +213,7 @@
 data ChangeType = Insertion | Deletion
                 deriving Show
 
-data ChangeInfo = ChangeInfo ChangeId Author ChangeDate
+data ChangeInfo = ChangeInfo ChangeId Author (Maybe ChangeDate)
                 deriving Show
 
 data TrackedChange = TrackedChange ChangeType ChangeInfo
@@ -276,7 +276,7 @@
 
 data ParPart = PlainRun Run
              | ChangedRuns TrackedChange [Run]
-             | CommentStart CommentId Author CommentDate [BodyPart]
+             | CommentStart CommentId Author (Maybe CommentDate) [BodyPart]
              | CommentEnd CommentId
              | BookMark BookMarkId Anchor
              | InternalHyperLink Anchor [Run]
@@ -404,12 +404,8 @@
                >>= (parseXMLDoc . UTF8.toStringLazy . fromEntry)
       enElem = findEntryByPath "word/endnotes.xml" zf
                >>= (parseXMLDoc . UTF8.toStringLazy . fromEntry)
-      fn_namespaces = case fnElem of
-        Just e  -> elemToNameSpaces e
-        Nothing -> []
-      en_namespaces = case enElem of
-        Just e  -> elemToNameSpaces e
-        Nothing -> []
+      fn_namespaces = maybe [] elemToNameSpaces fnElem
+      en_namespaces = maybe [] elemToNameSpaces enElem
       ns = unionBy (\x y -> fst x == fst y) fn_namespaces en_namespaces
       fn = fnElem >>= walkDocument ns >>= elemToNotes ns "footnote"
       en = enElem >>= walkDocument ns >>= elemToNotes ns "endnote"
@@ -420,9 +416,7 @@
 archiveToComments zf =
   let cmtsElem = findEntryByPath "word/comments.xml" zf
                >>= (parseXMLDoc . UTF8.toStringLazy . fromEntry)
-      cmts_namespaces = case cmtsElem of
-        Just e  -> elemToNameSpaces e
-        Nothing -> []
+      cmts_namespaces = maybe [] elemToNameSpaces cmtsElem
       cmts = elemToComments cmts_namespaces <$> (cmtsElem >>= walkDocument cmts_namespaces)
   in
     case cmts of
@@ -858,7 +852,7 @@
   | isElem ns "w" "comment" element
   , Just cmtId <- findAttrTextByName ns "w" "id" element
   , Just cmtAuthor <- findAttrTextByName ns "w" "author" element
-  , Just cmtDate <- findAttrTextByName ns "w" "date" element = do
+  , cmtDate <- findAttrTextByName ns "w" "date" element = do
       bps <- mapD (elemToBodyPart ns) (elChildren element)
       return $ CommentStart cmtId cmtAuthor cmtDate bps
 elemToCommentStart _ _ = throwError WrongElem
@@ -964,14 +958,14 @@
   | isElem ns "w" "ins" element || isElem ns "w" "moveTo" element
   , Just cId <- findAttrTextByName ns "w" "id" element
   , Just cAuthor <- findAttrTextByName ns "w" "author" element
-  , Just cDate <- findAttrTextByName ns "w" "date" element =
-      Just $ TrackedChange Insertion (ChangeInfo cId cAuthor cDate)
+  , mcDate <- findAttrTextByName ns "w" "date" element =
+      Just $ TrackedChange Insertion (ChangeInfo cId cAuthor mcDate)
 getTrackedChange ns element
   | isElem ns "w" "del" element || isElem ns "w" "moveFrom" element
   , Just cId <- findAttrTextByName ns "w" "id" element
   , Just cAuthor <- findAttrTextByName ns "w" "author" element
-  , Just cDate <- findAttrTextByName ns "w" "date" element =
-      Just $ TrackedChange Deletion (ChangeInfo cId cAuthor cDate)
+  , mcDate <- findAttrTextByName ns "w" "date" element =
+      Just $ TrackedChange Deletion (ChangeInfo cId cAuthor mcDate)
 getTrackedChange _ _ = Nothing
 
 elemToParagraphStyle :: NameSpaces -> Element -> ParStyleMap -> ParagraphStyle
diff --git a/src/Text/Pandoc/Readers/DokuWiki.hs b/src/Text/Pandoc/Readers/DokuWiki.hs
--- a/src/Text/Pandoc/Readers/DokuWiki.hs
+++ b/src/Text/Pandoc/Readers/DokuWiki.hs
@@ -472,7 +472,7 @@
                             else ([], rows)
   let attrs = (AlignDefault, ColWidthDefault) <$ transpose rows
   let toRow = Row nullAttr . map B.simpleCell
-      toHeaderRow l = if null l then [] else [toRow l]
+      toHeaderRow l = [toRow l | not (null l)]
   pure $ B.table B.emptyCaption
                  attrs
                  (TableHead nullAttr $ toHeaderRow headerRow)
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -517,7 +517,7 @@
                        else replicate cols (ColWidth (1.0 / fromIntegral cols))
                   else widths'
   let toRow = Row nullAttr . map B.simpleCell
-      toHeaderRow l = if null l then [] else [toRow l]
+      toHeaderRow l = [toRow l | not (null l)]
   return $ B.tableWith attribs
                    (B.simpleCaption $ B.plain caption)
                    (zip aligns widths)
@@ -585,7 +585,7 @@
 pPlain :: PandocMonad m => TagParser m Blocks
 pPlain = do
   contents <- setInPlain $ trimInlines . mconcat <$> many1 inline
-  if B.isNull contents
+  if null contents
      then return mempty
      else return $ B.plain contents
 
@@ -593,7 +593,7 @@
 pPara = do
   contents <- trimInlines <$> pInTags "p" inline
   (do guardDisabled Ext_empty_paragraphs
-      guard (B.isNull contents)
+      guard (null contents)
       return mempty)
     <|> return (B.para contents)
 
diff --git a/src/Text/Pandoc/Readers/Haddock.hs b/src/Text/Pandoc/Readers/Haddock.hs
--- a/src/Text/Pandoc/Readers/Haddock.hs
+++ b/src/Text/Pandoc/Readers/Haddock.hs
@@ -86,7 +86,7 @@
                     }
       -> let toCells = map (docHToBlocks . tableCellContents) . tableRowCells
              toRow = Row nullAttr . map B.simpleCell
-             toHeaderRow l = if null l then [] else [toRow l]
+             toHeaderRow l = [toRow l | not (null l)]
              (header, body) =
                if null headerRows
                   then ([], map toCells bodyRows)
diff --git a/src/Text/Pandoc/Readers/JATS.hs b/src/Text/Pandoc/Readers/JATS.hs
--- a/src/Text/Pandoc/Readers/JATS.hs
+++ b/src/Text/Pandoc/Readers/JATS.hs
@@ -26,7 +26,7 @@
 import Text.Pandoc.Builder
 import Text.Pandoc.Class.PandocMonad (PandocMonad)
 import Text.Pandoc.Options
-import Text.Pandoc.Shared (crFilter, safeRead)
+import Text.Pandoc.Shared (crFilter, safeRead, extractSpaces)
 import Text.TeXMath (readMathML, writeTeX)
 import Text.XML.Light
 import qualified Data.Set as S (fromList, member)
@@ -189,7 +189,7 @@
         _       -> getBlocks e
    where parseMixed container conts = do
            let (ils,rest) = break isBlockElement conts
-           ils' <- (trimInlines . mconcat) <$> mapM parseInline ils
+           ils' <- trimInlines . mconcat <$> mapM parseInline ils
            let p = if ils' == mempty then mempty else container ils'
            case rest of
                  []     -> return p
@@ -206,7 +206,7 @@
          parseBlockquote = do
             attrib <- case filterChild (named "attribution") e of
                              Nothing  -> return mempty
-                             Just z   -> (para . (str "— " <>) . mconcat)
+                             Just z   -> para . (str "— " <>) . mconcat
                                          <$>
                                               mapM parseInline (elContent z)
             contents <- getBlocks e
@@ -281,7 +281,7 @@
                                                             in  ColWidth . (/ tot) <$> ws'
                                                 Nothing  -> replicate numrows ColWidthDefault
                       let toRow = Row nullAttr . map simpleCell
-                          toHeaderRow l = if null l then [] else [toRow l]
+                          toHeaderRow l = [toRow l | not (null l)]
                       return $ table (simpleCaption $ plain capt)
                                      (zip aligns widths)
                                      (TableHead nullAttr $ toHeaderRow headrows)
@@ -309,7 +309,7 @@
                      return $ headerWith (ident,[],[]) n' headerText <> b
 
 getInlines :: PandocMonad m => Element -> JATS m Inlines
-getInlines e' = (trimInlines . mconcat) <$>
+getInlines e' = trimInlines . mconcat <$>
                  mapM parseInline (elContent e')
 
 parseMetadata :: PandocMonad m => Element -> JATS m Blocks
@@ -460,14 +460,14 @@
   return . text . maybe (T.toUpper $ T.pack ref) T.pack $ lookupEntity ref
 parseInline (Elem e) =
   case qName (elName e) of
-        "italic" -> emph <$> innerInlines
-        "bold" -> strong <$> innerInlines
-        "strike" -> strikeout <$> innerInlines
-        "sub" -> subscript <$> innerInlines
-        "sup" -> superscript <$> innerInlines
-        "underline" -> underline <$> innerInlines
+        "italic" -> innerInlines emph
+        "bold" -> innerInlines strong
+        "strike" -> innerInlines strikeout
+        "sub" -> innerInlines subscript
+        "sup" -> innerInlines superscript
+        "underline" -> innerInlines underline
         "break" -> return linebreak
-        "sc" -> smallcaps <$> innerInlines
+        "sc" -> innerInlines smallcaps
 
         "code" -> codeWithLang
         "monospace" -> codeWithLang
@@ -477,14 +477,14 @@
             qt <- gets jatsQuoteType
             let qt' = if qt == SingleQuote then DoubleQuote else SingleQuote
             modify $ \st -> st{ jatsQuoteType = qt' }
-            contents <- innerInlines
+            contents <- innerInlines id
             modify $ \st -> st{ jatsQuoteType = qt }
             return $ if qt == SingleQuote
                         then singleQuoted contents
                         else doubleQuoted contents
 
         "xref" -> do
-            ils <- innerInlines
+            ils <- innerInlines id
             let rid = attrValue "rid" e
             let rids = T.words rid
             let refType = ("ref-type",) <$> maybeAttrValue "ref-type" e
@@ -501,7 +501,7 @@
                              ils
                         else linkWith attr ("#" <> rid) "" ils
         "ext-link" -> do
-             ils <- innerInlines
+             ils <- innerInlines id
              let title = fromMaybe "" $ findAttrText (QName "title" (Just "http://www.w3.org/1999/xlink") Nothing) e
              let href = case findAttr (QName "href" (Just "http://www.w3.org/1999/xlink") Nothing) e of
                                Just h -> T.pack h
@@ -518,10 +518,10 @@
         "email" -> return $ link ("mailto:" <> textContent e) ""
                           $ str $ textContent e
         "uri" -> return $ link (textContent e) "" $ str $ textContent e
-        "fn" -> (note . mconcat) <$>
+        "fn" -> note . mconcat <$>
                          mapM parseBlock (elContent e)
-        _          -> innerInlines
-   where innerInlines = (trimInlines . mconcat) <$>
+        _          -> innerInlines id
+   where innerInlines f = extractSpaces f . mconcat <$>
                           mapM parseInline (elContent e)
          mathML x =
             case readMathML . T.pack . showElement $ everywhere (mkT removePrefix) x of
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE BangPatterns          #-}
 {-# LANGUAGE CPP                   #-}
 {-# LANGUAGE FlexibleInstances     #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
@@ -31,6 +32,7 @@
 import Control.Monad.Except (throwError)
 import Data.Char (isDigit, isLetter, toUpper, chr)
 import Data.Default
+import Data.Functor (($>))
 import Data.List (intercalate)
 import qualified Data.Map as M
 import Data.Maybe (fromMaybe, maybeToList)
@@ -57,6 +59,7 @@
 import Text.Pandoc.Readers.LaTeX.Parsing
 import Text.Pandoc.Readers.LaTeX.Lang (polyglossiaLangToBCP47,
                                        babelLangToBCP47)
+import Text.Pandoc.Readers.LaTeX.SIunitx
 import Text.Pandoc.Shared
 import qualified Text.Pandoc.Translations as Translations
 import Text.Pandoc.Walk
@@ -135,15 +138,15 @@
   inp <- getInput
   let toks = tokenize "source" inp
   snd <$> (rawLaTeXParser toks False (macroDef (const mempty)) blocks
-      <|> (rawLaTeXParser toks True
+      <|> rawLaTeXParser toks True
              (do choice (map controlSeq
                    ["include", "input", "subfile", "usepackage"])
                  skipMany opt
                  braced
-                 return mempty) blocks)
+                 return mempty) blocks
       <|> rawLaTeXParser toks True
            (environment <|> blockCommand)
-           (mconcat <$> (many (block <|> beginOrEndCommand))))
+           (mconcat <$> many (block <|> beginOrEndCommand)))
 
 -- See #4667 for motivation; sometimes people write macros
 -- that just evaluate to a begin or end command, which blockCommand
@@ -186,10 +189,10 @@
 -- inline elements:
 
 word :: PandocMonad m => LP m Inlines
-word = (str . untoken) <$> satisfyTok isWordTok
+word = str . untoken <$> satisfyTok isWordTok
 
 regularSymbol :: PandocMonad m => LP m Inlines
-regularSymbol = (str . untoken) <$> satisfyTok isRegularSymbol
+regularSymbol = str . untoken <$> satisfyTok isRegularSymbol
   where isRegularSymbol (Tok _ Symbol t) = not $ T.any isSpecial t
         isRegularSymbol _                = False
         isSpecial c = c `Set.member` specialChars
@@ -197,7 +200,7 @@
 inlineGroup :: PandocMonad m => LP m Inlines
 inlineGroup = do
   ils <- grouped inline
-  if isNull ils
+  if null ils
      then return mempty
      else return $ spanWith nullAttr ils
           -- we need the span so we can detitlecase bibtex entries;
@@ -205,7 +208,7 @@
 
 doLHSverb :: PandocMonad m => LP m Inlines
 doLHSverb =
-  (codeWith ("",["haskell"],[]) . untokenize)
+  codeWith ("",["haskell"],[]) . untokenize
     <$> manyTill (satisfyTok (not . isNewlineTok)) (symbol '|')
 
 mkImage :: PandocMonad m => [(Text, Text)] -> Text -> LP m Inlines
@@ -244,227 +247,6 @@
         startsWithLetter _ = False
 
 
--- converts e.g. \SI{1}[\$]{} to "$ 1" or \SI{1}{\euro} to "1 €"
-dosiunitx :: PandocMonad m => LP m Inlines
-dosiunitx = do
-  skipopts
-  value <- tok
-  valueprefix <- option "" $ bracketed tok
-  unit <- grouped (mconcat <$> many1 siUnit) <|> siUnit <|> tok
-  let emptyOr160 "" = ""
-      emptyOr160 _  = "\160"
-  return . mconcat $ [valueprefix,
-                      emptyOr160 valueprefix,
-                      value,
-                      emptyOr160 unit,
-                      unit]
-
--- converts e.g. \SIRange{100}{200}{\ms} to "100 ms--200 ms"
-doSIRange :: PandocMonad m => LP m Inlines
-doSIRange = do
-  skipopts
-  startvalue <- tok
-  startvalueprefix <- option "" $ bracketed tok
-  stopvalue <- tok
-  stopvalueprefix <- option "" $ bracketed tok
-  unit <- grouped (mconcat <$> many1 siUnit) <|> siUnit <|> tok
-  let emptyOr160 "" = ""
-      emptyOr160 _  = "\160"
-  return . mconcat $ [startvalueprefix,
-                      emptyOr160 startvalueprefix,
-                      startvalue,
-                      emptyOr160 unit,
-                      unit,
-                      "\8211", -- An en-dash
-                      stopvalueprefix,
-                      emptyOr160 stopvalueprefix,
-                      stopvalue,
-                      emptyOr160 unit,
-                      unit]
-
-siUnit :: PandocMonad m => LP m Inlines
-siUnit = do
-  Tok _ (CtrlSeq name) _ <- anyControlSeq
-  if name == "square"
-     then do
-       unit <- grouped (mconcat <$> many1 siUnit) <|> siUnit <|> tok
-       return . mconcat $ [unit, "\178"]
-     else
-       case M.lookup name siUnitMap of
-            Just il -> return il
-            Nothing -> mzero
-
-siUnitMap :: M.Map Text Inlines
-siUnitMap = M.fromList
-  [ ("fg", str "fg")
-  , ("pg", str "pg")
-  , ("ng", str "ng")
-  , ("ug", str "μg")
-  , ("mg", str "mg")
-  , ("g", str "g")
-  , ("kg", str "kg")
-  , ("amu", str "u")
-  , ("pm", str "pm")
-  , ("nm", str "nm")
-  , ("um", str "μm")
-  , ("mm", str "mm")
-  , ("cm", str "cm")
-  , ("dm", str "dm")
-  , ("m", str "m")
-  , ("km", str "km")
-  , ("as", str "as")
-  , ("fs", str "fs")
-  , ("ps", str "ps")
-  , ("ns", str "ns")
-  , ("us", str "μs")
-  , ("ms", str "ms")
-  , ("s", str "s")
-  , ("fmol", str "fmol")
-  , ("pmol", str "pmol")
-  , ("nmol", str "nmol")
-  , ("umol", str "μmol")
-  , ("mmol", str "mmol")
-  , ("mol", str "mol")
-  , ("kmol", str "kmol")
-  , ("pA", str "pA")
-  , ("nA", str "nA")
-  , ("uA", str "μA")
-  , ("mA", str "mA")
-  , ("A", str "A")
-  , ("kA", str "kA")
-  , ("ul", str "μl")
-  , ("ml", str "ml")
-  , ("l", str "l")
-  , ("hl", str "hl")
-  , ("uL", str "μL")
-  , ("mL", str "mL")
-  , ("L", str "L")
-  , ("hL", str "hL")
-  , ("mHz", str "mHz")
-  , ("Hz", str "Hz")
-  , ("kHz", str "kHz")
-  , ("MHz", str "MHz")
-  , ("GHz", str "GHz")
-  , ("THz", str "THz")
-  , ("mN", str "mN")
-  , ("N", str "N")
-  , ("kN", str "kN")
-  , ("MN", str "MN")
-  , ("Pa", str "Pa")
-  , ("kPa", str "kPa")
-  , ("MPa", str "MPa")
-  , ("GPa", str "GPa")
-  , ("mohm", str "mΩ")
-  , ("kohm", str "kΩ")
-  , ("Mohm", str "MΩ")
-  , ("pV", str "pV")
-  , ("nV", str "nV")
-  , ("uV", str "μV")
-  , ("mV", str "mV")
-  , ("V", str "V")
-  , ("kV", str "kV")
-  , ("W", str "W")
-  , ("uW", str "μW")
-  , ("mW", str "mW")
-  , ("kW", str "kW")
-  , ("MW", str "MW")
-  , ("GW", str "GW")
-  , ("J", str "J")
-  , ("uJ", str "μJ")
-  , ("mJ", str "mJ")
-  , ("kJ", str "kJ")
-  , ("eV", str "eV")
-  , ("meV", str "meV")
-  , ("keV", str "keV")
-  , ("MeV", str "MeV")
-  , ("GeV", str "GeV")
-  , ("TeV", str "TeV")
-  , ("kWh", str "kWh")
-  , ("F", str "F")
-  , ("fF", str "fF")
-  , ("pF", str "pF")
-  , ("K", str "K")
-  , ("dB", str "dB")
-  , ("angstrom", str "Å")
-  , ("arcmin", str "′")
-  , ("arcminute", str "′")
-  , ("arcsecond", str "″")
-  , ("astronomicalunit", str "ua")
-  , ("atomicmassunit", str "u")
-  , ("atto", str "a")
-  , ("bar", str "bar")
-  , ("barn", str "b")
-  , ("becquerel", str "Bq")
-  , ("bel", str "B")
-  , ("candela", str "cd")
-  , ("celsius", str "°C")
-  , ("centi", str "c")
-  , ("coulomb", str "C")
-  , ("dalton", str "Da")
-  , ("day", str "d")
-  , ("deca", str "d")
-  , ("deci", str "d")
-  , ("decibel", str "db")
-  , ("degreeCelsius",str "°C")
-  , ("degree", str "°")
-  , ("deka", str "d")
-  , ("electronvolt", str "eV")
-  , ("exa", str "E")
-  , ("farad", str "F")
-  , ("femto", str "f")
-  , ("giga", str "G")
-  , ("gram", str "g")
-  , ("hectare", str "ha")
-  , ("hecto", str "h")
-  , ("henry", str "H")
-  , ("hertz", str "Hz")
-  , ("hour", str "h")
-  , ("joule", str "J")
-  , ("katal", str "kat")
-  , ("kelvin", str "K")
-  , ("kilo", str "k")
-  , ("kilogram", str "kg")
-  , ("knot", str "kn")
-  , ("liter", str "L")
-  , ("litre", str "l")
-  , ("lumen", str "lm")
-  , ("lux", str "lx")
-  , ("mega", str "M")
-  , ("meter", str "m")
-  , ("metre", str "m")
-  , ("micro", str "μ")
-  , ("milli", str "m")
-  , ("minute", str "min")
-  , ("mmHg", str "mmHg")
-  , ("mole", str "mol")
-  , ("nano", str "n")
-  , ("nauticalmile", str "M")
-  , ("neper", str "Np")
-  , ("newton", str "N")
-  , ("ohm", str "Ω")
-  , ("Pa", str "Pa")
-  , ("pascal", str "Pa")
-  , ("percent", str "%")
-  , ("per", str "/")
-  , ("peta", str "P")
-  , ("pico", str "p")
-  , ("radian", str "rad")
-  , ("second", str "s")
-  , ("siemens", str "S")
-  , ("sievert", str "Sv")
-  , ("steradian", str "sr")
-  , ("tera", str "T")
-  , ("tesla", str "T")
-  , ("tonne", str "t")
-  , ("volt", str "V")
-  , ("watt", str "W")
-  , ("weber", str "Wb")
-  , ("yocto", str "y")
-  , ("yotta", str "Y")
-  , ("zepto", str "z")
-  , ("zetta", str "Z")
-  ]
-
 lit :: Text -> LP m Inlines
 lit = pure . str
 
@@ -562,7 +344,7 @@
               Just (c, ts) | T.null ts -> return c
               _            -> mzero
   withVerbatimMode $
-    (code . untokenize) <$>
+    code . untokenize <$>
       manyTill (notFollowedBy newlineTok >> verbTok marker) (symbol marker)
 
 verbTok :: PandocMonad m => Char -> LP m Tok
@@ -603,7 +385,7 @@
               _            -> mzero
   let stopchar = if marker == '{' then '}' else marker
   withVerbatimMode $
-    (codeWith ("",classes,[]) . T.map nlToSpace . untokenize) <$>
+    codeWith ("",classes,[]) . T.map nlToSpace . untokenize <$>
       manyTill (verbTok stopchar) (symbol stopchar)
 
 nlToSpace :: Char -> Char
@@ -622,7 +404,7 @@
   display <- option False (True <$ symbol '$')
   (do contents <- try $ untokenize <$> pDollarsMath 0
       if display
-         then (mathDisplay contents <$ symbol '$')
+         then mathDisplay contents <$ symbol '$'
          else return $ mathInline contents)
    <|> (guard display >> return (mathInline ""))
 
@@ -635,7 +417,7 @@
               , n == 0 -> return []
               | t == "\\" -> do
                   tk' <- anyTok
-                  ((tk :) . (tk' :)) <$> pDollarsMath n
+                  (tk :) . (tk' :) <$> pDollarsMath n
               | t == "{" -> (tk :) <$> pDollarsMath (n+1)
               | t == "}" ->
                 if n > 0
@@ -697,7 +479,7 @@
                tempCits <- many1 simpleCiteArgs
                case tempCits of
                  (k:ks) -> case ks of
-                             (_:_) -> return $ ((addMprenote pre k):init ks) ++
+                             (_:_) -> return $ (addMprenote pre k : init ks) ++
                                                  [addMpostnote suf (last ks)]
                              _ -> return [addMprenote pre (addMpostnote suf k)]
                  _ -> return [[]]
@@ -741,7 +523,7 @@
       bgroup
       items <- mconcat <$>
                 many1 (notFollowedBy (symbol ';') >> inline)
-                  `sepBy1` (symbol ';')
+                  `sepBy1` symbol ';'
       egroup
       return $ map handleCitationPart items
   case cs of
@@ -756,7 +538,7 @@
 inlineCommand' :: PandocMonad m => LP m Inlines
 inlineCommand' = try $ do
   Tok _ (CtrlSeq name) cmd <- anyControlSeq
-  guard $ name /= "begin" && name /= "end"
+  guard $ name /= "begin" && name /= "end" && name /= "and"
   star <- option "" ("*" <$ symbol '*' <* sp)
   overlay <- option "" overlaySpecification
   let name' = name <> star <> overlay
@@ -880,7 +662,7 @@
   , ("eqref", rawInlineOr "eqref" $ doref "eqref")   -- from amsmath.sty
   , ("mbox", rawInlineOr "mbox" $ processHBox <$> tok)
   , ("hbox", rawInlineOr "hbox" $ processHBox <$> tok)
-  , ("lettrine", rawInlineOr "lettrine" $ lettrine)
+  , ("lettrine", rawInlineOr "lettrine" lettrine)
   , ("(", mathInline . untokenize <$> manyTill anyTok (controlSeq ")"))
   , ("[", mathDisplay . untokenize <$> manyTill anyTok (controlSeq "]"))
   , ("ensuremath", mathInline . untokenize <$> braced)
@@ -1097,8 +879,13 @@
   , ("acfp", doAcronymPlural "full")
   , ("acsp", doAcronymPlural "abbrv")
   -- siuntix
-  , ("SI", dosiunitx)
-  , ("SIRange", doSIRange)
+  , ("si", skipopts *> dosi tok)
+  , ("SI", doSI tok)
+  , ("SIrange", doSIrange True tok)
+  , ("numrange", doSIrange False tok)
+  , ("numlist", doSInumlist)
+  , ("num", doSInum)
+  , ("ang", doSIang)
   -- hyphenat
   , ("bshyp", lit "\\\173")
   , ("fshyp", lit "/\173")
@@ -1288,7 +1075,7 @@
   spanWith ("",[],[("style",stylename <> ": " <> untokenize color)]) <$> tok
 
 ttfamily :: PandocMonad m => LP m Inlines
-ttfamily = (code . stringify . toList) <$> tok
+ttfamily = code . stringify . toList <$> tok
 
 rawInlineOr :: PandocMonad m => Text -> LP m Inlines -> LP m Inlines
 rawInlineOr name' fallback = do
@@ -1450,8 +1237,8 @@
 include :: (PandocMonad m, Monoid a) => Text -> LP m a
 include name = do
   skipMany opt
-  fs <- (map (T.unpack . removeDoubleQuotes . T.strip) . T.splitOn "," .
-         untokenize) <$> braced
+  fs <- map (T.unpack . removeDoubleQuotes . T.strip) . T.splitOn "," .
+         untokenize <$> braced
   let defaultExt | name == "usepackage" = ".sty"
                  | otherwise            = ".tex"
   mapM_ (insertIncluded defaultExt) fs
@@ -1466,7 +1253,7 @@
                 ".tex" -> f'
                 ".sty" -> f'
                 _      -> addExtension f' defaultExtension
-  dirs <- (map T.unpack . splitTextBy (==':') . fromMaybe ".") <$> lookupEnv "TEXINPUTS"
+  dirs <- map T.unpack . splitTextBy (==':') . fromMaybe "." <$> lookupEnv "TEXINPUTS"
   pos <- getPosition
   containers <- getIncludeFiles <$> getState
   when (T.pack f `elem` containers) $
@@ -1488,10 +1275,7 @@
 authors :: PandocMonad m => LP m ()
 authors = try $ do
   bgroup
-  let oneAuthor = mconcat <$>
-       many1 (notFollowedBy' (controlSeq "and") >>
-               (inline <|> mempty <$ blockCommand))
-               -- skip e.g. \vspace{10pt}
+  let oneAuthor = blocksToInlines' . B.toList . mconcat <$> many1 block
   auths <- sepBy oneAuthor (controlSeq "and")
   egroup
   addMeta "author" (map trimInlines auths)
@@ -1681,7 +1465,7 @@
 blockCommand :: PandocMonad m => LP m Blocks
 blockCommand = try $ do
   Tok _ (CtrlSeq name) txt <- anyControlSeq
-  guard $ name /= "begin" && name /= "end"
+  guard $ name /= "begin" && name /= "end" && name /= "and"
   star <- option "" ("*" <$ symbol '*' <* sp)
   let name' = name <> star
   let names = ordNub [name', name]
@@ -1779,7 +1563,7 @@
    , ("frametitle", section nullAttr 3)
    , ("framesubtitle", section nullAttr 4)
    -- letters
-   , ("opening", (para . trimInlines) <$> (skipopts *> tok))
+   , ("opening", para . trimInlines <$> (skipopts *> tok))
    , ("closing", skipopts *> closing)
    -- memoir
    , ("plainbreak", braced >> pure horizontalRule)
@@ -1793,10 +1577,10 @@
    --
    , ("hrule", pure horizontalRule)
    , ("strut", pure mempty)
-   , ("rule", skipopts *> tok *> tok *> pure horizontalRule)
+   , ("rule", skipopts *> tok *> tok $> horizontalRule)
    , ("item", looseItem)
    , ("documentclass", skipopts *> braced *> preamble)
-   , ("centerline", (para . trimInlines) <$> (skipopts *> tok))
+   , ("centerline", para . trimInlines <$> (skipopts *> tok))
    , ("caption", mempty <$ setCaption)
    , ("bibliography", mempty <$ (skipopts *> braced >>=
          addMeta "bibliography" . splitBibs . untokenize))
@@ -1838,7 +1622,7 @@
 environments = M.fromList
    [ ("document", env "document" blocks <* skipMany anyTok)
    , ("abstract", mempty <$ (env "abstract" blocks >>= addMeta "abstract"))
-   , ("sloppypar", env "sloppypar" $ blocks)
+   , ("sloppypar", env "sloppypar" blocks)
    , ("letter", env "letter" letterContents)
    , ("minipage", env "minipage" $
           skipopts *> spaces *> optional braced *> spaces *> blocks)
@@ -1903,7 +1687,7 @@
   sp
   series <- option Nothing $ Just . untokenize <$> bracketedToks
   sp
-  showName <- untokenize <$> braced
+  showName <- tok
   sp
   syncTo <- option Nothing $ Just . untokenize <$> bracketedToks
   sty <- sLastTheoremStyle <$> getState
@@ -1924,7 +1708,7 @@
   bs <- env "proof" blocks
   return $
     B.divWith ("", ["proof"], []) $
-      addQed $ addTitle (B.emph (title <> ".")) $ bs
+      addQed $ addTitle (B.emph (title <> ".")) bs
 
 addTitle :: Inlines -> Blocks -> Blocks
 addTitle ils bs =
@@ -1968,8 +1752,7 @@
             then do
                let name' = fromMaybe name $ theoremSeries tspec
                num <- getNextNumber
-                   (fromMaybe (DottedNum [0]) .
-                    fmap theoremLastNum .
+                   (maybe (DottedNum [0]) theoremLastNum .
                     M.lookup name' . sTheoremMap)
                updateState $ \s ->
                  s{ sTheoremMap =
@@ -1983,8 +1766,9 @@
                  Just ident ->
                    updateState $ \s ->
                      s{ sLabels = M.insert ident
-                         [Str (theoremName tspec), Str "\160",
-                          Str (renderDottedNum num)] (sLabels s) }
+                         (B.toList $
+                           theoremName tspec <> "\160" <>
+                           str (renderDottedNum num)) (sLabels s) }
                  Nothing -> return ()
                return $ space <> B.text (renderDottedNum num)
             else return mempty
@@ -1992,8 +1776,8 @@
                          PlainStyle      -> B.strong
                          DefinitionStyle -> B.strong
                          RemarkStyle     -> B.emph
-       let title = titleEmph (B.text (theoremName tspec) <> number)
-                                      <> optTitle <> "." <> space
+       let title = titleEmph (theoremName tspec <> number)
+                      <> optTitle <> "." <> space
        return $ divWith (fromMaybe "" mblabel, [name], []) $ addTitle title
               $ case theoremStyle tspec of
                   PlainStyle -> walk italicize bs
@@ -2081,7 +1865,7 @@
   pos <- getPosition
   attr <- mintedAttr
   f <- T.filter (/='"') . untokenize <$> braced
-  dirs <- (map T.unpack . splitTextBy (==':') . fromMaybe ".") <$> lookupEnv "TEXINPUTS"
+  dirs <- map T.unpack . splitTextBy (==':') . fromMaybe "." <$> lookupEnv "TEXINPUTS"
   mbCode <- readFileFromDirs dirs (T.unpack f)
   rawcode <- case mbCode of
                   Just s -> return s
@@ -2194,7 +1978,7 @@
   pos <- getPosition
   options <- option [] keyvals
   f <- T.filter (/='"') . untokenize <$> braced
-  dirs <- (map T.unpack . splitTextBy (==':') . fromMaybe ".") <$> lookupEnv "TEXINPUTS"
+  dirs <- map T.unpack . splitTextBy (==':') . fromMaybe "." <$> lookupEnv "TEXINPUTS"
   mbCode <- readFileFromDirs dirs (T.unpack f)
   codeLines <- case mbCode of
                       Just s -> return $ T.lines s
@@ -2359,6 +2143,8 @@
     toColWidth _                = ColWidthDefault
     toSpec (x, y, z) = (x, toColWidth y, z)
 
+-- N.B. this parser returns a Row that may have erroneous empty cells
+-- in it. See the note above fixTableHead for details.
 parseTableRow :: PandocMonad m
               => Text   -- ^ table environment name
               -> [([Tok], [Tok])] -- ^ pref/suffixes
@@ -2383,14 +2169,23 @@
   cells <- mapM (\ts -> setInput ts >> parseTableCell) rawcells
   setInput oldInput
   spaces
-  return $ Row nullAttr cells 
+  return $ Row nullAttr cells
 
 parseTableCell :: PandocMonad m => LP m Cell
 parseTableCell = do
+  spaces
   updateState $ \st -> st{ sInTableCell = True }
-  cell' <- parseMultiCell <|> parseSimpleCell
+  cell' <-   multicolumnCell
+         <|> multirowCell
+         <|> parseSimpleCell
+         <|> parseEmptyCell
   updateState $ \st -> st{ sInTableCell = False }
+  spaces
   return cell'
+  where
+    -- The parsing of empty cells is important in LaTeX, especially when dealing
+    -- with multirow/multicolumn. See #6603.
+    parseEmptyCell = spaces $> emptyCell
 
 cellAlignment :: PandocMonad m => LP m Alignment
 cellAlignment = skipMany (symbol '|') *> alignment <* skipMany (symbol '|')
@@ -2409,37 +2204,121 @@
                 [Para ils] -> plain (fromList ils)
                 _          -> bs
 
-parseMultiCell :: PandocMonad m => LP m Cell
-parseMultiCell =   (controlSeq "multirow"    >> parseMultirowCell) 
-               <|> (controlSeq "multicolumn" >> parseMulticolCell)
-  where
-    parseMultirowCell = parseMultiXCell RowSpan (const $ ColSpan 1)
-    parseMulticolCell = parseMultiXCell (const $ RowSpan 1) ColSpan
+multirowCell :: PandocMonad m => LP m Cell
+multirowCell = controlSeq "multirow" >> do
+  -- Full prototype for \multirow macro is:
+  --     \multirow[vpos]{nrows}[bigstruts]{width}[vmove]{text}
+  -- However, everything except `nrows` and `text` make
+  -- sense in the context of the Pandoc AST
+  _ <- optional $ symbol '[' *> cellAlignment <* symbol ']'   -- vertical position
+  nrows <- fmap (fromMaybe 1 . safeRead . untokenize) braced
+  _ <- optional $ symbol '[' *> manyTill anyTok (symbol ']')  -- bigstrut-related
+  _ <- symbol '{' *> manyTill anyTok (symbol '}')             -- Cell width
+  _ <- optional $ symbol '[' *> manyTill anyTok (symbol ']')  -- Length used for fine-tuning
+  content <- symbol '{' *> (plainify <$> blocks) <* symbol '}'
+  return $ cell AlignDefault (RowSpan nrows) (ColSpan 1) content
 
-    parseMultiXCell rowspanf colspanf = do
-      span' <- fmap (fromMaybe 1 . safeRead . untokenize) braced
-      alignment <- symbol '{' *> cellAlignment <* symbol '}'
+multicolumnCell :: PandocMonad m => LP m Cell
+multicolumnCell = controlSeq "multicolumn" >> do
+  span' <- fmap (fromMaybe 1 . safeRead . untokenize) braced
+  alignment <- symbol '{' *> cellAlignment <* symbol '}'
 
-      -- Two possible contents: either a nested \multirow/\multicol, or content.
-      -- E.g. \multirow{1}{c}{\multicol{1}{c}{content}}
-      let singleCell = do
-            content <- plainify <$> blocks
-            return $ cell alignment (rowspanf span') (colspanf span') content
+  let singleCell = do
+        content <- plainify <$> blocks
+        return $ cell alignment (RowSpan 1) (ColSpan span') content
 
-      let nestedCell = do
-            (Cell _ _ (RowSpan rs) (ColSpan cs) bs) <- parseMultiCell
-            return $ cell
-                      alignment
-                      (RowSpan $ max span' rs)
-                      (ColSpan $ max span' cs)
-                      (fromList bs)
+  -- Two possible contents: either a \multirow cell, or content.
+  -- E.g. \multicol{1}{c}{\multirow{2}{1em}{content}}
+  -- Note that a \multirow cell can be nested in a \multicolumn,
+  -- but not the other way around. See #6603
+  let nestedCell = do
+        (Cell _ _ (RowSpan rs) _ bs) <- multirowCell
+        return $ cell
+                  alignment
+                  (RowSpan rs)
+                  (ColSpan span')
+                  (fromList bs)
 
-      symbol '{' *> (nestedCell <|> singleCell) <* symbol '}'
+  symbol '{' *> (nestedCell <|> singleCell) <* symbol '}'
 
 -- Parse a simple cell, i.e. not multirow/multicol
 parseSimpleCell :: PandocMonad m => LP m Cell
 parseSimpleCell = simpleCell <$> (plainify <$> blocks)
 
+-- LaTeX tables are stored with empty cells underneath multirow cells
+-- denoting the grid spaces taken up by them. More specifically, if a
+-- cell spans m rows, then it will overwrite all the cells in the
+-- columns it spans for (m-1) rows underneath it, requiring padding
+-- cells in these places. These padding cells need to be removed for
+-- proper table reading. See #6603.
+--
+-- These fixTable functions do not otherwise fix up malformed
+-- input tables: that is left to the table builder.
+fixTableHead :: TableHead -> TableHead
+fixTableHead (TableHead attr rows) = TableHead attr rows'
+  where
+    rows' = fixTableRows rows
+
+fixTableBody :: TableBody -> TableBody
+fixTableBody (TableBody attr rhc th tb)
+  = TableBody attr rhc th' tb'
+  where
+    th' = fixTableRows th
+    tb' = fixTableRows tb
+
+fixTableRows :: [Row] -> [Row]
+fixTableRows = fixTableRows' $ repeat Nothing
+  where
+    fixTableRows' oldHang (Row attr cells : rs)
+      = let (newHang, cells') = fixTableRow oldHang cells
+            rs'               = fixTableRows' newHang rs
+        in Row attr cells' : rs'
+    fixTableRows' _ [] = []
+
+-- The overhang is represented as Just (relative cell dimensions) or
+-- Nothing for an empty grid space.
+fixTableRow :: [Maybe (ColSpan, RowSpan)] -> [Cell] -> ([Maybe (ColSpan, RowSpan)], [Cell])
+fixTableRow oldHang cells
+  -- If there's overhang, drop cells until their total width meets the
+  -- width of the occupied grid spaces (or we run out)
+  | (n, prefHang, restHang) <- splitHang oldHang
+  , n > 0
+  = let cells' = dropToWidth getCellW n cells
+        (restHang', cells'') = fixTableRow restHang cells'
+    in (prefHang restHang', cells'')
+  -- Otherwise record the overhang of a pending cell and fix the rest
+  -- of the row
+  | c@(Cell _ _ h w _):cells' <- cells
+  = let h' = max 1 h
+        w' = max 1 w
+        oldHang' = dropToWidth getHangW w' oldHang
+        (newHang, cells'') = fixTableRow oldHang' cells'
+    in (toHang w' h' <> newHang, c : cells'')
+  | otherwise
+  = (oldHang, [])
+  where
+    getCellW (Cell _ _ _ w _) = w
+    getHangW = maybe 1 fst
+    getCS (ColSpan n) = n
+
+    toHang c r
+      | r > 1     = [Just (c, r)]
+      | otherwise = replicate (getCS c) Nothing
+
+    -- Take the prefix of the overhang list representing filled grid
+    -- spaces. Also return the remainder and the length of this prefix.
+    splitHang = splitHang' 0 id
+
+    splitHang' !n l (Just (c, r):xs)
+      = splitHang' (n + c) (l . (toHang c (r-1) ++)) xs
+    splitHang' n l xs = (n, l, xs)
+
+    -- Drop list items until the total width of the dropped items
+    -- exceeds the passed width.
+    dropToWidth _     n l | n < 1 = l
+    dropToWidth wproj n (c:cs)    = dropToWidth wproj (n - wproj c) cs
+    dropToWidth _     _ []        = []
+
 simpTable :: PandocMonad m => Text -> Bool -> LP m Blocks
 simpTable envname hasWidthParameter = try $ do
   when hasWidthParameter $ () <$ (spaces >> tok)
@@ -2467,11 +2346,10 @@
   optional lbreak
   spaces
   lookAhead $ controlSeq "end" -- make sure we're at end
-  return $ table emptyCaption
-                 (zip aligns widths)
-                 (TableHead nullAttr $ header')
-                 [TableBody nullAttr 0 [] rows]
-                 (TableFoot nullAttr [])
+  let th  = fixTableHead $ TableHead nullAttr header'
+  let tbs = [fixTableBody $ TableBody nullAttr 0 [] rows]
+  let tf  = TableFoot nullAttr []
+  return $ table emptyCaption (zip aligns widths) th tbs tf
 
 addTableCaption :: PandocMonad m => Blocks -> LP m Blocks
 addTableCaption = walkM go
diff --git a/src/Text/Pandoc/Readers/LaTeX/Lang.hs b/src/Text/Pandoc/Readers/LaTeX/Lang.hs
--- a/src/Text/Pandoc/Readers/LaTeX/Lang.hs
+++ b/src/Text/Pandoc/Readers/LaTeX/Lang.hs
@@ -152,4 +152,4 @@
        "newzealand" -> Just $ Lang "en" "" "NZ" []
        "american" -> Just $ Lang "en" "" "US" []
        "classiclatin" -> Just $ Lang "la" "" "" ["x-classic"]
-       _ -> fmap ($ "") $ M.lookup s polyglossiaLangToBCP47
+       _ -> ($ "") <$> M.lookup s polyglossiaLangToBCP47
diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
--- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
+++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
@@ -1,8 +1,8 @@
 {-# LANGUAGE FlexibleInstances     #-}
+{-# LANGUAGE LambdaCase            #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE OverloadedStrings     #-}
 {-# LANGUAGE ScopedTypeVariables   #-}
-{-# LANGUAGE ViewPatterns          #-}
 {- |
    Module      : Text.Pandoc.Readers.LaTeX.Parsing
    Copyright   : Copyright (C) 2006-2020 John MacFarlane
@@ -122,7 +122,7 @@
 
 data TheoremSpec =
   TheoremSpec
-    { theoremName    :: Text
+    { theoremName    :: Inlines
     , theoremStyle   :: TheoremStyle
     , theoremSeries  :: Maybe Text
     , theoremSyncTo  :: Maybe Text
@@ -736,14 +736,14 @@
              (mconcat <$> many1 (
                  (untokenize . snd <$> withRaw braced)
                  <|>
-                 (untokenize <$> (many1
+                 (untokenize <$> many1
                       (satisfyTok
-                         (\t -> case t of
+                         (\case
                                 Tok _ Symbol "]" -> False
                                 Tok _ Symbol "," -> False
                                 Tok _ Symbol "{" -> False
                                 Tok _ Symbol "}" -> False
-                                _                -> True))))))
+                                _                -> True)))))
   optional (symbol ',')
   sp
   return (key, T.strip val)
@@ -756,8 +756,7 @@
   optional blankline
   res <- manyTill anyTok (end_ name)
   return $ stripTrailingNewline
-         $ untokenize
-         $ res
+         $ untokenize res
 
 -- Strip single final newline and any spaces following it.
 -- Input is unchanged if it doesn't end with newline +
@@ -819,8 +818,7 @@
 
 overlayTok :: PandocMonad m => LP m Tok
 overlayTok =
-  satisfyTok (\t ->
-                  case t of
+  satisfyTok (\case
                     Tok _ Word _       -> True
                     Tok _ Spaces _     -> True
                     Tok _ Symbol c     -> c `elem` ["-","+","@","|",":",","]
diff --git a/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs b/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs
new file mode 100644
--- /dev/null
+++ b/src/Text/Pandoc/Readers/LaTeX/SIunitx.hs
@@ -0,0 +1,351 @@
+{-# LANGUAGE OverloadedStrings #-}
+module Text.Pandoc.Readers.LaTeX.SIunitx
+  ( dosi
+  , doSI
+  , doSIrange
+  , doSInum
+  , doSInumlist
+  , doSIang
+  )
+where
+import Text.Pandoc.Builder
+import Text.Pandoc.Readers.LaTeX.Parsing
+import Text.Pandoc.Readers.LaTeX.Types
+import Text.Pandoc.Class
+import Text.Pandoc.Parsing hiding (blankline, mathDisplay, mathInline,
+                            optional, space, spaces, withRaw, (<|>))
+import Control.Applicative ((<|>))
+import qualified Data.Map as M
+import Data.Char (isDigit)
+import Data.Text (Text)
+import qualified Data.Text as T
+import Data.List (intersperse)
+
+dosi :: PandocMonad m => LP m Inlines -> LP m Inlines
+dosi tok = grouped (siUnit tok) <|> siUnit tok
+
+-- converts e.g. \SI{1}[\$]{} to "$ 1" or \SI{1}{\euro} to "1 €"
+doSI :: PandocMonad m => LP m Inlines -> LP m Inlines
+doSI tok = do
+  skipopts
+  value <- doSInum
+  valueprefix <- option "" $ bracketed tok
+  unit <- dosi tok
+  return . mconcat $ [valueprefix,
+                      emptyOr160 valueprefix,
+                      value,
+                      emptyOr160 unit,
+                      unit]
+
+doSInum :: PandocMonad m => LP m Inlines
+doSInum = skipopts *> (tonum . untokenize <$> braced)
+
+tonum :: Text -> Inlines
+tonum value =
+  case runParser parseNum () "" value of
+    Left _    -> text value
+    Right num -> num
+
+doSInumlist :: PandocMonad m => LP m Inlines
+doSInumlist = do
+  skipopts
+  xs <- map tonum . T.splitOn ";" . untokenize <$> braced
+  case xs of
+    []  -> return mempty
+    [x] -> return x
+    _   -> return $
+             mconcat (intersperse (str "," <> space) (init xs)) <>
+             text ", & " <> last xs
+
+parseNum :: Parser Text () Inlines
+parseNum = mconcat <$> many parseNumPart
+
+parseNumPart :: Parser Text () Inlines
+parseNumPart =
+  parseDecimalNum <|>
+  parseComma <|>
+  parsePlusMinus <|>
+  parseI <|>
+  parseExp <|>
+  parseX <|>
+  parseSpace
+ where
+  parseDecimalNum = do
+    basenum <- T.pack <$> many1 (satisfy (\c -> isDigit c || c == '.'))
+    uncertainty <- option mempty $ T.pack <$> parseParens
+    if T.null uncertainty
+       then return $ str basenum
+       else return $ str $ basenum <> "\xa0\xb1\xa0" <>
+             let (_,ys) = T.break (=='.') basenum
+              in case (T.length ys - 1, T.length uncertainty) of
+                   (0,_) -> uncertainty
+                   (x,y)
+                     | x > y  -> "0." <> T.replicate (x - y) "0" <>
+                                      T.dropWhileEnd (=='0') uncertainty
+                     | otherwise -> T.take (y - x) uncertainty <>
+                                      case T.dropWhileEnd (=='0')
+                                             (T.drop (y - x) uncertainty) of
+                                             t | T.null t -> mempty
+                                               | otherwise -> "." <> t
+  parseComma = str "." <$ char ','
+  parsePlusMinus = str "\xa0\xb1\xa0" <$ try (string "+-")
+  parseParens =
+    char '(' *> many1 (satisfy (\c -> isDigit c || c == '.')) <* char ')'
+  parseI = str "i" <$ char 'i'
+  parseX = str "\xa0\xd7\xa0" <$ char 'x'
+  parseExp = (\n -> str ("\xa0\xd7\xa0" <> "10") <> superscript n)
+               <$> (char 'e' *> parseDecimalNum)
+  parseSpace = mempty <$ skipMany1 (char ' ')
+
+doSIang :: PandocMonad m => LP m Inlines
+doSIang = do
+  skipopts
+  ps <- T.splitOn ";" . untokenize <$> braced
+  case ps ++ repeat "" of
+    (d:m:s:_) -> return $
+      (if T.null d then mempty else str d <> str "\xb0") <>
+      (if T.null m then mempty else str m <> str "\x2032") <>
+      (if T.null s then mempty else str s <> str "\x2033")
+    _ -> return mempty
+
+-- converts e.g. \SIrange{100}{200}{\ms} to "100 ms--200 ms"
+doSIrange :: PandocMonad m => Bool -> LP m Inlines -> LP m Inlines
+doSIrange includeUnits tok = do
+  skipopts
+  startvalue <- doSInum
+  startvalueprefix <- option "" $ bracketed tok
+  stopvalue <- doSInum
+  stopvalueprefix <- option "" $ bracketed tok
+  unit <- if includeUnits
+             then dosi tok
+             else return mempty
+  return . mconcat $ [startvalueprefix,
+                      emptyOr160 startvalueprefix,
+                      startvalue,
+                      emptyOr160 unit,
+                      unit,
+                      "\8211", -- An en-dash
+                      stopvalueprefix,
+                      emptyOr160 stopvalueprefix,
+                      stopvalue,
+                      emptyOr160 unit,
+                      unit]
+
+emptyOr160 :: Inlines -> Inlines
+emptyOr160 x = if x == mempty then x else str "\160"
+
+siUnit :: PandocMonad m => LP m Inlines -> LP m Inlines
+siUnit tok = try (do
+  Tok _ (CtrlSeq name) _ <- anyControlSeq
+  case name of
+    "square" -> do
+       unit <- siUnit tok
+       return $ unit <> superscript "2"
+    "cubic" -> do
+       unit <- siUnit tok
+       return $ unit <> superscript "3"
+    "raisetothe" -> do
+       n <- tok
+       unit <- siUnit tok
+       return $ unit <> superscript n
+    _ ->
+       case M.lookup name siUnitMap of
+            Just il ->
+              option il $
+                choice
+                 [ (il <> superscript "2") <$ controlSeq "squared"
+                 , (il <> superscript "3") <$ controlSeq "cubed"
+                 , (\n -> il <> superscript n) <$> (controlSeq "tothe" *> tok)
+                 ]
+            Nothing -> fail "not an siunit unit command")
+ <|> (lookAhead anyControlSeq >> tok)
+ <|> (do Tok _ Word t <- satisfyTok isWordTok
+         return $ str t)
+ <|> (symbol '^' *> (superscript <$> tok))
+ <|> (symbol '_' *> (subscript <$> tok))
+ <|> ("\xa0" <$ symbol '.')
+ <|> ("\xa0" <$ symbol '~')
+ <|> tok
+ <|> (do Tok _ _ t <- anyTok
+         return (str t))
+
+siUnitMap :: M.Map Text Inlines
+siUnitMap = M.fromList
+  [ ("fg", str "fg")
+  , ("pg", str "pg")
+  , ("ng", str "ng")
+  , ("ug", str "μg")
+  , ("mg", str "mg")
+  , ("g", str "g")
+  , ("kg", str "kg")
+  , ("amu", str "u")
+  , ("pm", str "pm")
+  , ("nm", str "nm")
+  , ("um", str "μm")
+  , ("mm", str "mm")
+  , ("cm", str "cm")
+  , ("dm", str "dm")
+  , ("m", str "m")
+  , ("km", str "km")
+  , ("as", str "as")
+  , ("fs", str "fs")
+  , ("ps", str "ps")
+  , ("ns", str "ns")
+  , ("us", str "μs")
+  , ("ms", str "ms")
+  , ("s", str "s")
+  , ("fmol", str "fmol")
+  , ("pmol", str "pmol")
+  , ("nmol", str "nmol")
+  , ("umol", str "μmol")
+  , ("mmol", str "mmol")
+  , ("mol", str "mol")
+  , ("kmol", str "kmol")
+  , ("pA", str "pA")
+  , ("nA", str "nA")
+  , ("uA", str "μA")
+  , ("mA", str "mA")
+  , ("A", str "A")
+  , ("kA", str "kA")
+  , ("ul", str "μl")
+  , ("ml", str "ml")
+  , ("l", str "l")
+  , ("hl", str "hl")
+  , ("uL", str "μL")
+  , ("mL", str "mL")
+  , ("L", str "L")
+  , ("hL", str "hL")
+  , ("mHz", str "mHz")
+  , ("Hz", str "Hz")
+  , ("kHz", str "kHz")
+  , ("MHz", str "MHz")
+  , ("GHz", str "GHz")
+  , ("THz", str "THz")
+  , ("mN", str "mN")
+  , ("N", str "N")
+  , ("kN", str "kN")
+  , ("MN", str "MN")
+  , ("Pa", str "Pa")
+  , ("kPa", str "kPa")
+  , ("MPa", str "MPa")
+  , ("GPa", str "GPa")
+  , ("mohm", str "mΩ")
+  , ("kohm", str "kΩ")
+  , ("Mohm", str "MΩ")
+  , ("pV", str "pV")
+  , ("nV", str "nV")
+  , ("uV", str "μV")
+  , ("mV", str "mV")
+  , ("V", str "V")
+  , ("kV", str "kV")
+  , ("W", str "W")
+  , ("uW", str "μW")
+  , ("mW", str "mW")
+  , ("kW", str "kW")
+  , ("MW", str "MW")
+  , ("GW", str "GW")
+  , ("J", str "J")
+  , ("uJ", str "μJ")
+  , ("mJ", str "mJ")
+  , ("kJ", str "kJ")
+  , ("eV", str "eV")
+  , ("meV", str "meV")
+  , ("keV", str "keV")
+  , ("MeV", str "MeV")
+  , ("GeV", str "GeV")
+  , ("TeV", str "TeV")
+  , ("kWh", str "kWh")
+  , ("F", str "F")
+  , ("fF", str "fF")
+  , ("pF", str "pF")
+  , ("K", str "K")
+  , ("dB", str "dB")
+  , ("ampere", str "A")
+  , ("angstrom", str "Å")
+  , ("arcmin", str "′")
+  , ("arcminute", str "′")
+  , ("arcsecond", str "″")
+  , ("astronomicalunit", str "ua")
+  , ("atomicmassunit", str "u")
+  , ("atto", str "a")
+  , ("bar", str "bar")
+  , ("barn", str "b")
+  , ("becquerel", str "Bq")
+  , ("bel", str "B")
+  , ("bohr", emph (str "a") <> subscript (str "0"))
+  , ("candela", str "cd")
+  , ("celsius", str "°C")
+  , ("centi", str "c")
+  , ("clight", emph (str "c") <> subscript (str "0"))
+  , ("coulomb", str "C")
+  , ("dalton", str "Da")
+  , ("day", str "d")
+  , ("deca", str "d")
+  , ("deci", str "d")
+  , ("decibel", str "db")
+  , ("degreeCelsius",str "°C")
+  , ("degree", str "°")
+  , ("deka", str "d")
+  , ("electronmass", emph (str "m") <> subscript (str "e"))
+  , ("electronvolt", str "eV")
+  , ("elementarycharge", emph (str "e"))
+  , ("exa", str "E")
+  , ("farad", str "F")
+  , ("femto", str "f")
+  , ("giga", str "G")
+  , ("gram", str "g")
+  , ("gray", str "Gy")
+  , ("hartree", emph (str "E") <> subscript (str "h"))
+  , ("hectare", str "ha")
+  , ("hecto", str "h")
+  , ("henry", str "H")
+  , ("hertz", str "Hz")
+  , ("hour", str "h")
+  , ("joule", str "J")
+  , ("katal", str "kat")
+  , ("kelvin", str "K")
+  , ("kilo", str "k")
+  , ("kilogram", str "kg")
+  , ("knot", str "kn")
+  , ("liter", str "L")
+  , ("litre", str "l")
+  , ("lumen", str "lm")
+  , ("lux", str "lx")
+  , ("mega", str "M")
+  , ("meter", str "m")
+  , ("metre", str "m")
+  , ("micro", str "μ")
+  , ("milli", str "m")
+  , ("minute", str "min")
+  , ("mmHg", str "mmHg")
+  , ("mole", str "mol")
+  , ("nano", str "n")
+  , ("nauticalmile", str "M")
+  , ("neper", str "Np")
+  , ("newton", str "N")
+  , ("ohm", str "Ω")
+  , ("Pa", str "Pa")
+  , ("pascal", str "Pa")
+  , ("percent", str "%")
+  , ("per", str "/")
+  , ("peta", str "P")
+  , ("pico", str "p")
+  , ("planckbar", emph (str "\x210f"))
+  , ("radian", str "rad")
+  , ("second", str "s")
+  , ("siemens", str "S")
+  , ("sievert", str "Sv")
+  , ("steradian", str "sr")
+  , ("tera", str "T")
+  , ("tesla", str "T")
+  , ("tonne", str "t")
+  , ("volt", str "V")
+  , ("watt", str "W")
+  , ("weber", str "Wb")
+  , ("yocto", str "y")
+  , ("yotta", str "Y")
+  , ("zepto", str "z")
+  , ("zetta", str "Z")
+  ]
+
+
diff --git a/src/Text/Pandoc/Readers/Man.hs b/src/Text/Pandoc/Readers/Man.hs
--- a/src/Text/Pandoc/Readers/Man.hs
+++ b/src/Text/Pandoc/Readers/Man.hs
@@ -33,7 +33,7 @@
 import Text.Pandoc.Readers.Roff  -- TODO explicit imports
 import Text.Parsec hiding (tokenPrim)
 import qualified Text.Parsec as Parsec
-import Text.Parsec.Pos (updatePosString, initialPos)
+import Text.Parsec.Pos (updatePosString)
 import qualified Data.Foldable as Foldable
 
 data ManState = ManState { readerOptions   :: ReaderOptions
@@ -162,7 +162,7 @@
       _   -> Nothing
 
   toRow = Row nullAttr . map simpleCell
-  toHeaderRow l = if null l then [] else [toRow l]
+  toHeaderRow l = [toRow l | not (null l)]
 
 parseNewParagraph :: PandocMonad m => ManParser m Blocks
 parseNewParagraph = do
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -13,7 +13,10 @@
 
 Conversion of markdown-formatted plain text to 'Pandoc' document.
 -}
-module Text.Pandoc.Readers.Markdown ( readMarkdown, yamlToMeta ) where
+module Text.Pandoc.Readers.Markdown (
+  readMarkdown,
+  yamlToMeta,
+  yamlToRefs ) where
 
 import Control.Monad
 import Control.Monad.Except (throwError)
@@ -36,6 +39,7 @@
 import Text.Pandoc.Error
 import Text.Pandoc.Logging
 import Text.Pandoc.Options
+import Text.Pandoc.Walk (walk)
 import Text.Pandoc.Parsing hiding (tableWith)
 import Text.Pandoc.Readers.HTML (htmlInBalanced, htmlTag, isBlockTag,
                                  isCommentTag, isInlineTag, isTextTag)
@@ -43,7 +47,7 @@
 import Text.Pandoc.Shared
 import qualified Text.Pandoc.UTF8 as UTF8
 import Text.Pandoc.XML (fromEntities)
-import Text.Pandoc.Readers.Metadata (yamlBsToMeta)
+import Text.Pandoc.Readers.Metadata (yamlBsToMeta, yamlBsToRefs)
 
 type MarkdownParser m = ParserT Text ParserState m
 
@@ -63,17 +67,49 @@
 -- String scalars in the YAML are parsed as Markdown.
 yamlToMeta :: PandocMonad m
            => ReaderOptions
+           -> Maybe FilePath
            -> BL.ByteString
            -> m Meta
-yamlToMeta opts bstr = do
+yamlToMeta opts mbfp bstr = do
   let parser = do
+        oldPos <- getPosition
+        case mbfp of
+          Nothing -> return ()
+          Just fp -> setPosition $ initialPos fp
         meta <- yamlBsToMeta (fmap B.toMetaValue <$> parseBlocks) bstr
+        setPosition oldPos
         return $ runF meta defaultParserState
   parsed <- readWithM parser def{ stateOptions = opts } ""
   case parsed of
     Right result -> return result
     Left e       -> throwError e
 
+-- | Read a YAML string and extract references from the
+-- 'references' field, filter using an id predicate and
+-- parsing fields as Markdown.
+yamlToRefs :: PandocMonad m
+           => (Text -> Bool)
+           -> ReaderOptions
+           -> Maybe FilePath
+           -> BL.ByteString
+           -> m [MetaValue]
+yamlToRefs idpred opts mbfp bstr = do
+  let parser = do
+        oldPos <- getPosition
+        case mbfp of
+          Nothing -> return ()
+          Just fp -> setPosition $ initialPos fp
+        refs <- yamlBsToRefs (fmap B.toMetaValue <$> parseBlocks) idpred bstr
+        setPosition oldPos
+        return $ runF refs defaultParserState
+  parsed <- readWithM parser def{ stateOptions = opts } ""
+  case parsed of
+    Right result -> return result
+    Left e       -> throwError e
+
+
+
+
 --
 -- Constants and data structure definitions
 --
@@ -222,9 +258,9 @@
                  author' <- author
                  date' <- date
                  return $
-                     (if B.isNull title' then id else B.setMeta "title" title')
+                     (if null title' then id else B.setMeta "title" title')
                    . (if null author' then id else B.setMeta "author" author')
-                   . (if B.isNull date' then id else B.setMeta "date" date')
+                   . (if null date' then id else B.setMeta "date" date')
                    $ nullMeta
   updateState $ \st -> st{ stateMeta' = stateMeta' st <> meta' }
 
@@ -380,6 +416,7 @@
      char ':'
      optional blankline
      optional indentSpaces
+     updateState $ \st -> st{ stateInNote = True }
      first <- rawLines
      rest <- many $ try $ blanklines >> indentSpaces >> rawLines
      let raw = T.unlines (first:rest) <> "\n"
@@ -390,7 +427,8 @@
        Just _  -> logMessage $ DuplicateNoteReference ref pos
        Nothing -> return ()
      updateState $ \s -> s { stateNotes' =
-       M.insert ref (pos, parsed) oldnotes }
+       M.insert ref (pos, parsed) oldnotes,
+                             stateInNote = False }
      return mempty
 
 --
@@ -1025,7 +1063,7 @@
   guardEnabled Ext_raw_html
   try (do
       (TagOpen _ attrs) <- lookAhead $ fst <$> htmlTag isBlockTag
-      (return . B.rawBlock "html") <$> rawVerbatimBlock
+      return . B.rawBlock "html" <$> rawVerbatimBlock
         <|> (do guardEnabled Ext_markdown_attribute
                 oldMarkdownAttribute <- stateMarkdownAttribute <$> getState
                 markdownAttribute <-
@@ -1582,7 +1620,7 @@
 three :: PandocMonad m => Char -> MarkdownParser m (F Inlines)
 three c = do
   contents <- mconcat <$> many (notFollowedBy (ender c 1) >> inline)
-  (ender c 3 >> updateLastStrPos >> return ((B.strong . B.emph) <$> contents))
+  (ender c 3 >> updateLastStrPos >> return (B.strong . B.emph <$> contents))
     <|> (ender c 2 >> updateLastStrPos >> one c (B.strong <$> contents))
     <|> (ender c 1 >> updateLastStrPos >> two c (B.emph <$> contents))
     <|> return (return (B.str $ T.pack [c,c,c]) <> contents)
@@ -1617,7 +1655,7 @@
                -> MarkdownParser m b
                -> MarkdownParser m (F Inlines)
 inlinesBetween start end =
-  (trimInlinesF . mconcat) <$> try (start >> many1Till inner end)
+  trimInlinesF . mconcat <$> try (start >> many1Till inner end)
     where inner      = innerSpace <|> (notFollowedBy' (() <$ whitespace) >> inline)
           innerSpace = try $ whitespace <* notFollowedBy' end
 
@@ -1662,6 +1700,7 @@
       abbrevs <- getOption readerAbbreviations
       if not (T.null result) && T.last result == '.' && result `Set.member` abbrevs
          then try (do ils <- whitespace
+                      notFollowedBy (() <$ cite <|> () <$ note)
                       -- ?? lookAhead alphaNum
                       -- replace space after with nonbreaking space
                       -- if softbreak, move before abbrev if possible (#4635)
@@ -1720,7 +1759,7 @@
             try parenthesizedChars
         <|> (notFollowedBy (oneOf " )") >> countChar 1 litChar)
         <|> try (many1Char spaceChar <* notFollowedBy (oneOf "\"')"))
-  let sourceURL = (T.unwords . T.words . T.concat) <$> many urlChunk
+  let sourceURL = T.unwords . T.words . T.concat <$> many urlChunk
   let betweenAngles = try $
          char '<' >> manyTillChar litChar (char '>')
   src <- try betweenAngles <|> sourceURL
@@ -1866,7 +1905,9 @@
 note = try $ do
   guardEnabled Ext_footnotes
   ref <- noteMarker
-  updateState $ \st -> st{ stateNoteRefs = Set.insert ref (stateNoteRefs st) }
+  updateState $ \st -> st{ stateNoteRefs = Set.insert ref (stateNoteRefs st)
+                         , stateNoteNumber = stateNoteNumber st + 1 }
+  noteNum <- stateNoteNumber <$> getState
   return $ do
     notes <- asksF stateNotes'
     case M.lookup ref notes of
@@ -1877,13 +1918,21 @@
           -- notes, to avoid infinite looping with notes inside
           -- notes:
           let contents' = runF contents st{ stateNotes' = M.empty }
-          return $ B.note contents'
+          let addCitationNoteNum (c@Citation{}) =
+                c{ citationNoteNum = noteNum }
+          let adjustCite (Cite cs ils) =
+                Cite (map addCitationNoteNum cs) ils
+              adjustCite x = x
+          return $ B.note $ walk adjustCite contents'
 
 inlineNote :: PandocMonad m => MarkdownParser m (F Inlines)
 inlineNote = try $ do
   guardEnabled Ext_inline_notes
   char '^'
+  updateState $ \st -> st{ stateInNote = True
+                         , stateNoteNumber = stateNoteNumber st + 1 }
   contents <- inlinesInBalancedBrackets
+  updateState $ \st -> st{ stateInNote = False }
   return $ B.note . B.para <$> contents
 
 rawLaTeXInline' :: PandocMonad m => MarkdownParser m (F Inlines)
@@ -2004,6 +2053,12 @@
 cite :: PandocMonad m => MarkdownParser m (F Inlines)
 cite = do
   guardEnabled Ext_citations
+  -- We only use stateNoteNumber for assigning citationNoteNum,
+  -- so we just assume that all citations produce notes.
+  -- citationNoteNum doesn't affect non-note styles.
+  inNote <- stateInNote <$> getState
+  unless inNote $
+    updateState $ \st -> st{ stateNoteNumber = stateNoteNumber st + 1 }
   textualCite
             <|> do (cs, raw) <- withRaw normalCite
                    return $ flip B.cite (B.text raw) <$> cs
@@ -2011,19 +2066,20 @@
 textualCite :: PandocMonad m => MarkdownParser m (F Inlines)
 textualCite = try $ do
   (suppressAuthor, key) <- citeKey
+  noteNum <- stateNoteNumber <$> getState
   let first = Citation{ citationId      = key
                       , citationPrefix  = []
                       , citationSuffix  = []
                       , citationMode    = if suppressAuthor
                                              then SuppressAuthor
                                              else AuthorInText
-                      , citationNoteNum = 0
+                      , citationNoteNum = noteNum
                       , citationHash    = 0
                       }
   mbrest <- option Nothing $ try $ spnl >> Just <$> withRaw normalCite
   case mbrest of
        Just (rest, raw) ->
-         return $ (flip B.cite (B.text $ "@" <> key <> " " <> raw) . (first:))
+         return $ flip B.cite (B.text $ "@" <> key <> " " <> raw) . (first:)
                <$> rest
        Nothing   ->
          (do
@@ -2090,6 +2146,7 @@
   pref <- prefix
   (suppress_author, key) <- citeKey
   suff <- suffix
+  noteNum <- stateNoteNumber <$> getState
   return $ do
     x <- pref
     y <- suff
@@ -2099,7 +2156,7 @@
                    , citationMode    = if suppress_author
                                           then SuppressAuthor
                                           else NormalCitation
-                   , citationNoteNum = 0
+                   , citationNoteNum = noteNum
                    , citationHash    = 0
                    }
 
@@ -2130,4 +2187,4 @@
 toRow = Row nullAttr . map B.simpleCell
 
 toHeaderRow :: [Blocks] -> [Row]
-toHeaderRow l = if null l then [] else [toRow l]
+toHeaderRow l = [toRow l | not (null l)]
diff --git a/src/Text/Pandoc/Readers/MediaWiki.hs b/src/Text/Pandoc/Readers/MediaWiki.hs
--- a/src/Text/Pandoc/Readers/MediaWiki.hs
+++ b/src/Text/Pandoc/Readers/MediaWiki.hs
@@ -231,7 +231,7 @@
                           then (hdr, rows')
                           else (replicate cols mempty, hdr:rows')
   let toRow = Row nullAttr . map B.simpleCell
-      toHeaderRow l = if null l then [] else [toRow l]
+      toHeaderRow l = [toRow l | not (null l)]
   return $ B.table (B.simpleCaption $ B.plain caption)
                    cellspecs
                    (TableHead nullAttr $ toHeaderRow headers)
@@ -283,7 +283,7 @@
   skipSpaces
   sym "|+"
   optional (try $ parseAttrs *> skipSpaces *> char '|' *> blanklines)
-  (trimInlines . mconcat) <$>
+  trimInlines . mconcat <$>
     many (notFollowedBy (cellsep <|> rowsep) *> inline)
 
 tableRow :: PandocMonad m => MWParser m [((Alignment, Double), Blocks)]
@@ -434,7 +434,7 @@
 defListItem = try $ do
   terms <- mconcat . intersperse B.linebreak <$> many defListTerm
   -- we allow dd with no dt, or dt with no dd
-  defs  <- if B.isNull terms
+  defs  <- if null terms
               then notFollowedBy
                     (try $ skipMany1 (char ':') >> string "<math>") *>
                        many1 (listItem ':')
@@ -678,7 +678,7 @@
 -- | Parses a list of inlines between start and end delimiters.
 inlinesBetween :: (PandocMonad m, Show b) => MWParser m a -> MWParser m b -> MWParser m Inlines
 inlinesBetween start end =
-  (trimInlines . mconcat) <$> try (start >> many1Till inner end)
+  trimInlines . mconcat <$> try (start >> many1Till inner end)
     where inner      = innerSpace <|> (notFollowedBy' (() <$ whitespace) >> inline)
           innerSpace = try $ whitespace <* notFollowedBy' end
 
diff --git a/src/Text/Pandoc/Readers/Metadata.hs b/src/Text/Pandoc/Readers/Metadata.hs
--- a/src/Text/Pandoc/Readers/Metadata.hs
+++ b/src/Text/Pandoc/Readers/Metadata.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE OverloadedStrings   #-}
+{-# LANGUAGE ScopedTypeVariables #-}
 {- |
    Module      : Text.Pandoc.Readers.Metadata
    Copyright   : Copyright (C) 2006-2020 John MacFarlane
@@ -10,12 +11,16 @@
 
 Parse YAML/JSON metadata to 'Pandoc' 'Meta'.
 -}
-module Text.Pandoc.Readers.Metadata ( yamlBsToMeta, yamlMap ) where
+module Text.Pandoc.Readers.Metadata (
+  yamlBsToMeta,
+  yamlBsToRefs,
+  yamlMap ) where
 
 import Control.Monad
 import Control.Monad.Except (throwError)
 import qualified Data.ByteString.Lazy as BL
 import qualified Data.Map as M
+import Data.Maybe
 import Data.Text (Text)
 import qualified Data.Text as T
 import qualified Data.YAML as YAML
@@ -23,7 +28,6 @@
 import Text.Pandoc.Class.PandocMonad (PandocMonad (..))
 import Text.Pandoc.Definition
 import Text.Pandoc.Error
-import Text.Pandoc.Logging
 import Text.Pandoc.Parsing hiding (tableWith)
 import Text.Pandoc.Shared
 
@@ -32,29 +36,74 @@
              -> BL.ByteString
              -> ParserT Text ParserState m (F Meta)
 yamlBsToMeta pMetaValue bstr = do
-  pos <- getPosition
   case YAML.decodeNode' YAML.failsafeSchemaResolver False False bstr of
        Right (YAML.Doc (YAML.Mapping _ _ o):_)
                 -> fmap Meta <$> yamlMap pMetaValue o
        Right [] -> return . return $ mempty
        Right [YAML.Doc (YAML.Scalar _ YAML.SNull)]
                 -> return . return $ mempty
-       Right _  -> do logMessage $ CouldNotParseYamlMetadata "not an object"
-                                   pos
-                      return . return $ mempty
+       Right _  -> Prelude.fail "expected YAML object"
+       Left (yamlpos, err')
+                -> do pos <- getPosition
+                      setPosition $ incSourceLine
+                            (setSourceColumn pos (YE.posColumn yamlpos))
+                            (YE.posLine yamlpos - 1)
+                      Prelude.fail err'
+
+fakePos :: YAML.Pos
+fakePos = YAML.Pos (-1) (-1) 1 0
+
+lookupYAML :: Text
+           -> YAML.Node YE.Pos
+           -> Maybe (YAML.Node YE.Pos)
+lookupYAML t (YAML.Mapping _ _ m) =
+  M.lookup (YAML.Scalar fakePos (YAML.SUnknown YE.untagged t)) m
+    `mplus`
+    M.lookup (YAML.Scalar fakePos (YAML.SStr t)) m
+lookupYAML _ _ = Nothing
+
+-- Returns filtered list of references.
+yamlBsToRefs :: PandocMonad m
+             => ParserT Text ParserState m (F MetaValue)
+             -> (Text -> Bool) -- ^ Filter for id
+             -> BL.ByteString
+             -> ParserT Text ParserState m (F [MetaValue])
+yamlBsToRefs pMetaValue idpred bstr =
+  case YAML.decodeNode' YAML.failsafeSchemaResolver False False bstr of
+       Right (YAML.Doc o@(YAML.Mapping _ _ _):_)
+                -> case lookupYAML "references" o of
+                     Just (YAML.Sequence _ _ ns) -> do
+                       let g n = case lookupYAML "id" n of
+                                    Just n' ->
+                                      case nodeToKey n' of
+                                        Nothing -> False
+                                        Just t -> idpred t ||
+                                          case lookupYAML "other-ids" n of
+                                            Just (YAML.Sequence _ _ ns') ->
+                                              let ts' = mapMaybe nodeToKey ns'
+                                               in any idpred ts'
+                                            _ -> False
+                                    Nothing   -> False
+                       sequence <$>
+                         mapM (yamlToMetaValue pMetaValue) (filter g ns)
+                     Just _ ->
+                       Prelude.fail "expecting sequence in 'references' field"
+                     Nothing ->
+                       Prelude.fail "expecting 'references' field"
+
+       Right [] -> return . return $ mempty
+       Right [YAML.Doc (YAML.Scalar _ YAML.SNull)]
+                -> return . return $ mempty
+       Right _  -> Prelude.fail "expecting YAML object"
        Left (_pos, err')
-                -> do logMessage $ CouldNotParseYamlMetadata
-                                   (T.pack err') pos
-                      return . return $ mempty
+                -> Prelude.fail err'
 
-nodeToKey :: PandocMonad m
-          => YAML.Node YE.Pos
-          -> m Text
-nodeToKey (YAML.Scalar _ (YAML.SStr t))       = return t
-nodeToKey (YAML.Scalar _ (YAML.SUnknown _ t)) = return t
-nodeToKey _  = throwError $ PandocParseError
-                              "Non-string key in YAML mapping"
 
+nodeToKey :: YAML.Node YE.Pos -> Maybe Text
+nodeToKey (YAML.Scalar _ (YAML.SStr t))       = Just t
+nodeToKey (YAML.Scalar _ (YAML.SUnknown _ t)) = Just t
+nodeToKey _                                   = Nothing
+
 normalizeMetaValue :: PandocMonad m
                    => ParserT Text ParserState m (F MetaValue)
                    -> Text
@@ -106,7 +155,9 @@
         -> ParserT Text ParserState m (F (M.Map Text MetaValue))
 yamlMap pMetaValue o = do
     kvs <- forM (M.toList o) $ \(key, v) -> do
-             k <- nodeToKey key
+             k <- maybe (throwError $ PandocParseError
+                            "Non-string key in YAML mapping")
+                        return $ nodeToKey key
              return (k, v)
     let kvs' = filter (not . ignorable . fst) kvs
     fmap M.fromList . sequence <$> mapM toMeta kvs'
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -653,7 +653,7 @@
   where attrs = (AlignDefault, ColWidthDefault) <$ transpose (headers ++ body ++ footers)
         (headRow, rows) = fromMaybe ([], []) $ uncons headers
         toRow = Row nullAttr . map B.simpleCell
-        toHeaderRow l = if null l then [] else [toRow l]
+        toHeaderRow l = [toRow l | not (null l)]
 
 museAppendElement :: MuseTableElement
                   -> MuseTable
diff --git a/src/Text/Pandoc/Readers/Odt/ContentReader.hs b/src/Text/Pandoc/Readers/Odt/ContentReader.hs
--- a/src/Text/Pandoc/Readers/Odt/ContentReader.hs
+++ b/src/Text/Pandoc/Readers/Odt/ContentReader.hs
@@ -220,9 +220,9 @@
 uniqueIdentFrom baseIdent usedIdents =
   let  numIdent n = baseIdent <> "-" <> T.pack (show n)
   in  if baseIdent `elem` usedIdents
-        then case find (\x -> numIdent x `notElem` usedIdents) ([1..60000] :: [Int]) of
-                  Just x  -> numIdent x
-                  Nothing -> baseIdent   -- if we have more than 60,000, allow repeats
+        then maybe baseIdent numIdent
+             $ find (\x -> numIdent x `notElem` usedIdents) ([1..60000] :: [Int])
+               -- if we have more than 60,000, allow repeats
         else baseIdent
 
 -- | First argument: basis for a new "pretty" anchor if none exists yet
diff --git a/src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs b/src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs
--- a/src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs
+++ b/src/Text/Pandoc/Readers/Odt/Generic/XMLConverter.hs
@@ -1,5 +1,6 @@
 {-# LANGUAGE TupleSections   #-}
 {-# LANGUAGE GADTs           #-}
+{-# LANGUAGE LambdaCase      #-}
 {-# LANGUAGE PatternGuards   #-}
 {- |
    Module      : Text.Pandoc.Readers.Odt.Generic.XMLConverter
@@ -691,7 +692,7 @@
                             >>% recover)
                     &&&^ snd
         contentToElem :: FallibleXMLConverter nsID extraState XML.Content XML.Element
-        contentToElem = arr $ \e -> case e of
+        contentToElem = arr $ \case
                                      XML.Elem e' -> succeedWith e'
                                      _           -> failEmpty
 
diff --git a/src/Text/Pandoc/Readers/Org/Blocks.hs b/src/Text/Pandoc/Readers/Org/Blocks.hs
--- a/src/Text/Pandoc/Readers/Org/Blocks.hs
+++ b/src/Text/Pandoc/Readers/Org/Blocks.hs
@@ -34,6 +34,7 @@
 import Control.Monad (foldM, guard, mplus, mzero, void)
 import Data.Char (isSpace)
 import Data.Default (Default)
+import Data.Functor (($>))
 import Data.List (foldl', intersperse)
 import Data.Maybe (fromMaybe, isJust, isNothing)
 import Data.Text (Text)
@@ -103,9 +104,7 @@
 attrFromBlockAttributes BlockAttributes{..} =
   let
     ident   = fromMaybe mempty $ lookup "id" blockAttrKeyValues
-    classes = case lookup "class" blockAttrKeyValues of
-                Nothing     -> []
-                Just clsStr -> T.words clsStr
+    classes = maybe [] T.words $ lookup "class" blockAttrKeyValues
     kv      = filter ((`notElem` ["id", "class"]) . fst) blockAttrKeyValues
   in (ident, classes, kv)
 
@@ -495,7 +494,7 @@
 
 -- | Example code marked up by a leading colon.
 example :: Monad m => OrgParser m (F Blocks)
-example = try $ returnF . exampleCode =<< T.unlines <$> many1 exampleLine
+example = try $ returnF . exampleCode . T.unlines =<< many1 exampleLine
  where
    exampleLine :: Monad m => OrgParser m Text
    exampleLine = try $ exampleLineStart *> anyLine
@@ -576,10 +575,10 @@
 rawOrgLine :: PandocMonad m => OrgParser m (F Blocks)
 rawOrgLine = do
   line <- metaLineStart *> anyLine
-  returnF $ B.rawBlock "org" $ ("#+" <> line)
+  returnF $ B.rawBlock "org" $ "#+" <> line
 
 commentLine :: Monad m => OrgParser m Blocks
-commentLine = commentLineStart *> anyLine *> pure mempty
+commentLine = commentLineStart *> anyLine $> mempty
 
 
 --
@@ -620,7 +619,7 @@
   -- tables start at first non-space character on the line
   let isFirstInListItem st = orgStateParserContext st == ListItemState &&
                              isNothing (orgStateLastPreCharPos st)
-  guard =<< not . isFirstInListItem <$> getState
+  guard . not . isFirstInListItem =<< getState
   blockAttrs <- blockAttributes
   lookAhead tableStart
   rows <- tableRows
@@ -648,12 +647,12 @@
              (TableFoot nullAttr [])
  where
    toRow = Row nullAttr . map B.simpleCell
-   toHeaderRow l = if null l then [] else [toRow l]
+   toHeaderRow l = [toRow l | not (null l)]
    convertColProp :: Maybe Int -> ColumnProperty -> (Alignment, ColWidth)
    convertColProp totalWidth colProp =
      let
        align' = fromMaybe AlignDefault $ columnAlignment colProp
-       width' = (\w t -> (fromIntegral w / fromIntegral t))
+       width' = (\w t -> fromIntegral w / fromIntegral t)
                 <$> columnRelWidth colProp
                 <*> totalWidth
      in (align', maybe ColWidthDefault ColWidth width')
@@ -691,9 +690,9 @@
 
 tableAlignFromChar :: Monad m => OrgParser m Alignment
 tableAlignFromChar = try $
-  choice [ char 'l' *> return AlignLeft
-         , char 'c' *> return AlignCenter
-         , char 'r' *> return AlignRight
+  choice [ char 'l' $> AlignLeft
+         , char 'c' $> AlignCenter
+         , char 'r' $> AlignRight
          ]
 
 tableHline :: Monad m => OrgParser m OrgTableRow
@@ -796,13 +795,13 @@
   -- Make sure we are not looking at a headline
   notFollowedBy' headerStart
   ils <- inlines
-  nl <- option False (newline *> return True)
+  nl <- option False (newline $> True)
   -- Read block as paragraph, except if we are in a list context and the block
   -- is directly followed by a list item, in which case the block is read as
   -- plain text.
   try (guard nl
        *> notFollowedBy (inList *> (orderedListStart <|> bulletListStart))
-       *> return (B.para <$> ils))
+       $> (B.para <$> ils))
     <|>  return (B.plain <$> ils)
 
 
diff --git a/src/Text/Pandoc/Readers/Org/ParserState.hs b/src/Text/Pandoc/Readers/Org/ParserState.hs
--- a/src/Text/Pandoc/Readers/Org/ParserState.hs
+++ b/src/Text/Pandoc/Readers/Org/ParserState.hs
@@ -122,7 +122,7 @@
   , orgMacros                    :: M.Map Text Macro
   }
 
-data OrgParserLocal = OrgParserLocal
+newtype OrgParserLocal = OrgParserLocal
   { orgLocalQuoteContext :: QuoteContext
   }
 
diff --git a/src/Text/Pandoc/Readers/Org/Shared.hs b/src/Text/Pandoc/Readers/Org/Shared.hs
--- a/src/Text/Pandoc/Readers/Org/Shared.hs
+++ b/src/Text/Pandoc/Readers/Org/Shared.hs
@@ -58,9 +58,7 @@
 originalLang :: Text -> [(Text, Text)]
 originalLang lang =
   let transLang = translateLang lang
-  in if transLang == lang
-     then []
-     else [("org-language", lang)]
+  in [("org-language", lang) | transLang /= lang]
 
 -- | Translate from Org-mode's programming language identifiers to those used
 -- by Pandoc.  This is useful to allow for proper syntax highlighting in
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -164,7 +164,7 @@
                         , stateIdentifiers = mempty }
   -- now parse it for real...
   blocks <- B.toList <$> parseBlocks
-  citations <- (sort . M.toList . stateCitations) <$> getState
+  citations <- sort . M.toList . stateCitations <$> getState
   citationItems <- mapM parseCitation citations
   let refBlock = [Div ("citations",[],[]) $
                  B.toList $ B.definitionList citationItems | not (null citationItems)]
@@ -758,7 +758,12 @@
             children <- case body of
                 "" -> block
                 _  -> parseFromString' parseBlocks  body'
-            return $ B.divWith attrs children
+            return $
+              case B.toList children of
+                [Header lev attrs' ils]
+                  | T.null body -> -- # see #6699
+                     B.headerWith (attrs' <> attrs) lev (B.fromList ils)
+                _ -> B.divWith attrs children
         other     -> do
             pos <- getPosition
             logMessage $ SkippedContent (".. " <> other) pos
@@ -823,7 +828,7 @@
                            splitTextBy (`elem` (" ," :: String)) specs
         _ -> replicate numOfCols ColWidthDefault
       toRow = Row nullAttr . map B.simpleCell
-      toHeaderRow l = if null l then [] else [toRow l]
+      toHeaderRow l = [toRow l | not (null l)]
   return $ B.table (B.simpleCaption $ B.plain title)
              (zip (replicate numOfCols AlignDefault) widths)
              (TableHead nullAttr $ toHeaderRow headerRow)
@@ -906,7 +911,7 @@
                                $ splitTextBy (`elem` (" ," :: String)) specs
                  _ -> replicate numOfCols ColWidthDefault
          let toRow = Row nullAttr . map B.simpleCell
-             toHeaderRow l = if null l then [] else [toRow l]
+             toHeaderRow l = [toRow l | not (null l)]
          return $ B.table (B.simpleCaption $ B.plain title)
                           (zip (replicate numOfCols AlignDefault) widths)
                           (TableHead nullAttr $ toHeaderRow headerRow)
@@ -1014,7 +1019,7 @@
 
 codeblock :: Text -> [Text] -> [(Text, Text)] -> Text -> Text -> Bool
           -> RSTParser m Blocks
-codeblock ident classes fields lang body rmTrailingNewlines = do
+codeblock ident classes fields lang body rmTrailingNewlines =
   return $ B.codeBlockWith attribs $ stripTrailingNewlines' body
     where stripTrailingNewlines' = if rmTrailingNewlines
                                      then stripTrailingNewlines
diff --git a/src/Text/Pandoc/Readers/TWiki.hs b/src/Text/Pandoc/Readers/TWiki.hs
--- a/src/Text/Pandoc/Readers/TWiki.hs
+++ b/src/Text/Pandoc/Readers/TWiki.hs
@@ -214,7 +214,7 @@
     listContinuation = notFollowedBy (textStr prefix >> marker) >>
                        string "   " >> lineContent
     parseContent = parseFromString' $ many1 $ nestedList <|> parseInline
-    parseInline = (B.plain . mconcat) <$> many1Till inline (lastNewline <|> newlineBeforeNestedList)
+    parseInline = B.plain . mconcat <$> many1Till inline (lastNewline <|> newlineBeforeNestedList)
     nestedList = list prefix
     lastNewline = try $ char '\n' <* eof
     newlineBeforeNestedList = try $ char '\n' <* lookAhead nestedList
@@ -235,7 +235,7 @@
     columns rows    = replicate (columCount rows) mempty
     columCount rows = length $ head rows
     toRow           = Row nullAttr . map B.simpleCell
-    toHeaderRow l = if null l then [] else [toRow l]
+    toHeaderRow l = [toRow l | not (null l)]
 
 tableParseHeader :: PandocMonad m => TWParser m ((Alignment, ColWidth), B.Blocks)
 tableParseHeader = try $ do
@@ -265,13 +265,13 @@
 tableEndOfRow = lookAhead (try $ char '|' >> char '\n') >> char '|'
 
 tableColumnContent :: PandocMonad m => TWParser m a -> TWParser m B.Blocks
-tableColumnContent end = (B.plain . mconcat) <$> manyTill content (lookAhead $ try end)
+tableColumnContent end = B.plain . mconcat <$> manyTill content (lookAhead $ try end)
   where
     content = continuation <|> inline
     continuation = try $ char '\\' >> newline >> return mempty
 
 blockQuote :: PandocMonad m => TWParser m B.Blocks
-blockQuote = (B.blockQuote . mconcat) <$> parseHtmlContent "blockquote" block
+blockQuote = B.blockQuote . mconcat <$> parseHtmlContent "blockquote" block
 
 noautolink :: PandocMonad m => TWParser m B.Blocks
 noautolink = do
@@ -285,7 +285,7 @@
     parseContent = parseFromString' $ many block
 
 para :: PandocMonad m => TWParser m B.Blocks
-para = (result . mconcat) <$> many1Till inline endOfParaElement
+para = result . mconcat <$> many1Till inline endOfParaElement
  where
    endOfParaElement = lookAhead $ endOfInput <|> endOfPara <|> newBlockElement
    endOfInput       = try $ skipMany blankline >> skipSpaces >> eof
@@ -428,13 +428,13 @@
     innerSpace = try $ many1Char spaceChar <* notFollowedBy end
 
 boldCode :: PandocMonad m => TWParser m B.Inlines
-boldCode = try $ (B.strong . B.code . fromEntities) <$> enclosed (string "==") nestedString
+boldCode = try $ B.strong . B.code . fromEntities <$> enclosed (string "==") nestedString
 
 htmlComment :: PandocMonad m => TWParser m B.Inlines
 htmlComment = htmlTag isCommentTag >> return mempty
 
 code :: PandocMonad m => TWParser m B.Inlines
-code = try $ (B.code . fromEntities) <$> enclosed (char '=') nestedString
+code = try $ B.code . fromEntities <$> enclosed (char '=') nestedString
 
 codeHtml :: PandocMonad m => TWParser m B.Inlines
 codeHtml = do
diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs
--- a/src/Text/Pandoc/Readers/Textile.hs
+++ b/src/Text/Pandoc/Readers/Textile.hs
@@ -282,7 +282,7 @@
 -- break.
 definitionListItem :: PandocMonad m => ParserT Text ParserState m (Inlines, [Blocks])
 definitionListItem = try $ do
-  term <- (mconcat . intersperse B.linebreak) <$> many1 definitionListStart
+  term <- mconcat . intersperse B.linebreak <$> many1 definitionListStart
   def' <- string ":=" *> optional whitespace *> (multilineDef <|> inlineDef)
   return (term, def')
   where inlineDef :: PandocMonad m => ParserT Text ParserState m [Blocks]
@@ -378,7 +378,7 @@
   let nbOfCols = maximum $ map length (headers:rows)
   let aligns = map minimum $ transpose $ map (map (snd . fst)) (headers:rows)
   let toRow = Row nullAttr . map B.simpleCell
-      toHeaderRow l = if null l then [] else [toRow l]
+      toHeaderRow l = [toRow l | not (null l)]
   return $ B.table (B.simpleCaption $ B.plain caption)
     (zip aligns (replicate nbOfCols ColWidthDefault))
     (TableHead nullAttr $ toHeaderRow $ map snd headers)
@@ -439,7 +439,7 @@
                 , link
                 , image
                 , mark
-                , (B.str . T.singleton) <$> characterReference
+                , B.str . T.singleton <$> characterReference
                 , smartPunctuation inline
                 , symbol
                 ]
diff --git a/src/Text/Pandoc/Readers/Txt2Tags.hs b/src/Text/Pandoc/Readers/Txt2Tags.hs
--- a/src/Text/Pandoc/Readers/Txt2Tags.hs
+++ b/src/Text/Pandoc/Readers/Txt2Tags.hs
@@ -267,7 +267,7 @@
   let rowsPadded = map (pad size) rows'
   let headerPadded = if null tableHeader then mempty else pad size tableHeader
   let toRow = Row nullAttr . map B.simpleCell
-      toHeaderRow l = if null l then [] else [toRow l]
+      toHeaderRow l = [toRow l | not (null l)]
   return $ B.table B.emptyCaption
                     (zip aligns (replicate ncolumns ColWidthDefault))
                       (TableHead nullAttr $ toHeaderRow headerPadded)
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -580,7 +580,7 @@
     let kvs' = -- don't touch number if already present
                case lookup "number" kvs of
                   Nothing | numbering
-                          , not ("unnumbered" `elem` classes) ->
+                          , "unnumbered" `notElem` classes ->
                         ("number", T.intercalate "." (map tshow newnum)) : kvs
                   _ -> kvs
     let divattr = (ident, "section":classes, kvs')
@@ -626,11 +626,9 @@
 uniqueIdent :: Extensions -> [Inline] -> Set.Set T.Text -> T.Text
 uniqueIdent exts title' usedIdents =
   if baseIdent `Set.member` usedIdents
-     then case find (\x -> numIdent x `Set.notMember` usedIdents)
-               ([1..60000] :: [Int]) of
-            Just x  -> numIdent x
-            Nothing -> baseIdent
-            -- if we have more than 60,000, allow repeats
+     then maybe baseIdent numIdent
+          $ find (\x -> numIdent x `Set.notMember` usedIdents) ([1..60000] :: [Int])
+          -- if we have more than 60,000, allow repeats
      else baseIdent
   where
     baseIdent = case inlineListToIdentifier exts title' of
diff --git a/src/Text/Pandoc/Templates.hs b/src/Text/Pandoc/Templates.hs
--- a/src/Text/Pandoc/Templates.hs
+++ b/src/Text/Pandoc/Templates.hs
@@ -80,6 +80,7 @@
   let format = T.takeWhile (`notElem` ("+-" :: String)) writer  -- strip off extensions
   case format of
        "native"  -> return ""
+       "csljson" -> return ""
        "json"    -> return ""
        "docx"    -> return ""
        "fb2"     -> return ""
diff --git a/src/Text/Pandoc/Writers.hs b/src/Text/Pandoc/Writers.hs
--- a/src/Text/Pandoc/Writers.hs
+++ b/src/Text/Pandoc/Writers.hs
@@ -24,6 +24,7 @@
     , writeCommonMark
     , writeConTeXt
     , writeCustom
+    , writeCslJson
     , writeDZSlides
     , writeDocbook4
     , writeDocbook5
@@ -86,6 +87,7 @@
 import Text.Pandoc.Writers.AsciiDoc
 import Text.Pandoc.Writers.CommonMark
 import Text.Pandoc.Writers.ConTeXt
+import Text.Pandoc.Writers.CslJson
 import Text.Pandoc.Writers.Custom
 import Text.Pandoc.Writers.Docbook
 import Text.Pandoc.Writers.Docx
@@ -182,6 +184,7 @@
   ,("gfm"          , TextWriter writeCommonMark)
   ,("tei"          , TextWriter writeTEI)
   ,("muse"         , TextWriter writeMuse)
+  ,("csljson"      , TextWriter writeCslJson)
   ]
 
 -- | Retrieve writer, extensions based on formatSpec (format+extensions).
diff --git a/src/Text/Pandoc/Writers/AnnotatedTable.hs b/src/Text/Pandoc/Writers/AnnotatedTable.hs
new file mode 100644
--- /dev/null
+++ b/src/Text/Pandoc/Writers/AnnotatedTable.hs
@@ -0,0 +1,300 @@
+{-# LANGUAGE BangPatterns #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveGeneric #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE TupleSections #-}
+
+{- |
+   Module      : Text.Pandoc.Writers.AnnotatedTable
+   Copyright   : Copyright 2020 Christian Despres
+   License     : GNU GPL, version 2 or above
+
+   Maintainer  : Christian Despres <christian.j.j.despres@gmail.com>
+   Stability   : alpha
+   Portability : portable
+
+Definitions and conversion functions for an intermediate 'Table' and
+related types, which annotates the existing Pandoc 'B.Table' types
+with additional inferred information. For use in writers that need to
+know the details of columns that cells span, row numbers, and the
+cells that are in the row head.
+-}
+
+module Text.Pandoc.Writers.AnnotatedTable
+  ( toTable
+  , fromTable
+  , Table(..)
+  , TableHead(..)
+  , TableBody(..)
+  , TableFoot(..)
+  , HeaderRow(..)
+  , BodyRow(..)
+  , RowNumber(..)
+  , RowHead
+  , RowBody
+  , Cell(..)
+  , ColNumber(..)
+  )
+where
+
+import           Control.Monad.RWS.Strict
+                                         hiding ( (<>) )
+import           Data.Generics                  ( Data
+                                                , Typeable
+                                                )
+import           Data.List.NonEmpty             ( NonEmpty(..) )
+import           GHC.Generics                   ( Generic )
+import qualified Text.Pandoc.Builder           as B
+
+-- | An annotated table type, corresponding to the Pandoc 'B.Table'
+-- constructor and the HTML @\<table\>@ element. It records the data
+-- of the columns that cells span, the cells in the row head, the row
+-- numbers of rows, and the column numbers of cells, in addition to
+-- the data in a 'B.Table'. The type itself does not enforce any
+-- guarantees about the consistency of this data. Use 'toTable' to
+-- produce a 'Table' from a Pandoc 'B.Table'.
+data Table = Table B.Attr B.Caption [B.ColSpec] TableHead [TableBody] TableFoot
+  deriving (Eq, Ord, Read, Show, Typeable, Data, Generic)
+
+-- | An annotated table head, corresponding to a Pandoc 'B.TableHead'
+-- and the HTML @\<thead\>@ element.
+data TableHead = TableHead B.Attr [HeaderRow]
+  deriving (Eq, Ord, Read, Show, Typeable, Data, Generic)
+
+-- | An annotated table body, with an intermediate head and body,
+-- corresponding to a Pandoc 'B.TableBody' and the HTML @\<tbody\>@
+-- element.
+data TableBody = TableBody B.Attr B.RowHeadColumns [HeaderRow] [BodyRow]
+  deriving (Eq, Ord, Read, Show, Typeable, Data, Generic)
+
+-- | An annotated table foot, corresponding to a Pandoc 'B.TableFoot'
+-- and the HTML @\<tfoot\>@ element.
+data TableFoot = TableFoot B.Attr [HeaderRow]
+  deriving (Eq, Ord, Read, Show, Typeable, Data, Generic)
+
+-- | An annotated header row, corresponding to a Pandoc 'B.Row' and
+-- the HTML @\<tr\>@ element, and also recording the row number of the
+-- row. All the cells in a 'HeaderRow' are header (@\<th\>@) cells.
+data HeaderRow = HeaderRow B.Attr RowNumber [Cell]
+  deriving (Eq, Ord, Read, Show, Typeable, Data, Generic)
+
+-- | An annotated body row, corresponding to a Pandoc 'B.Row' and the
+-- HTML @\<tr\>@ element, and also recording its row number and
+-- separating the row head cells from the row body cells.
+data BodyRow = BodyRow B.Attr RowNumber RowHead RowBody
+  deriving (Eq, Ord, Read, Show, Typeable, Data, Generic)
+
+-- | The row number of a row. Note that rows are numbered continuously
+-- from zero from the start of the table, so the first row in a table
+-- body, for instance, may have a large 'RowNumber'.
+newtype RowNumber = RowNumber Int
+  deriving (Eq, Ord, Read, Show, Typeable, Data, Generic, Num, Enum)
+
+-- | The head of a body row; the portion of the row lying in the stub
+-- of the 'TableBody'. Its cells correspond to HTML @\<th\>@ cells.
+type RowHead = [Cell]
+
+-- | The body of a body row; the portion of the row lying after the
+-- stub of the 'TableBody'. Its cells correspond to HTML @\<td\>@
+-- cells.
+type RowBody = [Cell]
+
+-- | An annotated table cell, wrapping a Pandoc 'B.Cell' with its
+-- 'ColNumber' and the 'B.ColSpec' data for the columns that the cell
+-- spans.
+data Cell = Cell (NonEmpty B.ColSpec) ColNumber B.Cell
+  deriving (Eq, Ord, Read, Show, Typeable, Data, Generic)
+
+-- | The column number of a cell, meaning the column number of the
+-- first column that the cell spans, if the table were laid on a
+-- grid. Columns are numbered starting from zero.
+newtype ColNumber = ColNumber Int
+  deriving (Eq, Ord, Read, Show, Typeable, Data, Generic, Num, Enum)
+
+-- | Convert a Pandoc 'B.Table' to an annotated 'Table'. This function
+-- also performs the same normalization that the 'B.table' builder
+-- does (fixing overlapping cells, cells that protrude out of their
+-- table section, and so on). If the input table happens to satisfy
+-- the conditions that 'B.table' guarantees, then the resulting
+-- 'Table' will be identical, save for the addition of the inferred
+-- table information.
+toTable
+  :: B.Attr
+  -> B.Caption
+  -> [B.ColSpec]
+  -> B.TableHead
+  -> [B.TableBody]
+  -> B.TableFoot
+  -> Table
+toTable attr cap cs th tbs tf = Table attr cap cs th' tbs' tf'
+ where
+  (th', tbs', tf') = fst $ evalRWS (annotateTable th tbs tf) (cs, length cs) 0
+
+-- | Internal monad for annotating a table, passing in the 'B.ColSpec'
+-- data for the table, the grid width, and the current 'RowNumber' to
+-- be referenced or updated.
+type AnnM a = RWS ([B.ColSpec], Int) () RowNumber a
+
+incRowNumber :: AnnM RowNumber
+incRowNumber = do
+  rn <- get
+  put $ rn + 1
+  return rn
+
+annotateTable
+  :: B.TableHead
+  -> [B.TableBody]
+  -> B.TableFoot
+  -> AnnM (TableHead, [TableBody], TableFoot)
+annotateTable th tbs tf = do
+  th'  <- annotateTableHead th
+  tbs' <- traverse annotateTableBody tbs
+  tf'  <- annotateTableFoot tf
+  return (th', tbs', tf')
+
+annotateTableHead :: B.TableHead -> AnnM TableHead
+annotateTableHead (B.TableHead attr rows) =
+  TableHead attr <$> annotateHeaderSection rows
+
+annotateTableBody :: B.TableBody -> AnnM TableBody
+annotateTableBody (B.TableBody attr rhc th tb) = do
+  twidth <- asks snd
+  let rhc' = max 0 $ min (B.RowHeadColumns twidth) rhc
+  th' <- annotateHeaderSection th
+  tb' <- annotateBodySection rhc' tb
+  return $ TableBody attr rhc' th' tb'
+
+annotateTableFoot :: B.TableFoot -> AnnM TableFoot
+annotateTableFoot (B.TableFoot attr rows) =
+  TableFoot attr <$> annotateHeaderSection rows
+
+annotateHeaderSection :: [B.Row] -> AnnM [HeaderRow]
+annotateHeaderSection rows = do
+  colspec <- asks fst
+  let hangcolspec = (1, ) <$> colspec
+  annotateHeaderSection' hangcolspec id $ B.clipRows rows
+ where
+  annotateHeaderSection' oldHang acc (B.Row attr cells : rs) = do
+    let (_, newHang, cells', _) =
+          annotateRowSection 0 oldHang $ cells <> repeat B.emptyCell
+    n <- incRowNumber
+    let annRow = HeaderRow attr n cells'
+    annotateHeaderSection' newHang (acc . (annRow :)) rs
+  annotateHeaderSection' _ acc [] = return $ acc []
+
+annotateBodySection :: B.RowHeadColumns -> [B.Row] -> AnnM [BodyRow]
+annotateBodySection (B.RowHeadColumns rhc) rows = do
+  colspec <- asks fst
+  let colspec'             = (1, ) <$> colspec
+  let (stubspec, bodyspec) = splitAt rhc colspec'
+  normalizeBodySection' stubspec bodyspec id $ B.clipRows rows
+ where
+  normalizeBodySection' headHang bodyHang acc (B.Row attr cells : rs) = do
+    let (colnum, headHang', rowStub, cells') =
+          annotateRowSection 0 headHang $ cells <> repeat B.emptyCell
+    let (_, bodyHang', rowBody, _) = annotateRowSection colnum bodyHang cells'
+    n <- incRowNumber
+    let annRow = BodyRow attr n rowStub rowBody
+    normalizeBodySection' headHang' bodyHang' (acc . (annRow :)) rs
+  normalizeBodySection' _ _ acc [] = return $ acc []
+
+-- | Lay out a section of a 'Table' row on a grid row, annotating the
+-- cells with the 'B.ColSpec' data for the columns that they
+-- span. Performs the same normalization as 'B.placeRowSection'.
+annotateRowSection
+  :: ColNumber -- ^ The current column number
+  -> [(B.RowSpan, B.ColSpec)] -- ^ The overhang of the previous grid row,
+                              -- with column data
+  -> [B.Cell] -- ^ The cells to annotate
+  -> (ColNumber, [(B.RowSpan, B.ColSpec)], [Cell], [B.Cell]) -- ^ The new
+                                                             -- column
+                                                             -- number,
+                                                             -- overhang,
+                                                             -- annotated
+                                                             -- cells,
+                                                             -- and
+                                                             -- remaining
+                                                             -- cells
+annotateRowSection !colnum oldHang cells
+  -- If the grid has overhang at our position, try to re-lay in
+  -- the next position.
+  | (o, colspec) : os <- oldHang
+  , o > 1
+  = let (colnum', newHang, newCell, cells') =
+            annotateRowSection (colnum + 1) os cells
+    in  (colnum', (o - 1, colspec) : newHang, newCell, cells')
+  -- Otherwise if there is any available width, place the cell and
+  -- continue.
+  | c : cells' <- cells
+  , (h, w) <- getDim c
+  , w' <- max 1 w
+  , (w'', cellHang@(chStart : chRest), oldHang') <- splitCellHang h w' oldHang
+  = let c'      = setW w'' c
+        annCell = Cell (snd <$> chStart :| chRest) colnum c'
+        colnum' = colnum + ColNumber (getColSpan w'')
+        (colnum'', newHang, newCells, remainCells) =
+            annotateRowSection colnum' oldHang' cells'
+    in  (colnum'', cellHang <> newHang, annCell : newCells, remainCells)
+  -- Otherwise there is no room in the section
+  | otherwise
+  = (colnum, [], [], cells)
+ where
+  getColSpan (B.ColSpan x) = x
+  getDim (B.Cell _ _ h w _) = (h, w)
+  setW w (B.Cell a b h _ c) = B.Cell a b h w c
+
+-- | In @'splitCellHang' rs cs coldata@, with @rs@ the height of a
+-- cell that lies at the beginning of @coldata@, and @cs@ its width
+-- (which is not assumed to fit in the available space), return the
+-- actual width of the cell (what will fit in the available space),
+-- the data for the columns that the cell spans (including updating
+-- the overhang to equal @rs@), and the remaining column data.
+splitCellHang
+  :: B.RowSpan
+  -> B.ColSpan
+  -> [(B.RowSpan, B.ColSpec)]
+  -> (B.ColSpan, [(B.RowSpan, B.ColSpec)], [(B.RowSpan, B.ColSpec)])
+splitCellHang h n = go 0
+ where
+  go acc ((1, spec) : ls) | acc < n =
+    let (acc', hang, ls') = go (acc + 1) ls in (acc', (h, spec) : hang, ls')
+  go acc l = (acc, [], l)
+
+-- | Convert an annotated 'Table' to a Pandoc
+-- 'B.Table'. This is the inverse of 'toTable' on
+-- well-formed tables (i.e. tables satisfying the guarantees of
+-- 'B.table').
+fromTable
+  :: Table
+  -> ( B.Attr
+     , B.Caption
+     , [B.ColSpec]
+     , B.TableHead
+     , [B.TableBody]
+     , B.TableFoot
+     )
+fromTable (Table attr cap cs th tbs tf) = (attr, cap, cs, th', tbs', tf')
+ where
+  th'  = fromTableHead th
+  tbs' = map fromTableBody tbs
+  tf'  = fromTableFoot tf
+
+fromTableHead :: TableHead -> B.TableHead
+fromTableHead (TableHead attr rows) = B.TableHead attr $ fromHeaderRow <$> rows
+
+fromTableBody :: TableBody -> B.TableBody
+fromTableBody (TableBody attr rhc th tb) =
+  B.TableBody attr rhc (fromHeaderRow <$> th) (fromBodyRow <$> tb)
+
+fromTableFoot :: TableFoot -> B.TableFoot
+fromTableFoot (TableFoot attr rows) = B.TableFoot attr $ fromHeaderRow <$> rows
+
+fromHeaderRow :: HeaderRow -> B.Row
+fromHeaderRow (HeaderRow attr _ cells) = B.Row attr $ fromCell <$> cells
+
+fromBodyRow :: BodyRow -> B.Row
+fromBodyRow (BodyRow attr _ rh rb) =
+  B.Row attr ((fromCell <$> rh) <> (fromCell <$> rb))
+
+fromCell :: Cell -> B.Cell
+fromCell (Cell _ _ c) = c
diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs
--- a/src/Text/Pandoc/Writers/AsciiDoc.hs
+++ b/src/Text/Pandoc/Writers/AsciiDoc.hs
@@ -66,7 +66,8 @@
 -- | Convert Pandoc to AsciiDoctor compatible AsciiDoc.
 writeAsciiDoctor :: PandocMonad m => WriterOptions -> Pandoc -> m Text
 writeAsciiDoctor opts document =
-  evalStateT (pandocToAsciiDoc opts document) defaultWriterState{ asciidoctorVariant = True }
+  evalStateT (pandocToAsciiDoc opts document)
+    defaultWriterState{ asciidoctorVariant = True }
 
 type ADW = StateT WriterState
 
@@ -138,9 +139,11 @@
 blockToAsciiDoc opts (Plain inlines) = do
   contents <- inlineListToAsciiDoc opts inlines
   return $ contents <> blankline
-blockToAsciiDoc opts (Para [Image attr alt (src,tgt)])
+blockToAsciiDoc opts (Para [Image attr alternate (src,tgt)])
+  -- image::images/logo.png[Company logo, title="blah"]
   | Just tit <- T.stripPrefix "fig:" tgt
-  = blockToAsciiDoc opts (Para [Image attr alt (src,tit)])
+  = (\args -> "image::" <> args <> blankline) <$>
+    imageArguments opts attr alternate src tit
 blockToAsciiDoc opts (Para inlines) = do
   contents <- inlineListToAsciiDoc opts inlines
   -- escape if para starts with ordered list marker
@@ -192,7 +195,8 @@
   let bar = text "____"
   return $ bar $$ chomp contents' $$ bar <> blankline
 blockToAsciiDoc opts (Table _ blkCapt specs thead tbody tfoot) = do
-  let (caption, aligns, widths, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot
+  let (caption, aligns, widths, headers, rows) =
+        toLegacyTable blkCapt specs thead tbody tfoot
   caption' <- inlineListToAsciiDoc opts caption
   let caption'' = if null caption
                      then empty
@@ -381,7 +385,10 @@
 data SpacyLocation = End | Start
 
 -- | Convert list of Pandoc inline elements to asciidoc.
-inlineListToAsciiDoc :: PandocMonad m => WriterOptions -> [Inline] -> ADW m (Doc Text)
+inlineListToAsciiDoc :: PandocMonad m =>
+                        WriterOptions ->
+                        [Inline] ->
+                        ADW m (Doc Text)
 inlineListToAsciiDoc opts lst = do
   oldIntraword <- gets intraword
   setIntraword False
@@ -518,27 +525,8 @@
   return $ if useAuto
               then literal srcSuffix
               else prefix <> literal src <> "[" <> linktext <> "]"
-inlineToAsciiDoc opts (Image attr alternate (src, tit)) = do
--- image:images/logo.png[Company logo, title="blah"]
-  let txt = if null alternate || (alternate == [Str ""])
-               then [Str "image"]
-               else alternate
-  linktext <- inlineListToAsciiDoc opts txt
-  let linktitle = if T.null tit
-                     then empty
-                     else ",title=\"" <> literal tit <> "\""
-      showDim dir = case dimension dir attr of
-                      Just (Percent a) ->
-                        ["scaledwidth=" <> text (show (Percent a))]
-                      Just dim         ->
-                        [text (show dir) <> "=" <> literal (showInPixel opts dim)]
-                      Nothing          ->
-                        []
-      dimList = showDim Width ++ showDim Height
-      dims = if null dimList
-                then empty
-                else "," <> mconcat (intersperse "," dimList)
-  return $ "image:" <> literal src <> "[" <> linktext <> linktitle <> dims <> "]"
+inlineToAsciiDoc opts (Image attr alternate (src, tit)) =
+  ("image:" <>) <$> imageArguments opts attr alternate src tit
 inlineToAsciiDoc opts (Note [Para inlines]) =
   inlineToAsciiDoc opts (Note [Plain inlines])
 inlineToAsciiDoc opts (Note [Plain inlines]) = do
@@ -556,3 +544,30 @@
        let modifier = brackets $ literal $ T.unwords $
             [ "#" <> ident | not (T.null ident)] ++ map ("." <>) classes
        return $ modifier <> marker <> contents <> marker
+
+-- | Provides the arguments for both `image:` and `image::`
+-- e.g.: sunset.jpg[Sunset,300,200]
+imageArguments :: PandocMonad m => WriterOptions ->
+  Attr -> [Inline] -> Text -> Text ->
+  ADW m (Doc Text)
+imageArguments opts attr altText src title = do
+  let txt = if null altText || (altText == [Str ""])
+               then [Str "image"]
+               else altText
+  linktext <- inlineListToAsciiDoc opts txt
+  let linktitle = if T.null title
+                     then empty
+                     else ",title=\"" <> literal title <> "\""
+      showDim dir = case dimension dir attr of
+                      Just (Percent a) ->
+                        ["scaledwidth=" <> text (show (Percent a))]
+                      Just dim         ->
+                        [text (show dir) <> "=" <>
+                          literal (showInPixel opts dim)]
+                      Nothing          ->
+                        []
+      dimList = showDim Width ++ showDim Height
+      dims = if null dimList
+                then empty
+                else "," <> mconcat (intersperse "," dimList)
+  return $ literal src <> "[" <> linktext <> linktitle <> dims <> "]"
diff --git a/src/Text/Pandoc/Writers/CommonMark.hs b/src/Text/Pandoc/Writers/CommonMark.hs
--- a/src/Text/Pandoc/Writers/CommonMark.hs
+++ b/src/Text/Pandoc/Writers/CommonMark.hs
@@ -1,5 +1,3 @@
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE ViewPatterns      #-}
 {- |
    Module      : Text.Pandoc.Writers.CommonMark
    Copyright   : Copyright (C) 2015-2020 John MacFarlane
diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs
--- a/src/Text/Pandoc/Writers/ConTeXt.hs
+++ b/src/Text/Pandoc/Writers/ConTeXt.hs
@@ -209,7 +209,7 @@
                                      <> literal lng <> "]" $$ txt $$ "\\stop"
                        Nothing  -> txt
       wrapBlank txt = blankline <> txt <> blankline
-  (wrapBlank . wrapLang . wrapDir . wrapRef) <$> blockListToConTeXt bs
+  wrapBlank . wrapLang . wrapDir . wrapRef <$> blockListToConTeXt bs
 blockToConTeXt (BulletList lst) = do
   contents <- mapM listItemToConTeXt lst
   return $ ("\\startitemize" <> if isTightList lst
@@ -332,7 +332,7 @@
                          AlignDefault -> empty
 
 listItemToConTeXt :: PandocMonad m => [Block] -> WM m (Doc Text)
-listItemToConTeXt list = (("\\item" $$) . nest 2) <$> blockListToConTeXt list
+listItemToConTeXt list = ("\\item" $$) . nest 2 <$> blockListToConTeXt list
 
 defListItemToConTeXt :: PandocMonad m => ([Inline], [[Block]]) -> WM m (Doc Text)
 defListItemToConTeXt (term, defs) = do
@@ -487,7 +487,7 @@
                        Just lng -> braces ("\\language" <>
                                            brackets (literal lng) <> txt)
                        Nothing -> txt
-  (wrapLang . wrapDir) <$> inlineListToConTeXt ils
+  wrapLang . wrapDir <$> inlineListToConTeXt ils
 
 -- | Craft the section header, inserting the section reference, if supplied.
 sectionHeader :: PandocMonad m
diff --git a/src/Text/Pandoc/Writers/CslJson.hs b/src/Text/Pandoc/Writers/CslJson.hs
new file mode 100644
--- /dev/null
+++ b/src/Text/Pandoc/Writers/CslJson.hs
@@ -0,0 +1,89 @@
+{-# LANGUAGE OverloadedStrings #-}
+{- |
+   Module      : Text.Pandoc.Writers.CslJson
+   Copyright   : Copyright (C) 2020 John MacFarlane
+   License     : GNU GPL, version 2 or above
+
+   Maintainer  : John MacFarlane <jgm@berkeley.edu>
+   Stability   : alpha
+   Portability : portable
+
+Conversion of references from 'Pandoc' metadata to CSL JSON:
+<https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html>.
+
+Note that this writer ignores everything in the body of the
+document and everything in the metadata except `references`.
+It assumes that the `references` field is a list with the structure
+of a CSL JSON bibliography.
+-}
+module Text.Pandoc.Writers.CslJson ( writeCslJson )
+where
+import Data.Text (Text)
+import qualified Data.Text as T
+import qualified Text.Pandoc.UTF8 as UTF8
+import Text.Pandoc.Error
+import Text.Pandoc.Class
+import Control.Monad.Except (throwError)
+import Data.ByteString.Lazy (toStrict)
+import Data.ByteString (ByteString)
+import Text.Pandoc.Definition
+import Text.Pandoc.Builder as B
+import Text.Pandoc.Citeproc.MetaValue (metaValueToReference, metaValueToText)
+import Citeproc (parseLang, Locale, Reference(..), Lang(..))
+import Control.Monad.Identity
+import Citeproc.Locale (getLocale)
+import Citeproc.CslJson
+import Text.Pandoc.Options (WriterOptions)
+import Data.Maybe (fromMaybe, mapMaybe)
+import Data.Aeson.Encode.Pretty         (Config (..), Indent (Spaces),
+                                         NumberFormat (Generic),
+                                         defConfig, encodePretty')
+
+writeCslJson :: PandocMonad m => WriterOptions -> Pandoc -> m Text
+writeCslJson _opts (Pandoc meta _) = do
+  let lang = fromMaybe (Lang "en" (Just "US")) $
+              parseLang <$> (lookupMeta "lang" meta >>= metaValueToText)
+  locale <- case getLocale lang of
+               Left e  -> throwError $ PandocCiteprocError e
+               Right l -> return l
+  case lookupMeta "references" meta of
+    Just (MetaList rs) -> return $ (UTF8.toText $
+         toCslJson locale (mapMaybe metaValueToReference rs))
+          <> "\n"
+    _ -> throwError $ PandocAppError "No references field"
+
+fromInlines :: [Inline] -> CslJson Text
+fromInlines = foldMap fromInline . B.fromList
+
+fromInline :: Inline -> CslJson Text
+fromInline (Str t) = CslText t
+fromInline (Emph ils) = CslItalic (fromInlines ils)
+fromInline (Strong ils) = CslBold (fromInlines ils)
+fromInline (Underline ils) = CslUnderline (fromInlines ils)
+fromInline (Strikeout ils) = fromInlines ils
+fromInline (Superscript ils) = CslSup (fromInlines ils)
+fromInline (Subscript ils) = CslSub (fromInlines ils)
+fromInline (SmallCaps ils) = CslSmallCaps (fromInlines ils)
+fromInline (Quoted _ ils) = CslQuoted (fromInlines ils)
+fromInline (Cite _ ils) = fromInlines ils
+fromInline (Code _ t) = CslText t
+fromInline Space = CslText " "
+fromInline SoftBreak = CslText " "
+fromInline LineBreak = CslText "\n"
+fromInline (Math _ t) = CslText t
+fromInline (RawInline _ _) = CslEmpty
+fromInline (Link _ ils _) = fromInlines ils
+fromInline (Image _ ils _) = fromInlines ils
+fromInline (Note _) = CslEmpty
+fromInline (Span (_,[cl],_) ils)
+  | "csl-" `T.isPrefixOf` cl = CslDiv cl (fromInlines ils)
+fromInline (Span _ ils) = fromInlines ils
+
+toCslJson :: Locale -> [Reference Inlines] -> ByteString
+toCslJson locale = toStrict .
+  encodePretty' defConfig{ confIndent = Spaces 2
+                         , confCompare = compare
+                         , confNumFormat = Generic }
+  . map (runIdentity .  traverse (return .
+                                  renderCslJson False locale .
+                                  foldMap fromInline))
diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs
--- a/src/Text/Pandoc/Writers/Docbook.hs
+++ b/src/Text/Pandoc/Writers/Docbook.hs
@@ -179,7 +179,7 @@
 blockToDocbook opts (Div (ident,_,_) [Para lst]) =
   let attribs = [("id", ident) | not (T.null ident)] in
   if hasLineBreaks lst
-     then (flush . nowrap . inTags False "literallayout" attribs)
+     then flush . nowrap . inTags False "literallayout" attribs
                          <$> inlinesToDocbook opts lst
      else inTags True "para" attribs <$> inlinesToDocbook opts lst
 blockToDocbook opts (Div (ident,_,_) bs) = do
@@ -206,7 +206,7 @@
              (imageToDocbook opts attr src) $$
            inTagsSimple "textobject" (inTagsSimple "phrase" alt))
 blockToDocbook opts (Para lst)
-  | hasLineBreaks lst = (flush . nowrap . inTagsSimple "literallayout")
+  | hasLineBreaks lst = flush . nowrap . inTagsSimple "literallayout"
                         <$> inlinesToDocbook opts lst
   | otherwise         = inTagsIndented "para" <$> inlinesToDocbook opts lst
 blockToDocbook opts (LineBlock lns) =
@@ -277,7 +277,7 @@
   head' <- if all null headers
               then return empty
               else inTagsIndented "thead" <$> tableRowToDocbook opts headers
-  body' <- (inTagsIndented "tbody" . vcat) <$>
+  body' <- inTagsIndented "tbody" . vcat <$>
               mapM (tableRowToDocbook opts) rows
   return $ inTagsIndented tableType $ captionDoc $$
         inTags True "tgroup" [("cols", tshow (length aligns))] (
@@ -305,14 +305,14 @@
                   -> [[Block]]
                   -> DB m (Doc Text)
 tableRowToDocbook opts cols =
-  (inTagsIndented "row" . vcat) <$> mapM (tableItemToDocbook opts) cols
+  inTagsIndented "row" . vcat <$> mapM (tableItemToDocbook opts) cols
 
 tableItemToDocbook :: PandocMonad m
                    => WriterOptions
                    -> [Block]
                    -> DB m (Doc Text)
 tableItemToDocbook opts item =
-  (inTags True "entry" [] . vcat) <$> mapM (blockToDocbook opts) item
+  inTags True "entry" [] . vcat <$> mapM (blockToDocbook opts) item
 
 -- | Convert a list of inline elements to Docbook.
 inlinesToDocbook :: PandocMonad m => WriterOptions -> [Inline] -> DB m (Doc Text)
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -3,6 +3,7 @@
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE ViewPatterns        #-}
 {-# LANGUAGE FlexibleContexts    #-}
+{-# LANGUAGE LambdaCase          #-}
 {-# LANGUAGE OverloadedStrings   #-}
 {- |
    Module      : Text.Pandoc.Writers.Docx
@@ -848,8 +849,16 @@
 
 -- | Convert a list of Pandoc blocks to OpenXML.
 blocksToOpenXML :: (PandocMonad m) => WriterOptions -> [Block] -> WS m [Element]
-blocksToOpenXML opts bls = concat `fmap` mapM (blockToOpenXML opts) bls
+blocksToOpenXML opts = fmap concat . mapM (blockToOpenXML opts) . separateTables
 
+-- Word combines adjacent tables unless you put an empty paragraph between
+-- them.  See #4315.
+separateTables :: [Block] -> [Block]
+separateTables [] = []
+separateTables (x@Table{}:xs@(Table{}:_)) =
+  x : RawBlock (Format "openxml") "<w:p />" : separateTables xs
+separateTables (x:xs) = x : separateTables xs
+
 pStyleM :: (PandocMonad m) => ParaStyleName -> WS m XML.Element
 pStyleM styleName = do
   pStyleMap <- gets (smParaStyle . stStyleMaps)
@@ -1022,7 +1031,7 @@
   let rowwidth = fullrow * sum widths
   let mkgridcol w = mknode "w:gridCol"
                        [("w:w", show (floor (textwidth * w) :: Integer))] ()
-  let hasHeader = any (not . null) headers
+  let hasHeader = not $ all null headers
   modify $ \s -> s { stInTable = False }
   return $
     caption' ++
@@ -1079,11 +1088,20 @@
 listItemToOpenXML opts numid (first:rest) = do
   oldInList <- gets stInList
   modify $ \st -> st{ stInList = True }
-  first' <- withNumId numid $ blockToOpenXML opts first
+  let isListBlock = \case
+        BulletList{}  -> True
+        OrderedList{} -> True
+        _             -> False
+  -- Prepend an empty string if the first entry is another
+  -- list. Otherwise the outer bullet will disappear.
+  let (first', rest') = if isListBlock first
+                           then (Plain [Str ""] , first:rest)
+                           else (first, rest)
+  first'' <- withNumId numid $ blockToOpenXML opts first'
   -- baseListId is the code for no list marker:
-  rest'  <- withNumId baseListId $ blocksToOpenXML opts rest
+  rest''  <- withNumId baseListId $ blocksToOpenXML opts rest'
   modify $ \st -> st{ stInList = oldInList }
-  return $ first' ++ rest'
+  return $ first'' ++ rest''
 
 alignmentToString :: Alignment -> [Char]
 alignmentToString alignment = case alignment of
@@ -1176,6 +1194,18 @@
   formattedString str
 inlineToOpenXML' opts Space = inlineToOpenXML opts (Str " ")
 inlineToOpenXML' opts SoftBreak = inlineToOpenXML opts (Str " ")
+inlineToOpenXML' opts (Span ("",["csl-block"],[]) ils) =
+  inlinesToOpenXML opts ils
+inlineToOpenXML' opts (Span ("",["csl-left-margin"],[]) ils) =
+  inlinesToOpenXML opts ils
+inlineToOpenXML' opts (Span ("",["csl-right-inline"],[]) ils) =
+  ([mknode "w:r" []
+    (mknode "w:t"
+      [("xml:space","preserve")]
+      ("\t" :: String))] ++)
+    <$> inlinesToOpenXML opts ils
+inlineToOpenXML' opts (Span ("",["csl-indent"],[]) ils) =
+  inlinesToOpenXML opts ils
 inlineToOpenXML' _ (Span (ident,["comment-start"],kvs) ils) = do
   -- prefer the "id" in kvs, since that is the one produced by the docx
   -- reader.
@@ -1214,33 +1244,29 @@
                   else id)
       getChangeAuthorDate = do
         defaultAuthor <- asks envChangesAuthor
-        defaultDate <- asks envChangesDate
         let author = fromMaybe defaultAuthor (lookup "author" kvs)
-            date   = fromMaybe defaultDate (lookup "date" kvs)
-        return (author, date)
+        let mdate = lookup "date" kvs
+        return $ ("w:author", T.unpack author) :
+                   maybe [] (\date -> [("w:date", T.unpack date)]) mdate
   insmod <- if "insertion" `elem` classes
                then do
-                 (author, date) <- getChangeAuthorDate
+                 changeAuthorDate <- getChangeAuthorDate
                  insId <- gets stInsId
                  modify $ \s -> s{stInsId = insId + 1}
                  return $ \f -> do
                    x <- f
                    return [ mknode "w:ins"
-                              [("w:id", show insId),
-                              ("w:author", T.unpack author),
-                              ("w:date", T.unpack date)] x ]
+                              (("w:id", show insId) : changeAuthorDate) x]
                else return id
   delmod <- if "deletion" `elem` classes
                then do
-                 (author, date) <- getChangeAuthorDate
+                 changeAuthorDate <- getChangeAuthorDate
                  delId <- gets stDelId
                  modify $ \s -> s{stDelId = delId + 1}
                  return $ \f -> local (\env->env{envInDel=True}) $ do
                    x <- f
                    return [mknode "w:del"
-                           [("w:id", show delId),
-                           ("w:author", T.unpack author),
-                           ("w:date", T.unpack date)] x]
+                           (("w:id", show delId) : changeAuthorDate) x]
                else return id
   contents <- insmod $ delmod $ dirmod $ stylemod $ pmod
                      $ inlinesToOpenXML opts ils
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs
--- a/src/Text/Pandoc/Writers/EPUB.hs
+++ b/src/Text/Pandoc/Writers/EPUB.hs
@@ -62,7 +62,7 @@
                           ToContext(toVal), Val(..))
 
 -- A Chapter includes a list of blocks.
-data Chapter = Chapter [Block]
+newtype Chapter = Chapter [Block]
   deriving (Show)
 
 data EPUBState = EPUBState {
@@ -711,10 +711,10 @@
                          | writerTableOfContents opts ] ++
                   map chapterRefNode chapterEntries)
           , unode "guide" $
-             [ unode "reference" !
-                   [("type","toc"),("title", tocTitle),
-                    ("href","nav.xhtml")] $ ()
-             ] ++
+             (unode "reference" !
+                 [("type","toc"),("title", tocTitle),
+                  ("href","nav.xhtml")] $ ()
+             ) :
              [ unode "reference" !
                    [("type","cover")
                    ,("title","Cover")
@@ -838,14 +838,12 @@
                                 ] | writerTableOfContents opts
                               ]
                          else []
-  let landmarks = if null landmarkItems
-                     then []
-                     else [RawBlock (Format "html") $ TS.pack $ ppElement $
-                            unode "nav" ! [("epub:type","landmarks")
-                                          ,("id","landmarks")
-                                          ,("hidden","hidden")] $
-                            [ unode "ol" landmarkItems ]
-                          ]
+  let landmarks = [RawBlock (Format "html") $ TS.pack $ ppElement $
+                    unode "nav" ! [("epub:type","landmarks")
+                                  ,("id","landmarks")
+                                  ,("hidden","hidden")] $
+                    [ unode "ol" landmarkItems ]
+                  | not (null landmarkItems)]
   navData <- lift $ writeHtml opts'{ writerVariables =
                      Context (M.fromList [("navpage", toVal' "true")])
                      <> cssvars False <> vars }
@@ -940,7 +938,7 @@
           | version == EPUB2 = [dcNode "identifier" !
               (("id",id') : maybe [] (\x -> [("opf:scheme", x)]) scheme) $
               txt]
-          | otherwise = [dcNode "identifier" ! [("id",id')] $ txt] ++
+          | otherwise = (dcNode "identifier" ! [("id",id')] $ txt) :
               maybe [] ((\x -> [unode "meta" !
                                 [ ("refines",'#':id')
                                 , ("property","identifier-type")
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE LambdaCase          #-}
 {-# LANGUAGE MultiWayIf          #-}
 {-# LANGUAGE OverloadedStrings   #-}
 {-# LANGUAGE ScopedTypeVariables #-}
@@ -30,6 +31,7 @@
 import Control.Monad.State.Strict
 import Data.Char (ord)
 import Data.List (intercalate, intersperse, partition, delete, (\\))
+import Data.List.NonEmpty (NonEmpty((:|)))
 import Data.Maybe (fromMaybe, isJust, isNothing, mapMaybe)
 import qualified Data.Set as Set
 import Data.Text (Text)
@@ -53,6 +55,7 @@
 import Text.Pandoc.Walk
 import Text.Pandoc.Writers.Math
 import Text.Pandoc.Writers.Shared
+import qualified Text.Pandoc.Writers.AnnotatedTable as Ann
 import Text.Pandoc.XML (escapeStringForXML, fromEntities, toEntities,
                         html5Attributes, html4Attributes, rdfaAttributes)
 import qualified Text.Blaze.XHtml5 as H5
@@ -83,6 +86,8 @@
     , stSlideLevel   :: Int     -- ^ Slide level
     , stInSection    :: Bool    -- ^ Content is in a section (revealjs)
     , stCodeBlockNum :: Int     -- ^ Number of code block
+    , stCsl          :: Bool    -- ^ Has CSL references
+    , stCslEntrySpacing :: Maybe Int  -- ^ CSL entry spacing
     }
 
 defaultWriterState :: WriterState
@@ -93,7 +98,9 @@
                                   stSlideVariant = NoSlides,
                                   stSlideLevel = 1,
                                   stInSection = False,
-                                  stCodeBlockNum = 0}
+                                  stCodeBlockNum = 0,
+                                  stCsl = False,
+                                  stCslEntrySpacing = Nothing}
 
 -- Helpers to render HTML with the appropriate function.
 
@@ -307,43 +314,54 @@
                           "/*]]>*/\n")
                           | otherwise -> mempty
                     Nothing -> mempty
+  let mCss :: Maybe [Text] = lookupContext "css" $ metadata
   let context =   (if stHighlighting st
                       then case writerHighlightStyle opts of
                                 Just sty -> defField "highlighting-css"
                                               (T.pack $ styleToCss sty)
                                 Nothing  -> id
-                      else id) $
+                      else id) .
+                  (if stCsl st
+                      then defField "csl-css" True .
+                           (case stCslEntrySpacing st of
+                              Nothing -> id
+                              Just 0  -> id
+                              Just n  ->
+                                defField "csl-entry-spacing"
+                                  (tshow n <> "em"))
+                      else id) .
                   (if stMath st
                       then defField "math" (renderHtml' math)
-                      else id) $
+                      else id) .
                   (case writerHTMLMathMethod opts of
                         MathJax u -> defField "mathjax" True .
                                      defField "mathjaxurl"
                                        (T.takeWhile (/='?') u)
-                        _         -> defField "mathjax" False) $
+                        _         -> defField "mathjax" False) .
                   (case writerHTMLMathMethod opts of
                         PlainMath -> defField "displaymath-css" True
                         WebTeX _  -> defField "displaymath-css" True
-                        _         -> id) $
-                  defField "quotes" (stQuotes st) $
+                        _         -> id) .
+                  defField "document-css" (isNothing mCss && slideVariant == NoSlides) .
+                  defField "quotes" (stQuotes st) .
                   -- for backwards compatibility we populate toc
                   -- with the contents of the toc, rather than a
                   -- boolean:
-                  maybe id (defField "toc") toc $
-                  maybe id (defField "table-of-contents") toc $
-                  defField "author-meta" authsMeta $
+                  maybe id (defField "toc") toc .
+                  maybe id (defField "table-of-contents") toc .
+                  defField "author-meta" authsMeta .
                   maybe id (defField "date-meta")
-                    (normalizeDate dateMeta) $
+                    (normalizeDate dateMeta) .
                   defField "pagetitle"
-                      (stringifyHTML . docTitle $ meta) $
-                  defField "idprefix" (writerIdentifierPrefix opts) $
+                      (stringifyHTML . docTitle $ meta) .
+                  defField "idprefix" (writerIdentifierPrefix opts) .
                   -- these should maybe be set in pandoc.hs
                   defField "slidy-url"
-                    ("https://www.w3.org/Talks/Tools/Slidy2" :: Text) $
-                  defField "slideous-url" ("slideous" :: Text) $
+                    ("https://www.w3.org/Talks/Tools/Slidy2" :: Text) .
+                  defField "slideous-url" ("slideous" :: Text) .
                   defField "revealjs-url" ("https://unpkg.com/reveal.js@^4/" :: Text) $
-                  defField "s5-url" ("s5/default" :: Text) $
-                  defField "html5" (stHtml5 st)
+                  defField "s5-url" ("s5/default" :: Text) .
+                  defField "html5" (stHtml5 st) $
                   metadata
   return (thebody, context)
 
@@ -738,12 +756,17 @@
 blockToHtml opts (Div attr@(ident, classes, kvs') bs) = do
   html5 <- gets stHtml5
   slideVariant <- gets stSlideVariant
+  let isCslBibBody = ident == "refs" || "csl-bib-body" `elem` classes
+  when isCslBibBody $ modify $ \st -> st{ stCsl = True
+                                        , stCslEntrySpacing =
+                                           lookup "entry-spacing" kvs' >>=
+                                           safeRead }
+  let isCslBibEntry = "csl-entry" `elem` classes
   let kvs = [(k,v) | (k,v) <- kvs', k /= "width"] ++
             [("style", "width:" <> w <> ";") | "column" `elem` classes,
              ("width", w) <- kvs'] ++
-            [("role", "doc-bibliography") | ident == "refs" && html5] ++
-            [("role", "doc-biblioentry")
-              | "ref-item" `T.isPrefixOf` ident && html5]
+            [("role", "doc-bibliography") | isCslBibBody && html5] ++
+            [("role", "doc-biblioentry") | isCslBibEntry && html5]
   let speakerNotes = "notes" `elem` classes
   -- we don't want incremental output inside speaker notes, see #1394
   let opts' = if | speakerNotes -> opts{ writerIncremental = False }
@@ -760,7 +783,9 @@
                       -- a newline between the column divs, which throws
                       -- off widths! see #4028
                       mconcat <$> mapM (blockToHtml opts) bs
-                 else blockListToHtml opts' bs
+                 else if isCslBibEntry
+                         then mconcat <$> mapM (cslEntryToHtml opts') bs
+                         else blockListToHtml opts' bs
   let contents' = nl opts >> contents >> nl opts
   let (divtag, classes'') = if html5 && "section" `elem` classes'
                             then (H5.section, filter (/= "section") classes')
@@ -899,96 +924,251 @@
                      return $ mconcat $ nl opts : term' : nl opts :
                                         intersperse (nl opts) defs') lst
   defList opts contents
-blockToHtml opts (Table attr blkCapt specs thead tbody tfoot) = do
-  let (capt, aligns, widths, headers, rows') = toLegacyTable blkCapt specs thead tbody tfoot
-  captionDoc <- if null capt
-                   then return mempty
-                   else do
-                     cs <- inlineListToHtml opts capt
-                     return $ H.caption cs >> nl opts
-  html5 <- gets stHtml5
-  let percent w = show (truncate (100*w) :: Integer) <> "%"
-  let coltags = if all (== 0.0) widths
-                   then mempty
-                   else do
-                     H.colgroup $ do
-                       nl opts
-                       mapM_ (\w -> do
-                            if html5
-                               then H.col ! A.style (toValue $ "width: " <>
-                                                      percent w)
-                               else H.col ! A.width (toValue $ percent w)
-                            nl opts) widths
-                     nl opts
-  head' <- if all null headers
-              then return mempty
-              else do
-                contents <- tableRowToHtml opts aligns 0 headers
-                return $ H.thead (nl opts >> contents) >> nl opts
-  body' <- liftM (\x -> H.tbody (nl opts >> mconcat x)) $
-               zipWithM (tableRowToHtml opts aligns) [1..] rows'
+blockToHtml opts (Table attr caption colspecs thead tbody tfoot) =
+  tableToHtml opts (Ann.toTable attr caption colspecs thead tbody tfoot)
+
+tableToHtml :: PandocMonad m
+            => WriterOptions
+            -> Ann.Table
+            -> StateT WriterState m Html
+tableToHtml opts (Ann.Table attr caption colspecs thead tbodies tfoot) = do
+  captionDoc <- case caption of
+    Caption _ [] -> return mempty
+    Caption _ longCapt -> do
+      cs <- blockListToHtml opts longCapt
+      return $ do
+        H.caption cs
+        nl opts
+  coltags <- colSpecListToHtml opts colspecs
+  head' <- tableHeadToHtml opts thead
+  bodies <- intersperse (nl opts) <$> mapM (tableBodyToHtml opts) tbodies
+  foot' <- tableFootToHtml opts tfoot
   let (ident,classes,kvs) = attr
   -- When widths of columns are < 100%, we need to set width for the whole
   -- table, or some browsers give us skinny columns with lots of space
   -- between:
-  let totalWidth = sum widths
+  let colWidth = \case
+        ColWidth d -> d
+        ColWidthDefault -> 0
+  let totalWidth = sum . map (colWidth . snd) $ colspecs
   let attr' = case lookup "style" kvs of
                 Nothing | totalWidth < 1 && totalWidth > 0
                   -> (ident,classes, ("style","width:" <>
                          T.pack (show (round (totalWidth * 100) :: Int))
                          <> "%;"):kvs)
                 _ -> attr
-  addAttrs opts attr' $ H.table $
-    nl opts >> captionDoc >> coltags >> head' >> body' >> nl opts
+  addAttrs opts attr' $ H.table $ do
+    nl opts
+    captionDoc
+    coltags
+    head'
+    mconcat bodies
+    foot'
+    nl opts
 
+tableBodyToHtml :: PandocMonad m
+                => WriterOptions
+                -> Ann.TableBody
+                -> StateT WriterState m Html
+tableBodyToHtml opts (Ann.TableBody attr _rowHeadCols inthead rows) =
+  addAttrs opts attr . H.tbody =<< do
+    intermediateHead <-
+      if null inthead
+      then return mempty
+      else headerRowsToHtml opts Thead inthead
+    bodyRows <- bodyRowsToHtml opts rows
+    return $ intermediateHead <> bodyRows
+
+tableHeadToHtml :: PandocMonad m
+                => WriterOptions
+                -> Ann.TableHead
+                -> StateT WriterState m Html
+tableHeadToHtml opts (Ann.TableHead attr rows) =
+  tablePartToHtml opts Thead attr rows
+
+tableFootToHtml :: PandocMonad m
+                => WriterOptions
+                -> Ann.TableFoot
+                -> StateT WriterState m Html
+tableFootToHtml opts (Ann.TableFoot attr rows) =
+  tablePartToHtml opts Tfoot attr rows
+
+tablePartToHtml :: PandocMonad m
+                => WriterOptions
+                -> TablePart
+                -> Attr
+                -> [Ann.HeaderRow]
+                -> StateT WriterState m Html
+tablePartToHtml opts tblpart attr rows =
+  if null rows || all isEmptyRow rows
+  then return mempty
+  else do
+    let tag' = case tblpart of
+                 Thead -> H.thead
+                 Tfoot -> H.tfoot
+                 Tbody -> H.tbody -- this would be unexpected
+    contents <- headerRowsToHtml opts tblpart rows
+    tablePartElement <- addAttrs opts attr $ tag' contents
+    return $ do
+      tablePartElement
+      nl opts
+  where
+    isEmptyRow (Ann.HeaderRow _attr _rownum cells) = all isEmptyCell cells
+    isEmptyCell (Ann.Cell _colspecs _colnum cell) =
+      cell == Cell nullAttr AlignDefault (RowSpan 1) (ColSpan 1) []
+
+-- | The part of a table; header, footer, or body.
+data TablePart = Thead | Tfoot | Tbody
+  deriving (Eq)
+
+data CellType = HeaderCell | BodyCell
+
+data TableRow = TableRow TablePart Attr Ann.RowNumber Ann.RowHead Ann.RowBody
+
+headerRowsToHtml :: PandocMonad m
+                 => WriterOptions
+                 -> TablePart
+                 -> [Ann.HeaderRow]
+                 -> StateT WriterState m Html
+headerRowsToHtml opts tablepart =
+  rowListToHtml opts . map toTableRow
+  where
+    toTableRow (Ann.HeaderRow attr rownum rowbody) =
+      TableRow tablepart attr rownum [] rowbody
+
+bodyRowsToHtml :: PandocMonad m
+               => WriterOptions
+               -> [Ann.BodyRow]
+               -> StateT WriterState m Html
+bodyRowsToHtml opts =
+  rowListToHtml opts . zipWith toTableRow [1..]
+  where
+    toTableRow rownum (Ann.BodyRow attr _rownum rowhead rowbody) =
+      TableRow Tbody attr rownum rowhead rowbody
+
+
+rowListToHtml :: PandocMonad m
+              => WriterOptions
+              -> [TableRow]
+              -> StateT WriterState m Html
+rowListToHtml opts rows =
+  (\x -> nl opts *> mconcat x) <$>
+     mapM (tableRowToHtml opts) rows
+
+colSpecListToHtml :: PandocMonad m
+                  => WriterOptions
+                  -> [ColSpec]
+                  -> StateT WriterState m Html
+colSpecListToHtml opts colspecs = do
+  html5 <- gets stHtml5
+  let hasDefaultWidth (_, ColWidthDefault) = True
+      hasDefaultWidth _                    = False
+
+  let percent w = show (truncate (100*w) :: Integer) <> "%"
+
+  let col :: ColWidth -> Html
+      col cw = do
+        H.col ! case cw of
+          ColWidthDefault -> mempty
+          ColWidth w -> if html5
+                        then A.style (toValue $ "width: " <> percent w)
+                        else A.width (toValue $ percent w)
+        nl opts
+
+  return $
+    if all hasDefaultWidth colspecs
+    then mempty
+    else do
+      H.colgroup $ do
+        nl opts
+        mapM_ (col . snd) colspecs
+      nl opts
+
 tableRowToHtml :: PandocMonad m
                => WriterOptions
-               -> [Alignment]
-               -> Int
-               -> [[Block]]
+               -> TableRow
                -> StateT WriterState m Html
-tableRowToHtml opts aligns rownum cols' = do
-  let mkcell = if rownum == 0 then H.th else H.td
-  let rowclass = case rownum of
-                      0                  -> "header"
-                      x | x `rem` 2 == 1 -> "odd"
-                      _                  -> "even"
-  cols'' <- zipWithM
-            (\alignment item -> tableItemToHtml opts mkcell alignment item)
-            aligns cols'
-  return $ (H.tr ! A.class_ rowclass $ nl opts >> mconcat cols'')
-          >> nl opts
+tableRowToHtml opts (TableRow tblpart attr rownum rowhead rowbody) = do
+  let rowclass = A.class_ $ case rownum of
+        Ann.RowNumber x | x `rem` 2 == 1   -> "odd"
+        _               | tblpart /= Thead -> "even"
+        _                                  -> "header"
+  let celltype = case tblpart of
+                   Thead -> HeaderCell
+                   _     -> BodyCell
+  headcells <- mapM (cellToHtml opts HeaderCell) rowhead
+  bodycells <- mapM (cellToHtml opts celltype) rowbody
+  rowHtml <- addAttrs opts attr $ H.tr ! rowclass $ do
+    nl opts
+    mconcat headcells
+    mconcat bodycells
+  return $ do
+    rowHtml
+    nl opts
 
-alignmentToString :: Alignment -> [Char]
-alignmentToString alignment = case alignment of
-                                 AlignLeft    -> "left"
-                                 AlignRight   -> "right"
-                                 AlignCenter  -> "center"
-                                 AlignDefault -> ""
+alignmentToString :: Alignment -> Maybe Text
+alignmentToString = \case
+  AlignLeft    -> Just "left"
+  AlignRight   -> Just "right"
+  AlignCenter  -> Just "center"
+  AlignDefault -> Nothing
 
-tableItemToHtml :: PandocMonad m
+colspanAttrib :: ColSpan -> Attribute
+colspanAttrib = \case
+  ColSpan 1 -> mempty
+  ColSpan n -> A.colspan (toValue n)
+
+rowspanAttrib :: RowSpan -> Attribute
+rowspanAttrib = \case
+  RowSpan 1 -> mempty
+  RowSpan n -> A.rowspan (toValue n)
+
+cellToHtml :: PandocMonad m
+           => WriterOptions
+           -> CellType
+           -> Ann.Cell
+           -> StateT WriterState m Html
+cellToHtml opts celltype (Ann.Cell (colspec :| _) _colNum cell) =
+  let align = fst colspec
+  in tableCellToHtml opts celltype align cell
+
+tableCellToHtml :: PandocMonad m
                 => WriterOptions
-                -> (Html -> Html)
+                -> CellType
                 -> Alignment
-                -> [Block]
+                -> Cell
                 -> StateT WriterState m Html
-tableItemToHtml opts tag' align' item = do
+tableCellToHtml opts ctype colAlign (Cell attr align rowspan colspan item) = do
   contents <- blockListToHtml opts item
   html5 <- gets stHtml5
-  let alignStr = alignmentToString align'
-  let attribs = if html5
-                   then A.style (toValue $ "text-align: " <> alignStr <> ";")
-                   else A.align (toValue alignStr)
-  let tag'' = if null alignStr
-                 then tag'
-                 else tag' ! attribs
-  return $ tag'' contents >> nl opts
+  let tag' = case ctype of
+        BodyCell   -> H.td
+        HeaderCell -> H.th
+  let align' = case align of
+        AlignDefault -> colAlign
+        _            -> align
+  let alignAttribs = case alignmentToString align' of
+        Nothing ->
+          mempty
+        Just alignStr ->
+          if html5
+          then A.style (toValue $ "text-align: " <> alignStr <> ";")
+          else A.align (toValue alignStr)
+  otherAttribs <- attrsToHtml opts attr
+  let attribs = mconcat
+              $ alignAttribs
+              : colspanAttrib colspan
+              : rowspanAttrib rowspan
+              : otherAttribs
+  return $ do
+    tag' ! attribs $ contents
+    nl opts
 
 toListItems :: WriterOptions -> [Html] -> [Html]
 toListItems opts items = map (toListItem opts) items ++ [nl opts]
 
 toListItem :: WriterOptions -> Html -> Html
-toListItem opts item = nl opts >> H.li item
+toListItem opts item = nl opts *> H.li item
 
 blockListToHtml :: PandocMonad m
                 => WriterOptions -> [Block] -> StateT WriterState m Html
@@ -1278,6 +1458,23 @@
                                        customAttribute "role" "doc-endnote"
                        _          -> noteItem
   return $ nl opts >> noteItem'
+
+cslEntryToHtml :: PandocMonad m
+               => WriterOptions
+               -> Block
+               -> StateT WriterState m Html
+cslEntryToHtml opts (Para xs) = do
+  html5 <- gets stHtml5
+  let inDiv :: Text -> Html -> Html
+      inDiv cls x = ((if html5 then H5.div else H.div)
+                      x ! A.class_ (toValue cls))
+  let go (Span ("",[cls],[]) ils)
+        | cls == "csl-block" || cls == "csl-left-margin" ||
+          cls == "csl-right-inline" || cls == "csl-indent"
+        = inDiv cls <$> inlineListToHtml opts ils
+      go il = inlineToHtml opts il
+  mconcat <$> mapM go xs
+cslEntryToHtml opts x = blockToHtml opts x
 
 isMathEnvironment :: Text -> Bool
 isMathEnvironment s = "\\begin{" `T.isPrefixOf` s &&
diff --git a/src/Text/Pandoc/Writers/Haddock.hs b/src/Text/Pandoc/Writers/Haddock.hs
--- a/src/Text/Pandoc/Writers/Haddock.hs
+++ b/src/Text/Pandoc/Writers/Haddock.hs
@@ -28,7 +28,7 @@
 import Text.Pandoc.Writers.Shared
 
 type Notes = [[Block]]
-data WriterState = WriterState { stNotes :: Notes }
+newtype WriterState = WriterState { stNotes :: Notes }
 instance Default WriterState
   where def = WriterState{ stNotes = [] }
 
diff --git a/src/Text/Pandoc/Writers/ICML.hs b/src/Text/Pandoc/Writers/ICML.hs
--- a/src/Text/Pandoc/Writers/ICML.hs
+++ b/src/Text/Pandoc/Writers/ICML.hs
@@ -136,10 +136,11 @@
   let colwidth = if writerWrapText opts == WrapAuto
                     then Just $ writerColumns opts
                     else Nothing
-      renderMeta f s = fst <$> runStateT (f opts [] s) defaultWriterState
+      renderBlockMeta f s = fst <$> runStateT (f opts [] s) defaultWriterState
+      renderInlineMeta f s = fst <$> runStateT (f opts [] "" s) defaultWriterState
   metadata <- metaToContext opts
-             (renderMeta blocksToICML)
-             (renderMeta inlinesToICML)
+             (renderBlockMeta blocksToICML)
+             (renderInlineMeta inlinesToICML)
              meta
   (main, st) <- runStateT (blocksToICML opts [] blocks) defaultWriterState
   let context = defField "body" main
@@ -266,10 +267,18 @@
 
 -- | Escape colon characters as %3a
 escapeColons :: Text -> Text
-escapeColons = Text.concatMap $ \x -> case x of
-  ':' -> "%3a"
-  _   -> Text.singleton x
+escapeColons txt = Text.replace ":" "%3a" txt
 
+-- | figure out the link destination for a given URL
+-- | HyperlinkURLDestination with more than one colon crashes CS6
+makeDest :: Text -> Doc Text
+makeDest txt = literal $
+  if "#" `Text.isPrefixOf` txt
+  then "HyperlinkTextDestination/" <> escTxt
+  else "HyperlinkURLDestination/" <> escTxt
+  where
+    escTxt = escapeColons $ escapeStringForXML txt
+
 -- | Convert a list of (identifier, url) pairs to the ICML listing of hyperlinks.
 hyperlinksToDoc :: Hyperlink -> Doc Text
 hyperlinksToDoc []     = empty
@@ -277,13 +286,15 @@
   where
     hyp (ident, url) = hdest $$ hlink
       where
-        hdest = selfClosingTag "HyperlinkURLDestination"
+        hdest = if "#" `Text.isPrefixOf` url
+                then empty
+                else selfClosingTag "HyperlinkURLDestination"
                   [("Self", "HyperlinkURLDestination/"<>escapeColons url), ("Name","link"), ("DestinationURL",url), ("DestinationUniqueKey","1")] -- HyperlinkURLDestination with more than one colon crashes CS6
         hlink = inTags True "Hyperlink" [("Self","uf-"<>tshow ident),  ("Name",url),
-                    ("Source","htss-"<>tshow ident), ("Visible","true"), ("DestinationUniqueKey","1")]
+                    ("Source","htss-"<>tshow ident), ("Visible","false"), ("DestinationUniqueKey","1")]
                   $ inTags True "Properties" []
                   $ inTags False "BorderColor" [("type","enumeration")] (text "Black")
-                  $$ inTags False "Destination" [("type","object")] (literal $ "HyperlinkURLDestination/"<>escapeColons (escapeStringForXML url)) -- HyperlinkURLDestination with more than one colon crashes CS6
+                 $$ inTags False "Destination" [("type","object")] (makeDest url)
 
 -- | Key for specifying user-defined styles
 dynamicStyleKey :: Text
@@ -297,16 +308,16 @@
 
 -- | Convert a Pandoc block element to ICML.
 blockToICML :: PandocMonad m => WriterOptions -> Style -> Block -> WS m (Doc Text)
-blockToICML opts style (Plain lst) = parStyle opts style lst
+blockToICML opts style (Plain lst) = parStyle opts style "" lst
 -- title beginning with fig: indicates that the image is a figure
 blockToICML opts style (Para img@[Image _ txt (_,Text.stripPrefix "fig:" -> Just _)]) = do
-  figure  <- parStyle opts (figureName:style) img
-  caption <- parStyle opts (imgCaptionName:style) txt
+  figure  <- parStyle opts (figureName:style) "" img
+  caption <- parStyle opts (imgCaptionName:style) "" txt
   return $ intersperseBrs [figure, caption]
-blockToICML opts style (Para lst) = parStyle opts (paragraphName:style) lst
+blockToICML opts style (Para lst) = parStyle opts (paragraphName:style) "" lst
 blockToICML opts style (LineBlock lns) =
   blockToICML opts style $ linesToPara lns
-blockToICML opts style (CodeBlock _ str) = parStyle opts (codeBlockName:style) [Str str]
+blockToICML opts style (CodeBlock _ str) = parStyle opts (codeBlockName:style) "" [Str str]
 blockToICML _ _ b@(RawBlock f str)
   | f == Format "icml" = return $ literal str
   | otherwise          = do
@@ -316,12 +327,12 @@
 blockToICML opts style (OrderedList attribs lst) = listItemsToICML opts orderedListName style (Just attribs) lst
 blockToICML opts style (BulletList lst) = listItemsToICML opts bulletListName style Nothing lst
 blockToICML opts style (DefinitionList lst) = intersperseBrs `fmap` mapM (definitionListItemToICML opts style) lst
-blockToICML opts style (Header lvl (_, cls, _) lst) =
+blockToICML opts style (Header lvl (ident, cls, _) lst) =
   let stl = (headerName <> tshow lvl <> unnumbered):style
       unnumbered = if "unnumbered" `elem` cls
                    then " (unnumbered)"
                    else ""
-  in parStyle opts stl lst
+  in parStyle opts stl ident lst
 blockToICML _ _ HorizontalRule = return empty -- we could insert a page break instead
 blockToICML opts style (Table _ blkCapt specs thead tbody tfoot) =
   let (caption, aligns, widths, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot
@@ -366,8 +377,8 @@
                        , ("BodyRowCount", tshow nrRows)
                        , ("ColumnCount", tshow nrCols)
                        ] (colDescs $$ cells)
-      liftM2 ($$) tableDoc $ parStyle opts (tableCaptionName:style) caption
-blockToICML opts style (Div (_, _, kvs) lst) =
+      liftM2 ($$) tableDoc $ parStyle opts (tableCaptionName:style) "" caption
+blockToICML opts style (Div (_ident, _, kvs) lst) =
   let dynamicStyle = maybeToList $ lookup dynamicStyleKey kvs
   in  blocksToICML opts (dynamicStyle <> style) lst
 blockToICML _ _ Null = return empty
@@ -416,61 +427,65 @@
 
 definitionListItemToICML :: PandocMonad m => WriterOptions -> Style -> ([Inline],[[Block]]) -> WS m (Doc Text)
 definitionListItemToICML opts style (term,defs) = do
-  term' <- parStyle opts (defListTermName:style) term
+  term' <- parStyle opts (defListTermName:style) "" term
   defs' <- mapM (blocksToICML opts (defListDefName:style)) defs
   return $ intersperseBrs (term' : defs')
 
 
 -- | Convert a list of inline elements to ICML.
-inlinesToICML :: PandocMonad m => WriterOptions -> Style -> [Inline] -> WS m (Doc Text)
-inlinesToICML opts style lst = vcat `fmap` mapM (inlineToICML opts style) (mergeStrings opts lst)
+inlinesToICML :: PandocMonad m => WriterOptions -> Style -> Text -> [Inline] -> WS m (Doc Text)
+inlinesToICML opts style ident lst = vcat `fmap` mapM (inlineToICML opts style ident) (mergeStrings opts lst)
 
 -- | Convert an inline element to ICML.
-inlineToICML :: PandocMonad m => WriterOptions -> Style -> Inline -> WS m (Doc Text)
-inlineToICML _    style (Str str) = charStyle style $ literal $ escapeStringForXML str
-inlineToICML opts style (Emph lst) = inlinesToICML opts (emphName:style) lst
-inlineToICML opts style (Underline lst) = inlinesToICML opts (underlineName:style) lst
-inlineToICML opts style (Strong lst) = inlinesToICML opts (strongName:style) lst
-inlineToICML opts style (Strikeout lst) = inlinesToICML opts (strikeoutName:style) lst
-inlineToICML opts style (Superscript lst) = inlinesToICML opts (superscriptName:style) lst
-inlineToICML opts style (Subscript lst) = inlinesToICML opts (subscriptName:style) lst
-inlineToICML opts style (SmallCaps lst) = inlinesToICML opts (smallCapsName:style) lst
-inlineToICML opts style (Quoted SingleQuote lst) = inlinesToICML opts style $
+inlineToICML :: PandocMonad m => WriterOptions -> Style -> Text -> Inline -> WS m (Doc Text)
+inlineToICML _    style ident (Str str) = charStyle style ident $ literal $ escapeStringForXML str
+inlineToICML opts style ident (Emph lst) = inlinesToICML opts (emphName:style) ident lst
+inlineToICML opts style ident (Underline lst) = inlinesToICML opts (underlineName:style) ident lst
+inlineToICML opts style ident (Strong lst) = inlinesToICML opts (strongName:style) ident lst
+inlineToICML opts style ident (Strikeout lst) = inlinesToICML opts (strikeoutName:style) ident lst
+inlineToICML opts style ident (Superscript lst) = inlinesToICML opts (superscriptName:style) ident lst
+inlineToICML opts style ident (Subscript lst) = inlinesToICML opts (subscriptName:style) ident lst
+inlineToICML opts style ident (SmallCaps lst) = inlinesToICML opts (smallCapsName:style) ident lst
+inlineToICML opts style ident (Quoted SingleQuote lst) = inlinesToICML opts style ident $
   mergeStrings opts $ [Str "‘"] ++ lst ++ [Str "’"]
-inlineToICML opts style (Quoted DoubleQuote lst) = inlinesToICML opts style $
+inlineToICML opts style ident (Quoted DoubleQuote lst) = inlinesToICML opts style ident $
   mergeStrings opts $ [Str "“"] ++ lst ++ [Str "”"]
-inlineToICML opts style (Cite _ lst) = inlinesToICML opts (citeName:style) lst
-inlineToICML _    style (Code _ str) = charStyle (codeName:style) $ literal $ escapeStringForXML str
-inlineToICML _    style Space = charStyle style space
-inlineToICML opts style SoftBreak =
+inlineToICML opts style ident (Cite _ lst) = inlinesToICML opts (citeName:style) ident lst
+inlineToICML _    style ident (Code _ str) = charStyle (codeName:style) ident $ literal $ escapeStringForXML str
+inlineToICML _    style ident Space = charStyle style ident space
+inlineToICML opts style ident SoftBreak =
   case writerWrapText opts of
-       WrapAuto     -> charStyle style space
-       WrapNone     -> charStyle style space
-       WrapPreserve -> charStyle style cr
-inlineToICML _ style LineBreak = charStyle style $ literal lineSeparator
-inlineToICML opts style (Math mt str) =
+       WrapAuto     -> charStyle style ident space
+       WrapNone     -> charStyle style ident space
+       WrapPreserve -> charStyle style ident cr
+inlineToICML _ style ident LineBreak = charStyle style ident $ literal lineSeparator
+inlineToICML opts style ident (Math mt str) =
   lift (texMathToInlines mt str) >>=
-    (fmap mconcat . mapM (inlineToICML opts style))
-inlineToICML _ _ il@(RawInline f str)
+    (fmap mconcat . mapM (inlineToICML opts style ident))
+inlineToICML _ _ _ il@(RawInline f str)
   | f == Format "icml" = return $ literal str
   | otherwise          = do
       report $ InlineNotRendered il
       return empty
-inlineToICML opts style (Link _ lst (url, title)) = do
-  content <- inlinesToICML opts (linkName:style) lst
+inlineToICML opts style ident (Link _ lst (url, title)) = do
+  content <- inlinesToICML opts (linkName:style) ident lst
   state $ \st ->
-            let ident = if null $ links st
-                           then 1::Int
-                           else 1 + fst (head $ links st)
-                newst = st{ links = (ident, url):links st }
+            let link_id = if null $ links st
+                            then 1::Int
+                            else 1 + fst (head $ links st)
+                newst = st{ links = (link_id, url):links st }
                 cont  = inTags True "HyperlinkTextSource"
-                         [("Self","htss-"<>tshow ident), ("Name",title), ("Hidden","false")] content
+                         [("Self","htss-"<>tshow link_id), ("Name",title), ("Hidden","false")] content
             in  (cont, newst)
-inlineToICML opts style (Image attr _ target) = imageICML opts style attr target
-inlineToICML opts style (Note lst) = footnoteToICML opts style lst
-inlineToICML opts style (Span (_, _, kvs) lst) =
+inlineToICML opts style _ident (Image attr _ target) = imageICML opts style attr target
+inlineToICML opts style _ (Note lst) = footnoteToICML opts style lst
+inlineToICML opts style _ (Span (ident, _, kvs) lst) =
   let dynamicStyle = maybeToList $ lookup dynamicStyleKey kvs
-  in  inlinesToICML opts (dynamicStyle <> style) lst
+  in  inlinesToICML opts (dynamicStyle <> style) ident lst
+-- ident will be the id of the span, that we need to use down in the hyperlink setter
+--  if T.null ident
+--     then 
+--     else do
 
 -- | Convert a list of block elements to an ICML footnote.
 footnoteToICML :: PandocMonad m => WriterOptions -> Style -> [Block] -> WS m (Doc Text)
@@ -503,8 +518,8 @@
 intersperseBrs = vcat . intersperse (selfClosingTag "Br" []) . filter (not . isEmpty)
 
 -- | Wrap a list of inline elements in an ICML Paragraph Style
-parStyle :: PandocMonad m => WriterOptions -> Style -> [Inline] -> WS m (Doc Text)
-parStyle opts style lst =
+parStyle :: PandocMonad m => WriterOptions -> Style -> Text -> [Inline] -> WS m (Doc Text)
+parStyle opts style ident lst =
   let slipIn x y = if Text.null y
                       then x
                       else x <> " > " <> y
@@ -523,15 +538,36 @@
                                     in  ("NumberingStartAt", i) : ats
                    else [attrs]
   in  do
-      content <- inlinesToICML opts [] lst
+      content <- inlinesToICML opts [] ident lst
       let cont = inTags True "ParagraphStyleRange" attrs' content
       state $ \st -> (cont, st{ blockStyles = Set.insert stlStr $ blockStyles st })
 
+-- | Create the destination name
+makeDestName :: Text -> Text
+makeDestName name = "#" <> Text.replace " " "-" name
+
+-- | Create a HyperlinkTextDestination for a given identifier
+makeLinkDest :: Text -> Doc Text -> Doc Text
+makeLinkDest ident cont = vcat [
+    selfClosingTag "HyperlinkTextDestination"
+      [("Self", "HyperlinkTextDestination/"<>makeDestName ident), ("Name","Destination"), ("DestinationUniqueKey","1")]
+    , inTagsSimple "Content" $ flush cont
+  ]
+
+-- | Create the markup for the content (incl. named destinations)
+-- |  NOTE: since we have no easy way to get actual named dests, we just create them for any short content blocks
+makeContent :: Text -> Doc Text -> Doc Text
+makeContent ident cont 
+              | isEmpty cont = empty
+              | not (Text.null ident) = makeLinkDest ident cont
+              | otherwise = inTagsSimple "Content" $ flush cont
+
 -- | Wrap a Doc in an ICML Character Style.
-charStyle :: PandocMonad m => Style -> Doc Text -> WS m (Doc Text)
-charStyle style content =
+charStyle :: PandocMonad m => Style -> Text -> Doc Text -> WS m (Doc Text)
+charStyle style ident content =
   let (stlStr, attrs) = styleToStrAttr style
-      doc = inTags True "CharacterStyleRange" attrs $ inTagsSimple "Content" $ flush content
+      doc = inTags True "CharacterStyleRange" attrs
+              $ makeContent ident content
   in
       state $ \st ->
     let styles = if Text.null stlStr
diff --git a/src/Text/Pandoc/Writers/JATS.hs b/src/Text/Pandoc/Writers/JATS.hs
--- a/src/Text/Pandoc/Writers/JATS.hs
+++ b/src/Text/Pandoc/Writers/JATS.hs
@@ -216,7 +216,7 @@
                   (T.takeWhile (/='/') <$> mbMT)
       subtype = fromMaybe "" $
                   lookup "mime-subtype" kvs `mplus`
-                  ((T.drop 1 . T.dropWhile (/='/')) <$> mbMT)
+                  (T.drop 1 . T.dropWhile (/='/') <$> mbMT)
   in (maintype, subtype)
 
 languageFor :: [Text] -> Text
@@ -372,7 +372,7 @@
       thead <- if all null headers
                   then return empty
                   else inTagsIndented "thead" <$> tableRowToJATS opts True headers
-      tbody <- (inTagsIndented "tbody" . vcat) <$>
+      tbody <- inTagsIndented "tbody" . vcat <$>
                     mapM (tableRowToJATS opts False) rows
       return $ inTags True "table" [] $ coltags $$ thead $$ tbody
 
@@ -389,7 +389,7 @@
                   -> [[Block]]
                   -> JATS m (Doc Text)
 tableRowToJATS opts isHeader cols =
-  (inTagsIndented "tr" . vcat) <$> mapM (tableItemToJATS opts isHeader) cols
+  inTagsIndented "tr" . vcat <$> mapM (tableItemToJATS opts isHeader) cols
 
 tableItemToJATS :: PandocMonad m
                    => WriterOptions
@@ -400,7 +400,7 @@
   inTags False (if isHeader then "th" else "td") [] <$>
     inlinesToJATS opts item
 tableItemToJATS opts isHeader item =
-  (inTags False (if isHeader then "th" else "td") [] . vcat) <$>
+  inTags False (if isHeader then "th" else "td") [] . vcat <$>
     mapM (blockToJATS opts) item
 
 -- | Convert a list of inline elements to JATS.
@@ -547,7 +547,7 @@
                   (T.takeWhile (/='/') <$> mbMT)
   let subtype = fromMaybe "" $
                   lookup "mime-subtype" kvs `mplus`
-                  ((T.drop 1 . T.dropWhile (/='/')) <$> mbMT)
+                  (T.drop 1 . T.dropWhile (/='/') <$> mbMT)
   let attr = [("id", ident) | not (T.null ident)] ++
              [("mimetype", maintype),
               ("mime-subtype", subtype),
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -71,7 +71,7 @@
               , stBeamer        :: Bool          -- produce beamer
               , stEmptyLine     :: Bool          -- true if no content on line
               , stHasCslRefs    :: Bool          -- has a Div with class refs
-              , stCslHangingIndent :: Bool       -- use hanging indent for bib
+              , stIsFirstInDefinition :: Bool    -- first block in a defn list
               }
 
 startingState :: WriterOptions -> WriterState
@@ -102,7 +102,7 @@
                 , stBeamer = False
                 , stEmptyLine = True
                 , stHasCslRefs = False
-                , stCslHangingIndent = False }
+                , stIsFirstInDefinition = False }
 
 -- | Convert Pandoc to LaTeX.
 writeLaTeX :: PandocMonad m => WriterOptions -> Pandoc -> m Text
@@ -241,7 +241,6 @@
                      else defField "dir" ("ltr" :: Text)) $
                   defField "section-titles" True $
                   defField "csl-refs" (stHasCslRefs st) $
-                  defField "csl-hanging-indent" (stCslHangingIndent st) $
                   defField "geometry" geometryFromMargins $
                   (case T.uncons . render Nothing <$>
                         getField "papersize" metadata of
@@ -539,16 +538,23 @@
      then modify $ \st -> st{ stIncremental = True }
      else when (beamer && "nonincremental" `elem` classes) $
              modify $ \st -> st { stIncremental = False }
-  result <- if identifier == "refs"
+  result <- if identifier == "refs" || -- <- for backwards compatibility
+               "csl-bib-body" `elem` classes
                then do
+                 modify $ \st -> st{ stHasCslRefs = True }
                  inner <- blockListToLaTeX bs
-                 modify $ \st -> st{ stHasCslRefs = True
-                                   , stCslHangingIndent =
-                                      "hanging-indent" `elem` classes }
-                 return $ "\\begin{cslreferences}" $$
-                          inner $$
-                          "\\end{cslreferences}"
-               else blockListToLaTeX bs
+                 return $ "\\begin{CSLReferences}" <>
+                          (if "hanging-indent" `elem` classes
+                              then braces "1"
+                              else braces "0") <>
+                          (case lookup "entry-spacing" kvs of
+                             Nothing -> braces "0"
+                             Just s  -> braces (literal s))
+                          $$ inner
+                          $+$ "\\end{CSLReferences}"
+               else if "csl-entry" `elem` classes
+                       then vcat <$> mapM cslEntryToLaTeX bs
+                       else blockListToLaTeX bs
   modify $ \st -> st{ stIncremental = oldIncremental }
   linkAnchor' <- hypertarget True identifier empty
   -- see #2704 for the motivation for adding \leavevmode:
@@ -682,19 +688,25 @@
 blockToLaTeX (BulletList []) = return empty  -- otherwise latex error
 blockToLaTeX (BulletList lst) = do
   incremental <- gets stIncremental
+  isFirstInDefinition <- gets stIsFirstInDefinition
   beamer <- gets stBeamer
   let inc = if beamer && incremental then "[<+->]" else ""
   items <- mapM listItemToLaTeX lst
   let spacing = if isTightList lst
                    then text "\\tightlist"
                    else empty
-  return $ text ("\\begin{itemize}" <> inc) $$ spacing $$ vcat items $$
+  return $ text ("\\begin{itemize}" <> inc) $$
+             spacing $$
+             -- force list at beginning of definition to start on new line
+             (if isFirstInDefinition then "\\item[]" else mempty) $$
+             vcat items $$
              "\\end{itemize}"
 blockToLaTeX (OrderedList _ []) = return empty -- otherwise latex error
 blockToLaTeX (OrderedList (start, numstyle, numdelim) lst) = do
   st <- get
   let inc = if stBeamer st && stIncremental st then "[<+->]" else ""
   let oldlevel = stOLLevel st
+  isFirstInDefinition <- gets stIsFirstInDefinition
   put $ st {stOLLevel = oldlevel + 1}
   items <- mapM listItemToLaTeX lst
   modify (\s -> s {stOLLevel = oldlevel})
@@ -738,6 +750,8 @@
          $$ stylecommand
          $$ resetcounter
          $$ spacing
+         -- force list at beginning of definition to start on new line
+         $$ (if isFirstInDefinition then "\\item[]" else mempty)
          $$ vcat items
          $$ "\\end{enumerate}"
 blockToLaTeX (DefinitionList []) = return empty
@@ -948,7 +962,14 @@
     let term'' = if any isInternalLink term
                     then braces term'
                     else term'
-    def'  <- liftM vsep $ mapM blockListToLaTeX defs
+    def'  <- case concat defs of
+               [] -> return mempty
+               (x:xs) -> do
+                 modify $ \s -> s{stIsFirstInDefinition = True }
+                 firstitem <- blockToLaTeX x
+                 modify $ \s -> s{stIsFirstInDefinition = False }
+                 rest <- blockListToLaTeX xs
+                 return $ firstitem $+$ rest
     return $ case defs of
      ((Header{} : _) : _)    ->
        "\\item" <> brackets term'' <> " ~ " $$ def'
@@ -1049,7 +1070,7 @@
                            let valign = maybe "T" mapAlignment (lookup "align" kvs)
                                totalwidth = maybe [] (\x -> ["totalwidth=" <> x])
                                  (lookup "totalwidth" kvs)
-                               onlytextwidth = filter ((==) "onlytextwidth") classes
+                               onlytextwidth = filter ("onlytextwidth" ==) classes
                                options = text $ T.unpack $ T.intercalate "," $
                                  valign : totalwidth ++ onlytextwidth 
                            in inCmd "begin" "columns" <> brackets options
@@ -1134,6 +1155,23 @@
 isQuoted (Quoted _ _) = True
 isQuoted _            = False
 
+cslEntryToLaTeX :: PandocMonad m
+                => Block
+                -> LW m (Doc Text)
+cslEntryToLaTeX (Para xs) =
+  mconcat <$> mapM go xs
+ where
+   go (Span ("",["csl-block"],[]) ils) =
+     (cr <>) . inCmd "CSLBlock" <$> inlineListToLaTeX ils
+   go (Span ("",["csl-left-margin"],[]) ils) =
+     inCmd "CSLLeftMargin" <$> inlineListToLaTeX ils
+   go (Span ("",["csl-right-inline"],[]) ils) =
+     (cr <>) . inCmd "CSLRightInline" <$> inlineListToLaTeX ils
+   go (Span ("",["csl-indent"],[]) ils) =
+     (cr <>) . inCmd "CSLIndent" <$> inlineListToLaTeX ils
+   go il = inlineToLaTeX il
+cslEntryToLaTeX x = blockToLaTeX x
+
 -- | Convert inline element to LaTeX
 inlineToLaTeX :: PandocMonad m
               => Inline    -- ^ Inline to convert
@@ -1458,8 +1496,8 @@
 citeArgumentsList (CiteGroup pfxs sfxs ids) = do
       pdoc <- inlineListToLaTeX pfxs
       sdoc <- inlineListToLaTeX sfxs'
-      return $ (optargs pdoc sdoc) <>
-              (braces (literal (T.intercalate "," (reverse ids))))
+      return $ optargs pdoc sdoc <>
+              braces (literal (T.intercalate "," (reverse ids)))
       where sfxs' = stripLocatorBraces $ case sfxs of
                 (Str t : r) -> case T.uncons t of
                   Just (x, xs)
@@ -1516,12 +1554,12 @@
 
       groups <- mapM citeArgumentsList (reverse (foldl' grouper [] (c:cs)))
 
-      return $ text cmd <> (mconcat groups)
+      return $ text cmd <> mconcat groups
 
   where grouper prev cit = case prev of
          ((CiteGroup oPfx oSfx ids):rest)
-             | null oSfx && null pfx -> (CiteGroup oPfx sfx (cid:ids)):rest
-         _ -> (CiteGroup pfx sfx [cid]):prev
+             | null oSfx && null pfx -> CiteGroup oPfx sfx (cid:ids) : rest
+         _ -> CiteGroup pfx sfx [cid] : prev
          where pfx = citationPrefix cit
                sfx = citationSuffix cit
                cid = citationId cit
diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs
--- a/src/Text/Pandoc/Writers/Man.hs
+++ b/src/Text/Pandoc/Writers/Man.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE LambdaCase        #-}
 {-# LANGUAGE OverloadedStrings #-}
 {-# LANGUAGE ViewPatterns      #-}
 {- |
@@ -232,8 +233,7 @@
   labelText <- inlineListToMan opts $ makeCodeBold label
   contents <- if null defs
                  then return empty
-                 else liftM vcat $ forM defs $ \blocks ->
-                        case blocks of
+                 else liftM vcat $ forM defs $ \case
                           (x:xs) -> do
                             first' <- blockToMan opts $
                                       case x of
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -24,10 +24,9 @@
 import Control.Monad.State.Strict
 import Data.Char (isAlphaNum)
 import Data.Default
-import Data.List (find, intersperse, sortBy, transpose)
+import Data.List (find, intersperse, sortOn, transpose)
 import qualified Data.Map as M
 import Data.Maybe (fromMaybe, mapMaybe)
-import Data.Ord (comparing)
 import qualified Data.Set as Set
 import Data.Text (Text)
 import qualified Data.Text as T
@@ -127,7 +126,7 @@
 
 mmdTitleBlock :: Context Text -> Doc Text
 mmdTitleBlock (Context hashmap) =
-  vcat $ map go $ sortBy (comparing fst) $ M.toList hashmap
+  vcat $ map go $ sortOn (T.toCaseFold . fst) $ M.toList hashmap
   where go (k,v) =
           case (text (T.unpack k), v) of
                (k', ListVal xs)
@@ -148,15 +147,15 @@
 plainTitleBlock :: Doc Text -> [Doc Text] -> Doc Text -> Doc Text
 plainTitleBlock tit auths dat =
   tit <> cr <>
-  (hcat (intersperse (text "; ") auths)) <> cr <>
+  hcat (intersperse (text "; ") auths) <> cr <>
   dat <> cr
 
 yamlMetadataBlock :: Context Text -> Doc Text
-yamlMetadataBlock v = "---" $$ (contextToYaml v) $$ "---"
+yamlMetadataBlock v = "---" $$ contextToYaml v $$ "---"
 
 contextToYaml :: Context Text -> Doc Text
 contextToYaml (Context o) =
-  vcat $ map keyvalToYaml $ sortBy (comparing fst) $ M.toList o
+  vcat $ map keyvalToYaml $ sortOn (T.toCaseFold . fst) $ M.toList o
  where
   keyvalToYaml (k,v) =
           case (text (T.unpack k), v) of
@@ -180,20 +179,27 @@
   | otherwise =
       if hasNewlines x
          then hang 0 ("|" <> cr) x
-         else if any hasPunct x
-           then "'" <> fmap escapeSingleQuotes x <> "'"
+         else if fst $ foldr needsDoubleQuotes (False, True) x
+           then "\"" <> fmap escapeInDoubleQuotes x <> "\""
            else x
     where
+      needsDoubleQuotes t (positive, isFirst)
+        = if T.any isBadAnywhere t ||
+             (isFirst && T.any isYamlPunct (T.take 1 t))
+              then (True, False)
+              else (positive, False)
+      isBadAnywhere '#' = True
+      isBadAnywhere ':' = True
+      isBadAnywhere '`' = False
+      isBadAnywhere _   = False
       hasNewlines NewLine = True
       hasNewlines BlankLines{} = True
       hasNewlines CarriageReturn = True
       hasNewlines (Concat w z) = hasNewlines w || hasNewlines z
       hasNewlines _ = False
-      hasPunct = T.any isYamlPunct
       isYamlPunct = (`elem` ['-','?',':',',','[',']','{','}',
-                             '#','&','*','!','|','>','\'','"',
-                             '%','@','`',',','[',']','{','}'])
-      escapeSingleQuotes = T.replace "'" "''"
+                             '#','&','*','!','|','>','\'','"', '%','@','`'])
+      escapeInDoubleQuotes = T.replace "\"" "\\\"" . T.replace "\\" "\\\\"
 valToYaml _ = empty
 
 -- | Return markdown representation of document.
@@ -250,7 +256,7 @@
 
 -- | Return markdown representation of reference key table.
 refsToMarkdown :: PandocMonad m => WriterOptions -> Refs -> MD m (Doc Text)
-refsToMarkdown opts refs = mapM (keyToMarkdown opts) refs >>= return . vcat
+refsToMarkdown opts refs = vcat <$> mapM (keyToMarkdown opts) refs
 
 -- | Return markdown representation of a reference key.
 keyToMarkdown :: PandocMonad m
@@ -446,7 +452,7 @@
            then inlines
            else case inlines of
                   (Str t:ys)
-                    | (null ys || startsWithSpace ys)
+                    | null ys || startsWithSpace ys
                     , beginsWithOrderedListMarker t
                     -> RawInline (Format "markdown") (escapeMarker t):ys
                   (Str t:_)
@@ -462,7 +468,7 @@
   | isEnabled Ext_raw_html opts &&
     not (isEnabled Ext_link_attributes opts) &&
     attr /= nullAttr = -- use raw HTML
-    ((<> blankline) . literal . T.strip) <$>
+    (<> blankline) . literal . T.strip <$>
       writeHtml5String opts{ writerTemplate = Nothing }
         (Pandoc nullMeta [Para [Image attr alt (src,tgt)]])
   | otherwise = blockToMarkdown opts (Para [Image attr alt (src,tit)])
@@ -472,7 +478,7 @@
   if isEnabled Ext_line_blocks opts
   then do
     mdLines <- mapM (inlineListToMarkdown opts) lns
-    return $ (vcat $ map (hang 2 (literal "| ")) mdLines) <> blankline
+    return $ vcat (map (hang 2 (literal "| ")) mdLines) <> blankline
   else blockToMarkdown opts $ linesToPara lns
 blockToMarkdown' opts b@(RawBlock f str) = do
   variant <- asks envVariant
@@ -561,9 +567,12 @@
   | "haskell" `elem` classes && "literate" `elem` classes &&
     isEnabled Ext_literate_haskell opts =
   return $ prefixed "> " (literal str) <> blankline
-blockToMarkdown' opts (CodeBlock attribs str) = return $
-  case attribs == nullAttr of
-     False | isEnabled Ext_backtick_code_blocks opts ->
+blockToMarkdown' opts (CodeBlock attribs str) = do
+  variant <- asks envVariant
+  return $
+   case attribs == nullAttr of
+     False | variant == Commonmark ||
+             isEnabled Ext_backtick_code_blocks opts ->
           backticks <> attrs <> cr <> literal str <> cr <> backticks <> blankline
            | isEnabled Ext_fenced_code_blocks opts ->
           tildes <> attrs <> cr <> literal str <> cr <> tildes <> blankline
@@ -579,28 +588,28 @@
          attrs  = if isEnabled Ext_fenced_code_attributes opts
                      then nowrap $ " " <> attrsToMarkdown attribs
                      else case attribs of
-                                (_,(cls:_),_) -> " " <> literal cls
+                                (_,cls:_,_) -> " " <> literal cls
                                 _             -> empty
 blockToMarkdown' opts (BlockQuote blocks) = do
   variant <- asks envVariant
   -- if we're writing literate haskell, put a space before the bird tracks
   -- so they won't be interpreted as lhs...
-  let leader = if isEnabled Ext_literate_haskell opts
-                  then " > "
-                  else if variant == PlainText then "  " else "> "
+  let leader
+        | isEnabled Ext_literate_haskell opts = " > "
+        | variant == PlainText = "  "
+        | otherwise            = "> "
   contents <- blockListToMarkdown opts blocks
-  return $ (prefixed leader contents) <> blankline
+  return $ prefixed leader contents <> blankline
 blockToMarkdown' opts t@(Table _ blkCapt specs thead tbody tfoot) = do
   let (caption, aligns, widths, headers, rows) = toLegacyTable blkCapt specs thead tbody tfoot
   let numcols = maximum (length aligns : length widths :
                            map length (headers:rows))
   caption' <- inlineListToMarkdown opts caption
-  let caption'' = if null caption
-                     then blankline
-                     else
-                       if isEnabled Ext_table_captions opts
-                          then blankline $$ (": " <> caption') $$ blankline
-                          else blankline $$ caption' $$ blankline
+  let caption''
+        | null caption = blankline
+        | isEnabled Ext_table_captions opts
+        = blankline $$ (": " <> caption') $$ blankline
+        | otherwise = blankline $$ caption' $$ blankline
   let hasSimpleCells = onlySimpleTableCells $ headers : rows
   let isSimple = hasSimpleCells && all (==0) widths
   let isPlainBlock (Plain _) = True
@@ -649,7 +658,7 @@
                 (id,) <$> pipeTable (all null headers) aligns' rawHeaders rawRows
             | isEnabled Ext_raw_html opts -> fmap (id,) $
                    literal <$>
-                   (writeHtml5String opts{ writerTemplate = Nothing } $ Pandoc nullMeta [t])
+                   writeHtml5String opts{ writerTemplate = Nothing } (Pandoc nullMeta [t])
             | otherwise -> return (id, literal "[TABLE]")
   return $ nst (tbl $$ caption'') $$ blankline
 blockToMarkdown' opts (BulletList items) = do
@@ -677,7 +686,7 @@
 addMarkdownAttribute :: Text -> Text
 addMarkdownAttribute s =
   case span isTagText $ reverse $ parseTags s of
-       (xs,(TagOpen t attrs:rest)) ->
+       (xs, TagOpen t attrs:rest) ->
             renderTags' $ reverse rest ++ (TagOpen t attrs' : reverse xs)
               where attrs' = ("markdown","1"):[(x,y) | (x,y) <- attrs,
                                  x /= "markdown"]
@@ -742,17 +751,16 @@
         | isSimple  = map numChars columns
         | otherwise = zipWith relWidth widths columns
   let makeRow = hcat . intersperse (lblock 1 (literal " ")) .
-                   (zipWith3 alignHeader aligns widthsInChars)
+                   zipWith3 alignHeader aligns widthsInChars
   let rows' = map makeRow rawRows
   let head' = makeRow rawHeaders
   let underline = mconcat $ intersperse (literal " ") $
                   map (\width -> literal (T.replicate width "-")) widthsInChars
-  let border = if multiline
-                  then literal (T.replicate (sum widthsInChars +
-                          length widthsInChars - 1) "-")
-                  else if headless
-                          then underline
-                          else empty
+  let border
+        | multiline = literal (T.replicate (sum widthsInChars +
+                        length widthsInChars - 1) "-")
+        | headless  = underline
+        | otherwise = empty
   let head'' = if headless
                   then empty
                   else border <> cr <> head'
@@ -856,9 +864,12 @@
   -- b) change Plain to Para unless it's followed by a RawBlock
   -- or has a list as its parent (#3487)
   let fixBlocks (b : CodeBlock attr x : rest)
-         | (not (isEnabled Ext_fenced_code_blocks opts) || attr == nullAttr)
-             && isListBlock b = b : commentSep : CodeBlock attr x :
-                                fixBlocks rest
+       | (not (variant == Commonmark ||
+               isEnabled Ext_backtick_code_blocks opts ||
+                 isEnabled Ext_fenced_code_blocks opts) ||
+              attr == nullAttr)
+            && isListBlock b
+              = b : commentSep : CodeBlock attr x : fixBlocks rest
       fixBlocks (b1@(BulletList _) : b2@(BulletList _) : bs) =
            b1 : commentSep : fixBlocks (b2:bs)
       fixBlocks (b1@(OrderedList _ _) : b2@(OrderedList _ _) : bs) =
@@ -884,18 +895,17 @@
       isListBlock (OrderedList _ _)  = True
       isListBlock (DefinitionList _) = True
       isListBlock _                  = False
-      commentSep  = if variant == PlainText
-                       then Null
-                       else if isEnabled Ext_raw_html opts
-                            then RawBlock "html" "<!-- -->\n"
-                            else RawBlock "markdown" "&nbsp;\n"
-  mapM (blockToMarkdown opts) (fixBlocks blocks) >>= return . mconcat
+      commentSep
+        | variant == PlainText        = Null
+        | isEnabled Ext_raw_html opts = RawBlock "html" "<!-- -->\n"
+        | otherwise                   = RawBlock "markdown" "&nbsp;\n"
+  mconcat <$> mapM (blockToMarkdown opts) (fixBlocks blocks)
 
 getKey :: Doc Text -> Key
 getKey = toKey . render Nothing
 
 findUsableIndex :: [Text] -> Int -> Int
-findUsableIndex lbls i = if (tshow i) `elem` lbls
+findUsableIndex lbls i = if tshow i `elem` lbls
                          then findUsableIndex lbls (i + 1)
                          else i
 
@@ -967,19 +977,19 @@
   go (if inlist then avoidBadWrapsInList lst else lst)
   where go [] = return empty
         go (i:is) = case i of
-            (Link _ _ _) -> case is of
+            Link {} -> case is of
                 -- If a link is followed by another link, or '[', '(' or ':'
                 -- then we don't shortcut
-                (Link _ _ _):_                                  -> unshortcutable
-                Space:(Link _ _ _):_                            -> unshortcutable
+                Link {}:_                                       -> unshortcutable
+                Space:Link {}:_                                 -> unshortcutable
                 Space:(Str(thead -> Just '[')):_                -> unshortcutable
                 Space:(RawInline _ (thead -> Just '[')):_       -> unshortcutable
                 Space:(Cite _ _):_                              -> unshortcutable
-                SoftBreak:(Link _ _ _):_                        -> unshortcutable
+                SoftBreak:Link {}:_                             -> unshortcutable
                 SoftBreak:(Str(thead -> Just '[')):_            -> unshortcutable
                 SoftBreak:(RawInline _ (thead -> Just '[')):_   -> unshortcutable
                 SoftBreak:(Cite _ _):_                          -> unshortcutable
-                LineBreak:(Link _ _ _):_                        -> unshortcutable
+                LineBreak:Link {}:_                             -> unshortcutable
                 LineBreak:(Str(thead -> Just '[')):_            -> unshortcutable
                 LineBreak:(RawInline _ (thead -> Just '[')):_   -> unshortcutable
                 LineBreak:(Cite _ _):_                          -> unshortcutable
@@ -1010,16 +1020,16 @@
 avoidBadWrapsInList [] = []
 avoidBadWrapsInList (s:Str (T.uncons -> Just ('>',cs)):xs) | isSp s =
   Str (" >" <> cs) : avoidBadWrapsInList xs
-avoidBadWrapsInList (s:Str (T.uncons -> Just (c, cs)):[])
-  | T.null cs && isSp s && c `elem` ['-','*','+'] = Str (T.pack [' ', c]) : []
+avoidBadWrapsInList [s, Str (T.uncons -> Just (c, cs))]
+  | T.null cs && isSp s && c `elem` ['-','*','+'] = [Str $ T.pack [' ', c]]
 avoidBadWrapsInList (s:Str (T.uncons -> Just (c, cs)):Space:xs)
   | T.null cs && isSp s && c `elem` ['-','*','+'] =
     Str (T.pack [' ', c]) : Space : avoidBadWrapsInList xs
 avoidBadWrapsInList (s:Str cs:Space:xs)
   | isSp s && isOrderedListMarker cs =
     Str (" " <> cs) : Space : avoidBadWrapsInList xs
-avoidBadWrapsInList (s:Str cs:[])
-  | isSp s && isOrderedListMarker cs = Str (" " <> cs) : []
+avoidBadWrapsInList [s, Str cs]
+  | isSp s && isOrderedListMarker cs = [Str $ " " <> cs]
 avoidBadWrapsInList (x:xs) = x : avoidBadWrapsInList xs
 
 isOrderedListMarker :: Text -> Bool
@@ -1099,7 +1109,7 @@
                        else contents
 inlineToMarkdown _ (Superscript []) = return empty
 inlineToMarkdown opts (Superscript lst) =
-  local (\env -> env {envEscapeSpaces = (envVariant env == Markdown)}) $ do
+  local (\env -> env {envEscapeSpaces = envVariant env == Markdown}) $ do
     contents <- inlineListToMarkdown opts lst
     if isEnabled Ext_superscript opts
        then return $ "^" <> contents <> "^"
@@ -1117,7 +1127,7 @@
                            Nothing -> literal $ "^(" <> rendered <> ")"
 inlineToMarkdown _ (Subscript []) = return empty
 inlineToMarkdown opts (Subscript lst) =
-  local (\env -> env {envEscapeSpaces = (envVariant env == Markdown)}) $ do
+  local (\env -> env {envEscapeSpaces = envVariant env == Markdown}) $ do
     contents <- inlineListToMarkdown opts lst
     if isEnabled Ext_subscript opts
        then return $ "~" <> contents <> "~"
@@ -1161,7 +1171,7 @@
                      then 0
                      else maximum $ map T.length tickGroups
   let marker     = T.replicate (longest + 1) "`"
-  let spacer     = if (longest == 0) then "" else " "
+  let spacer     = if longest == 0 then "" else " "
   let attrs      = if isEnabled Ext_inline_code_attributes opts && attr /= nullAttr
                       then attrsToMarkdown attr
                       else empty
@@ -1290,7 +1300,7 @@
   | isEnabled Ext_raw_html opts &&
     not (isEnabled Ext_link_attributes opts) &&
     attr /= nullAttr = -- use raw HTML
-    (literal . T.strip) <$>
+    literal . T.strip <$>
       writeHtml5String opts{ writerTemplate = Nothing } (Pandoc nullMeta [Plain [lnk]])
   | otherwise = do
   variant <- asks envVariant
@@ -1331,7 +1341,7 @@
   | isEnabled Ext_raw_html opts &&
     not (isEnabled Ext_link_attributes opts) &&
     attr /= nullAttr = -- use raw HTML
-    (literal . T.strip) <$>
+    literal . T.strip <$>
       writeHtml5String opts{ writerTemplate = Nothing } (Pandoc nullMeta [Plain [img]])
   | otherwise = do
   variant <- asks envVariant
@@ -1346,7 +1356,7 @@
 inlineToMarkdown opts (Note contents) = do
   modify (\st -> st{ stNotes = contents : stNotes st })
   st <- get
-  let ref = literal $ writerIdentifierPrefix opts <> tshow (stNoteNum st + (length $ stNotes st) - 1)
+  let ref = literal $ writerIdentifierPrefix opts <> tshow (stNoteNum st + length (stNotes st) - 1)
   if isEnabled Ext_footnotes opts
      then return $ "[^" <> ref <> "]"
      else return $ "[" <> ref <> "]"
diff --git a/src/Text/Pandoc/Writers/Ms.hs b/src/Text/Pandoc/Writers/Ms.hs
--- a/src/Text/Pandoc/Writers/Ms.hs
+++ b/src/Text/Pandoc/Writers/Ms.hs
@@ -67,9 +67,7 @@
   let authorsMeta = map (escapeStr opts . stringify) $ docAuthors meta
   hasHighlighting <- gets stHighlighting
   let highlightingMacros = if hasHighlighting
-                              then case writerHighlightStyle opts of
-                                        Nothing  -> mempty
-                                        Just sty -> styleToMs sty
+                              then maybe mempty styleToMs $ writerHighlightStyle opts
                               else mempty
 
   let context = defField "body" main
@@ -112,16 +110,37 @@
           -> Block         -- ^ Block element
           -> MS m (Doc Text)
 blockToMs _ Null = return empty
-blockToMs opts (Div (ident,_,_) bs) = do
+blockToMs opts (Div (ident,cls,kvs) bs) = do
   let anchor = if T.null ident
                   then empty
                   else nowrap $
                          literal ".pdfhref M "
                          <> doubleQuotes (literal (toAscii ident))
-  setFirstPara
-  res <- blockListToMs opts bs
-  setFirstPara
-  return $ anchor $$ res
+  case cls of
+    _ | "csl-entry" `elem` cls ->
+       (".CSLENTRY" $$) . vcat <$> mapM (cslEntryToMs True opts) bs
+      | "csl-bib-body" `elem` cls -> do
+       res <- blockListToMs opts bs
+       return $ anchor $$
+                -- so that XP paragraphs are indented:
+                ".nr PI 3n" $$
+                -- space between entries
+                ".de CSLENTRY" $$
+                (case lookup "entry-spacing" kvs >>= safeRead of
+                   Just n | n > (0 :: Int) -> ".sp"
+                   _ -> mempty) $$
+                ".." $$
+                ".de CSLP" $$
+                (if "hanging-indent" `elem` cls
+                    then ".XP"
+                    else ".LP") $$
+                ".." $$
+                res
+    _ -> do
+       setFirstPara
+       res <- blockListToMs opts bs
+       setFirstPara
+       return $ anchor $$ res
 blockToMs opts (Plain inlines) =
   liftM vcat $ mapM (inlineListToMs' opts) $ splitSentences inlines
 blockToMs opts (Para [Image attr alt (src,_tit)])
@@ -442,6 +461,39 @@
   modify $ \st -> st{ stNotes = contents : stNotes st }
   return $ literal "\\**"
 
+cslEntryToMs :: PandocMonad m
+             => Bool
+             -> WriterOptions
+             -> Block
+             -> MS m (Doc Text)
+cslEntryToMs atStart opts (Para xs) =
+  case xs of
+    (Span ("",["csl-left-margin"],[]) lils :
+      rest@(Span ("",["csl-right-inline"],[]) _ : _))
+      -> do lils' <- inlineListToMs' opts lils
+            ((cr <> literal ".IP " <>
+              doubleQuotes (nowrap lils') <>
+              literal " 5") $$)
+                <$> cslEntryToMs False opts (Para rest)
+    (Span ("",["csl-block"],[]) ils : rest)
+      -> ((cr <> literal ".LP") $$)
+                <$> cslEntryToMs False opts (Para (ils ++ rest))
+    (Span ("",["csl-left-margin"],[]) ils : rest)
+      -> ((cr <> literal ".LP") $$)
+              <$> cslEntryToMs False opts (Para (ils ++ rest))
+    (Span ("",["csl-indented"],[]) ils : rest)
+      -> ((cr <> literal ".LP") $$)
+              <$> cslEntryToMs False opts (Para (ils ++ rest))
+    _ | atStart
+         -> (".CSLP" $$) <$> cslEntryToMs False opts (Para xs)
+      | otherwise
+         -> case xs of
+           [] -> return mempty
+           (x:rest) -> (<>) <$> (inlineToMs opts x)
+                            <*> (cslEntryToMs False opts (Para rest))
+cslEntryToMs _ opts x = blockToMs opts x
+
+
 handleNotes :: PandocMonad m => WriterOptions -> Doc Text -> MS m (Doc Text)
 handleNotes opts fallback = do
   notes <- gets stNotes
@@ -523,7 +575,7 @@
  where
   fmtLine = mconcat . map fmtToken
   fmtToken (toktype, tok) =
-    "\\*[" <> (tshow toktype) <> " \"" <> (escapeStr opts tok) <> "\"]"
+    "\\*[" <> tshow toktype <> " \"" <> escapeStr opts tok <> "\"]"
 
 highlightCode :: PandocMonad m => WriterOptions -> Attr -> Text -> MS m (Doc Text)
 highlightCode opts attr str =
diff --git a/src/Text/Pandoc/Writers/ODT.hs b/src/Text/Pandoc/Writers/ODT.hs
--- a/src/Text/Pandoc/Writers/ODT.hs
+++ b/src/Text/Pandoc/Writers/ODT.hs
@@ -71,7 +71,7 @@
   refArchive <-
        case writerReferenceDoc opts of
              Just f -> liftM toArchive $ lift $ P.readFileLazy f
-             Nothing -> lift $ (toArchive . B.fromStrict) <$>
+             Nothing -> lift $ toArchive . B.fromStrict <$>
                                 P.readDataFile "reference.odt"
   -- handle formulas and pictures
   -- picEntriesRef <- P.newIORef ([] :: [Entry])
diff --git a/src/Text/Pandoc/Writers/OPML.hs b/src/Text/Pandoc/Writers/OPML.hs
--- a/src/Text/Pandoc/Writers/OPML.hs
+++ b/src/Text/Pandoc/Writers/OPML.hs
@@ -40,7 +40,7 @@
                 writeMarkdown def (Pandoc nullMeta [Plain ils]))
               meta'
   let blocks' = makeSections False (Just 1) blocks
-  main <- (render colwidth . vcat) <$>
+  main <- render colwidth . vcat <$>
              mapM (blockToOPML opts) blocks'
   let context = defField "body" main metadata
   return $
diff --git a/src/Text/Pandoc/Writers/OpenDocument.hs b/src/Text/Pandoc/Writers/OpenDocument.hs
--- a/src/Text/Pandoc/Writers/OpenDocument.hs
+++ b/src/Text/Pandoc/Writers/OpenDocument.hs
@@ -19,7 +19,7 @@
 import Data.Char (chr)
 import Data.List (sortOn, sortBy, foldl')
 import qualified Data.Map as Map
-import Data.Maybe (fromMaybe)
+import Data.Maybe (fromMaybe, isNothing)
 import Data.Ord (comparing)
 import qualified Data.Set as Set
 import Data.Text (Text)
@@ -32,13 +32,16 @@
 import Text.Pandoc.Logging
 import Text.Pandoc.Options
 import Text.DocLayout
-import Text.Pandoc.Shared (linesToPara, tshow)
+import Text.Pandoc.Shared (linesToPara, tshow, blocksToInlines)
 import Text.Pandoc.Templates (renderTemplate)
 import qualified Text.Pandoc.Translations as Term (Term(Figure, Table))
 import Text.Pandoc.Writers.Math
 import Text.Pandoc.Writers.Shared
+import qualified Text.Pandoc.Writers.AnnotatedTable as Ann
 import Text.Pandoc.XML
 import Text.Printf (printf)
+import Text.Pandoc.Highlighting (highlight)
+import Skylighting
 
 -- | Auxiliary function to convert Plain block to Para.
 plainToPara :: Block -> Block
@@ -247,6 +250,7 @@
   let automaticStyles = vcat $ reverse $ styles ++ listStyles
   let context = defField "body" body
               . defField "toc" (writerTableOfContents opts)
+              . defField "toc-depth" (tshow $ writerTOCDepth opts)
               . defField "automatic-styles" automaticStyles
               $ metadata
   return $ render colwidth $
@@ -370,9 +374,7 @@
     | BulletList     b <- bs = setFirstPara >> bulletListToOpenDocument o b
     | OrderedList  a b <- bs = setFirstPara >> orderedList a b
     | CodeBlock    _ s <- bs = setFirstPara >> preformatted s
-    | Table _ bc s th tb tf
-                       <- bs = let (c, a, w, h, r) = toLegacyTable bc s th tb tf
-                               in setFirstPara >> table c a w h r
+    | Table a bc s th tb tf <- bs =  setFirstPara >> table (Ann.toTable a bc s th tb tf)
     | HorizontalRule   <- bs = setFirstPara >> return (selfClosingTag "text:p"
                                 [ ("text:style-name", "Horizontal_20_Line") ])
     | RawBlock f     s <- bs = if f == Format "opendocument"
@@ -387,7 +389,7 @@
                            r <- vcat  <$> mapM (deflistItemToOpenDocument o) b
                            setInDefinitionList False
                            return r
-      preformatted  s = (flush . vcat) <$> mapM (inPreformattedTags . escapeStringForXML) (T.lines s)
+      preformatted  s = flush . vcat <$> mapM (inPreformattedTags . escapeStringForXML) (T.lines s)
       mkBlockQuote  b = do increaseIndent
                            i <- paraStyle
                                  [("style:parent-style-name","Quotations")]
@@ -395,29 +397,32 @@
       orderedList a b = do (ln,pn) <- newOrderedListStyle (isTightList b) a
                            inTags True "text:list" [ ("text:style-name", "L" <> tshow ln)]
                                       <$> orderedListToOpenDocument o pn b
-      table c a w h r = do
+      table :: PandocMonad m => Ann.Table -> OD m (Doc Text)
+      table (Ann.Table _ (Caption _ c) colspecs thead tbodies _) = do
         tn <- length <$> gets stTableStyles
         pn <- length <$> gets stParaStyles
         let  genIds      = map chr [65..]
              name        = "Table" <> tshow (tn + 1)
-             columnIds   = zip genIds w
+             (aligns, mwidths) = unzip colspecs
+             fromWidth (ColWidth w) | w > 0 = w
+             fromWidth _                    = 0
+             widths = map fromWidth mwidths
+             columnIds   = zip genIds widths
              mkColumn  n = selfClosingTag "table:table-column" [("table:style-name", name <> "." <> T.singleton (fst n))]
              columns     = map mkColumn columnIds
-             paraHStyles = paraTableStyles "Heading"  pn a
-             paraStyles  = paraTableStyles "Contents" (pn + length (newPara paraHStyles)) a
+             paraHStyles = paraTableStyles "Heading"  pn aligns
+             paraStyles  = paraTableStyles "Contents" (pn + length (newPara paraHStyles)) aligns
              newPara     = map snd . filter (not . isEmpty . snd)
         addTableStyle $ tableStyle tn columnIds
         mapM_ addParaStyle . newPara $ paraHStyles ++ paraStyles
         captionDoc <- if null c
                       then return empty
-                      else inlinesToOpenDocument o c >>=
+                      else inlinesToOpenDocument o (blocksToInlines c) >>=
                              if isEnabled Ext_native_numbering o
                                 then numberedTableCaption
                                 else unNumberedCaption "TableCaption"
-        th <- if all null h
-                 then return empty
-                 else colHeadsToOpenDocument o (map fst paraHStyles) h
-        tr <- mapM (tableRowToOpenDocument o (map fst paraStyles)) r
+        th <- colHeadsToOpenDocument o (map fst paraHStyles) thead
+        tr <- mapM (tableBodyToOpenDocument o (map fst paraStyles)) tbodies
         let tableDoc = inTags True "table:table" [
                             ("table:name"      , name)
                           , ("table:style-name", name)
@@ -463,28 +468,70 @@
 unNumberedCaption style caption = return $ inParagraphTagsWithStyle style caption
 
 colHeadsToOpenDocument :: PandocMonad m
-                       => WriterOptions -> [Text] -> [[Block]]
+                       => WriterOptions -> [Text] -> Ann.TableHead
                        -> OD m (Doc Text)
-colHeadsToOpenDocument o ns hs =
-    inTagsIndented "table:table-header-rows" . inTagsIndented "table:table-row" . vcat <$>
-    mapM (tableItemToOpenDocument o "TableHeaderRowCell") (zip ns hs)
+colHeadsToOpenDocument o ns (Ann.TableHead _ hs) =
+  case hs of
+    [] -> return empty
+    (x:_) ->
+        let (Ann.HeaderRow _ _ c) = x
+        in inTagsIndented "table:table-header-rows" .
+        inTagsIndented "table:table-row" .
+        vcat <$> mapM (tableItemToOpenDocument o "TableHeaderRowCell") (zip ns c)
 
+tableBodyToOpenDocument:: PandocMonad m
+                       => WriterOptions -> [Text] -> Ann.TableBody
+                       -> OD m (Doc Text)
+tableBodyToOpenDocument o ns tb =
+    let (Ann.TableBody _ _ _ r) = tb
+    in vcat <$> mapM (tableRowToOpenDocument o ns) r
+
 tableRowToOpenDocument :: PandocMonad m
-                       => WriterOptions -> [Text] -> [[Block]]
+                       => WriterOptions -> [Text] -> Ann.BodyRow
                        -> OD m (Doc Text)
-tableRowToOpenDocument o ns cs =
-    inTagsIndented "table:table-row" . vcat <$>
-    mapM (tableItemToOpenDocument o "TableRowCell") (zip ns cs)
+tableRowToOpenDocument o ns r =
+    let (Ann.BodyRow _ _ _ c ) = r
+    in inTagsIndented "table:table-row" . vcat <$>
+    mapM (tableItemToOpenDocument o "TableRowCell") (zip ns c)
 
+colspanAttrib :: ColSpan -> [(Text, Text)]
+colspanAttrib cs =
+  case cs of
+    ColSpan 1 -> mempty
+    ColSpan n -> [("table:number-columns-spanned", tshow n)]
+
+rowspanAttrib :: RowSpan -> [(Text, Text)]
+rowspanAttrib rs =
+  case rs of
+    RowSpan 1 -> mempty
+    RowSpan n -> [("table:number-rows-spanned", tshow n)]
+
+alignAttrib :: Alignment -> [(Text,Text)]
+alignAttrib a = case a of
+  AlignRight  -> ("fo:text-align","end") : style
+  AlignCenter -> ("fo:text-align","center") : style
+  _ -> []
+  where
+    style = [("style:justify-single-word","false")]
+
 tableItemToOpenDocument :: PandocMonad m
-                        => WriterOptions -> Text -> (Text,[Block])
+                        => WriterOptions -> Text -> (Text,Ann.Cell)
                         -> OD m (Doc Text)
-tableItemToOpenDocument o s (n,i) =
-  let a = [ ("table:style-name" , s )
-          , ("office:value-type", "string"     )
-          ]
-  in  inTags True "table:table-cell" a <$>
-      withParagraphStyle o n (map plainToPara i)
+tableItemToOpenDocument o s (n,c) = do
+  let (Ann.Cell _colspecs _colnum (Cell _ align rs cs i) ) = c
+      csa = colspanAttrib cs
+      rsa = rowspanAttrib rs
+      aa = alignAttrib align
+      a = [ ("table:style-name" , s )
+          , ("office:value-type", "string" ) ] ++ csa ++ rsa
+  itemParaStyle <- case aa of
+                     [] -> return 0
+                     _  -> paraStyleFromParent n aa
+  let itemParaStyle' = case itemParaStyle of
+                         0 -> n
+                         x -> "P" <> tshow x
+  inTags True "table:table-cell" a <$>
+    withParagraphStyle o itemParaStyle' (map plainToPara i)
 
 -- | Convert a list of inline elements to OpenDocument.
 inlinesToOpenDocument :: PandocMonad m => WriterOptions -> [Inline] -> OD m (Doc Text)
@@ -518,7 +565,7 @@
     SoftBreak
      | writerWrapText o == WrapPreserve
                   -> return $ preformatted "\n"
-     | otherwise  ->return space
+     | otherwise  -> return space
     Span attr xs  -> withLangFromAttr attr (inlinesToOpenDocument o xs)
     LineBreak     -> return $ selfClosingTag "text:line-break" []
     Str         s -> return $ handleSpaces $ escapeStringForXML s
@@ -530,7 +577,14 @@
     Subscript   l -> withTextStyle Sub    $ inlinesToOpenDocument o l
     SmallCaps   l -> withTextStyle SmallC $ inlinesToOpenDocument o l
     Quoted    t l -> inQuotes t <$> inlinesToOpenDocument o l
-    Code      _ s -> inlinedCode $ preformatted s
+    Code      attrs s -> if isNothing (writerHighlightStyle o)
+      then unhighlighted s
+      else case highlight (writerSyntaxMap o)
+                  formatOpenDocument attrs s of
+                Right h  -> return $ mconcat $ mconcat h
+                Left msg -> do
+                  unless (T.null msg) $ report $ CouldNotHighlight msg
+                  unhighlighted s
     Math      t s -> lift (texMathToInlines t s) >>=
                          inlinesToOpenDocument o
     Cite      _ l -> inlinesToOpenDocument o l
@@ -543,6 +597,12 @@
     Image attr _ (s,t) -> mkImg attr s t
     Note        l  -> mkNote l
     where
+      formatOpenDocument :: FormatOptions -> [SourceLine] -> [[Doc Text]]
+      formatOpenDocument _fmtOpts = map (map toHlTok)
+      toHlTok :: Token -> Doc Text
+      toHlTok (toktype,tok) =
+        inTags False "text:span" [("text:style-name", (T.pack $ show toktype))] $ preformatted tok
+      unhighlighted s = inlinedCode $ preformatted s
       preformatted s = handleSpaces $ escapeStringForXML s
       inlinedCode s = return $ inTags False "text:span" [("text:style-name", "Source_Text")] s
       mkLink   s t = inTags False "text:a" [ ("xlink:type" , "simple")
@@ -681,6 +741,20 @@
                              "style:paragraph-properties" attributes
   addParaStyle $ inTags True "style:style" (styleAttr <> attrs) paraProps
   return pn
+
+paraStyleFromParent :: PandocMonad m => Text -> [(Text,Text)] -> OD m Int
+paraStyleFromParent parent attrs = do
+  pn <- (+) 1 . length  <$> gets stParaStyles
+  let styleAttr = [ ("style:name"             , "P" <> tshow pn)
+                  , ("style:family"           , "paragraph")
+                  , ("style:parent-style-name", parent)]
+      paraProps = if null attrs
+                     then mempty
+                     else selfClosingTag
+                          "style:paragraph-properties" attrs
+  addParaStyle $ inTags True "style:style" styleAttr paraProps
+  return pn
+
 
 paraListStyle :: PandocMonad m => Int -> OD m Int
 paraListStyle l = paraStyle
diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs
--- a/src/Text/Pandoc/Writers/Org.hs
+++ b/src/Text/Pandoc/Writers/Org.hs
@@ -138,7 +138,7 @@
   let drawerStr = if attr == nullAttr
                   then empty
                   else cr <> nest (level + 1) (propertiesDrawer attr)
-  return $ headerStr <> " " <> contents <> drawerStr <> blankline
+  return $ headerStr <> " " <> contents <> drawerStr <> cr
 blockToOrg (CodeBlock (_,classes,kvs) str) = do
   let startnum = maybe "" (\x -> " " <> trimr x) $ lookup "startFrom" kvs
   let numberlines = if "numberLines" `elem` classes
diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs
--- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs
+++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs
@@ -303,11 +303,11 @@
 
 presentationToArchive :: PandocMonad m => WriterOptions -> Presentation -> m Archive
 presentationToArchive opts pres = do
-  distArchive <- (toArchive . BL.fromStrict) <$>
+  distArchive <- toArchive . BL.fromStrict <$>
                       P.readDefaultDataFile "reference.pptx"
   refArchive <- case writerReferenceDoc opts of
                      Just f  -> toArchive <$> P.readFileLazy f
-                     Nothing -> (toArchive . BL.fromStrict) <$>
+                     Nothing -> toArchive . BL.fromStrict <$>
                         P.readDataFile "reference.pptx"
 
   utctime <- P.getCurrentTime
@@ -351,10 +351,10 @@
 getLayout :: PandocMonad m => Layout -> P m Element
 getLayout layout = do
   let layoutpath = case layout of
-        (MetadataSlide{}) -> "ppt/slideLayouts/slideLayout1.xml"
-        (TitleSlide _)          -> "ppt/slideLayouts/slideLayout3.xml"
-        (ContentSlide _ _)      -> "ppt/slideLayouts/slideLayout2.xml"
-        (TwoColumnSlide{})    -> "ppt/slideLayouts/slideLayout4.xml"
+        MetadataSlide{}  -> "ppt/slideLayouts/slideLayout1.xml"
+        TitleSlide{}     -> "ppt/slideLayouts/slideLayout3.xml"
+        ContentSlide{}   -> "ppt/slideLayouts/slideLayout2.xml"
+        TwoColumnSlide{} -> "ppt/slideLayouts/slideLayout4.xml"
   refArchive <- asks envRefArchive
   distArchive <- asks envDistArchive
   parseXml refArchive distArchive layoutpath
@@ -547,7 +547,7 @@
 
 makeMediaEntry :: PandocMonad m => MediaInfo -> P m Entry
 makeMediaEntry mInfo = do
-  epochtime <- (floor . utcTimeToPOSIXSeconds) <$> asks envUTCTime
+  epochtime <- floor . utcTimeToPOSIXSeconds <$> asks envUTCTime
   (imgBytes, _) <- P.fetchItem (T.pack $ mInfoFilePath mInfo)
   let ext = fromMaybe "" (mInfoExt mInfo)
   let fp = "ppt/media/image" <>
@@ -1473,7 +1473,7 @@
 
 elemToEntry :: PandocMonad m => FilePath -> Element -> P m Entry
 elemToEntry fp element = do
-  epochtime <- (floor . utcTimeToPOSIXSeconds) <$> asks envUTCTime
+  epochtime <- floor . utcTimeToPOSIXSeconds <$> asks envUTCTime
   return $ toEntry fp epochtime $ renderXml element
 
 slideToEntry :: PandocMonad m => Slide -> P m Entry
@@ -1500,8 +1500,7 @@
 
 slideToSpeakerNotesRelElement :: PandocMonad m => Slide -> P m (Maybe Element)
 slideToSpeakerNotesRelElement (Slide _ _ (SpeakerNotes [])) = return Nothing
-slideToSpeakerNotesRelElement slide@(
-  Slide{}) = do
+slideToSpeakerNotesRelElement slide@Slide{} = do
   idNum <- slideNum slide
   return $ Just $
     mknode "Relationships"
@@ -1585,10 +1584,10 @@
 slideToSlideRelElement slide = do
   idNum <- slideNum slide
   let target =  case slide of
-        (Slide _ (MetadataSlide{}) _) -> "../slideLayouts/slideLayout1.xml"
-        (Slide _ (TitleSlide _) _)          -> "../slideLayouts/slideLayout3.xml"
-        (Slide _ (ContentSlide _ _) _)      -> "../slideLayouts/slideLayout2.xml"
-        (Slide _ (TwoColumnSlide{}) _)  -> "../slideLayouts/slideLayout4.xml"
+        (Slide _ MetadataSlide{} _)  -> "../slideLayouts/slideLayout1.xml"
+        (Slide _ TitleSlide{} _)     -> "../slideLayouts/slideLayout3.xml"
+        (Slide _ ContentSlide{} _)   -> "../slideLayouts/slideLayout2.xml"
+        (Slide _ TwoColumnSlide{} _) -> "../slideLayouts/slideLayout4.xml"
 
   speakerNotesRels <- maybeToList <$> speakerNotesSlideRelElement slide
 
@@ -1819,7 +1818,7 @@
 
 presentationToContentTypes :: PandocMonad m => Presentation -> P m ContentTypes
 presentationToContentTypes p@(Presentation _ slides) = do
-  mediaInfos <- (mconcat . M.elems) <$> gets stMediaIds
+  mediaInfos <- mconcat . M.elems <$> gets stMediaIds
   filePaths <- patternsToFilePaths $ inheritedPatterns p
   let mediaFps = filter (match (compile "ppt/media/image*")) filePaths
   let defaults = [ DefaultContentType "xml" "application/xml"
diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs
--- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs
+++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs
@@ -537,10 +537,10 @@
 blockToShape :: Block -> Pres Shape
 blockToShape (Plain ils) = blockToShape (Para ils)
 blockToShape (Para (il:_))  | Image attr ils (url, _) <- il =
-      (withAttr attr . Pic def (T.unpack url)) <$> inlinesToParElems ils
+      withAttr attr . Pic def (T.unpack url) <$> inlinesToParElems ils
 blockToShape (Para (il:_))  | Link _ (il':_) target <- il
                             , Image attr ils (url, _) <- il' =
-      (withAttr attr . Pic def{picPropLink = Just $ ExternalTarget target} (T.unpack url))
+      withAttr attr . Pic def{picPropLink = Just $ ExternalTarget target} (T.unpack url)
       <$> inlinesToParElems ils
 blockToShape (Table _ blkCapt specs thead tbody tfoot) = do
   let (caption, algn, _, hdrCells, rows) = toLegacyTable blkCapt specs thead tbody tfoot
@@ -721,7 +721,7 @@
   let enum = Str (tshow n <> ".")
   in
     case blks of
-      (Para ils : blks') -> (Para $ enum : Space : ils) : blks'
+      (Para ils : blks') -> Para (enum : Space : ils) : blks'
       _ -> Para [enum] : blks
 
 forceFontSize :: Pixels -> Pres a -> Pres a
@@ -767,7 +767,7 @@
          mempty
 
 addSpeakerNotesToMetaSlide :: Slide -> [Block] -> Pres (Slide, [Block])
-addSpeakerNotesToMetaSlide (Slide sldId layout@(MetadataSlide{}) spkNotes) blks =
+addSpeakerNotesToMetaSlide (Slide sldId layout@MetadataSlide{} spkNotes) blks =
   do let (ntsBlks, blks') = span isNotesDiv blks
      spkNotes' <- mconcat <$> mapM blockToSpeakerNotes ntsBlks
      return (Slide sldId layout (spkNotes <> spkNotes'), blks')
diff --git a/src/Text/Pandoc/Writers/RTF.hs b/src/Text/Pandoc/Writers/RTF.hs
--- a/src/Text/Pandoc/Writers/RTF.hs
+++ b/src/Text/Pandoc/Writers/RTF.hs
@@ -241,12 +241,12 @@
   | otherwise         = do
       report $ BlockNotRendered b
       return ""
-blockToRTF indent alignment (BulletList lst) = (spaceAtEnd . T.concat) <$>
+blockToRTF indent alignment (BulletList lst) = spaceAtEnd . T.concat <$>
   mapM (listItemToRTF alignment indent (bulletMarker indent)) lst
 blockToRTF indent alignment (OrderedList attribs lst) =
-  (spaceAtEnd . T.concat) <$>
+  spaceAtEnd . T.concat <$>
    zipWithM (listItemToRTF alignment indent) (orderedMarkers indent attribs) lst
-blockToRTF indent alignment (DefinitionList lst) = (spaceAtEnd . T.concat) <$>
+blockToRTF indent alignment (DefinitionList lst) = spaceAtEnd . T.concat <$>
   mapM (definitionListItemToRTF alignment indent) lst
 blockToRTF indent _ HorizontalRule = return $
   rtfPar indent 0 AlignCenter "\\emdash\\emdash\\emdash\\emdash\\emdash"
diff --git a/src/Text/Pandoc/Writers/Shared.hs b/src/Text/Pandoc/Writers/Shared.hs
--- a/src/Text/Pandoc/Writers/Shared.hs
+++ b/src/Text/Pandoc/Writers/Shared.hs
@@ -78,8 +78,8 @@
 -- | Like 'metaToContext, but does not include variables and is
 -- not sensitive to 'writerTemplate'.
 metaToContext' :: (Monad m, TemplateTarget a)
-           => ([Block] -> m (Doc a))
-           -> ([Inline] -> m (Doc a))
+           => ([Block] -> m (Doc a))     -- ^ block writer
+           -> ([Inline] -> m (Doc a))    -- ^ inline writer
            -> Meta
            -> m (Context a)
 metaToContext' blockWriter inlineWriter (Meta metamap) =
@@ -98,9 +98,11 @@
                                mempty
    jsonrep = UTF8.toText $ BL.toStrict $ encode $ toJSON c1
 
+-- | Converts a 'MetaValue' into a doctemplate 'Val', using the given
+-- converter functions.
 metaValueToVal :: (Monad m, TemplateTarget a)
-               => ([Block] -> m (Doc a))
-               -> ([Inline] -> m (Doc a))
+               => ([Block] -> m (Doc a))    -- ^ block writer
+               -> ([Inline] -> m (Doc a))   -- ^ inline writer
                -> MetaValue
                -> m (Val a)
 metaValueToVal blockWriter inlineWriter (MetaMap metamap) =
@@ -145,7 +147,7 @@
   where
     f _newval oldval = oldval
 
--- Produce an HTML tag with the given pandoc attributes.
+-- | Produce an HTML tag with the given pandoc attributes.
 tagWithAttrs :: HasChars a => T.Text -> Attr -> Doc a
 tagWithAttrs tag (ident,classes,kvs) = hsep
   ["<" <> text (T.unpack tag)
@@ -159,18 +161,21 @@
                 doubleQuotes (text $ T.unpack (escapeStringForXML v))) kvs)
   ] <> ">"
 
+-- | Returns 'True' iff the argument is an inline 'Math' element of type
+-- 'DisplayMath'.
 isDisplayMath :: Inline -> Bool
 isDisplayMath (Math DisplayMath _)          = True
 isDisplayMath (Span _ [Math DisplayMath _]) = True
 isDisplayMath _                             = False
 
+-- | Remove leading and trailing 'Space' and 'SoftBreak' elements.
 stripLeadingTrailingSpace :: [Inline] -> [Inline]
 stripLeadingTrailingSpace = go . reverse . go . reverse
   where go (Space:xs)     = xs
         go (SoftBreak:xs) = xs
         go xs             = xs
 
--- Put display math in its own block (for ODT/DOCX).
+-- | Put display math in its own block (for ODT/DOCX).
 fixDisplayMath :: Block -> Block
 fixDisplayMath (Plain lst)
   | any isDisplayMath lst && not (all isDisplayMath lst) =
@@ -192,6 +197,8 @@
                          not (isDisplayMath x || isDisplayMath y)) lst
 fixDisplayMath x = x
 
+-- | Converts a Unicode character into the ASCII sequence used to
+-- represent the character in "smart" Markdown.
 unsmartify :: WriterOptions -> T.Text -> T.Text
 unsmartify opts = T.concatMap $ \c -> case c of
   '\8217' -> "'"
@@ -366,6 +373,8 @@
          Just (MetaBool b)      -> T.pack (show b)
          _                      -> ""
 
+-- | Tries to convert a character into a unicode superscript version of
+-- the character.
 toSuperscript :: Char -> Maybe Char
 toSuperscript '1' = Just '\x00B9'
 toSuperscript '2' = Just '\x00B2'
@@ -381,6 +390,8 @@
   | isSpace c = Just c
   | otherwise = Nothing
 
+-- | Tries to convert a character into a unicode subscript version of
+-- the character.
 toSubscript :: Char -> Maybe Char
 toSubscript '+' = Just '\x208A'
 toSubscript '-' = Just '\x208B'
@@ -402,7 +413,8 @@
              $ map (sectionToListItem opts)
              $ makeSections (writerNumberSections opts) Nothing bs
 
--- | Converts an Element to a list item for a table of contents,
+-- | Converts a section Div to a list item for a table of contents;
+-- returns an empty list if the given block is not a section Div.
 sectionToListItem :: WriterOptions -> Block -> [Block]
 sectionToListItem opts (Div (ident,_,_)
                          (Header lev (_,classes,kvs) ils : subsecs))
@@ -422,6 +434,8 @@
    listContents = filter (not . null) $ map (sectionToListItem opts) subsecs
 sectionToListItem _ _ = []
 
+-- | Returns 'True' iff the list of blocks has a @'Plain'@ as its last
+-- element.
 endsWithPlain :: [Block] -> Bool
 endsWithPlain xs =
   case lastMay xs of
diff --git a/src/Text/Pandoc/Writers/TEI.hs b/src/Text/Pandoc/Writers/TEI.hs
--- a/src/Text/Pandoc/Writers/TEI.hs
+++ b/src/Text/Pandoc/Writers/TEI.hs
@@ -205,14 +205,14 @@
               -> [[Block]]
               -> m (Doc Text)
 tableRowToTEI opts cols =
-  (inTagsIndented "row" . vcat) <$> mapM (tableItemToTEI opts) cols
+  inTagsIndented "row" . vcat <$> mapM (tableItemToTEI opts) cols
 
 tableHeadersToTEI :: PandocMonad m
                   => WriterOptions
                   -> [[Block]]
                   -> m (Doc Text)
 tableHeadersToTEI opts cols =
-  (inTags True "row" [("role","label")] . vcat) <$>
+  inTags True "row" [("role","label")] . vcat <$>
     mapM (tableItemToTEI opts) cols
 
 tableItemToTEI :: PandocMonad m
@@ -220,7 +220,7 @@
                -> [Block]
                -> m (Doc Text)
 tableItemToTEI opts item =
-  (inTags False "cell" [] . vcat) <$> mapM (blockToTEI opts) item
+  inTags False "cell" [] . vcat <$> mapM (blockToTEI opts) item
 
 -- | Convert a list of inline elements to TEI.
 inlinesToTEI :: PandocMonad m => WriterOptions -> [Inline] -> m (Doc Text)
diff --git a/src/Text/Pandoc/Writers/XWiki.hs b/src/Text/Pandoc/Writers/XWiki.hs
--- a/src/Text/Pandoc/Writers/XWiki.hs
+++ b/src/Text/Pandoc/Writers/XWiki.hs
@@ -45,7 +45,7 @@
 import Text.Pandoc.Writers.MediaWiki (highlightingLangs)
 import Text.Pandoc.Writers.Shared (toLegacyTable)
 
-data WriterState = WriterState {
+newtype WriterState = WriterState {
   listLevel :: Text -- String at the beginning of items
 }
 
diff --git a/src/Text/Pandoc/XML.hs b/src/Text/Pandoc/XML.hs
--- a/src/Text/Pandoc/XML.hs
+++ b/src/Text/Pandoc/XML.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE LambdaCase        #-}
 {-# LANGUAGE OverloadedStrings #-}
 {-# LANGUAGE ViewPatterns      #-}
 {- |
@@ -54,7 +55,7 @@
 
 -- | Escape newline characters as &#10;
 escapeNls :: Text -> Text
-escapeNls = T.concatMap $ \x -> case x of
+escapeNls = T.concatMap $ \case
   '\n' -> "&#10;"
   c    -> T.singleton c
 
diff --git a/stack.yaml b/stack.yaml
--- a/stack.yaml
+++ b/stack.yaml
@@ -3,23 +3,16 @@
     trypandoc: false
     embed_data_files: true
     static: false
-  pandoc-citeproc:
-    bibutils: true
-    embed_data_files: true
-    unicode_collation: false
-    test_citeproc: false
-    debug: false
 packages:
 - '.'
 extra-deps:
-- pandoc-types-1.21
-- pandoc-citeproc-0.17.0.1
-- texmath-0.12.0.2
+- citeproc-0.1
+- pandoc-types-1.22
+- texmath-0.12.0.3
+- rfc5051-0.2
 - haddock-library-1.9.0
-- skylighting-0.8.5
-- skylighting-core-0.8.5
-- regex-pcre-builtin-0.95.1.2.8.43
-- regex-base-0.94.0.0
+- skylighting-0.10.0.2
+- skylighting-core-0.10.0.2
 - doclayout-0.3
 - emojis-0.1
 - hslua-1.1.2
@@ -27,12 +20,13 @@
 - HsYAML-0.2.1.0
 - HsYAML-aeson-0.2.0.0
 - doctemplates-0.8.2
-- commonmark-0.1.0.1
-- commonmark-extensions-0.2.0.0
-- commonmark-pandoc-0.2.0.0
+- commonmark-0.1.0.2
+- commonmark-extensions-0.2.0.1
+- commonmark-pandoc-0.2.0.1
 
 ghc-options:
    "$locals": -fhide-source-paths -Wno-missing-home-modules
 resolver: lts-14.6
 nix:
   packages: [zlib]
+
diff --git a/test/Tests/Command.hs b/test/Tests/Command.hs
--- a/test/Tests/Command.hs
+++ b/test/Tests/Command.hs
@@ -28,18 +28,17 @@
 import System.Process
 import Test.Tasty
 import Test.Tasty.HUnit
+import Test.Tasty.Golden.Advanced (goldenTest)
 import Tests.Helpers
 import Text.Pandoc
 import qualified Text.Pandoc.UTF8 as UTF8
 
--- | Run a test with normalize function, return True if test passed.
-runTest :: String    -- ^ Title of test
-        -> FilePath  -- ^ Path to pandoc
-        -> String    -- ^ Shell command
-        -> String    -- ^ Input text
-        -> String    -- ^ Expected output
-        -> TestTree
-runTest testname pandocpath cmd inp norm = testCase testname $ do
+-- | Run a test with and return output.
+execTest :: FilePath  -- ^ Path to pandoc
+         -> String    -- ^ Shell command
+         -> String    -- ^ Input text
+         -> IO (ExitCode, String)  -- ^ Exit code and actual output
+execTest pandocpath cmd inp = do
   mldpath   <- Env.lookupEnv "LD_LIBRARY_PATH"
   mdyldpath <- Env.lookupEnv "DYLD_LIBRARY_PATH"
   let findDynlibDir []           = Nothing
@@ -47,13 +46,32 @@
       findDynlibDir (_:xs)       = findDynlibDir xs
   let mbDynlibDir = findDynlibDir (reverse $ splitDirectories $
                                    takeDirectory $ takeWhile (/=' ') cmd)
-  let dynlibEnv = [("DYLD_LIBRARY_PATH", intercalate ":" $ catMaybes [mbDynlibDir, mdyldpath])
-                  ,("LD_LIBRARY_PATH",   intercalate ":" $ catMaybes [mbDynlibDir, mldpath])]
-  let env' = dynlibEnv ++ [("PATH",takeDirectory pandocpath),("TMP","."),("LANG","en_US.UTF-8"),("HOME", "./"),("pandoc_datadir", "..")]
+  let dynlibEnv = [("DYLD_LIBRARY_PATH",
+                    intercalate ":" $ catMaybes [mbDynlibDir, mdyldpath])
+                  ,("LD_LIBRARY_PATH",
+                    intercalate ":" $ catMaybes [mbDynlibDir, mldpath])]
+  let env' = dynlibEnv ++ [("PATH",takeDirectory pandocpath),("TMP","."),
+                           ("LANG","en_US.UTF-8"),
+                           ("HOME", "./"),
+                           ("pandoc_datadir", "..")]
   let pr = (shell cmd){ env = Just env' }
   (ec, out', err') <- readCreateProcessWithExitCode pr inp
   -- filter \r so the tests will work on Windows machines
   let out = filter (/= '\r') $ err' ++ out'
+  case ec of
+    ExitFailure _ -> hPutStr stderr err'
+    ExitSuccess   -> return ()
+  return (ec, out)
+
+-- | Run a test, return True if test passed.
+runTest :: String    -- ^ Title of test
+        -> FilePath  -- ^ Path to pandoc
+        -> String    -- ^ Shell command
+        -> String    -- ^ Input text
+        -> String    -- ^ Expected output
+        -> TestTree
+runTest testname pandocpath cmd inp norm = testCase testname $ do
+  (ec, out) <- execTest pandocpath cmd inp
   result  <- if ec == ExitSuccess
                 then
                   if out == norm
@@ -61,9 +79,7 @@
                      else return
                           $ TestFailed cmd "expected"
                           $ getDiff (lines out) (lines norm)
-                else do
-                  hPutStr stderr err'
-                  return $ TestError ec
+                else return $ TestError ec
   assertBool (show result) (result == TestPassed)
 
 tests :: FilePath -> TestTree
@@ -86,18 +102,34 @@
 dropPercent ('%':xs) = dropWhile (== ' ') xs
 dropPercent xs       = xs
 
-runCommandTest :: FilePath -> Int -> String -> TestTree
-runCommandTest pandocpath num code =
-  let codelines = lines code
-      (continuations, r1) = span ("\\" `isSuffixOf`) codelines
-      (cmd, r2) = (dropPercent (unwords (map init continuations ++ take 1 r1)),
-                   drop 1 r1)
-      (inplines, r3) = break (=="^D") r2
-      normlines = takeWhile (/=".") (drop 1 r3)
-      input = unlines inplines
-      norm = unlines normlines
-      shcmd = cmd -- trimr $ takeDirectory pandocpath </> cmd
-  in  runTest ("#" ++ show num) pandocpath shcmd input norm
+runCommandTest :: FilePath -> FilePath -> Int -> String -> TestTree
+runCommandTest pandocpath fp num code =
+  goldenTest testname getExpected getActual compareValues updateGolden
+ where
+  testname = "#" <> show num
+  codelines = lines code
+  (continuations, r1) = span ("\\" `isSuffixOf`) codelines
+  cmd = dropPercent (unwords (map init continuations ++ take 1 r1))
+  r2 = drop 1 r1
+  (inplines, r3) = break (=="^D") r2
+  normlines = takeWhile (/=".") (drop 1 r3)
+  input = unlines inplines
+  norm = unlines normlines
+  getExpected = return norm
+  getActual = snd <$> execTest pandocpath cmd input
+  compareValues expected actual
+    | actual == expected = return Nothing
+    | otherwise = return $ Just $ "--- test/command/" ++ fp ++ "\n+++ " ++
+                                cmd ++ "\n" ++ showDiff (1,1)
+                                   (getDiff (lines actual) (lines expected))
+  updateGolden newnorm = do
+    let fp' = "command" </> fp
+    raw <- UTF8.readFile fp'
+    let cmdline = "% " <> cmd
+    let x = cmdline <> "\n" <> input <> "^D\n" <> norm
+    let y = cmdline <> "\n" <> input <> "^D\n" <> newnorm
+    let updated = T.unpack $ T.replace (T.pack x) (T.pack y) (T.pack raw)
+    UTF8.writeFile fp' updated
 
 extractCommandTest :: FilePath -> FilePath -> TestTree
 extractCommandTest pandocpath fp = unsafePerformIO $ do
@@ -105,5 +137,5 @@
   Pandoc _ blocks <- runIOorExplode (readMarkdown
                         def{ readerExtensions = pandocExtensions } contents)
   let codeblocks = map extractCode $ filter isCodeBlock blocks
-  let cases = zipWith (runCommandTest pandocpath) [1..] codeblocks
+  let cases = zipWith (runCommandTest pandocpath fp) [1..] codeblocks
   return $ testGroup fp cases
diff --git a/test/Tests/Helpers.hs b/test/Tests/Helpers.hs
--- a/test/Tests/Helpers.hs
+++ b/test/Tests/Helpers.hs
@@ -1,7 +1,6 @@
 {-# LANGUAGE CPP #-}
 {-# LANGUAGE NoImplicitPrelude #-}
 {-# LANGUAGE FlexibleInstances    #-}
-{-# LANGUAGE TypeSynonymInstances #-}
 {- |
    Module      : Tests.Helpers
    Copyright   : © 2006-2020 John MacFarlane
@@ -104,7 +103,7 @@
              -- cabalv1
              "test-pandoc" : "build" : ps
                -> joinPath (reverse ps) </> "build" </> "pandoc"
-             _ -> error $ "findPandoc: could not find pandoc executable"
+             _ -> error "findPandoc: could not find pandoc executable"
   let pandocPath = pandocDir </> "pandoc"
 #ifdef _WINDOWS
                              <.> "exe"
diff --git a/test/Tests/Old.hs b/test/Tests/Old.hs
--- a/test/Tests/Old.hs
+++ b/test/Tests/Old.hs
@@ -14,7 +14,6 @@
 
 import Prelude
 import Data.Algorithm.Diff
-import Prelude hiding (readFile)
 import Data.List (intercalate)
 import Data.Maybe (catMaybes)
 import System.Exit
@@ -67,8 +66,11 @@
       ]
     ]
   , testGroup "html"
-    [ testGroup "writer" (writerTests' "html4" ++ writerTests' "html5" ++
-        lhsWriterTests' "html")
+    [ testGroup "writer" $ mconcat
+      [ extWriterTests' "html4"
+      , extWriterTests' "html5"
+      , lhsWriterTests' "html"
+      ]
     , test' "reader" ["-r", "html", "-w", "native", "-s"]
       "html-reader.html" "html-reader.native"
     ]
@@ -225,6 +227,7 @@
     fb2WriterTest'  = fb2WriterTest pandocPath
     lhsWriterTests' = lhsWriterTests pandocPath
     lhsReaderTest'  = lhsReaderTest pandocPath
+    extWriterTests' = extendedWriterTests pandocPath
 
 -- makes sure file is fully closed after reading
 readFile' :: FilePath -> IO String
@@ -260,6 +263,20 @@
     opts = ["-r", "native", "-w", format, "--columns=78",
             "--variable", "pandoc-version="]
 
+extendedWriterTests :: FilePath -> String -> [TestTree]
+extendedWriterTests pandocPath format
+  = writerTests pandocPath format ++
+    let testForTable name =
+          test pandocPath
+               (name ++ " table")
+               opts
+               ("tables" </> name <.> "native")
+               ("tables" </> name <.> format)
+    in map testForTable ["planets", "nordics", "students"]
+  where
+    opts = ["-r", "native", "-w", format, "--columns=78",
+            "--variable", "pandoc-version="]
+
 s5WriterTest :: FilePath -> String -> [String] -> String -> TestTree
 s5WriterTest pandocPath modifier opts format
   = test pandocPath (format ++ " writer (" ++ modifier ++ ")")
@@ -273,7 +290,7 @@
   where
     formatXML xml = splitTags $ zip xml (drop 1 xml)
     splitTags []               = []
-    splitTags [end]            = fst end : snd end : []
+    splitTags [end]            = [fst end, snd end]
     splitTags (('>','<'):rest) = ">\n" ++ splitTags rest
     splitTags ((c,_):rest)     = c : splitTags rest
     ignoreBinary = unlines . filter (not . startsWith "<binary ") . lines
diff --git a/test/Tests/Readers/Docx.hs b/test/Tests/Readers/Docx.hs
--- a/test/Tests/Readers/Docx.hs
+++ b/test/Tests/Readers/Docx.hs
@@ -33,7 +33,7 @@
 -- tests. Since we do our own normalization, we want to make sure
 -- we're doing it right.
 
-data NoNormPandoc = NoNormPandoc {unNoNorm :: Pandoc}
+newtype NoNormPandoc = NoNormPandoc {unNoNorm :: Pandoc}
                  deriving Show
 
 noNorm :: Pandoc -> NoNormPandoc
@@ -405,6 +405,10 @@
             "paragraph insertion/deletion (all)"
             "docx/paragraph_insertion_deletion.docx"
             "docx/paragraph_insertion_deletion_all.native"
+          , testCompareWithOpts def{readerTrackChanges=AllChanges}
+            "paragraph insertion/deletion (all)"
+            "docx/track_changes_scrubbed_metadata.docx"
+            "docx/track_changes_scrubbed_metadata.native"
           , testForWarningsWithOpts def{readerTrackChanges=AcceptChanges}
             "comment warnings (accept -- no warnings)"
             "docx/comments_warning.docx"
diff --git a/test/Tests/Readers/LaTeX.hs b/test/Tests/Readers/LaTeX.hs
--- a/test/Tests/Readers/LaTeX.hs
+++ b/test/Tests/Readers/LaTeX.hs
@@ -148,30 +148,47 @@
                                   , simpleCell (plain "Two")
                                   ]
                    ]
+          , "table with multicolumn item (#6596)" =:
+            "\\begin{tabular}{l c r}One & \\multicolumn{2}{c}{Two} & \\\\ \\end{tabular}" =?>
+            table' [AlignLeft, AlignCenter, AlignRight]
+                   [ Row nullAttr [ simpleCell (plain "One")
+                                  , cell AlignCenter (RowSpan 1) (ColSpan 2) (plain "Two")
+                                  ]
+                   ]
           , "Table with multirow item" =:
             T.unlines ["\\begin{tabular}{c}"
-                      ,"\\multirow{2}{c}{One}\\\\Two\\\\"
+                      ,"\\multirow{2}{5em}{One}\\\\Two\\\\"
                       ,"\\end{tabular}"
                       ] =?>
             table' [AlignCenter]
-                  [ Row nullAttr [ cell AlignCenter (RowSpan 2) (ColSpan 1) (plain "One") ]
+                  [ Row nullAttr [ cell AlignDefault (RowSpan 2) (ColSpan 1) (plain "One") ]
                   , Row nullAttr [ simpleCell (plain "Two") ]
                   ]
+          , "Table with multirow item using full prototype" =:
+            T.unlines ["\\begin{tabular}{c}"
+                      ,"\\multirow[c]{2}[3]{5em}[1in]{One}\\\\Two\\\\"
+                      ,"\\end{tabular}"
+                      ] =?>
+            table' [AlignCenter]
+                  [ Row nullAttr [ cell AlignDefault (RowSpan 2) (ColSpan 1) (plain "One") ]
+                  , Row nullAttr [ simpleCell (plain "Two") ]
+                  ]
           , "Table with nested multirow/multicolumn item" =:
-            T.unlines [ "\\begin{tabular}{c c c}"
-                      , "\\multirow{2}{c}{\\multicolumn{2}{c}{One}}&Two\\\\"
-                      , "Three\\\\"
-                      , "Four&Five&Six\\\\"
+            T.unlines [ "\\begin{tabular}{c c c c}"
+                      , "\\multicolumn{3}{c}{\\multirow{2}{5em}{One}}&Two\\\\"
+                      , "\\multicolumn{2}{c}{} & & Three\\\\"
+                      , "Four&Five&Six&Seven\\\\"
                       , "\\end{tabular}"
                       ] =?>
-            table' [AlignCenter, AlignCenter, AlignCenter]
-                   [ Row nullAttr [ cell AlignCenter (RowSpan 2) (ColSpan 2) (plain "One")
+            table' [AlignCenter, AlignCenter, AlignCenter, AlignCenter]
+                   [ Row nullAttr [ cell AlignCenter (RowSpan 2) (ColSpan 3) (plain "One")
                                   , simpleCell (plain "Two")
                                   ]
                    , Row nullAttr [ simpleCell (plain "Three") ]
                    , Row nullAttr [ simpleCell (plain "Four") 
                                   , simpleCell (plain "Five")
                                   , simpleCell (plain "Six")
+                                  , simpleCell (plain "Seven")
                                   ]
                    ]
           , "Table with multicolumn header" =:
@@ -188,6 +205,25 @@
                                                          ]
                                            ]
                   ]
+                  (TableFoot nullAttr [])
+          , "Table with normal empty cells" =:
+            T.unlines [ "\\begin{tabular}{|r|r|r|}"
+                      , "A &   & B \\\\"
+                      , "  & C &"
+                      , "\\end{tabular}"
+                      ] =?>
+            table emptyCaption
+                  (replicate 3 (AlignRight, ColWidthDefault))
+                  (TableHead nullAttr [])
+                  [TableBody nullAttr 0 []
+                    [Row nullAttr [ simpleCell (plain "A")
+                                  , emptyCell
+                                  , simpleCell (plain "B")
+                                  ]
+                    ,Row nullAttr [ emptyCell
+                                  , simpleCell (plain "C")
+                                  , emptyCell
+                                  ]]]
                   (TableFoot nullAttr [])
           ]
 
diff --git a/test/Tests/Readers/Man.hs b/test/Tests/Readers/Man.hs
--- a/test/Tests/Readers/Man.hs
+++ b/test/Tests/Readers/Man.hs
@@ -68,7 +68,7 @@
   testGroup "Escapes" [
       "fonts" =:
       "aa\\fIbb\\fRcc"
-      =?>para (str "aa" <> (emph $ str "bb") <> str "cc")
+      =?>para (str "aa" <> emph (str "bb") <> str "cc")
     , "nested fonts" =:
       "\\f[BI]hi\\f[I] there\\f[R]"
       =?> para (emph (strong (text "hi") <> text " there"))
diff --git a/test/Tests/Readers/Markdown.hs b/test/Tests/Readers/Markdown.hs
--- a/test/Tests/Readers/Markdown.hs
+++ b/test/Tests/Readers/Markdown.hs
@@ -471,7 +471,7 @@
                         , citationPrefix  = []
                         , citationSuffix  = []
                         , citationMode    = AuthorInText
-                        , citationNoteNum = 0
+                        , citationNoteNum = 1
                         , citationHash    = 0
                         }
                 ] "@item1")
@@ -481,12 +481,12 @@
                         , citationPrefix  = []
                         , citationSuffix  = []
                         , citationMode    = AuthorInText
-                        , citationNoteNum = 0
+                        , citationNoteNum = 1
                         , citationHash    = 0
                         }
                 ] "@1657:huyghens")
           ]
-        , let citation = cite [Citation "cita" [] [] AuthorInText 0 0] (str "@cita")
+        , let citation = cite [Citation "cita" [] [] AuthorInText 1 0] (str "@cita")
           in testGroup "footnote/link following citation" -- issue #2083
           [ "footnote" =:
               T.unlines [ "@cita[^note]"
@@ -523,7 +523,7 @@
           , "regular citation" =:
               "@cita [foo]" =?>
               para (
-                cite [Citation "cita" [] [Str "foo"] AuthorInText 0 0]
+                cite [Citation "cita" [] [Str "foo"] AuthorInText 1 0]
                   (str "@cita" <> space <> str "[foo]")
               )
           ]
diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs
--- a/test/Tests/Readers/Muse.hs
+++ b/test/Tests/Readers/Muse.hs
@@ -51,7 +51,7 @@
           (TableFoot nullAttr [])
   where
     toRow = Row nullAttr . map simpleCell
-    toHeaderRow l = if null l then [] else [toRow l]
+    toHeaderRow l = [toRow l | not (null l)]
 
 -- Tables don't round-trip yet
 --
diff --git a/test/Tests/Readers/Org/Block/Table.hs b/test/Tests/Readers/Org/Block/Table.hs
--- a/test/Tests/Readers/Org/Block/Table.hs
+++ b/test/Tests/Readers/Org/Block/Table.hs
@@ -35,7 +35,7 @@
           (TableFoot nullAttr [])
   where
     toRow = Row nullAttr . map simpleCell
-    toHeaderRow l = if null l then [] else [toRow l]
+    toHeaderRow l = [toRow l | not (null l)]
 
 tests :: [TestTree]
 tests =
diff --git a/test/Tests/Readers/Org/Directive.hs b/test/Tests/Readers/Org/Directive.hs
--- a/test/Tests/Readers/Org/Directive.hs
+++ b/test/Tests/Readers/Org/Directive.hs
@@ -30,7 +30,7 @@
               -> (T.Text, c)    -- ^ (input, expected value)
               -> TestTree
 testWithFiles fileDefs = test (orgWithFiles fileDefs)
-  where
+
 orgWithFiles :: [(FilePath, BS.ByteString)] -> T.Text -> Pandoc
 orgWithFiles fileDefs input =
   let readOrg' = readOrg def{ readerExtensions = getDefaultExtensions "org" }
diff --git a/test/Tests/Readers/Txt2Tags.hs b/test/Tests/Readers/Txt2Tags.hs
--- a/test/Tests/Readers/Txt2Tags.hs
+++ b/test/Tests/Readers/Txt2Tags.hs
@@ -54,7 +54,7 @@
           (TableFoot nullAttr [])
   where
     toRow = Row nullAttr . map simpleCell
-    toHeaderRow l = if null l then [] else [toRow l]
+    toHeaderRow l = [toRow l | not (null l)]
 
 tests :: [TestTree]
 tests =
diff --git a/test/Tests/Shared.hs b/test/Tests/Shared.hs
--- a/test/Tests/Shared.hs
+++ b/test/Tests/Shared.hs
@@ -35,24 +35,24 @@
 
 testCollapse :: [TestTree]
 testCollapse = map (testCase "collapse")
- [  collapseFilePath (joinPath [ ""]) @?= (joinPath [ ""])
- ,  collapseFilePath (joinPath [ ".","foo"]) @?= (joinPath [ "foo"])
- ,  collapseFilePath (joinPath [ ".",".","..","foo"]) @?= (joinPath [ joinPath ["..", "foo"]])
- ,  collapseFilePath (joinPath [ "..","foo"]) @?= (joinPath [ "..","foo"])
- ,  collapseFilePath (joinPath [ "","bar","..","baz"]) @?= (joinPath [ "","baz"])
- ,  collapseFilePath (joinPath [ "","..","baz"]) @?= (joinPath [ "","..","baz"])
- ,  collapseFilePath (joinPath [ ".","foo","..",".","bar","..",".",".","baz"]) @?= (joinPath [ "baz"])
- ,  collapseFilePath (joinPath [ ".",""]) @?= (joinPath [ ""])
- ,  collapseFilePath (joinPath [ ".",".",""]) @?= (joinPath [ ""])
- ,  collapseFilePath (joinPath [ "..",""]) @?= (joinPath [ ".."])
- ,  collapseFilePath (joinPath [ "..",".",""]) @?= (joinPath [ ".."])
- ,  collapseFilePath (joinPath [ ".","..",""]) @?= (joinPath [ ".."])
- ,  collapseFilePath (joinPath [ "..","..",""]) @?= (joinPath [ "..",".."])
- ,  collapseFilePath (joinPath [ "parent","foo","baz","..","bar"]) @?= (joinPath [ "parent","foo","bar"])
- ,  collapseFilePath (joinPath [ "parent","foo","baz","..","..","bar"]) @?= (joinPath [ "parent","bar"])
- ,  collapseFilePath (joinPath [ "parent","foo",".."]) @?= (joinPath [ "parent"])
- ,  collapseFilePath (joinPath [ "","parent","foo","..","..","bar"]) @?= (joinPath [ "","bar"])
- ,  collapseFilePath (joinPath [ "",".","parent","foo"]) @?= (joinPath [ "","parent","foo"])]
+ [  collapseFilePath (joinPath [ ""]) @?= joinPath [ ""]
+ ,  collapseFilePath (joinPath [ ".","foo"]) @?= joinPath [ "foo"]
+ ,  collapseFilePath (joinPath [ ".",".","..","foo"]) @?= joinPath [ joinPath ["..", "foo"]]
+ ,  collapseFilePath (joinPath [ "..","foo"]) @?= joinPath [ "..","foo"]
+ ,  collapseFilePath (joinPath [ "","bar","..","baz"]) @?= joinPath [ "","baz"]
+ ,  collapseFilePath (joinPath [ "","..","baz"]) @?= joinPath [ "","..","baz"]
+ ,  collapseFilePath (joinPath [ ".","foo","..",".","bar","..",".",".","baz"]) @?= joinPath [ "baz"]
+ ,  collapseFilePath (joinPath [ ".",""]) @?= joinPath [ ""]
+ ,  collapseFilePath (joinPath [ ".",".",""]) @?= joinPath [ ""]
+ ,  collapseFilePath (joinPath [ "..",""]) @?= joinPath [ ".."]
+ ,  collapseFilePath (joinPath [ "..",".",""]) @?= joinPath [ ".."]
+ ,  collapseFilePath (joinPath [ ".","..",""]) @?= joinPath [ ".."]
+ ,  collapseFilePath (joinPath [ "..","..",""]) @?= joinPath [ "..",".."]
+ ,  collapseFilePath (joinPath [ "parent","foo","baz","..","bar"]) @?= joinPath [ "parent","foo","bar"]
+ ,  collapseFilePath (joinPath [ "parent","foo","baz","..","..","bar"]) @?= joinPath [ "parent","bar"]
+ ,  collapseFilePath (joinPath [ "parent","foo",".."]) @?= joinPath [ "parent"]
+ ,  collapseFilePath (joinPath [ "","parent","foo","..","..","bar"]) @?= joinPath [ "","bar"]
+ ,  collapseFilePath (joinPath [ "",".","parent","foo"]) @?= joinPath [ "","parent","foo"]]
 
 testLegacyTable :: [TestTree]
 testLegacyTable =
diff --git a/test/Tests/Writers/AnnotatedTable.hs b/test/Tests/Writers/AnnotatedTable.hs
new file mode 100644
--- /dev/null
+++ b/test/Tests/Writers/AnnotatedTable.hs
@@ -0,0 +1,254 @@
+{-# LANGUAGE NoImplicitPrelude #-}
+{-# LANGUAGE OverloadedStrings #-}
+{- |
+   Module      : Tests.Writers.AnnotatedTable
+   Copyright   : 2020 Christian Despres
+   License     : GNU GPL, version 2 or above
+
+   Maintainer  : Christian Despres <christian.j.j.despres@gmail.com>
+   Stability   : alpha
+   Portability : portable
+
+Tests for the table helper functions.
+-}
+module Tests.Writers.AnnotatedTable
+  ( tests
+  )
+where
+
+import           Prelude
+import qualified Data.Foldable                 as F
+import qualified Data.List.NonEmpty            as NonEmpty
+import           Test.Tasty
+import           Test.Tasty.HUnit               ( testCase
+                                                , (@?=)
+                                                )
+import           Test.Tasty.QuickCheck          ( QuickCheckTests(..)
+                                                , Property
+                                                , Testable
+                                                , conjoin
+                                                , forAll
+                                                , testProperty
+                                                , (===)
+                                                , vectorOf
+                                                , choose
+                                                , arbitrary
+                                                , elements
+                                                )
+import           Text.Pandoc.Arbitrary          ( )
+import           Text.Pandoc.Builder
+import qualified Text.Pandoc.Writers.AnnotatedTable
+                                               as Ann
+
+tests :: [TestTree]
+tests = [testGroup "toTable" $ testAnnTable <> annTableProps]
+
+getSpec :: Ann.Cell -> [ColSpec]
+getSpec (Ann.Cell colspec _ _) = F.toList colspec
+
+catHeaderSpec :: Ann.HeaderRow -> [ColSpec]
+catHeaderSpec (Ann.HeaderRow _ _ x) = concatMap getSpec x
+
+catBodySpec :: Ann.BodyRow -> [ColSpec]
+catBodySpec (Ann.BodyRow _ _ x y) = concatMap getSpec x <> concatMap getSpec y
+
+-- Test if the first list can be obtained from the second by deleting
+-- elements from it.
+isSubsetOf :: Eq a => [a] -> [a] -> Bool
+isSubsetOf (x : xs) (y : ys) | x == y    = isSubsetOf xs ys
+                             | otherwise = isSubsetOf (x : xs) ys
+isSubsetOf [] _  = True
+isSubsetOf _  [] = False
+
+testAnnTable :: [TestTree]
+testAnnTable =
+  [testCase "annotates a sample table properly" $ generated @?= expected]
+ where
+  spec1 = (AlignRight, ColWidthDefault)
+  spec2 = (AlignLeft, ColWidthDefault)
+  spec3 = (AlignCenter, ColWidthDefault)
+  spec  = [spec1, spec2, spec3]
+
+  cl a h w = Cell (a, [], []) AlignDefault h w []
+  rws = map $ Row nullAttr
+  th  = TableHead nullAttr . rws
+  tb n x y = TableBody nullAttr n (rws x) (rws y)
+  tf           = TableFoot nullAttr . rws
+  initialHeads = [[cl "a" 1 1, cl "b" 3 2], [cl "c" 2 2, cl "d" 1 1]]
+  initialTB1   = tb 1
+                    [[], [cl "e" 5 1, cl "f" (-7) 0]]
+                    [[cl "g" 4 3, cl "h" 4 3], [], [emptyCell]]
+  initialTB2 = tb 2 [] [[cl "i" 4 3, cl "j" 4 3]]
+  generated  = Ann.toTable nullAttr
+                           emptyCaption
+                           spec
+                           (th initialHeads)
+                           [initialTB1, initialTB2]
+                           (tf initialHeads)
+
+  acl al n a h w =
+    Ann.Cell (NonEmpty.fromList al) n $ Cell (a, [], []) AlignDefault h w []
+  emptyAnnCell al n = acl al n "" 1 1
+  ahrw    = Ann.HeaderRow nullAttr
+  abrw    = Ann.BodyRow nullAttr
+  ath     = Ann.TableHead nullAttr
+  atb     = Ann.TableBody nullAttr
+  atf     = Ann.TableFoot nullAttr
+
+  finalTH = ath
+    [ ahrw 0 [acl [spec1] 0 "a" 1 1, acl [spec2, spec3] 1 "b" 2 2]
+    , ahrw 1 [acl [spec1] 0 "c" 1 1]
+    ]
+  finalTB1 = atb
+    1
+    [ ahrw
+      2
+      [emptyAnnCell [spec1] 0, emptyAnnCell [spec2] 1, emptyAnnCell [spec3] 2]
+    , ahrw
+      3
+      [acl [spec1] 0 "e" 1 1, acl [spec2] 1 "f" 1 1, emptyAnnCell [spec3] 2]
+    ]
+    [ abrw 4 [acl [spec1] 0 "g" 3 1] [acl [spec2, spec3] 1 "h" 3 2]
+    , abrw 5 []                      []
+    , abrw 6 []                      []
+    ]
+  finalTB2 =
+    atb 2 [] [abrw 7 [acl [spec1, spec2] 0 "i" 1 2] [acl [spec3] 2 "j" 1 1]]
+  finalTF = atf
+    [ ahrw 8 [acl [spec1] 0 "a" 1 1, acl [spec2, spec3] 1 "b" 2 2]
+    , ahrw 9 [acl [spec1] 0 "c" 1 1]
+    ]
+  expected =
+    Ann.Table nullAttr emptyCaption spec finalTH [finalTB1, finalTB2] finalTF
+
+withColSpec :: Testable prop => ([ColSpec] -> prop) -> Property
+withColSpec = forAll arbColSpec
+ where
+  arbColSpec = do
+    cs <- choose (1 :: Int, 6)
+    vectorOf
+      cs
+      ((,) <$> arbitrary <*> elements
+        [ColWidthDefault, ColWidth (1 / 3), ColWidth 0.25]
+      )
+
+annTableProps :: [TestTree]
+annTableProps =
+  localOption (QuickCheckTests 50)
+    <$> [ testProperty "normalizes like the table builder"  propBuilderAnnTable
+        , testProperty "has valid final cell columns"       propColNumber
+        , testProperty "has valid first row column data"    propFirstRowCols
+        , testProperty "has valid all row column data"      propColSubsets
+        , testProperty "has valid cell column data lengths" propCellColLengths
+        ]
+
+-- The property that Ann.toTable will normalize a table identically to
+-- the table builder. This should mean that Ann.toTable is at least as
+-- rigorous as Builder.table in that respect without repeating those
+-- tests here (see the pandoc-types Table tests for examples).
+propBuilderAnnTable :: TableHead -> [TableBody] -> TableFoot -> Property
+propBuilderAnnTable th tbs tf = withColSpec $ \cs ->
+  convertTable (table emptyCaption cs th tbs tf)
+    === convertAnnTable (Ann.toTable nullAttr emptyCaption cs th tbs tf)
+ where
+  convertTable blks = case toList blks of
+    [Table _ _ colspec a b c] -> Right (colspec, a, b, c)
+    x                         -> Left x
+  convertAnnTable x = case Ann.fromTable x of
+    (_, _, colspec, a, b, c) -> Right (colspec, a, b, c)
+
+-- The property of Ann.toTable that if the last cell in the first row
+-- of a table section has ColSpan w and ColNumber n, then w + n is the
+-- width of the table.
+propColNumber :: TableHead -> [TableBody] -> TableFoot -> Property
+propColNumber th tbs tf = withColSpec $ \cs ->
+  let twidth = length cs
+      Ann.Table _ _ _ ath atbs atf =
+          Ann.toTable nullAttr emptyCaption cs th tbs tf
+  in  conjoin
+        $  [colNumTH twidth ath]
+        <> (colNumTB twidth <$> atbs)
+        <> [colNumTF twidth atf]
+ where
+  colNumTH n (Ann.TableHead _ rs) = firstly (isHeaderValid n) rs
+  colNumTB n (Ann.TableBody _ _ rs ts) =
+    firstly (isHeaderValid n) rs && firstly (isBodyValid n) ts
+  colNumTF n (Ann.TableFoot _ rs) = firstly (isHeaderValid n) rs
+
+  isHeaderValid n (Ann.HeaderRow _ _ x) = isSegmentValid n x
+  isBodyValid n (Ann.BodyRow _ _ _ x) = isSegmentValid n x
+
+  firstly f (x : _) = f x
+  firstly _ []      = True
+  lastly f [x     ] = f x
+  lastly f (_ : xs) = lastly f xs
+  lastly _ []       = True
+
+  isSegmentValid twidth cs =
+    flip lastly cs
+      $ \(Ann.Cell _ (Ann.ColNumber n) (Cell _ _ _ (ColSpan w) _)) ->
+          n + w == twidth
+
+-- The property of an Ann.Table from Ann.toTable that if the NonEmpty
+-- ColSpec data of the cells in the first row of a table section are
+-- concatenated, the result should equal the [ColSpec] of the entire
+-- table.
+propFirstRowCols :: TableHead -> [TableBody] -> TableFoot -> Property
+propFirstRowCols th tbs tf = withColSpec $ \cs ->
+  let Ann.Table _ _ _ ath atbs atf =
+          Ann.toTable nullAttr emptyCaption cs th tbs tf
+  in  conjoin
+        $  [firstRowTH cs ath]
+        <> (firstRowTB cs <$> atbs)
+        <> [firstRowTF cs atf]
+ where
+  firstly f (x : _) = f x
+  firstly _ []      = True
+
+  firstHeaderValid cs = firstly $ \r -> cs == catHeaderSpec r
+  firstBodyValid cs = firstly $ \r -> cs == catBodySpec r
+
+  firstRowTH cs (Ann.TableHead _ rs) = firstHeaderValid cs rs
+  firstRowTB cs (Ann.TableBody _ _ rs ts) =
+    firstHeaderValid cs rs && firstBodyValid cs ts
+  firstRowTF cs (Ann.TableFoot _ rs) = firstHeaderValid cs rs
+
+-- The property that in any row in an Ann.Table from Ann.toTable, the
+-- NonEmpty ColSpec annotations on cells, when concatenated, form a
+-- subset (really sublist) of the [ColSpec] of the entire table.
+propColSubsets :: TableHead -> [TableBody] -> TableFoot -> Property
+propColSubsets th tbs tf = withColSpec $ \cs ->
+  let Ann.Table _ _ _ ath atbs atf =
+          Ann.toTable nullAttr emptyCaption cs th tbs tf
+  in  conjoin
+        $  subsetTH cs ath
+        <> concatMap (subsetTB cs) atbs
+        <> subsetTF cs atf
+ where
+  subsetTH cs (Ann.TableHead _ rs) = map (subsetHeader cs) rs
+  subsetTB cs (Ann.TableBody _ _ rs ts) =
+    map (subsetHeader cs) rs <> map (subsetBody cs) ts
+  subsetTF cs (Ann.TableFoot _ rs) = map (subsetHeader cs) rs
+
+  subsetHeader cs r = catHeaderSpec r `isSubsetOf` cs
+  subsetBody cs r = catBodySpec r `isSubsetOf` cs
+
+-- The property that in any cell in an Ann.Table from Ann.toTable, the
+-- NonEmpty ColSpec annotation on a cell is equal in length to its
+-- ColSpan.
+propCellColLengths :: TableHead -> [TableBody] -> TableFoot -> Property
+propCellColLengths th tbs tf = withColSpec $ \cs ->
+  let Ann.Table _ _ _ ath atbs atf =
+          Ann.toTable nullAttr emptyCaption cs th tbs tf
+  in  conjoin $ cellColTH ath <> concatMap cellColTB atbs <> cellColTF atf
+ where
+  cellColTH (Ann.TableHead _ rs) = concatMap cellColHeader rs
+  cellColTB (Ann.TableBody _ _ rs ts) =
+    concatMap cellColHeader rs <> concatMap cellColBody ts
+  cellColTF (Ann.TableFoot _ rs) = concatMap cellColHeader rs
+
+  cellColHeader (Ann.HeaderRow _ _ x) = fmap validLength x
+  cellColBody (Ann.BodyRow _ _ x y) = fmap validLength x <> fmap validLength y
+
+  validLength (Ann.Cell colspec _ (Cell _ _ _ (ColSpan w) _)) =
+    length colspec == w
diff --git a/test/Tests/Writers/Docx.hs b/test/Tests/Writers/Docx.hs
--- a/test/Tests/Writers/Docx.hs
+++ b/test/Tests/Writers/Docx.hs
@@ -84,6 +84,11 @@
             "docx/lists_restarting.native"
             "docx/golden/lists_restarting.docx"
           , docxTest
+            "lists with multiple initial list levels"
+            def
+            "docx/lists_multiple_initial.native"
+            "docx/golden/lists_multiple_initial.docx"
+          , docxTest
             "definition lists"
             def
             "docx/definition_list.native"
@@ -145,6 +150,11 @@
             def
             "docx/comments.native"
             "docx/golden/comments.docx"
+          , docxTest
+            "scrubbed metadata"
+            def
+            "docx/track_changes_scrubbed_metadata.native"
+            "docx/golden/track_changes_scrubbed_metadata.docx"
           ]
         , testGroup "custom styles"
           [ docxTest "custom styles without reference.docx"
diff --git a/test/Tests/Writers/OOXML.hs b/test/Tests/Writers/OOXML.hs
--- a/test/Tests/Writers/OOXML.hs
+++ b/test/Tests/Writers/OOXML.hs
@@ -48,7 +48,7 @@
   showDiff (1,1) $ getDiff (lines $ ppContent elemA) (lines $ ppContent elemB)
 
 goldenArchive :: FilePath -> IO Archive
-goldenArchive fp = (toArchive . BL.fromStrict) <$> BS.readFile fp
+goldenArchive fp = toArchive . BL.fromStrict <$> BS.readFile fp
 
 testArchive :: (WriterOptions -> Pandoc -> PandocIO BL.ByteString)
             -> WriterOptions
diff --git a/test/command/1279.md b/test/command/1279.md
--- a/test/command/1279.md
+++ b/test/command/1279.md
@@ -9,7 +9,7 @@
 [^1]: Dept. of This and That
 ^D
 ---
-author: 'John Doe[^1]'
+author: "John Doe[^1]"
 date: 2014
 title: My Article
 ---
diff --git a/test/command/1608.md b/test/command/1608.md
--- a/test/command/1608.md
+++ b/test/command/1608.md
@@ -33,7 +33,7 @@
 ,Div ("",["lemma"],[])
  [Para [Strong [Str "Lemma",Space,Str "2"],Str ".",Space,Space,Emph [Str "The",Space,Str "triangle",Space,Str "with",Space,Str "sides",Space,Str "of",Space,Str "length\160",Math InlineMath "3",Str ",",Space,Math InlineMath "4",Space,Str "and\160",Math InlineMath "5",Space,Str "is",Space,Str "right-angled."]]]
 ,Div ("",["proof"],[])
- [Para [Emph [Str "Proof."],Space,Str "This",Space,Str "lemma",Space,Str "follows",Space,Str "from",Space,Link ("",[],[("reference-type","ref"),("reference","def:tri")]) [Str "Definition",Str "\160",Str "1"] ("#def:tri",""),Space,Str "since",Space,Math InlineMath "3^2+4^2=9+16=25=5^2",Str ".",Str "\160\9723"]]
+ [Para [Emph [Str "Proof."],Space,Str "This",Space,Str "lemma",Space,Str "follows",Space,Str "from",Space,Link ("",[],[("reference-type","ref"),("reference","def:tri")]) [Str "Definition\160\&1"] ("#def:tri",""),Space,Str "since",Space,Math InlineMath "3^2+4^2=9+16=25=5^2",Str ".",Str "\160\9723"]]
 ,Div ("thm:py",["theorem"],[])
  [Para [Strong [Str "Theorem",Space,Str "3"],Space,Str "(Pythagorean",Space,Str "triplets).",Space,Space,Emph [Str "Triangles",Space,Str "with",Space,Str "sides",Space,Str "of",Space,Str "length",Space,Math InlineMath "a=p^2-q^2",Str ",",Space,Math InlineMath "b=2pq",Space,Str "and",Space,Math InlineMath "c=p^2+q^2",Space,Str "are",Space,Str "right-angled",Space,Str "triangles."]]]
 ,Div ("",["remark"],[])
diff --git a/test/command/3587.md b/test/command/3587.md
--- a/test/command/3587.md
+++ b/test/command/3587.md
@@ -15,13 +15,6 @@
 
 ```
 % pandoc -f latex -t native
-\SI[round-precision=2]{\{\}}[\{\}]{\{\}}
-^D
-[Para [Str "{}\160{}\160{}"]]
-```
-
-```
-% pandoc -f latex -t native
 \SI{30}{\milli\meter}
 ^D
 [Para [Str "30\160mm"]]
@@ -38,7 +31,7 @@
 % pandoc -f latex -t native
 \SI{25}{\square\meter}
 ^D
-[Para [Str "25\160m\178"]]
+[Para [Str "25\160m",Superscript [Str "2"]]]
 ```
 
 ```
@@ -55,25 +48,25 @@
 [Para [Str "18.2\160\176C"]]
 ```
 
-# SIRange tests
+# SIrange tests
 
 ## Integer range with simple common units
 
 ```
 % pandoc -f latex -t native
-\SIRange{10}{20}{\gram}
+\SIrange{10}{20}{\gram}
 ^D
 [Para [Str "10\160g\8211\&20\160g"]]
 ```
 ```
 % pandoc -f latex -t native
-\SIRange{35}{9}{\milli\meter}
+\SIrange{35}{9}{\milli\meter}
 ^D
 [Para [Str "35\160mm\8211\&9\160mm"]]
 ```
 ```
 % pandoc -f latex -t native
-\SIRange{4}{97367265}{\celsius}
+\SIrange{4}{97367265}{\celsius}
 ^D
 [Para [Str "4\160\176C\8211\&97367265\160\176C"]]
 ```
@@ -82,34 +75,72 @@
 
 ```
 % pandoc -f latex -t native
-\SIRange{4.5}{97367265.5}{\celsius}
+\SIrange{4.5}{97367265.5}{\celsius}
 ^D
 [Para [Str "4.5\160\176C\8211\&97367265.5\160\176C"]]
 ```
 
-## Squared units
+## Squared, cubed etc. units
 
 ```
 % pandoc -f latex -t native
-\SIRange{10}{20}{\square\meter}
+\SIrange{10}{20}{\square\meter}
 ^D
-[Para [Str "10\160m\178\8211\&20\160m\178"]]
+[Para [Str "10\160m",Superscript [Str "2"],Str "\8211\&20\160m",Superscript [Str "2"]]]
 ```
 
+```
+% pandoc -f latex -t native
+\SIrange{10}{20}{\cubic\meter}
+^D
+[Para [Str "10\160m",Superscript [Str "3"],Str "\8211\&20\160m",Superscript [Str "3"]]]
+```
+
+```
+% pandoc -f latex -t native
+\SIrange{10}{20}{\raisetothe{4}\meter}
+^D
+[Para [Str "10\160m",Superscript [Str "4"],Str "\8211\&20\160m",Superscript [Str "4"]]]
+```
+
+
+```
+% pandoc -f latex -t native
+\SIrange{10}{20}{\meter\squared}
+^D
+[Para [Str "10\160m",Superscript [Str "2"],Str "\8211\&20\160m",Superscript [Str "2"]]]
+```
+
+```
+% pandoc -f latex -t native
+\SIrange{10}{20}{\meter\cubed}
+^D
+[Para [Str "10\160m",Superscript [Str "3"],Str "\8211\&20\160m",Superscript [Str "3"]]]
+```
+
+```
+% pandoc -f latex -t native
+\SIrange{10}{20}{\meter\tothe{4}}
+^D
+[Para [Str "10\160m",Superscript [Str "4"],Str "\8211\&20\160m",Superscript [Str "4"]]]
+```
+
+
+
 ## Ignore round precision
 
 `round-precision` option appears to be ignored by `\SI` as of 7c6dbd37e, so
-`\SIRange` will ignore it as well.
+`\SIrange` will ignore it as well.
 
 ```
 % pandoc -f latex -t native
-\SIRange[round-precision=2]{10}{20}{\gram}
+\SIrange[round-precision=2]{10}{20}{\gram}
 ^D
 [Para [Str "10\160g\8211\&20\160g"]]
 ```
 ```
 % pandoc -f latex -t native
-\SIRange[round-precision=2]{10.0}{20.25}{\gram}
+\SIrange[round-precision=2]{10.0}{20.25}{\gram}
 ^D
 [Para [Str "10.0\160g\8211\&20.25\160g"]]
 ```
diff --git a/test/command/3792.md b/test/command/3792.md
--- a/test/command/3792.md
+++ b/test/command/3792.md
@@ -6,7 +6,7 @@
 ok
 ^D
 ---
-title: '\<this\> \*that\*'
+title: \<this\> \*that\*
 ---
 
 ok
diff --git a/test/command/5099.md b/test/command/5099.md
--- a/test/command/5099.md
+++ b/test/command/5099.md
@@ -2,7 +2,7 @@
 % pandoc -t native
 (@citation
 ^D
-[Para [Str "(",Cite [Citation {citationId = "citation", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 0, citationHash = 0}] [Str "@citation"]]]
+[Para [Str "(",Cite [Citation {citationId = "citation", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 1, citationHash = 0}] [Str "@citation"]]]
 ```
 
 ```
diff --git a/test/command/5541-localLink.md b/test/command/5541-localLink.md
new file mode 100644
--- /dev/null
+++ b/test/command/5541-localLink.md
@@ -0,0 +1,149 @@
+```
+% pandoc -f markdown -t icml -s
+
+# Header 1
+
+this is some text
+
+## Header 2
+
+some more text that [links to](#header-1) the first header. And this links to [some text](#spanner) in 2.1.
+
+## Header 2.1
+
+if you can read this text, [and it's linked]{#spanner} - all good!
+
+^D
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<?aid style="50" type="snippet" readerVersion="6.0" featureSet="513" product="8.0(370)" ?>
+<?aid SnippetType="InCopyInterchange"?>
+<Document DOMVersion="8.0" Self="pandoc_doc">
+    <RootCharacterStyleGroup Self="pandoc_character_styles">
+      <CharacterStyle Self="$ID/NormalCharacterStyle" Name="Default" />
+      <CharacterStyle Self="CharacterStyle/Link" Name="Link">
+        <Properties>
+          <BasedOn type="object">$ID/NormalCharacterStyle</BasedOn>
+        </Properties>
+      </CharacterStyle>
+    </RootCharacterStyleGroup>
+    <RootParagraphStyleGroup Self="pandoc_paragraph_styles">
+      <ParagraphStyle Self="$ID/NormalParagraphStyle" Name="$ID/NormalParagraphStyle"
+          SpaceBefore="6" SpaceAfter="6"> <!-- paragraph spacing -->
+        <Properties>
+          <TabList type="list">
+            <ListItem type="record">
+              <Alignment type="enumeration">LeftAlign</Alignment>
+              <AlignmentCharacter type="string">.</AlignmentCharacter>
+              <Leader type="string"></Leader>
+              <Position type="unit">10</Position> <!-- first tab stop -->
+            </ListItem>
+          </TabList>
+        </Properties>
+      </ParagraphStyle>
+      <ParagraphStyle Self="ParagraphStyle/Header1" Name="Header1" LeftIndent="0" PointSize="36">
+        <Properties>
+          <BasedOn type="object">$ID/NormalParagraphStyle</BasedOn>
+        </Properties>
+      </ParagraphStyle>
+      <ParagraphStyle Self="ParagraphStyle/Header2" Name="Header2" LeftIndent="0" PointSize="30">
+        <Properties>
+          <BasedOn type="object">$ID/NormalParagraphStyle</BasedOn>
+        </Properties>
+      </ParagraphStyle>
+      <ParagraphStyle Self="ParagraphStyle/Paragraph" Name="Paragraph" LeftIndent="0">
+        <Properties>
+          <BasedOn type="object">$ID/NormalParagraphStyle</BasedOn>
+        </Properties>
+      </ParagraphStyle>
+    </RootParagraphStyleGroup>
+    <RootTableStyleGroup Self="pandoc_table_styles">
+      <TableStyle Self="TableStyle/Table" Name="Table" />
+    </RootTableStyleGroup>
+    <RootCellStyleGroup Self="pandoc_cell_styles">
+      <CellStyle Self="CellStyle/Cell" AppliedParagraphStyle="ParagraphStyle/$ID/[No paragraph style]" Name="Cell" />
+    </RootCellStyleGroup>
+  <Story Self="pandoc_story"
+      TrackChanges="false"
+      StoryTitle=""
+      AppliedTOCStyle="n"
+      AppliedNamedGrid="n" >
+    <StoryPreference OpticalMarginAlignment="true" OpticalMarginSize="12" />
+
+<!-- body needs to be non-indented, otherwise code blocks are indented too far -->
+<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#header-1" Name="Destination" DestinationUniqueKey="1" />
+    <Content>Header 1</Content>
+  </CharacterStyleRange>
+</ParagraphStyleRange>
+<Br />
+<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <Content>this is some text</Content>
+  </CharacterStyleRange>
+</ParagraphStyleRange>
+<Br />
+<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header2">
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#header-2" Name="Destination" DestinationUniqueKey="1" />
+    <Content>Header 2</Content>
+  </CharacterStyleRange>
+</ParagraphStyleRange>
+<Br />
+<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <Content>some more text that </Content>
+  </CharacterStyleRange>
+  <HyperlinkTextSource Self="htss-1" Name="" Hidden="false">
+    <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Link">
+      <Content>links to</Content>
+    </CharacterStyleRange>
+  </HyperlinkTextSource>
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <Content> the first header. And this links to </Content>
+  </CharacterStyleRange>
+  <HyperlinkTextSource Self="htss-2" Name="" Hidden="false">
+    <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Link">
+      <Content>some text</Content>
+    </CharacterStyleRange>
+  </HyperlinkTextSource>
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <Content> in 2.1.</Content>
+  </CharacterStyleRange>
+</ParagraphStyleRange>
+<Br />
+<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header2">
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#header-2.1" Name="Destination" DestinationUniqueKey="1" />
+    <Content>Header 2.1</Content>
+  </CharacterStyleRange>
+</ParagraphStyleRange>
+<Br />
+<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <Content>if you can read this text, </Content>
+  </CharacterStyleRange>
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#spanner" Name="Destination" DestinationUniqueKey="1" />
+    <Content>and it’s linked</Content>
+  </CharacterStyleRange>
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <Content> - all good!</Content>
+  </CharacterStyleRange>
+</ParagraphStyleRange>
+
+  </Story>
+  <Hyperlink Self="uf-2" Name="#spanner" Source="htss-2" Visible="false" DestinationUniqueKey="1">
+    <Properties>
+      <BorderColor type="enumeration">Black</BorderColor>
+      <Destination type="object">HyperlinkTextDestination/#spanner</Destination>
+    </Properties>
+  </Hyperlink>
+  <Hyperlink Self="uf-1" Name="#header-1" Source="htss-1" Visible="false" DestinationUniqueKey="1">
+    <Properties>
+      <BorderColor type="enumeration">Black</BorderColor>
+      <Destination type="object">HyperlinkTextDestination/#header-1</Destination>
+    </Properties>
+  </Hyperlink>
+</Document>
+```
diff --git a/test/command/5541-nesting.md b/test/command/5541-nesting.md
new file mode 100644
--- /dev/null
+++ b/test/command/5541-nesting.md
@@ -0,0 +1,97 @@
+```
+% pandoc -f html -t icml -s
+
+<div id="blockId">
+  <div id="blockId2">
+    <span id="inlineId">
+      <img id="inlineId2" src="lalune.jpg" />
+    </span>
+  </div>
+</div>
+
+^D
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<?aid style="50" type="snippet" readerVersion="6.0" featureSet="513" product="8.0(370)" ?>
+<?aid SnippetType="InCopyInterchange"?>
+<Document DOMVersion="8.0" Self="pandoc_doc">
+    <RootCharacterStyleGroup Self="pandoc_character_styles">
+      <CharacterStyle Self="$ID/NormalCharacterStyle" Name="Default" />
+      <CharacterStyle Self="CharacterStyle/" Name="">
+        <Properties>
+          <BasedOn type="object">$ID/NormalCharacterStyle</BasedOn>
+        </Properties>
+      </CharacterStyle>
+    </RootCharacterStyleGroup>
+    <RootParagraphStyleGroup Self="pandoc_paragraph_styles">
+      <ParagraphStyle Self="$ID/NormalParagraphStyle" Name="$ID/NormalParagraphStyle"
+          SpaceBefore="6" SpaceAfter="6"> <!-- paragraph spacing -->
+        <Properties>
+          <TabList type="list">
+            <ListItem type="record">
+              <Alignment type="enumeration">LeftAlign</Alignment>
+              <AlignmentCharacter type="string">.</AlignmentCharacter>
+              <Leader type="string"></Leader>
+              <Position type="unit">10</Position> <!-- first tab stop -->
+            </ListItem>
+          </TabList>
+        </Properties>
+      </ParagraphStyle>
+      <ParagraphStyle Self="ParagraphStyle/" Name="" LeftIndent="0">
+        <Properties>
+          <BasedOn type="object">$ID/NormalParagraphStyle</BasedOn>
+        </Properties>
+      </ParagraphStyle>
+    </RootParagraphStyleGroup>
+    <RootTableStyleGroup Self="pandoc_table_styles">
+      <TableStyle Self="TableStyle/Table" Name="Table" />
+    </RootTableStyleGroup>
+    <RootCellStyleGroup Self="pandoc_cell_styles">
+      <CellStyle Self="CellStyle/Cell" AppliedParagraphStyle="ParagraphStyle/$ID/[No paragraph style]" Name="Cell" />
+    </RootCellStyleGroup>
+  <Story Self="pandoc_story"
+      TrackChanges="false"
+      StoryTitle=""
+      AppliedTOCStyle="n"
+      AppliedNamedGrid="n" >
+    <StoryPreference OpticalMarginAlignment="true" OpticalMarginSize="12" />
+
+<!-- body needs to be non-indented, otherwise code blocks are indented too far -->
+<ParagraphStyleRange AppliedParagraphStyle="">
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#inlineId" Name="Destination" DestinationUniqueKey="1" />
+    <Content> </Content>
+  </CharacterStyleRange>
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <Rectangle Self="uec" StrokeWeight="0" ItemTransform="1 0 0 1 75 -75">
+      <Properties>
+        <PathGeometry>
+          <GeometryPathType PathOpen="false">
+            <PathPointArray>
+              <PathPointType Anchor="-75 -75" LeftDirection="-75 -75" RightDirection="-75 -75" />
+              <PathPointType Anchor="-75 75" LeftDirection="-75 75" RightDirection="-75 75" />
+              <PathPointType Anchor="75 75" LeftDirection="75 75" RightDirection="75 75" />
+              <PathPointType Anchor="75 -75" LeftDirection="75 -75" RightDirection="75 -75" />
+            </PathPointArray>
+          </GeometryPathType>
+        </PathGeometry>
+      </Properties>
+      <Image Self="ue6" ItemTransform="1 0 0 1 -75 -75">
+        <Properties>
+          <Profile type="string">
+            $ID/Embedded
+          </Profile>
+        </Properties>
+        <Link Self="ueb" LinkResourceURI="file:lalune.jpg" />
+      </Image>
+    </Rectangle>
+  </CharacterStyleRange>
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#inlineId" Name="Destination" DestinationUniqueKey="1" />
+    <Content> </Content>
+  </CharacterStyleRange>
+</ParagraphStyleRange>
+
+  </Story>
+  
+</Document>
+```
diff --git a/test/command/5541-urlLink.md b/test/command/5541-urlLink.md
new file mode 100644
--- /dev/null
+++ b/test/command/5541-urlLink.md
@@ -0,0 +1,112 @@
+```
+% pandoc -f markdown -t icml -s
+
+# Header 1
+
+this is some text
+
+## Header 2
+
+some more text that [links to](https://www.pandoc.org) Pandoc.
+
+^D
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<?aid style="50" type="snippet" readerVersion="6.0" featureSet="513" product="8.0(370)" ?>
+<?aid SnippetType="InCopyInterchange"?>
+<Document DOMVersion="8.0" Self="pandoc_doc">
+    <RootCharacterStyleGroup Self="pandoc_character_styles">
+      <CharacterStyle Self="$ID/NormalCharacterStyle" Name="Default" />
+      <CharacterStyle Self="CharacterStyle/Link" Name="Link">
+        <Properties>
+          <BasedOn type="object">$ID/NormalCharacterStyle</BasedOn>
+        </Properties>
+      </CharacterStyle>
+    </RootCharacterStyleGroup>
+    <RootParagraphStyleGroup Self="pandoc_paragraph_styles">
+      <ParagraphStyle Self="$ID/NormalParagraphStyle" Name="$ID/NormalParagraphStyle"
+          SpaceBefore="6" SpaceAfter="6"> <!-- paragraph spacing -->
+        <Properties>
+          <TabList type="list">
+            <ListItem type="record">
+              <Alignment type="enumeration">LeftAlign</Alignment>
+              <AlignmentCharacter type="string">.</AlignmentCharacter>
+              <Leader type="string"></Leader>
+              <Position type="unit">10</Position> <!-- first tab stop -->
+            </ListItem>
+          </TabList>
+        </Properties>
+      </ParagraphStyle>
+      <ParagraphStyle Self="ParagraphStyle/Header1" Name="Header1" LeftIndent="0" PointSize="36">
+        <Properties>
+          <BasedOn type="object">$ID/NormalParagraphStyle</BasedOn>
+        </Properties>
+      </ParagraphStyle>
+      <ParagraphStyle Self="ParagraphStyle/Header2" Name="Header2" LeftIndent="0" PointSize="30">
+        <Properties>
+          <BasedOn type="object">$ID/NormalParagraphStyle</BasedOn>
+        </Properties>
+      </ParagraphStyle>
+      <ParagraphStyle Self="ParagraphStyle/Paragraph" Name="Paragraph" LeftIndent="0">
+        <Properties>
+          <BasedOn type="object">$ID/NormalParagraphStyle</BasedOn>
+        </Properties>
+      </ParagraphStyle>
+    </RootParagraphStyleGroup>
+    <RootTableStyleGroup Self="pandoc_table_styles">
+      <TableStyle Self="TableStyle/Table" Name="Table" />
+    </RootTableStyleGroup>
+    <RootCellStyleGroup Self="pandoc_cell_styles">
+      <CellStyle Self="CellStyle/Cell" AppliedParagraphStyle="ParagraphStyle/$ID/[No paragraph style]" Name="Cell" />
+    </RootCellStyleGroup>
+  <Story Self="pandoc_story"
+      TrackChanges="false"
+      StoryTitle=""
+      AppliedTOCStyle="n"
+      AppliedNamedGrid="n" >
+    <StoryPreference OpticalMarginAlignment="true" OpticalMarginSize="12" />
+
+<!-- body needs to be non-indented, otherwise code blocks are indented too far -->
+<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#header-1" Name="Destination" DestinationUniqueKey="1" />
+    <Content>Header 1</Content>
+  </CharacterStyleRange>
+</ParagraphStyleRange>
+<Br />
+<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <Content>this is some text</Content>
+  </CharacterStyleRange>
+</ParagraphStyleRange>
+<Br />
+<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header2">
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#header-2" Name="Destination" DestinationUniqueKey="1" />
+    <Content>Header 2</Content>
+  </CharacterStyleRange>
+</ParagraphStyleRange>
+<Br />
+<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <Content>some more text that </Content>
+  </CharacterStyleRange>
+  <HyperlinkTextSource Self="htss-1" Name="" Hidden="false">
+    <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Link">
+      <Content>links to</Content>
+    </CharacterStyleRange>
+  </HyperlinkTextSource>
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <Content> Pandoc.</Content>
+  </CharacterStyleRange>
+</ParagraphStyleRange>
+
+  </Story>
+  <HyperlinkURLDestination Self="HyperlinkURLDestination/https%3a//www.pandoc.org" Name="link" DestinationURL="https://www.pandoc.org" DestinationUniqueKey="1" />
+  <Hyperlink Self="uf-1" Name="https://www.pandoc.org" Source="htss-1" Visible="false" DestinationUniqueKey="1">
+    <Properties>
+      <BorderColor type="enumeration">Black</BorderColor>
+      <Destination type="object">HyperlinkURLDestination/https%3a//www.pandoc.org</Destination>
+    </Properties>
+  </Hyperlink>
+</Document>
+```
diff --git a/test/command/5627.md b/test/command/5627.md
--- a/test/command/5627.md
+++ b/test/command/5627.md
@@ -20,8 +20,8 @@
 <li>Two <code>--&gt;something&lt;!--</code></li>
 <li>Three</li>
 </ol>
-<div class="sourceCode" id="cb1"><pre class="sourceCode html"><code class="sourceCode html"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true"></a>--&gt;<span class="co">&lt;!--&lt;script&gt;alert(&#39;Escaped!&#39;)&lt;/script&gt;</span></span></code></pre></div>
-<div class="sourceCode" id="cb2"><pre class="sourceCode html"><code class="sourceCode html"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true"></a>Something</span></code></pre></div>
+<div class="sourceCode" id="cb1"><pre class="sourceCode html"><code class="sourceCode html"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>--&gt;<span class="co">&lt;!--&lt;script&gt;alert(&#39;Escaped!&#39;)&lt;/script&gt;</span></span></code></pre></div>
+<div class="sourceCode" id="cb2"><pre class="sourceCode html"><code class="sourceCode html"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>Something</span></code></pre></div>
 ```
 
 ```
@@ -46,8 +46,8 @@
 <li><code>--&gt;something&lt;!--</code></li>
 <li>bye <code>--&gt;something else&lt;!--</code></li>
 </ul>
-<div class="sourceCode" id="cb1"><pre class="sourceCode html"><code class="sourceCode html"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true"></a>--&gt;<span class="co">&lt;!--&lt;script&gt;alert(&#39;Escaped!&#39;)&lt;/script&gt;</span></span></code></pre></div>
-<div class="sourceCode" id="cb2"><pre class="sourceCode html"><code class="sourceCode html"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true"></a>Something</span></code></pre></div>
+<div class="sourceCode" id="cb1"><pre class="sourceCode html"><code class="sourceCode html"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>--&gt;<span class="co">&lt;!--&lt;script&gt;alert(&#39;Escaped!&#39;)&lt;/script&gt;</span></span></code></pre></div>
+<div class="sourceCode" id="cb2"><pre class="sourceCode html"><code class="sourceCode html"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a>Something</span></code></pre></div>
 ```
 
 ```
diff --git a/test/command/5650.md b/test/command/5650.md
--- a/test/command/5650.md
+++ b/test/command/5650.md
@@ -5,8 +5,8 @@
 b
 ```
 ^D
-<div class="sourceCode" id="foocb1"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span id="foocb1-1"><a href="#foocb1-1" aria-hidden="true"></a>a</span>
-<span id="foocb1-2"><a href="#foocb1-2" aria-hidden="true"></a>b</span></code></pre></div>
+<div class="sourceCode" id="foocb1"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span id="foocb1-1"><a href="#foocb1-1" aria-hidden="true" tabindex="-1"></a>a</span>
+<span id="foocb1-2"><a href="#foocb1-2" aria-hidden="true" tabindex="-1"></a>b</span></code></pre></div>
 ````
 
 ````
@@ -16,7 +16,7 @@
 b
 ```
 ^D
-<div class="sourceCode" id="foobar"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span id="foobar-1"><a href="#foobar-1" aria-hidden="true"></a>a</span>
-<span id="foobar-2"><a href="#foobar-2" aria-hidden="true"></a>b</span></code></pre></div>
+<div class="sourceCode" id="foobar"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span id="foobar-1"><a href="#foobar-1" aria-hidden="true" tabindex="-1"></a>a</span>
+<span id="foobar-2"><a href="#foobar-2" aria-hidden="true" tabindex="-1"></a>b</span></code></pre></div>
 ````
 
diff --git a/test/command/5849-prefix.md b/test/command/5849-prefix.md
--- a/test/command/5849-prefix.md
+++ b/test/command/5849-prefix.md
@@ -2,31 +2,30 @@
 % pandoc -t latex --biblatex
 [e.g. @a1;@a2;@a3; but also @b1;@b2;@b3]
 ^D
-\autocites[e.g.~][]{a1,a2,a3}[but also][]{b1,b2,b3}
+\autocites[e.g.][]{a1,a2,a3}[but also][]{b1,b2,b3}
 ```
 ```
 % pandoc -t latex --biblatex
 [e.g. @a1; e.g. @a2;@a3; but also @b1;@b2;but also @b3]
 ^D
-\autocites[e.g.~][]{a1}[e.g.~][]{a2,a3}[but also][]{b1,b2}[but
-also][]{b3}
+\autocites[e.g.][]{a1}[e.g.][]{a2,a3}[but also][]{b1,b2}[but also][]{b3}
 ```
 ```
 % pandoc -t latex --biblatex
 [e.g. @a1, ch.3 and elsewhere;@a2;@a3; but also @a4;@a5]
 ^D
-\autocites[e.g.~][ch.3 and elsewhere]{a1}{a2,a3}[but also][]{a4,a5}
+\autocites[e.g.][ch.3 and elsewhere]{a1}{a2,a3}[but also][]{a4,a5}
 ```
 ```
 % pandoc -t latex --biblatex
 [e.g. @a1;@a2, ch.3 and elsewhere;@a3; but also @a4;@a5]
 ^D
-\autocites[e.g.~][ch.3 and elsewhere]{a1,a2}{a3}[but also][]{a4,a5}
+\autocites[e.g.][ch.3 and elsewhere]{a1,a2}{a3}[but also][]{a4,a5}
 ```
 ```
 % pandoc -t latex --biblatex
 [e.g. @a1, blah;@a2, ch.3 and elsewhere;@a3; but also @b4;@b5]
 ^D
-\autocites[e.g.~][blah]{a1}[ch.3 and elsewhere]{a2}{a3}[but
+\autocites[e.g.][blah]{a1}[ch.3 and elsewhere]{a2}{a3}[but
 also][]{b4,b5}
 ```
diff --git a/test/command/6324.md b/test/command/6324.md
new file mode 100644
--- /dev/null
+++ b/test/command/6324.md
@@ -0,0 +1,17 @@
+```
+% pandoc -f latex -t native -s
+\documentclass{article}
+
+\begin{document}
+    \title{Document title}
+    \author{
+
+Me
+
+}
+\maketitle
+\end{document}
+^D
+Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "Me"]]),("title",MetaInlines [Str "Document",Space,Str "title"])]})
+[]
+```
diff --git a/test/command/6620.md b/test/command/6620.md
new file mode 100644
--- /dev/null
+++ b/test/command/6620.md
@@ -0,0 +1,15 @@
+```
+% pandoc -f latex
+\SI{23(2)}{\m}
+
+\SI{125(12)}{\m}
+
+\SI{0.135(21)}{\m}
+
+\SI{12.3(60)}{\m}
+^D
+<p>23 ± 2 m</p>
+<p>125 ± 12 m</p>
+<p>0.135 ± 0.021 m</p>
+<p>12.3 ± 6 m</p>
+```
diff --git a/test/command/6675.md b/test/command/6675.md
new file mode 100644
--- /dev/null
+++ b/test/command/6675.md
@@ -0,0 +1,134 @@
+```
+% pandoc -f markdown -t icml -s
+
+# Header 1
+
+this is some text
+
+## Header 2
+
+some more text that [links to](https://www.pandoc.org) Pandoc.
+
+and some text that [links to](#header-1) the first header
+
+^D
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<?aid style="50" type="snippet" readerVersion="6.0" featureSet="513" product="8.0(370)" ?>
+<?aid SnippetType="InCopyInterchange"?>
+<Document DOMVersion="8.0" Self="pandoc_doc">
+    <RootCharacterStyleGroup Self="pandoc_character_styles">
+      <CharacterStyle Self="$ID/NormalCharacterStyle" Name="Default" />
+      <CharacterStyle Self="CharacterStyle/Link" Name="Link">
+        <Properties>
+          <BasedOn type="object">$ID/NormalCharacterStyle</BasedOn>
+        </Properties>
+      </CharacterStyle>
+    </RootCharacterStyleGroup>
+    <RootParagraphStyleGroup Self="pandoc_paragraph_styles">
+      <ParagraphStyle Self="$ID/NormalParagraphStyle" Name="$ID/NormalParagraphStyle"
+          SpaceBefore="6" SpaceAfter="6"> <!-- paragraph spacing -->
+        <Properties>
+          <TabList type="list">
+            <ListItem type="record">
+              <Alignment type="enumeration">LeftAlign</Alignment>
+              <AlignmentCharacter type="string">.</AlignmentCharacter>
+              <Leader type="string"></Leader>
+              <Position type="unit">10</Position> <!-- first tab stop -->
+            </ListItem>
+          </TabList>
+        </Properties>
+      </ParagraphStyle>
+      <ParagraphStyle Self="ParagraphStyle/Header1" Name="Header1" LeftIndent="0" PointSize="36">
+        <Properties>
+          <BasedOn type="object">$ID/NormalParagraphStyle</BasedOn>
+        </Properties>
+      </ParagraphStyle>
+      <ParagraphStyle Self="ParagraphStyle/Header2" Name="Header2" LeftIndent="0" PointSize="30">
+        <Properties>
+          <BasedOn type="object">$ID/NormalParagraphStyle</BasedOn>
+        </Properties>
+      </ParagraphStyle>
+      <ParagraphStyle Self="ParagraphStyle/Paragraph" Name="Paragraph" LeftIndent="0">
+        <Properties>
+          <BasedOn type="object">$ID/NormalParagraphStyle</BasedOn>
+        </Properties>
+      </ParagraphStyle>
+    </RootParagraphStyleGroup>
+    <RootTableStyleGroup Self="pandoc_table_styles">
+      <TableStyle Self="TableStyle/Table" Name="Table" />
+    </RootTableStyleGroup>
+    <RootCellStyleGroup Self="pandoc_cell_styles">
+      <CellStyle Self="CellStyle/Cell" AppliedParagraphStyle="ParagraphStyle/$ID/[No paragraph style]" Name="Cell" />
+    </RootCellStyleGroup>
+  <Story Self="pandoc_story"
+      TrackChanges="false"
+      StoryTitle=""
+      AppliedTOCStyle="n"
+      AppliedNamedGrid="n" >
+    <StoryPreference OpticalMarginAlignment="true" OpticalMarginSize="12" />
+
+<!-- body needs to be non-indented, otherwise code blocks are indented too far -->
+<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#header-1" Name="Destination" DestinationUniqueKey="1" />
+    <Content>Header 1</Content>
+  </CharacterStyleRange>
+</ParagraphStyleRange>
+<Br />
+<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <Content>this is some text</Content>
+  </CharacterStyleRange>
+</ParagraphStyleRange>
+<Br />
+<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header2">
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#header-2" Name="Destination" DestinationUniqueKey="1" />
+    <Content>Header 2</Content>
+  </CharacterStyleRange>
+</ParagraphStyleRange>
+<Br />
+<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <Content>some more text that </Content>
+  </CharacterStyleRange>
+  <HyperlinkTextSource Self="htss-1" Name="" Hidden="false">
+    <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Link">
+      <Content>links to</Content>
+    </CharacterStyleRange>
+  </HyperlinkTextSource>
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <Content> Pandoc.</Content>
+  </CharacterStyleRange>
+</ParagraphStyleRange>
+<Br />
+<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <Content>and some text that </Content>
+  </CharacterStyleRange>
+  <HyperlinkTextSource Self="htss-2" Name="" Hidden="false">
+    <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Link">
+      <Content>links to</Content>
+    </CharacterStyleRange>
+  </HyperlinkTextSource>
+  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <Content> the first header</Content>
+  </CharacterStyleRange>
+</ParagraphStyleRange>
+
+  </Story>
+  <Hyperlink Self="uf-2" Name="#header-1" Source="htss-2" Visible="false" DestinationUniqueKey="1">
+    <Properties>
+      <BorderColor type="enumeration">Black</BorderColor>
+      <Destination type="object">HyperlinkTextDestination/#header-1</Destination>
+    </Properties>
+  </Hyperlink>
+  <HyperlinkURLDestination Self="HyperlinkURLDestination/https%3a//www.pandoc.org" Name="link" DestinationURL="https://www.pandoc.org" DestinationUniqueKey="1" />
+  <Hyperlink Self="uf-1" Name="https://www.pandoc.org" Source="htss-1" Visible="false" DestinationUniqueKey="1">
+    <Properties>
+      <BorderColor type="enumeration">Black</BorderColor>
+      <Destination type="object">HyperlinkURLDestination/https%3a//www.pandoc.org</Destination>
+    </Properties>
+  </Hyperlink>
+</Document>
+```
diff --git a/test/command/6699.md b/test/command/6699.md
new file mode 100644
--- /dev/null
+++ b/test/command/6699.md
@@ -0,0 +1,13 @@
+```
+% pandoc -f rst -t native
+.. class:: allowframebreaks
+
+title
+-----
+
+text
+^D
+[Header 1 ("title",["allowframebreaks"],[]) [Str "title"]
+,Para [Str "text"]]
+```
+
diff --git a/test/command/6719.md b/test/command/6719.md
new file mode 100644
--- /dev/null
+++ b/test/command/6719.md
@@ -0,0 +1,18 @@
+```
+% pandoc -f docbook -t native
+<para>
+<emphasis>emphasized </emphasis>text
+</para>
+^D
+[Para [Emph [Str "emphasized"],Space,Str "text"]]
+```
+
+```
+% pandoc -f jats -t native
+<p>
+<italic> hi  </italic>there
+</p>
+^D
+[Para [Emph [Str "hi"],Space,Str "there"]]
+```
+
diff --git a/test/command/6723.md b/test/command/6723.md
new file mode 100644
--- /dev/null
+++ b/test/command/6723.md
@@ -0,0 +1,33 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: command/chicago-fullnote-bibliography.csl
+references:
+- id: doe
+  type: article
+  author:
+  - family: Doe
+    given: John
+  DOI: 10.1109/5.771073
+  issued:
+    - year: 2020
+  title: An article
+...
+Blah [@doe].
+
+# References {-}
+
+^D
+Blah.[^1]
+
+References {#references .unnumbered}
+==========
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-doe .csl-entry}
+Doe, John. "An Article," 2020. <https://doi.org/10.1109/5.771073>.
+:::
+:::
+
+[^1]: John Doe, "An Article," 2020, <https://doi.org/10.1109/5.771073>.
+```
diff --git a/test/command/advanced-optical-materials.csl b/test/command/advanced-optical-materials.csl
new file mode 100644
--- /dev/null
+++ b/test/command/advanced-optical-materials.csl
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-US">
+  <info>
+    <title>Advanced Optical Materials</title>
+    <id>http://www.zotero.org/styles/advanced-optical-materials</id>
+    <link href="http://www.zotero.org/styles/advanced-optical-materials" rel="self"/>
+    <link href="http://www.zotero.org/styles/small" rel="template"/>
+    <link href="http://onlinelibrary.wiley.com/journal/10.1002/(ISSN)2195-1071/homepage/2298_forauthors.html" rel="documentation"/>
+    <author>
+      <name>Martin F. Schumann</name>
+      <email>mfs@mfs.name</email>
+    </author>
+    <category citation-format="numeric"/>
+    <category field="engineering"/>
+    <eissn>2195-1071</eissn>
+    <summary>A style for Wiley's Advanced Optical Materials</summary>
+    <updated>2017-02-16T15:37:41+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <macro name="author">
+    <names variable="author">
+      <name initialize-with=". " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="short" prefix=", " text-case="capitalize-first" suffix=" "/>
+      <substitute>
+        <names variable="editor"/>
+        <names variable="translator"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="editor">
+    <names variable="editor">
+      <label form="short" text-case="capitalize-first" suffix=".: " strip-periods="true"/>
+      <name initialize-with="." delimiter=", " delimiter-precedes-last="always"/>
+    </names>
+  </macro>
+  <macro name="year-date">
+    <group font-weight="bold">
+      <choose>
+        <if variable="issued">
+          <date variable="issued">
+            <date-part name="year"/>
+          </date>
+        </if>
+        <else>
+          <text term="no date" form="short"/>
+        </else>
+      </choose>
+    </group>
+  </macro>
+  <macro name="access-date">
+    <group delimiter=", ">
+      <date variable="accessed">
+        <date-part name="month" prefix="accessed: " suffix=", " form="short"/>
+        <date-part name="year"/>
+      </date>
+    </group>
+  </macro>
+  <macro name="access">
+    <choose>
+      <if variable="page" match="none">
+        <choose>
+          <if variable="DOI">
+            <text variable="DOI" prefix="DOI: "/>
+          </if>
+        </choose>
+        <choose>
+          <if type="webpage">
+            <text variable="URL"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="publisher">
+    <group delimiter=", ">
+      <text variable="publisher" text-case="capitalize-all"/>
+      <text variable="publisher-place" text-case="title"/>
+    </group>
+  </macro>
+  <macro name="pages">
+    <label variable="page" form="short" suffix=" "/>
+    <text variable="page"/>
+  </macro>
+  <citation collapse="citation-number">
+    <sort>
+      <key variable="citation-number"/>
+    </sort>
+    <layout prefix="[" suffix="]" delimiter="," vertical-align="sup">
+      <text variable="citation-number"/>
+    </layout>
+  </citation>
+  <bibliography entry-spacing="0" second-field-align="flush" line-spacing="2">
+    <layout suffix=".">
+      <text variable="citation-number" prefix="[" suffix="]"/>
+      <text macro="author" suffix=", "/>
+      <choose>
+        <if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+          <group delimiter=", ">
+            <text variable="title" text-case="title" font-style="italic"/>
+            <text macro="publisher"/>
+            <text macro="year-date"/>
+          </group>
+        </if>
+        <else-if type="chapter paper-conference" match="any">
+          <group delimiter=", ">
+            <group delimiter=" ">
+              <text term="in"/>
+              <text variable="container-title" form="short" text-case="title" font-style="italic"/>
+              <text macro="editor" prefix="(" suffix=")"/>
+            </group>
+            <text macro="publisher"/>
+            <text macro="year-date"/>
+            <group delimiter=" ">
+              <text macro="pages"/>
+            </group>
+          </group>
+        </else-if>
+        <else-if type="patent">
+          <group delimiter=", ">
+            <text variable="number" font-style="italic"/>
+            <text macro="year-date"/>
+          </group>
+        </else-if>
+        <else-if type="thesis">
+          <group delimiter=", ">
+            <text variable="title" text-case="title"/>
+            <text variable="genre"/>
+            <text variable="publisher"/>
+            <text macro="year-date"/>
+          </group>
+        </else-if>
+        <else-if type="webpage">
+          <group delimiter=", ">
+            <text variable="title"/>
+            <text macro="access"/>
+            <text macro="access-date"/>
+          </group>
+        </else-if>
+        <else>
+          <group delimiter=" ">
+            <text variable="container-title" form="short" font-style="italic"/>
+            <group delimiter=", ">
+              <text macro="year-date"/>
+              <group>
+                <text variable="volume" font-style="italic"/>
+              </group>
+              <text variable="page-first"/>
+            </group>
+          </group>
+          <text macro="access" prefix=", "/>
+        </else>
+      </choose>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/annales.csl b/test/command/annales.csl
new file mode 100644
--- /dev/null
+++ b/test/command/annales.csl
@@ -0,0 +1,334 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="note" default-locale="fr-FR" version="1.0" page-range-format="expanded" demote-non-dropping-particle="sort-only">
+  <info>
+    <title>Annales. Histoire, Sciences sociales (French)</title>
+    <id>http://www.zotero.org/styles/annales</id>
+    <link href="http://www.zotero.org/styles/annales" rel="self"/>
+    <link href="http://annales.ehess.fr/?lang=en/" rel="documentation"/>
+    <author>
+      <name>Franziska Heimburger</name>
+      <email>zotero@franziska.fr</email>
+    </author>
+    <category citation-format="note"/>
+    <category field="social_science"/>
+    <issn>0395-2649</issn>
+    <updated>2013-08-29T04:18:55+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="fr">
+    <terms>
+      <term name="ordinal-01">ère</term>
+      <term name="ordinal-02">e</term>
+      <term name="ordinal-03">e</term>
+      <term name="ordinal-04">e</term>
+      <term name="cited">op.&#160;cit.</term>
+      <term name="page" form="short">
+        <single>p.</single>
+        <multiple>p.</multiple>
+      </term>
+      <term name="editor" form="short">
+        <single>dir.</single>
+        <multiple>dir.</multiple>
+      </term>
+    </terms>
+  </locale>
+  <macro name="author">
+    <names variable="author">
+      <name form="long" and="text" delimiter-precedes-last="never">
+        <name-part name="family" font-variant="small-caps"/>
+      </name>
+      <label form="short" prefix="&#160;(" suffix=")"/>
+      <substitute>
+        <names variable="editor"/>
+        <names variable="translator"/>
+        <text macro="title"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="author-short">
+    <names variable="author">
+      <name form="long" and="text" initialize-with=". " delimiter-precedes-last="never">
+        <name-part name="family" font-variant="small-caps"/>
+      </name>
+      <label form="short" prefix="&#160;(" suffix=")"/>
+      <substitute>
+        <names variable="editor"/>
+        <names variable="translator"/>
+        <text macro="title"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="editor">
+    <names variable="editor">
+      <name form="long" and="text" delimiter-precedes-last="never" sort-separator=" " font-style="normal">
+      </name>
+      <label form="short" prefix="&#160;(" suffix=".)"/>
+    </names>
+  </macro>
+  <macro name="translator">
+    <names variable="translator">
+      <name form="long" and="text" delimiter-precedes-last="never" sort-separator=" " font-style="normal" prefix=" trad. fr. ">
+        <name-part name="family" font-variant="small-caps"/>
+      </name>
+    </names>
+  </macro>
+  <macro name="title">
+    <choose>
+      <if type="bill book graphic legal_case motion_picture report song" match="any">
+        <text variable="title" text-case="capitalize-first" font-style="italic"/>
+      </if>
+      <else-if type="article-journal article-newspaper article-magazine" match="any">
+        <group delimiter=", ">
+          <text variable="title" text-case="capitalize-first" quotes="true" font-style="normal"/>
+          <text variable="container-title" font-style="italic"/>
+        </group>
+      </else-if>
+      <else-if type="thesis" match="any">
+        <group>
+          <text variable="title" text-case="capitalize-first" quotes="true" font-style="normal"/>
+          <text variable="genre" suffix=", " prefix=" "/>
+          <text variable="publisher"/>
+        </group>
+      </else-if>
+      <else-if type="manuscript" match="any">
+        <group delimiter=",">
+          <text variable="title" text-case="capitalize-first" quotes="true" font-style="normal"/>
+          <text variable="genre" prefix=" "/>
+        </group>
+      </else-if>
+      <else-if type="chapter entry-dictionary entry-encyclopedia" match="any">
+        <group>
+          <text variable="title" text-case="capitalize-first" quotes="true" suffix=","/>
+          <text value="in" font-style="italic" suffix=" " prefix=" "/>
+          <text macro="editor" suffix=", "/>
+          <text variable="container-title" text-case="capitalize-first" font-style="italic"/>
+        </group>
+      </else-if>
+      <else-if type="webpage" match="any">
+        <group>
+          <text variable="title" text-case="capitalize-first" font-style="italic" suffix=", "/>
+          <text variable="URL" text-decoration="underline"/>
+        </group>
+      </else-if>
+      <else>
+        <text variable="title" quotes="true"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="pub-place">
+    <choose>
+      <if type="bill book chapter entry-dictionary entry-encyclopedia thesis graphic legal_case manuscript motion_picture paper-conference report song" match="any">
+        <text variable="publisher-place"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="publisher">
+    <choose>
+      <if type="bill book chapter entry-dictionary entry-encyclopedia graphic legal_case motion_picture paper-conference report song" match="any">
+        <text variable="publisher"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="yearpage">
+    <choose>
+      <if type="bill book graphic legal_case motion_picture paper-conference manuscript report song thesis" match="any">
+        <group delimiter=", " font-style="normal">
+          <date variable="issued">
+            <date-part name="year"/>
+          </date>
+          <group delimiter=" ">
+            <text term="volume" form="short"/>
+            <text variable="volume"/>
+          </group>
+          <group delimiter="&#8239;">
+            <label variable="locator" form="short"/>
+            <text variable="locator"/>
+          </group>
+        </group>
+      </if>
+      <else-if type="chapter entry-dictionary entry-encyclopedia" match="any">
+        <group delimiter=" " font-style="normal">
+          <date variable="issued">
+            <date-part name="year" suffix=", "/>
+          </date>
+          <group>
+            <text term="volume" form="short" suffix="."/>
+            <text variable="number-of-volumes" prefix=". " suffix="/"/>
+            <text variable="volume" suffix=","/>
+          </group>
+          <label variable="page" form="short"/>
+          <group delimiter=", ">
+            <text variable="page"/>
+            <group delimiter="&#8239;">
+              <label variable="locator" form="short"/>
+              <text variable="locator"/>
+            </group>
+          </group>
+        </group>
+      </else-if>
+      <else-if type="article-journal" match="any">
+        <group delimiter=" " font-style="normal">
+          <label variable="page" form="short"/>
+          <group delimiter=", ">
+            <text variable="page"/>
+            <group delimiter="&#8239;">
+              <label variable="locator" form="short"/>
+              <text variable="locator"/>
+            </group>
+          </group>
+        </group>
+      </else-if>
+      <else-if type="article-newspaper article-magazine" match="any">
+        <group delimiter=" " font-style="normal">
+          <date variable="issued" form="numeric">
+            <date-part name="day"/>
+            <date-part name="month"/>
+            <date-part name="year"/>
+          </date>
+          <group delimiter=" " font-style="normal">
+            <choose>
+              <if variable="locator" match="any">
+                <group delimiter="&#8239;">
+                  <label variable="locator" form="short"/>
+                  <text variable="locator"/>
+                </group>
+              </if>
+              <else-if variable="locator" match="none">
+                <label variable="page" form="short"/>
+              </else-if>
+            </choose>
+          </group>
+        </group>
+      </else-if>
+      <else-if type="webpage" match="any">
+        <group delimiter=" " font-style="normal">
+          <text value="consulté le" suffix=" " prefix=" "/>
+          <date variable="accessed" form="text">
+            <date-part name="day"/>
+            <date-part name="month"/>
+            <date-part name="year"/>
+          </date>
+        </group>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="edition">
+    <choose>
+      <if type="bill book graphic legal_case motion_picture report song chapter paper-conference" match="any">
+        <choose>
+          <if is-numeric="edition">
+            <group delimiter=" ">
+              <number variable="edition" form="ordinal"/>
+              <text term="edition" form="short"/>
+            </group>
+          </if>
+          <else>
+            <text variable="edition" text-case="capitalize-first" suffix="."/>
+          </else>
+        </choose>
+      </if>
+      <else-if type="article-journal article-magazine" match="any">
+        <group font-style="normal">
+          <choose>
+            <if variable="issued">
+              <date variable="issued">
+                <date-part name="year"/>
+              </date>
+              <text macro="volume" prefix=", "/>
+            </if>
+            <else>
+              <text macro="volume" text-case="capitalize-first"/>
+            </else>
+          </choose>
+        </group>
+      </else-if>
+    </choose>
+    <text macro="issue" prefix=", "/>
+  </macro>
+  <macro name="volume">
+    <choose>
+      <if is-numeric="volume">
+        <text term="volume" form="short" suffix=".&#160;"/>
+        <text variable="volume"/>
+      </if>
+      <else>
+        <text variable="volume"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="issue">
+    <choose>
+      <if is-numeric="issue">
+        <text term="issue" form="short" suffix="&#160;"/>
+        <text variable="issue"/>
+      </if>
+      <else>
+        <text variable="issue"/>
+      </else>
+    </choose>
+  </macro>
+  <citation>
+    <layout suffix="." delimiter="&#160;; ">
+      <choose>
+        <if position="ibid-with-locator">
+          <group delimiter=", ">
+            <text term="ibid" text-case="capitalize-first" font-style="italic" suffix="."/>
+            <group delimiter="&#8239;">
+              <label variable="locator" form="short"/>
+              <text variable="locator"/>
+            </group>
+          </group>
+        </if>
+        <else-if position="ibid">
+          <text term="ibid" text-case="capitalize-first" font-style="italic"/>
+        </else-if>
+        <else-if position="subsequent">
+          <group delimiter=", ">
+            <text macro="author-short"/>
+            <choose>
+              <if type="bill book graphic legal_case motion_picture report song thesis" match="any">
+                <text variable="title" form="short" font-style="italic"/>
+              </if>
+              <else>
+                <text variable="title" text-case="capitalize-first" form="short" quotes="true" font-style="normal"/>
+              </else>
+            </choose>
+            <text term="cited" font-style="italic" suffix="."/>
+            <group delimiter="&#8239;">
+              <label variable="locator" form="short"/>
+              <text variable="locator"/>
+            </group>
+          </group>
+        </else-if>
+        <else>
+          <group delimiter=", ">
+            <text macro="author"/>
+            <text macro="title"/>
+            <text macro="translator"/>
+            <text macro="edition"/>
+            <text macro="pub-place"/>
+            <text macro="publisher"/>
+            <text macro="yearpage"/>
+          </group>
+        </else>
+      </choose>
+    </layout>
+  </citation>
+  <bibliography>
+    <sort>
+      <key macro="author" names-min="3" names-use-first="3"/>
+      <key variable="issued" sort="descending"/>
+    </sort>
+    <layout suffix=".">
+      <group delimiter=", ">
+        <text macro="author"/>
+        <text macro="title"/>
+        <text macro="translator"/>
+        <text macro="edition"/>
+        <text macro="pub-place"/>
+        <text macro="publisher"/>
+        <text macro="yearpage"/>
+      </group>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/apa.csl b/test/command/apa.csl
new file mode 100644
--- /dev/null
+++ b/test/command/apa.csl
@@ -0,0 +1,474 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never">
+  <!-- This style was edited with the Visual CSL Editor (http://steveridout.com/csl/visualEditor/) -->
+  <info>
+    <title>American Psychological Association 6th edition</title>
+    <title-short>APA</title-short>
+    <id>http://www.zotero.org/styles/apa</id>
+    <link href="http://www.zotero.org/styles/apa" rel="self"/>
+    <link href="http://owl.english.purdue.edu/owl/resource/560/01/" rel="documentation"/>
+    <author>
+      <name>Simon Kornblith</name>
+      <email>simon@simonster.com</email>
+    </author>
+    <contributor>
+      <name>Bruce D'Arcus</name>
+    </contributor>
+    <contributor>
+      <name>Curtis M. Humphrey</name>
+    </contributor>
+    <contributor>
+      <name>Richard Karnesky</name>
+      <email>karnesky+zotero@gmail.com</email>
+      <uri>http://arc.nucapt.northwestern.edu/Richard_Karnesky</uri>
+    </contributor>
+    <contributor>
+      <name>Sebastian Karcher</name>
+    </contributor>
+    <category citation-format="author-date"/>
+    <category field="psychology"/>
+    <category field="generic-base"/>
+    <updated>2014-04-12T01:20:52+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="en">
+    <terms>
+      <term name="editortranslator" form="short">
+        <single>ed. &amp; trans.</single>
+        <multiple>eds. &amp; trans.</multiple>
+      </term>
+      <term name="translator" form="short">
+        <single>trans.</single>
+        <multiple>trans.</multiple>
+      </term>
+    </terms>
+  </locale>
+  <macro name="container-contributors">
+    <choose>
+      <if type="chapter paper-conference" match="any">
+        <names variable="editor translator container-author" delimiter=", " suffix=", ">
+          <name and="symbol" initialize-with=". " delimiter=", "/>
+          <label form="short" prefix=" (" text-case="title" suffix=")"/>
+        </names>
+      </if>
+    </choose>
+  </macro>
+  <macro name="secondary-contributors">
+    <choose>
+      <if type="article-journal chapter paper-conference" match="none">
+        <names variable="translator editor container-author" delimiter=", " prefix=" (" suffix=")">
+          <name and="symbol" initialize-with=". " delimiter=", "/>
+          <label form="short" prefix=", " text-case="title"/>
+        </names>
+      </if>
+    </choose>
+  </macro>
+  <macro name="author">
+    <names variable="author">
+      <name name-as-sort-order="all" and="symbol" sort-separator=", " initialize-with=". " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="short" prefix=" (" suffix=")" text-case="capitalize-first"/>
+      <substitute>
+        <names variable="editor"/>
+        <names variable="translator"/>
+        <choose>
+          <if type="report">
+            <text variable="publisher"/>
+            <text macro="title"/>
+          </if>
+          <else>
+            <text macro="title"/>
+          </else>
+        </choose>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="author-short">
+    <names variable="author">
+      <name form="short" and="symbol" delimiter=", " initialize-with=". "/>
+      <substitute>
+        <names variable="editor"/>
+        <names variable="translator"/>
+        <choose>
+          <if type="report">
+            <text variable="publisher"/>
+            <text variable="title" form="short" font-style="italic"/>
+          </if>
+          <else-if type="legal_case">
+            <text variable="title" font-style="italic"/>
+          </else-if>
+          <else-if type="bill book graphic legislation motion_picture song" match="any">
+            <text variable="title" form="short" font-style="italic"/>
+          </else-if>
+          <else>
+            <text variable="title" form="short" quotes="true"/>
+          </else>
+        </choose>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="access">
+    <choose>
+      <if type="thesis">
+        <choose>
+          <if variable="archive" match="any">
+            <group>
+              <text term="retrieved" text-case="capitalize-first" suffix=" "/>
+              <text term="from" suffix=" "/>
+              <text variable="archive" suffix="."/>
+              <text variable="archive_location" prefix=" (" suffix=")"/>
+            </group>
+          </if>
+          <else>
+            <group>
+              <text term="retrieved" text-case="capitalize-first" suffix=" "/>
+              <text term="from" suffix=" "/>
+              <text variable="URL"/>
+            </group>
+          </else>
+        </choose>
+      </if>
+      <else>
+        <choose>
+          <if variable="DOI">
+            <text variable="DOI" prefix="doi:"/>
+          </if>
+          <else>
+            <choose>
+              <if type="webpage">
+                <group delimiter=" ">
+                  <text term="retrieved" text-case="capitalize-first" suffix=" "/>
+                  <group>
+                    <date variable="accessed" form="text" suffix=", "/>
+                  </group>
+                  <text term="from"/>
+                  <text variable="URL"/>
+                </group>
+              </if>
+              <else>
+                <group>
+                  <text term="retrieved" text-case="capitalize-first" suffix=" "/>
+                  <text term="from" suffix=" "/>
+                  <text variable="URL"/>
+                </group>
+              </else>
+            </choose>
+          </else>
+        </choose>
+      </else>
+    </choose>
+  </macro>
+  <macro name="title">
+    <choose>
+      <if type="report thesis" match="any">
+        <text variable="title" font-style="italic"/>
+        <group prefix=" (" suffix=")" delimiter=" ">
+          <text variable="genre"/>
+          <text variable="number" prefix="No. "/>
+        </group>
+      </if>
+      <else-if type="book graphic  motion_picture report song manuscript speech" match="any">
+        <!---This is a hack until we have a computer program type -->
+        <choose>
+          <if variable="version">
+            <group delimiter=" ">
+              <text variable="title"/>
+              <group delimiter=" " prefix="(" suffix=")">
+                <text term="version" text-case="capitalize-first"/>
+                <text variable="version"/>
+              </group>
+            </group>
+          </if>
+          <else>
+            <text variable="title" font-style="italic"/>
+          </else>
+        </choose>
+      </else-if>
+      <else>
+        <text variable="title"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="publisher">
+    <choose>
+      <if type="report" match="any">
+        <group delimiter=": ">
+          <text variable="publisher-place"/>
+          <text variable="publisher"/>
+        </group>
+      </if>
+      <else-if type="thesis" match="any">
+        <group delimiter=", ">
+          <text variable="publisher"/>
+          <text variable="publisher-place"/>
+        </group>
+      </else-if>
+      <else>
+        <group delimiter=", ">
+          <choose>
+            <if variable="event" match="none">
+              <text variable="genre"/>
+            </if>
+          </choose>
+          <choose>
+            <if type="article-journal article-magazine" match="none">
+              <group delimiter=": ">
+                <text variable="publisher-place"/>
+                <text variable="publisher"/>
+              </group>
+            </if>
+          </choose>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="event">
+    <choose>
+      <if variable="container-title" match="none">
+        <choose>
+          <if variable="event">
+            <choose>
+              <if variable="genre" match="none">
+                <text term="presented at" text-case="capitalize-first" suffix=" "/>
+                <text variable="event"/>
+              </if>
+              <else>
+                <group delimiter=" ">
+                  <text variable="genre" text-case="capitalize-first"/>
+                  <text term="presented at"/>
+                  <text variable="event"/>
+                </group>
+              </else>
+            </choose>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="issued">
+    <choose>
+      <if type="bill legal_case legislation" match="none">
+        <choose>
+          <if variable="issued">
+            <group prefix=" (" suffix=")">
+              <date variable="issued">
+                <date-part name="year"/>
+              </date>
+              <text variable="year-suffix"/>
+              <choose>
+                <if type="article-journal bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="none">
+                  <date variable="issued">
+                    <date-part prefix=", " name="month"/>
+                    <date-part prefix=" " name="day"/>
+                  </date>
+                </if>
+              </choose>
+            </group>
+          </if>
+          <else>
+            <group prefix=" (" suffix=")">
+              <text term="no date" form="short"/>
+              <text variable="year-suffix" prefix="-"/>
+            </group>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="issued-sort">
+    <choose>
+      <if type="article-journal bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="none">
+        <date variable="issued">
+          <date-part name="year"/>
+          <date-part name="month"/>
+          <date-part name="day"/>
+        </date>
+      </if>
+      <else>
+        <date variable="issued">
+          <date-part name="year"/>
+        </date>
+      </else>
+    </choose>
+  </macro>
+  <macro name="issued-year">
+    <choose>
+      <if variable="issued">
+        <date variable="issued">
+          <date-part name="year"/>
+        </date>
+        <text variable="year-suffix"/>
+      </if>
+      <else>
+        <text term="no date" form="short"/>
+        <text variable="year-suffix" prefix="-"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="edition">
+    <choose>
+      <if is-numeric="edition">
+        <group delimiter=" ">
+          <number variable="edition" form="ordinal"/>
+          <text term="edition" form="short"/>
+        </group>
+      </if>
+      <else>
+        <text variable="edition" suffix="."/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="locators">
+    <choose>
+      <if type="article-journal article-magazine" match="any">
+        <group prefix=", " delimiter=", ">
+          <group>
+            <text variable="volume" font-style="italic"/>
+            <text variable="issue" prefix="(" suffix=")"/>
+          </group>
+          <text variable="page"/>
+        </group>
+      </if>
+      <else-if type="article-newspaper">
+        <group delimiter=" " prefix=", ">
+          <label variable="page" form="short"/>
+          <text variable="page"/>
+        </group>
+      </else-if>
+      <else-if type="book graphic motion_picture report song chapter paper-conference" match="any">
+        <group prefix=" (" suffix=")" delimiter=", ">
+          <text macro="edition"/>
+          <group>
+            <text term="volume" form="short" plural="true" text-case="capitalize-first" suffix=" "/>
+            <number variable="number-of-volumes" form="numeric" prefix="1-"/>
+          </group>
+          <group>
+            <text term="volume" form="short" text-case="capitalize-first" suffix=" "/>
+            <number variable="volume" form="numeric"/>
+          </group>
+          <group>
+            <label variable="page" form="short" suffix=" "/>
+            <text variable="page"/>
+          </group>
+        </group>
+      </else-if>
+      <else-if type="legal_case">
+        <group prefix=" (" suffix=")" delimiter=" ">
+          <text variable="authority"/>
+          <date variable="issued" form="text"/>
+        </group>
+      </else-if>
+      <else-if type="bill legislation" match="any">
+        <date variable="issued" prefix=" (" suffix=")">
+          <date-part name="year"/>
+        </date>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="citation-locator">
+    <group>
+      <choose>
+        <if locator="chapter">
+          <label variable="locator" form="long" text-case="capitalize-first"/>
+        </if>
+        <else>
+          <label variable="locator" form="short"/>
+        </else>
+      </choose>
+      <text variable="locator" prefix=" "/>
+    </group>
+  </macro>
+  <macro name="container">
+    <group>
+      <choose>
+        <if type="chapter paper-conference entry-encyclopedia" match="any">
+          <text term="in" text-case="capitalize-first" suffix=" "/>
+        </if>
+      </choose>
+      <text macro="container-contributors"/>
+      <text macro="secondary-contributors"/>
+      <text macro="container-title"/>
+    </group>
+  </macro>
+  <macro name="container-title">
+    <choose>
+      <if type="article article-journal article-magazine article-newspaper" match="any">
+        <text variable="container-title" font-style="italic" text-case="title"/>
+      </if>
+      <else-if type="bill legal_case legislation" match="none">
+        <text variable="container-title" font-style="italic"/>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="legal-cites">
+    <choose>
+      <if type="bill legal_case legislation" match="any">
+        <group delimiter=" " prefix=", ">
+          <choose>
+            <if variable="container-title">
+              <text variable="volume"/>
+              <text variable="container-title"/>
+              <group delimiter=" ">
+                <!--change to label variable="section" as that becomes available -->
+                <text term="section" form="symbol"/>
+                <text variable="section"/>
+              </group>
+              <text variable="page"/>
+            </if>
+            <else>
+              <choose>
+                <if type="legal_case">
+                  <text variable="number" prefix="No. "/>
+                </if>
+                <else>
+                  <text variable="number" prefix="Pub. L. No. "/>
+                  <group delimiter=" ">
+                    <!--change to label variable="section" as that becomes available -->
+                    <text term="section" form="symbol"/>
+                    <text variable="section"/>
+                  </group>
+                </else>
+              </choose>
+            </else>
+          </choose>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <citation et-al-min="6" et-al-use-first="1" et-al-subsequent-min="3" et-al-subsequent-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true" collapse="year" givenname-disambiguation-rule="primary-name">
+    <sort>
+      <key macro="author"/>
+      <key macro="issued-sort"/>
+    </sort>
+    <layout prefix="(" suffix=")" delimiter="; ">
+      <group delimiter=", ">
+        <text macro="author-short"/>
+        <text macro="issued-year"/>
+        <text macro="citation-locator"/>
+      </group>
+    </layout>
+  </citation>
+  <bibliography hanging-indent="true" et-al-min="8" et-al-use-first="6" et-al-use-last="true" entry-spacing="0" line-spacing="2">
+    <sort>
+      <key macro="author"/>
+      <key macro="issued-sort" sort="ascending"/>
+      <key macro="title"/>
+    </sort>
+    <layout>
+      <group suffix=".">
+        <group delimiter=". ">
+          <text macro="author"/>
+          <text macro="issued"/>
+          <text macro="title" prefix=" "/>
+          <text macro="container"/>
+        </group>
+        <text macro="legal-cites"/>
+        <text macro="locators"/>
+        <group delimiter=", " prefix=". ">
+          <text macro="event"/>
+          <text macro="publisher"/>
+        </group>
+      </group>
+      <text macro="access" prefix=" "/>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/archeologie-medievale.csl b/test/command/archeologie-medievale.csl
new file mode 100644
--- /dev/null
+++ b/test/command/archeologie-medievale.csl
@@ -0,0 +1,291 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" version="1.0" class="note" demote-non-dropping-particle="display-and-sort" default-locale="fr-FR" page-range-format="expanded">
+  <info>
+    <title>Archéologie médiévale (French)</title>
+    <id>http://www.zotero.org/styles/archeologie-medievale</id>
+    <link href="http://www.zotero.org/styles/archeologie-medievale" rel="self"/>
+    <link href="http://www.unicaen.fr/crahm/archeomed/spip.php?article80" rel="documentation"/>
+    <author>
+      <name>Nicolas Monteix</name>
+      <email>nicolas.monteix@univ-rouen.fr</email>
+    </author>
+    <category citation-format="note"/>
+    <category field="history"/>
+    <category field="anthropology"/>
+    <issn>0153-9337</issn>
+    <summary>Style auteur-date en note pour Archéologie médiévale. NB: les sources éditées doivent être considérées comme des livres ayant un auteur (médiéval) et un éditeur (contemporain). Pour les sources éditées ne disposant pas d'auteur (médiéval), il est nécessaire de transformer le (dir.) en (éd.). Pour les archives (type=manuscrit), le "lieu" correspond au dépôt d'archives, l' "archive" au fonds, la "loc. dans l'archive" à la cote.</summary>
+    <updated>2014-08-17T23:30:36+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="fr">
+    <terms>
+      <term name="editor" form="short">dir.</term>
+      <term name="in">dans</term>
+      <term name="anonymous">anonyme</term>
+      <term name="anonymous" form="short">anon.</term>
+      <term name="accessed">consulté le</term>
+      <term name="no date">sans date</term>
+      <term name="no date" form="short">s.&#160;d.</term>
+    </terms>
+  </locale>
+  <macro name="author">
+    <names variable="author" delimiter=" ">
+      <name name-as-sort-order="all" font-variant="small-caps" sort-separator=" " initialize-with="." delimiter-precedes-last="never" and="text" delimiter=", "/>
+      <substitute>
+        <text macro="editor"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="editor">
+    <names variable="editor">
+      <name name-as-sort-order="all" font-variant="small-caps" sort-separator=" " initialize-with="." delimiter-precedes-last="never" and="text" delimiter=", "/>
+      <label form="short" font-variant="normal" text-case="lowercase" prefix=" (" suffix=")"/>
+    </names>
+  </macro>
+  <macro name="pages">
+    <group>
+      <text variable="page" prefix="p.&#160;"/>
+    </group>
+  </macro>
+  <macro name="author-short">
+    <names variable="author">
+      <name form="short" delimiter-precedes-last="never" and="text" delimiter=", "/>
+      <et-al font-variant="normal" font-style="italic"/>
+      <substitute>
+        <text macro="editor-short"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="editor-short">
+    <names variable="editor">
+      <name form="short" delimiter-precedes-last="never" and="text" delimiter=", "/>
+      <et-al font-variant="normal" font-style="italic"/>
+    </names>
+  </macro>
+  <macro name="URLaccess">
+    <group prefix="(" suffix=")">
+      <text variable="URL"/>
+      <text macro="access"/>
+    </group>
+  </macro>
+  <macro name="access">
+    <group prefix=" [" suffix="]">
+      <text term="accessed" suffix=" "/>
+      <date variable="accessed">
+        <date-part name="day" suffix=" "/>
+        <date-part name="month" suffix=" "/>
+        <date-part name="year"/>
+      </date>
+    </group>
+  </macro>
+  <macro name="editor-text">
+    <group>
+      <names variable="editor" suffix=" (éd.), ">
+        <name name-as-sort-order="all" font-variant="small-caps" sort-separator=" " initialize-with="." delimiter-precedes-last="never" and="text" delimiter=", "/>
+      </names>
+      <text macro="publisher" suffix=", "/>
+      <text macro="year-date"/>
+    </group>
+  </macro>
+  <macro name="editor-text-short">
+    <group>
+      <names variable="editor" suffix=" (éd.), ">
+        <name name-as-sort-order="all" form="short" font-variant="small-caps" delimiter-precedes-last="never" and="text" delimiter=", "/>
+      </names>
+      <text macro="year-date"/>
+    </group>
+  </macro>
+  <macro name="title">
+    <choose>
+      <if type="book" match="any">
+        <text variable="title" font-style="italic"/>
+      </if>
+      <else-if type="webpage" match="any">
+        <text variable="title"/>
+      </else-if>
+      <else-if variable="container-title" match="none">
+        <text variable="title" font-style="italic"/>
+      </else-if>
+      <else>
+        <text variable="title"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="publisher">
+    <group delimiter=", ">
+      <text variable="publisher-place"/>
+      <text variable="publisher"/>
+    </group>
+  </macro>
+  <macro name="year-date">
+    <choose>
+      <if variable="issued">
+        <date variable="issued">
+          <date-part name="year"/>
+        </date>
+      </if>
+      <else>
+        <text term="no date" form="short"/>
+      </else>
+    </choose>
+    <choose>
+      <if is-numeric="edition">
+        <group vertical-align="sup">
+          <number variable="edition"/>
+        </group>
+      </if>
+      <else>
+        <text variable="edition"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="type-sorting">
+    <choose>
+      <if type="book" variable="editor author" match="all">
+        <text value="1"/>
+      </if>
+      <else-if type="manuscript">
+        <text value="2"/>
+      </else-if>
+      <else>
+        <text value="3"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="locator">
+    <choose>
+      <if locator="paragraph">
+        <text variable="locator" prefix=", § "/>
+      </if>
+      <else-if locator="folio">
+        <text variable="locator" prefix=",&#160;fol.&#160;"/>
+      </else-if>
+      <else>
+        <group prefix=",&#160;">
+          <label variable="locator" form="short" suffix=".&#160;"/>
+          <text variable="locator"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <citation et-al-min="4" et-al-use-first="3" delimiter-precedes-et-al="never" disambiguate-add-year-suffix="true">
+    <sort>
+      <key variable="issued"/>
+    </sort>
+    <layout delimiter="&#160;; ">
+      <choose>
+        <if position="ibid-with-locator">
+          <group>
+            <text term="ibid" text-case="capitalize-first" font-style="italic"/>
+            <text macro="locator"/>
+          </group>
+        </if>
+        <else-if position="ibid">
+          <text term="ibid" text-case="capitalize-first" font-style="italic"/>
+        </else-if>
+        <else-if type="book" variable="editor author" match="all">
+          <group suffix=".">
+            <text macro="author-short" font-variant="small-caps" suffix=", "/>
+            <text macro="title" suffix=", "/>
+            <text macro="editor-text-short"/>
+            <text macro="locator"/>
+          </group>
+        </else-if>
+        <else-if type="manuscript">
+          <group delimiter=", ">
+            <text variable="publisher-place"/>
+            <text variable="archive_location"/>
+            <text macro="locator"/>
+          </group>
+        </else-if>
+        <else>
+          <text macro="author-short" suffix="&#160;" font-variant="small-caps"/>
+          <text macro="year-date"/>
+          <text macro="locator"/>
+        </else>
+      </choose>
+    </layout>
+  </citation>
+  <bibliography subsequent-author-substitute="">
+    <sort>
+      <key macro="type-sorting"/>
+      <key macro="author"/>
+      <key variable="issued"/>
+      <key variable="title"/>
+    </sort>
+    <layout suffix=".">
+      <choose>
+        <if type="book" variable="editor author" match="all">
+          <group suffix=".">
+            <text macro="author" suffix=", "/>
+            <text macro="title" suffix=", "/>
+            <text macro="editor-text"/>
+          </group>
+        </if>
+        <else-if type="manuscript">
+          <group delimiter=", ">
+            <text variable="archive_location"/>
+            <text variable="archive"/>
+            <text variable="title" font-style="italic"/>
+          </group>
+          <group prefix=" (" suffix=")">
+            <date variable="issued">
+              <date-part name="year"/>
+            </date>
+          </group>
+        </else-if>
+        <else>
+          <group display="block">
+            <text macro="author" suffix="&#9;"/>
+          </group>
+          <group display="left-margin">
+            <text macro="year-date" suffix=", "/>
+            <choose>
+              <if type="thesis">
+                <group delimiter=", " suffix=".">
+                  <text macro="title" font-style="italic"/>
+                  <text variable="genre"/>
+                  <text variable="publisher"/>
+                  <text variable="publisher-place"/>
+                </group>
+              </if>
+              <else-if type="webpage">
+                <group delimiter=" ">
+                  <text macro="title" font-style="italic"/>
+                  <text macro="URLaccess"/>
+                </group>
+              </else-if>
+              <else-if type="article-journal article-magazine article-newspaper broadcast personal_communication thesis entry-dictionary entry-encyclopedia" match="any">
+                <group delimiter=", " suffix=".">
+                  <text macro="title" quotes="true"/>
+                  <text variable="container-title" font-style="italic"/>
+                  <text variable="volume"/>
+                  <text variable="issue"/>
+                  <text macro="pages"/>
+                </group>
+              </else-if>
+              <else-if type="book graphic" match="any">
+                <group suffix=".">
+                  <text macro="title" suffix=", "/>
+                  <text macro="publisher"/>
+                </group>
+              </else-if>
+              <else-if type="chapter paper-conference" match="any">
+                <text macro="title" quotes="true" suffix=", "/>
+                <group delimiter=", ">
+                  <group delimiter=" ">
+                    <text term="in"/>
+                    <text macro="editor"/>
+                  </group>
+                  <text variable="container-title" font-style="italic"/>
+                  <text macro="publisher"/>
+                  <text macro="pages"/>
+                </group>
+              </else-if>
+            </choose>
+          </group>
+        </else>
+      </choose>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/biblatex-266.md b/test/command/biblatex-266.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-266.md
@@ -0,0 +1,34 @@
+```
+% pandoc -f biblatex -t markdown -s
+@book{goethe2005,
+  langid = {german},
+  location = {{Frankfurt am Main}},
+  title = {Not A Real Book},
+  date = {2005},
+  author = {family=Goethe, given=Johann Wolfgang, prefix=von, useprefix=false and given=Antonie, prefix=van, family=Leeuwenhoek, useprefix=true}, editor = {Schöne, Albrecht}
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - dropping-particle: von
+    family: Goethe
+    given: Johann Wolfgang
+  - family: Leeuwenhoek
+    given: Antonie
+    non-dropping-particle: van
+  editor:
+  - family: Schöne
+    given: Albrecht
+  id: goethe2005
+  issued: 2005
+  language: de-DE
+  publisher-place: Frankfurt am Main
+  title: Not A Real Book
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-aksin.md b/test/command/biblatex-aksin.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-aksin.md
@@ -0,0 +1,78 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Aksin et al. 2006)
+
+Aksin, Özge, Hayati Türkmen, Levent Artok, Bekir Çetinkaya, Chaoying Ni,
+Orhan Büyükgüngör, and Erhan Özkal. 2006. “Effect of Immobilization on
+Catalytic Characteristics of Saturated Pd-N-heterocyclic Carbenes in
+Mizoroki-Heck Reactions.” *J. Organomet. Chem.* 691 (13): 3027–3036.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Aksin et al., 2006)
+
+Aksin, Ö., Türkmen, H., Artok, L., Çetinkaya, B., Ni, C., Büyükgüngör,
+O., & Özkal, E. (2006). Effect of immobilization on catalytic
+characteristics of saturated Pd-N-heterocyclic carbenes in Mizoroki-Heck
+reactions. *J. Organomet. Chem.*, *691*(13), 3027–3036.
+
+
+}
+
+@string{ jomch   = {J.~Organomet. Chem.} }
+
+@Article{aksin,
+  author       = {Aks{\i}n, {\"O}zge and T{\"u}rkmen, Hayati and Artok, Levent
+                  and {\c{C}}etinkaya, Bekir and Ni, Chaoying and
+                  B{\"u}y{\"u}kg{\"u}ng{\"o}r, Orhan and {\"O}zkal, Erhan},
+  title        = {Effect of immobilization on catalytic characteristics of
+                  saturated {Pd-N}-heterocyclic carbenes in {Mizoroki-Heck}
+                  reactions},
+  journaltitle = jomch,
+  date         = 2006,
+  volume       = 691,
+  number       = 13,
+  pages        = {3027-3036},
+  indextitle   = {Effect of immobilization on catalytic characteristics},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Aksın
+    given: Özge
+  - family: Türkmen
+    given: Hayati
+  - family: Artok
+    given: Levent
+  - family: Çetinkaya
+    given: Bekir
+  - family: Ni
+    given: Chaoying
+  - family: Büyükgüngör
+    given: Orhan
+  - family: Özkal
+    given: Erhan
+  container-title: J. Organomet. Chem.
+  id: aksin
+  issue: 13
+  issued: 2006
+  page: 3027-3036
+  title: Effect of immobilization on catalytic characteristics of
+    saturated Pd-N-heterocyclic carbenes in Mizoroki-Heck reactions
+  type: article-journal
+  volume: 691
+---
+
+
+```
diff --git a/test/command/biblatex-almendro.md b/test/command/biblatex-almendro.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-almendro.md
@@ -0,0 +1,71 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Almendro et al. 1998)
+
+Almendro, José L., Jacinto Martín, Alberto Sánchez, and Fernando Nozal.
+1998. “Elektromagnetisches Signalhorn.”
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Almendro, Martín, Sánchez, & Nozal, 1998)
+
+Almendro, J. L., Martín, J., Sánchez, A., & Nozal, F. (1998).
+Elektromagnetisches Signalhorn.
+
+
+NOTES:
+
+- CSL styles’ handling of patent items needs to be improved
+
+}
+
+@Patent{almendro,
+  author       = {Almendro, Jos{\'e} L. and Mart{\'i}n, Jacinto and S{\'a}nchez,
+                  Alberto and Nozal, Fernando},
+  title        = {Elektromagnetisches Signalhorn},
+  number       = {EU-29702195U},
+  date         = 1998,
+  location     = {countryfr and countryuk and countryde},
+  hyphenation  = {german},
+  annotation   = {This is a patent entry with a location
+                  field. The number is given in the number field. Note
+                  the format of the location field in the database
+                  file. Compare laufenberg, sorace, and
+                  kowalik},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a patent entry with a location field. The number is
+    given in the number field. Note the format of the location field in
+    the database file. Compare laufenberg, sorace, and kowalik
+  author:
+  - family: Almendro
+    given: José L.
+  - family: Martín
+    given: Jacinto
+  - family: Sánchez
+    given: Alberto
+  - family: Nozal
+    given: Fernando
+  id: almendro
+  issued: 1998
+  jurisdiction: France; United Kingdom; Germany
+  language: de-DE
+  number: EU-29702195U
+  title: Elektromagnetisches Signalhorn
+  type: patent
+---
+
+
+```
diff --git a/test/command/biblatex-angenendt.md b/test/command/biblatex-angenendt.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-angenendt.md
@@ -0,0 +1,66 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Angenendt 2002)
+
+Angenendt, Arnold. 2002. “In Honore Salvatoris – Vom Sinn und Unsinn der
+Patrozinienkunde.” *Revue d’Histoire Ecclésiastique* 97: 431–456,
+791–823.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Angenendt, 2002)
+
+Angenendt, A. (2002). In Honore Salvatoris – Vom Sinn und Unsinn der
+Patrozinienkunde. *Revue d’Histoire Ecclésiastique*, *97*, 431–456,
+791–823.
+
+
+}
+
+@Article{angenendt,
+  author       = {Angenendt, Arnold},
+  title        = {In Honore Salvatoris~-- Vom Sinn und Unsinn der
+                  Patrozinienkunde},
+  journaltitle = {Revue d'Histoire Eccl{\'e}siastique},
+  date         = 2002,
+  volume       = 97,
+  pages        = {431--456, 791--823},
+  hyphenation  = {german},
+  indextitle   = {In Honore Salvatoris},
+  shorttitle   = {In Honore Salvatoris},
+  annotation   = {A German article in a French journal. Apart from that, a
+                  typical article entry. Note the indextitle
+                  field},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A German article in a French journal. Apart from that, a
+    typical article entry. Note the indextitle field
+  author:
+  - family: Angenendt
+    given: Arnold
+  container-title: Revue d'Histoire Ecclésiastique
+  id: angenendt
+  issued: 2002
+  language: de-DE
+  page: 431-456, 791-823
+  title: In Honore Salvatoris -- Vom Sinn und Unsinn der
+    Patrozinienkunde
+  title-short: In Honore Salvatoris
+  type: article-journal
+  volume: 97
+---
+
+
+```
diff --git a/test/command/biblatex-aristotle-anima.md b/test/command/biblatex-aristotle-anima.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-aristotle-anima.md
@@ -0,0 +1,62 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Aristotle 1907)
+
+Aristotle. 1907. *De Anima*. Edited by Robert Drew Hicks. Cambridge:
+Cambridge University Press.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Aristotle, 1907)
+
+Aristotle. (1907). *De anima*. (R. D. Hicks, Ed.). Cambridge: Cambridge
+University Press.
+
+
+}
+
+@string{ cup     = {Cambridge University Press} }
+
+@Book{aristotle:anima,
+  author       = {Aristotle},
+  title        = {De Anima},
+  date         = 1907,
+  editor       = {Hicks, Robert Drew},
+  publisher    = cup,
+  location     = {Cambridge},
+  keywords     = {primary},
+  hyphenation  = {british},
+  annotation   = {A book entry with an author and an
+                  editor},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A book entry with an author and an editor
+  author:
+  - family: Aristotle
+  editor:
+  - family: Hicks
+    given: Robert Drew
+  id: "aristotle:anima"
+  issued: 1907
+  keyword: primary
+  language: en-GB
+  publisher: Cambridge University Press
+  publisher-place: Cambridge
+  title: De anima
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-aristotle-physics.md b/test/command/biblatex-aristotle-physics.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-aristotle-physics.md
@@ -0,0 +1,63 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Aristotle 1929)
+
+Aristotle. 1929. *Physics*. Translated by P. H. Wicksteed and F. M.
+Cornford. New York: G. P. Putnam.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Aristotle, 1929)
+
+Aristotle. (1929). *Physics*. (P. H. Wicksteed & F. M. Cornford,
+Trans.). New York: G. P. Putnam.
+
+
+}
+
+@Book{aristotle:physics,
+  author       = {Aristotle},
+  title        = {Physics},
+  date         = 1929,
+  translator   = {Wicksteed, P. H. and Cornford, F. M.},
+  publisher    = {G. P. Putnam},
+  location     = {New York},
+  keywords     = {primary},
+  hyphenation  = {american},
+  shorttitle   = {Physics},
+  annotation   = {A book entry with a translator field},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A book entry with a translator field
+  author:
+  - family: Aristotle
+  id: "aristotle:physics"
+  issued: 1929
+  keyword: primary
+  language: en-US
+  publisher: G. P. Putnam
+  publisher-place: New York
+  title: Physics
+  title-short: Physics
+  translator:
+  - family: Wicksteed
+    given: P. H.
+  - family: Cornford
+    given: F. M.
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-aristotle-poetics.md b/test/command/biblatex-aristotle-poetics.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-aristotle-poetics.md
@@ -0,0 +1,65 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Aristotle 1968)
+
+Aristotle. 1968. *Poetics*. Edited by D. W. Lucas. Clarendon Aristotle.
+Oxford: Clarendon Press.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Aristotle, 1968)
+
+Aristotle. (1968). *Poetics*. (D. W. Lucas, Ed.). Oxford: Clarendon
+Press.
+
+
+}
+
+@Book{aristotle:poetics,
+  author       = {Aristotle},
+  title        = {Poetics},
+  date         = 1968,
+  editor       = {Lucas, D. W.},
+  series       = {Clarendon {Aristotle}},
+  publisher    = {Clarendon Press},
+  location     = {Oxford},
+  keywords     = {primary},
+  hyphenation  = {british},
+  shorttitle   = {Poetics},
+  annotation   = {A book entry with an author and an
+                  editor as well as a series field},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A book entry with an author and an editor as well as a series
+    field
+  author:
+  - family: Aristotle
+  collection-title: Clarendon Aristotle
+  editor:
+  - family: Lucas
+    given: D. W.
+  id: "aristotle:poetics"
+  issued: 1968
+  keyword: primary
+  language: en-GB
+  publisher: Clarendon Press
+  publisher-place: Oxford
+  title: Poetics
+  title-short: Poetics
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-aristotle-rhetoric.md b/test/command/biblatex-aristotle-rhetoric.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-aristotle-rhetoric.md
@@ -0,0 +1,80 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Aristotle 1877)
+
+Aristotle. 1877. *The Rhetoric of Aristotle with a Commentary by the
+Late Edward Meredith Cope*. Edited by Edward Meredith Cope. 3. Cambridge
+University Press.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Aristotle, 1877)
+
+Aristotle. (1877). *The rhetoric of Aristotle with a commentary by the
+late Edward Meredith Cope*. (E. M. Cope, Ed.) (1-3). Cambridge
+University Press.
+
+
+NOTES:
+
+- biblio2yaml
+	- commentator has no counterpart in CSL
+
+}
+
+@string{ cup     = {Cambridge University Press} }
+
+@Book{aristotle:rhetoric,
+  author       = {Aristotle},
+  title        = {The Rhetoric of {Aristotle} with a commentary by the late {Edward
+                  Meredith Cope}},
+  date         = 1877,
+  editor       = {Cope, Edward Meredith},
+  commentator  = {Cope, Edward Meredith},
+  volumes      = 3,
+  publisher    = cup,
+  keywords     = {primary},
+  hyphenation  = {british},
+  sorttitle    = {Rhetoric of Aristotle},
+  indextitle   = {Rhetoric of {Aristotle}, The},
+  shorttitle   = {Rhetoric},
+  annotation   = {A commented edition. Note the concatenation of the
+                  editor and commentator fields as well as the
+                  volumes, sorttitle, and indextitle
+                  fields},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A commented edition. Note the concatenation of the editor and
+    commentator fields as well as the volumes, sorttitle, and indextitle
+    fields
+  author:
+  - family: Aristotle
+  editor:
+  - family: Cope
+    given: Edward Meredith
+  id: "aristotle:rhetoric"
+  issued: 1877
+  keyword: primary
+  language: en-GB
+  number-of-volumes: 3
+  publisher: Cambridge University Press
+  title: The rhetoric of Aristotle with a commentary by the late Edward
+    Meredith Cope
+  title-short: Rhetoric
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-article.md b/test/command/biblatex-article.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-article.md
@@ -0,0 +1,128 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+    - contains:
+        - an article entry with just the required fields
+        - an article entry with required and all optional fields
+    - notes:
+        - year, month to be ignored if date is present
+        - journal to be ignored if journaltitle is present
+        - editortype, editoratype, editorbtype, editorctype, pubstate,
+series contain keys which, unless corresponding CSL terms exist, require
+locale-specific expansion
+    - limitations:
+        - annotator, commentator, eid, eprint, eprintclass, eprinttype,
+issuetitle, issuesubtitle, language, origlanguage have no matching
+counterparts in CSL
+        - for editor, editora, editorb, editorc (plus editortype,
+editoratype, editorbtype, editorctype) only a subset, editor and director,
+has matching counterparts in CSL
+    - kludges:
+        - note + addendum -> CSL note
+        - number + issue -> CSL issue
+        - handling of titleaddon
+        - handling of (journal) series
+            - done properly, this should be mapped to some CSL variable
+(version? edition? collection-number?), CSL styles would have to be adapted
+            - slightly better kludge would map integer to ordinal + "ser."
+("3" -> "3rd ser."); localization keys "newseries" -> "new ser.",
+"oldseries" -> "old ser."; and print all other values as is -- but still
+wouldn't fit all styles or locales.
+    }
+
+@article{article-req,
+    Author = {Author, Ann},
+    Date = {2013-07-29},
+    Hyphenation = {english},
+    Journaltitle = {The Journaltitle},
+    Title = {An Article Entry with Just the Required Fields}}
+
+@article{article-opt,
+    Addendum = {The Addendum},
+    Annotator = {Annotator, A.},
+    Author = {Author, Jr., Ann A.},
+    Commentator = {Commentator, C.},
+    Date = {2008-12-31},
+    Doi = {10.1086/520976},
+    Editor = {Editor, Edward},
+    Editora = {Editor, A.},
+    Editorb = {Editor, B.},
+    Editorc = {Editor, C.},
+    Eid = {eid},
+    Eprint = {eprint},
+    Eprintclass = {eprintclass},
+    Eprinttype = {eprinttype},
+    Hyphenation = {english},
+    Issn = {issn},
+    Issue = {issue},
+    Issuesubtitle = {The Issuesubtitle},
+    Issuetitle = {The Issuetitle},
+    Journalsubtitle = {The Journalsubtitle},
+    Journaltitle = {The Journaltitle},
+    Journal = {The Journal},
+    Language = {language},
+    Month = {08},
+    Year = {2007},
+    Note = {The Note},
+    Number = {number},
+    Origlanguage = {origlanguage},
+    Pages = {pages},
+    Pubstate = {inpress},
+    Series = {newseries},
+    Subtitle = {The Subtitle},
+    Title = {An Article Entry with the Required and All Optional Fields},
+    Titleaddon = {The Titleaddon},
+    Translator = {Translator, Ted},
+    Url = {http://foo.bar.baz/},
+    Urldate = {2013-07-29},
+    Version = {version},
+    Volume = {volume},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Author
+    given: Ann
+  container-title: The Journaltitle
+  id: article-req
+  issued: 2013-07-29
+  language: en-US
+  title: An article entry with just the required fields
+  type: article-journal
+- accessed: 2013-07-29
+  author:
+  - family: Author
+    given: Ann A.
+    suffix: Jr.
+  collection-title: new series
+  container-title: "The Journaltitle: The Journalsubtitle"
+  doi: 10.1086/520976
+  editor:
+  - family: Editor
+    given: Edward
+  id: article-opt
+  issn: issn
+  issue: number, issue
+  issued: 2008-12-31
+  language: en-US
+  note: The Note. The Addendum
+  page: pages
+  status: in press
+  title: "An article entry with the required and all optional fields:
+    The subtitle. The titleaddon"
+  title-short: An article entry with the required and all optional
+    fields
+  translator:
+  - family: Translator
+    given: Ted
+  type: article-journal
+  url: "http://foo.bar.baz/"
+  version: version
+  volume: volume
+---
+
+
+```
diff --git a/test/command/biblatex-augustine.md b/test/command/biblatex-augustine.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-augustine.md
@@ -0,0 +1,56 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Augustine 1995)
+
+Augustine, Robert L. 1995. *Heterogeneous Catalysis for the Synthetic
+Chemist*. New York: Marcel Dekker.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Augustine, 1995)
+
+Augustine, R. L. (1995). *Heterogeneous catalysis for the synthetic
+chemist*. New York: Marcel Dekker.
+
+
+}
+
+@Book{augustine,
+  author       = {Augustine, Robert L.},
+  title        = {Heterogeneous catalysis for the synthetic chemist},
+  date         = 1995,
+  publisher    = {Marcel Dekker},
+  location     = {New York},
+  hyphenation  = {american},
+  shorttitle   = {Heterogeneous catalysis},
+  annotation   = {A plain book entry},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A plain book entry
+  author:
+  - family: Augustine
+    given: Robert L.
+  id: augustine
+  issued: 1995
+  language: en-US
+  publisher: Marcel Dekker
+  publisher-place: New York
+  title: Heterogeneous catalysis for the synthetic chemist
+  title-short: Heterogeneous catalysis
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-averroes-bland.md b/test/command/biblatex-averroes-bland.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-averroes-bland.md
@@ -0,0 +1,85 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Averroes 1982)
+
+Averroes. 1982. *The Epistle on the Possibility of Conjunction with the
+Active Intellect by Ibn Rushd with the Commentary of Moses Narboni*.
+Kalman P. Bland. Moreshet: Studies in Jewish History, Literature and
+Thought 7. New York: Jewish Theological Seminary of America.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Averroes, 1982)
+
+Averroes. (1982). *The epistle on the possibility of conjunction with
+the active intellect by Ibn Rushd with the commentary of Moses Narboni*.
+(K. P. Bland). New York: Jewish Theological Seminary of America.
+
+
+NOTES:
+
+- citeproc
+	- term "edited and translated by" missing
+
+}
+
+@Book{averroes-bland,
+  author       = {Averroes},
+  title        = {The Epistle on the Possibility of Conjunction with the Active
+                  Intellect by {Ibn Rushd} with the Commentary of {Moses Narboni}},
+  date         = 1982,
+  editor       = {Bland, Kalman P.},
+  translator   = {Bland, Kalman P.},
+  series       = {Moreshet: {Studies} in {Jewish} History, Literature and Thought},
+  number       = 7,
+  publisher    = {Jewish Theological Seminary of America},
+  location     = {New York},
+  keywords     = {primary},
+  hyphenation  = {american},
+  indextitle   = {Epistle on the Possibility of Conjunction, The},
+  shorttitle   = {Possibility of Conjunction},
+  annotation   = {A book entry with a series and a
+                  number. Note the concatenation of the editor
+                  and translator fields as well as the
+                  indextitle field},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A book entry with a series and a number. Note the
+    concatenation of the editor and translator fields as well as the
+    indextitle field
+  author:
+  - family: Averroes
+  collection-number: 7
+  collection-title: "Moreshet: Studies in Jewish history, literature and
+    thought"
+  editor:
+  - family: Bland
+    given: Kalman P.
+  id: averroes-bland
+  issued: 1982
+  keyword: primary
+  language: en-US
+  publisher: Jewish Theological Seminary of America
+  publisher-place: New York
+  title: The epistle on the possibility of conjunction with the active
+    intellect by Ibn Rushd with the commentary of Moses Narboni
+  title-short: Possibility of conjunction
+  translator:
+  - family: Bland
+    given: Kalman P.
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-averroes-hannes.md b/test/command/biblatex-averroes-hannes.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-averroes-hannes.md
@@ -0,0 +1,84 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Averroes 1892)
+
+Averroes. 1892. *Des Averroës Abhandlung: “Über die Möglichkeit der
+Conjunktion” oder “Über den materiellen Intellekt”*. Ludwig Hannes.
+Halle an der Saale: C. A. Kaemmerer.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Averroes, 1892)
+
+Averroes. (1892). *Des Averroës Abhandlung: “Über die Möglichkeit der
+Conjunktion” oder “Über den materiellen Intellekt”*. (L. Hannes). Halle
+an der Saale: C. A. Kaemmerer.
+
+
+NOTES:
+
+- citeproc
+	- term "edited and translated by" missing
+
+}
+
+@Book{averroes-hannes,
+  author       = {Averroes},
+  title        = {Des Averro{\"e}s Abhandlung: \mkbibquote{{\"U}ber die
+                  M{\"o}glichkeit der Conjunktion} oder \mkbibquote{{\"U}ber den
+                  materiellen Intellekt}},
+  date         = 1892,
+  editor       = {Hannes, Ludwig},
+  translator   = {Hannes, Ludwig},
+  annotator    = {Hannes, Ludwig},
+  publisher    = {C.~A. Kaemmerer},
+  location     = {Halle an der Saale},
+  keywords     = {primary},
+  hyphenation  = {german},
+  sorttitle    = {Uber die Moglichkeit der Conjunktion},
+  indexsorttitle= {Uber die Moglichkeit der Conjunktion},
+  indextitle   = {{\"U}ber die M{\"o}glichkeit der Conjunktion},
+  shorttitle   = {{\"U}ber die M{\"o}glichkeit der Conjunktion},
+  annotation   = {An annotated edition. Note the concatenation of the
+                  editor, translator, and annotator
+                  fields. Also note the shorttitle,
+                  indextitle, sorttitle, and
+                  indexsorttitle fields},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: An annotated edition. Note the concatenation of the editor,
+    translator, and annotator fields. Also note the shorttitle,
+    indextitle, sorttitle, and indexsorttitle fields
+  author:
+  - family: Averroes
+  editor:
+  - family: Hannes
+    given: Ludwig
+  id: averroes-hannes
+  issued: 1892
+  keyword: primary
+  language: de-DE
+  publisher: C. A. Kaemmerer
+  publisher-place: Halle an der Saale
+  title: "Des Averroës Abhandlung: \"Über die Möglichkeit der
+    Conjunktion\" oder \"Über den materiellen Intellekt\""
+  title-short: Über die Möglichkeit der Conjunktion
+  translator:
+  - family: Hannes
+    given: Ludwig
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-averroes-hercz.md b/test/command/biblatex-averroes-hercz.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-averroes-hercz.md
@@ -0,0 +1,85 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Averroes 1869)
+
+Averroes. 1869. *Drei Abhandlungen über die Conjunction des separaten
+Intellects mit dem Menschen: Von Averroes (Vater und Sohn), aus dem
+Arabischen übersetzt von Samuel Ibn Tibbon*. J. Hercz. Berlin:
+S. Hermann.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Averroes, 1869)
+
+Averroes. (1869). *Drei Abhandlungen über die Conjunction des separaten
+Intellects mit dem Menschen: Von Averroes (Vater und Sohn), aus dem
+Arabischen übersetzt von Samuel Ibn Tibbon*. (J. Hercz). Berlin:
+S. Hermann.
+
+
+NOTES:
+
+- citeproc
+	- term "edited and translated by" missing
+
+}
+
+@Book{averroes-hercz,
+  author       = {Averroes},
+  title        = {Drei Abhandlungen {\"u}ber die Conjunction des separaten
+                  Intellects mit dem Menschen},
+  date         = 1869,
+  editor       = {Hercz, J.},
+  translator   = {Hercz, J.},
+  publisher    = {S.~Hermann},
+  location     = {Berlin},
+  keywords     = {primary},
+  hyphenation  = {german},
+  indexsorttitle= {Drei Abhandlungen uber die Conjunction},
+  indextitle   = {Drei Abhandlungen {\"u}ber die Conjunction},
+  subtitle     = {Von Averroes (Vater und Sohn), aus dem Arabischen
+                  {\"u}bersetzt von Samuel Ibn Tibbon},
+  shorttitle   = {Drei Abhandlungen},
+  annotation   = {A book entry. Note the concatenation of the
+                  editor and translator fields as well as the
+                  indextitle and indexsorttitle fields},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A book entry. Note the concatenation of the editor and
+    translator fields as well as the indextitle and indexsorttitle
+    fields
+  author:
+  - family: Averroes
+  editor:
+  - family: Hercz
+    given: J.
+  id: averroes-hercz
+  issued: 1869
+  keyword: primary
+  language: de-DE
+  publisher: S. Hermann
+  publisher-place: Berlin
+  title: "Drei Abhandlungen über die Conjunction des separaten
+    Intellects mit dem Menschen: Von Averroes (Vater und Sohn), aus dem
+    Arabischen übersetzt von Samuel Ibn Tibbon"
+  title-short: Drei Abhandlungen
+  translator:
+  - family: Hercz
+    given: J.
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-baez-article.md b/test/command/biblatex-baez-article.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-baez-article.md
@@ -0,0 +1,76 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Baez and Lauda 2004)
+
+Baez, John C., and Aaron D. Lauda. 2004. “Higher-dimensional Algebra V:
+2-groups” (version 3). *Theory and Applications of Categories* 12:
+423–491.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Baez & Lauda, 2004)
+
+Baez, J. C., & Lauda, A. D. (2004). Higher-dimensional algebra V:
+2-groups. *Theory and Applications of Categories*, *12*, 423–491.
+
+
+NOTES:
+
+- biblio2yaml
+	- eprint: see baez-online
+
+}
+
+@Article{baez-article,
+  author       = {Baez, John C. and Lauda, Aaron D.},
+  title        = {Higher-Dimensional Algebra {V}: 2-Groups},
+  journaltitle = {Theory and Applications of Categories},
+  date         = 2004,
+  volume       = 12,
+  pages        = {423-491},
+  version      = 3,
+  eprint       = {math/0307200v3},
+  eprinttype   = {arxiv},
+  hyphenation  = {american},
+  annotation   = {An article with eprint and
+                  eprinttype fields. Note that the arXiv reference is
+                  transformed into a clickable link if hyperref support
+                  has been enabled.  Compare baez\slash online, which
+                  is the same item given as an online entry},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: An article with eprint and eprinttype fields. Note that the
+    arXiv reference is transformed into a clickable link if hyperref
+    support has been enabled. Compare baez/online, which is the same
+    item given as an online entry
+  author:
+  - family: Baez
+    given: John C.
+  - family: Lauda
+    given: Aaron D.
+  container-title: Theory and Applications of Categories
+  id: baez-article
+  issued: 2004
+  language: en-US
+  page: 423-491
+  title: "Higher-dimensional algebra V: 2-groups"
+  title-short: Higher-dimensional algebra V
+  type: article-journal
+  url: "http://arxiv.org/abs/math/0307200v3"
+  version: 3
+  volume: 12
+---
+
+
+```
diff --git a/test/command/biblatex-baez-online.md b/test/command/biblatex-baez-online.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-baez-online.md
@@ -0,0 +1,69 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Baez and Lauda 2004)
+
+Baez, John C., and Aaron D. Lauda. 2004. “Higher-dimensional Algebra V:
+2-groups” (version 3). October 27.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Baez & Lauda, 2004)
+
+Baez, J. C., & Lauda, A. D. (2004, October 27). Higher-dimensional
+algebra V: 2-groups.
+
+
+NOTES:
+
+- biblio2yaml:
+	- eprinttype = {arxiv}, eprint = {math/0307200v3}, 
+	  should be converted to a url: http://arxiv.org/abs/math/0307200v3
+	  (prefix http://arxiv.org/abs/ seems to work for all arxiv material)
+
+}
+
+@Online{baez-online,
+  author       = {Baez, John C. and Lauda, Aaron D.},
+  title        = {Higher-Dimensional Algebra {V}: 2-Groups},
+  date         = {2004-10-27},
+  version      = 3,
+  hyphenation  = {american},
+  eprinttype   = {arxiv},
+  eprint       = {math/0307200v3},
+  annotation   = {An online reference from arXiv. Note the
+                  eprint and eprinttype fields. Compare
+                  baez\slash article which is the same item given as an
+                  article entry with eprint information},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: An online reference from arXiv. Note the eprint and eprinttype
+    fields. Compare baez/article which is the same item given as an
+    article entry with eprint information
+  author:
+  - family: Baez
+    given: John C.
+  - family: Lauda
+    given: Aaron D.
+  id: baez-online
+  issued: 2004-10-27
+  language: en-US
+  title: "Higher-dimensional algebra V: 2-groups"
+  title-short: Higher-dimensional algebra V
+  type: webpage
+  url: "http://arxiv.org/abs/math/0307200v3"
+  version: 3
+---
+
+
+```
diff --git a/test/command/biblatex-basic.md b/test/command/biblatex-basic.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-basic.md
@@ -0,0 +1,69 @@
+@Book{item1,
+author="John Doe",
+title="First Book",
+year="2005",
+address="Cambridge",
+publisher="Cambridge University Press"
+}
+
+@Article{item2,
+author="John Doe",
+title="Article",
+year="2006",
+journal="Journal of Generic Studies",
+volume="6",
+pages="33-34"
+}
+
+@InCollection{пункт3,
+author="John Doe and Jenny Roe",
+title="Why Water Is Wet",
+booktitle="Third Book",
+editor="Sam Smith",
+publisher="Oxford University Press",
+address="Oxford",
+year="2007"
+}
+
+^D
+---
+nocite: '[@*]'
+references:
+- author:
+  - family: Doe
+    given: John
+  id: item1
+  issued: 2005
+  publisher: Cambridge University Press
+  publisher-place: Cambridge
+  title: First book
+  type: book
+- author:
+  - family: Doe
+    given: John
+  container-title: Journal of Generic Studies
+  id: item2
+  issued: 2006
+  page: '33-34'
+  title: Article
+  type: 'article-journal'
+  volume: 6
+- author:
+  - family: Doe
+    given: John
+  - family: Roe
+    given: Jenny
+  container-title: Third book
+  editor:
+  - family: Smith
+    given: Sam
+  id: пункт3
+  issued: 2007
+  publisher: Oxford University Press
+  publisher-place: Oxford
+  title: Why water is wet
+  type: chapter
+---
+
+
+```
diff --git a/test/command/biblatex-bertram.md b/test/command/biblatex-bertram.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-bertram.md
@@ -0,0 +1,66 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Bertram and Wentworth 1996)
+
+Bertram, Aaron, and Richard Wentworth. 1996. “Gromov Invariants for
+Holomorphic Maps on Riemann Surfaces.” *J. Amer. Math. Soc.* 9 (2):
+529–571.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Bertram & Wentworth, 1996)
+
+Bertram, A., & Wentworth, R. (1996). Gromov invariants for holomorphic
+maps on Riemann surfaces. *J. Amer. Math. Soc.*, *9*(2), 529–571.
+
+
+}
+
+@string{ jams    = {J.~Amer. Math. Soc.} }
+
+@Article{bertram,
+  author       = {Bertram, Aaron and Wentworth, Richard},
+  title        = {Gromov invariants for holomorphic maps on {Riemann} surfaces},
+  journaltitle = jams,
+  date         = 1996,
+  volume       = 9,
+  number       = 2,
+  pages        = {529-571},
+  hyphenation  = {american},
+  shorttitle   = {Gromov invariants},
+  annotation   = {An article entry with a volume and a
+                  number field},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: An article entry with a volume and a number field
+  author:
+  - family: Bertram
+    given: Aaron
+  - family: Wentworth
+    given: Richard
+  container-title: J. Amer. Math. Soc.
+  id: bertram
+  issue: 2
+  issued: 1996
+  language: en-US
+  page: 529-571
+  title: Gromov invariants for holomorphic maps on Riemann surfaces
+  title-short: Gromov invariants
+  type: article-journal
+  volume: 9
+---
+
+
+```
diff --git a/test/command/biblatex-bibstring-resolution.md b/test/command/biblatex-bibstring-resolution.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-bibstring-resolution.md
@@ -0,0 +1,20 @@
+```
+% pandoc -f biblatex -t markdown -s
+@book{item1,
+	Title = {The Title: \bibstring{newseries}},
+        Hyphenation = {english}
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- id: item1
+  language: en-US
+  title: "The title: New series"
+  title-short: The title
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-book-averroes.md b/test/command/biblatex-book-averroes.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-book-averroes.md
@@ -0,0 +1,129 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+adapted from
+http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib}
+
+@book{averroes/bland,
+	Annotation = {A book entry with a series and a number. Note the concatenation of the editor and translator fields as well as the indextitle field},
+	Author = {Averroes},
+	Date = 1982,
+	Editor = {Bland, Kalman P.},
+	Hyphenation = {american},
+	Indextitle = {Epistle on the Possibility of Conjunction, The},
+	Keywords = {primary},
+	Location = {New York},
+	Number = 7,
+	Publisher = {Jewish Theological Seminary of America},
+	Series = {{Moreshet: Studies in Jewish History, Literature and Thought}},
+	Shorttitle = {Possibility of Conjunction},
+	Title = {The Epistle on the Possibility of Conjunction with the Active Intellect by {Ibn Rushd} with the Commentary of {Moses Narboni}},
+	Translator = {Bland, Kalman P.}}
+
+@book{averroes/hannes,
+	Annotation = {An annotated edition. Note the concatenation of the editor, translator, and annotator fields. Also note the shorttitle, indextitle, sorttitle, and indexsorttitle fields},
+	Annotator = {Hannes, Ludwig},
+	Author = {Averroes},
+	Date = 1892,
+	Editor = {Hannes, Ludwig},
+	Hyphenation = {german},
+	Indexsorttitle = {Uber die Moglichkeit der Conjunktion},
+	Indextitle = {Über die Möglichkeit der Conjunktion},
+	Keywords = {primary},
+	Location = {Halle an der Saale},
+	Publisher = {C.~A. Kaemmerer},
+	Shorttitle = {Über die Möglichkeit der Conjunktion},
+	Sorttitle = {Uber die Moglichkeit der Conjunktion},
+	Title = {Des Averroës Abhandlung: \mkbibquote{Über die Möglichkeit der Conjunktion} oder \mkbibquote{Über den materiellen Intellekt}},
+	Translator = {Hannes, Ludwig}}
+
+@book{averroes/hercz,
+	Annotation = {A book entry. Note the concatenation of the editor and translator fields as well as the indextitle and indexsorttitle fields},
+	Author = {Averroes},
+	Date = 1869,
+	Editor = {Hercz, J.},
+	Hyphenation = {german},
+	Indexsorttitle = {Drei Abhandlungen uber die Conjunction},
+	Indextitle = {Drei Abhandlungen über die Conjunction},
+	Keywords = {primary},
+	Location = {Berlin},
+	Publisher = {S.~Hermann},
+	Shorttitle = {Drei Abhandlungen},
+	Subtitle = {Von Averroes (Vater und Sohn), aus dem Arabischen übersetzt von Samuel Ibn Tibbon},
+	Title = {Drei Abhandlungen über die Conjunction des separaten Intellects mit dem Menschen},
+	Translator = {Hercz, J.}}
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A book entry with a series and a number. Note the
+    concatenation of the editor and translator fields as well as the
+    indextitle field
+  author:
+  - family: Averroes
+  collection-number: 7
+  collection-title: "[Moreshet: Studies in Jewish History, Literature
+    and Thought]{.nocase}"
+  editor:
+  - family: Bland
+    given: Kalman P.
+  id: averroes/bland
+  issued: 1982
+  keyword: primary
+  language: en-US
+  publisher: Jewish Theological Seminary of America
+  publisher-place: New York
+  title: The epistle on the possibility of conjunction with the active
+    intellect by Ibn Rushd with the commentary of Moses Narboni
+  title-short: Possibility of conjunction
+  translator:
+  - family: Bland
+    given: Kalman P.
+  type: book
+- annote: An annotated edition. Note the concatenation of the editor,
+    translator, and annotator fields. Also note the shorttitle,
+    indextitle, sorttitle, and indexsorttitle fields
+  author:
+  - family: Averroes
+  editor:
+  - family: Hannes
+    given: Ludwig
+  id: averroes/hannes
+  issued: 1892
+  keyword: primary
+  language: de-DE
+  publisher: C. A. Kaemmerer
+  publisher-place: Halle an der Saale
+  title: "Des Averroës Abhandlung: \"Über die Möglichkeit der
+    Conjunktion\" oder \"Über den materiellen Intellekt\""
+  title-short: Über die Möglichkeit der Conjunktion
+  translator:
+  - family: Hannes
+    given: Ludwig
+  type: book
+- annote: A book entry. Note the concatenation of the editor and
+    translator fields as well as the indextitle and indexsorttitle
+    fields
+  author:
+  - family: Averroes
+  editor:
+  - family: Hercz
+    given: J.
+  id: averroes/hercz
+  issued: 1869
+  keyword: primary
+  language: de-DE
+  publisher: S. Hermann
+  publisher-place: Berlin
+  title: "Drei Abhandlungen über die Conjunction des separaten
+    Intellects mit dem Menschen: Von Averroes (Vater und Sohn), aus dem
+    Arabischen übersetzt von Samuel Ibn Tibbon"
+  title-short: Drei Abhandlungen
+  translator:
+  - family: Hercz
+    given: J.
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-book-coleridge.md b/test/command/biblatex-book-coleridge.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-book-coleridge.md
@@ -0,0 +1,59 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{adapted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib
+
+TODO (as a stopgap):
+Combine biblatex “volume = 7” and “part = 2” to CSL “volume: 7.2”
+
+}
+
+@book{coleridge,
+	Annotation = {One (partial) volume of a multivolume book. This is a book entry with a volume and a part field which explicitly refers to the second (physical) part of the seventh (logical) volume. Also note the series and number fields},
+	Author = {Coleridge, Samuel Taylor},
+	Date = 1983,
+	Editor = {Coburn, Kathleen and Engell, James and Bate, W. Jackson},
+	Hyphenation = {british},
+	Indextitle = {Biographia literaria},
+	Location = {London},
+	Maintitle = {The collected works of {Samuel Taylor Coleridge}},
+	Number = 75,
+	Part = 2,
+	Publisher = {Routledge {and} Kegan Paul},
+	Series = {Bollingen Series},
+	Shorttitle = {Biographia literaria},
+	Title = {Biographia literaria, or {Biographical} sketches of my literary life and opinions},
+	Volume = 7}
+^D
+---
+nocite: "[@*]"
+references:
+- annote: One (partial) volume of a multivolume book. This is a book
+    entry with a volume and a part field which explicitly refers to the
+    second (physical) part of the seventh (logical) volume. Also note
+    the series and number fields
+  author:
+  - family: Coleridge
+    given: Samuel Taylor
+  collection-number: 75
+  collection-title: Bollingen series
+  editor:
+  - family: Coburn
+    given: Kathleen
+  - family: Engell
+    given: James
+  - family: Bate
+    given: W. Jackson
+  id: coleridge
+  issued: 1983
+  language: en-GB
+  publisher: Routledge and Kegan Paul
+  publisher-place: London
+  title: The collected works of Samuel Taylor Coleridge
+  type: book
+  volume: 7.2
+  volume-title: Biographia literaria, or Biographical sketches of my
+    literary life and opinions
+---
+
+
+```
diff --git a/test/command/biblatex-book-title-maintitle-series.md b/test/command/biblatex-book-title-maintitle-series.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-book-title-maintitle-series.md
@@ -0,0 +1,39 @@
+```
+% pandoc -f biblatex -t markdown -s
+@book{item1,
+	Author = {Author, Al},
+	Date = {2013},
+	Hyphenation = {french},
+	Location = {Location},
+	Mainsubtitle = {Mainsubtitle},
+	Maintitle = {Maintitle},
+	Maintitleaddon = {Maintitleaddon},
+	Number = {3},
+	Publisher = {Publisher},
+	Series = {Series},
+	Subtitle = {Subtitle},
+	Title = {Title of the Book},
+	Titleaddon = {Titleaddon},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Author
+    given: Al
+  collection-number: 3
+  collection-title: Series
+  id: item1
+  issued: 2013
+  language: fr-FR
+  publisher: Publisher
+  publisher-place: Location
+  title: "Maintitle: Mainsubtitle. Maintitleaddon"
+  type: book
+  volume-title: "Title of the Book: Subtitle. Titleaddon"
+---
+
+
+```
diff --git a/test/command/biblatex-book-vazques-de-parga.md b/test/command/biblatex-book-vazques-de-parga.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-book-vazques-de-parga.md
@@ -0,0 +1,48 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{excerpted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib
+
+Note handling of Author = {Vázques{ de }Parga, Luis}
+
+}
+
+@book{vazques-de-parga,
+	Annotation = {A multivolume book cited as a whole. This is a book entry with volumes, note, sorttitle, and indextitle fields},
+	Author = {Vázques{ de }Parga, Luis and Lacarra, José María and Uría Ríu, Juan},
+	Date = 1993,
+	Hyphenation = {spanish},
+	Indextitle = {Peregrinaciones a Santiago de Compostela, Las},
+	Location = {Pamplona},
+	Note = {Ed. facs. de la realizada en 1948--49},
+	Publisher = {Iberdrola},
+	Shorttitle = {Peregrinaciones},
+	Sorttitle = {Peregrinaciones a Santiago de Compostela},
+	Title = {Las Peregrinaciones a Santiago de Compostela},
+	Volumes = 3}
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A multivolume book cited as a whole. This is a book entry with
+    volumes, note, sorttitle, and indextitle fields
+  author:
+  - family: Vázques de Parga
+    given: Luis
+  - family: Lacarra
+    given: José María
+  - family: Uría Ríu
+    given: Juan
+  id: vazques-de-parga
+  issued: 1993
+  language: es-ES
+  note: Ed. facs. de la realizada en 1948--49
+  number-of-volumes: 3
+  publisher: Iberdrola
+  publisher-place: Pamplona
+  title: Las Peregrinaciones a Santiago de Compostela
+  title-short: Peregrinaciones
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-brandt.md b/test/command/biblatex-brandt.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-brandt.md
@@ -0,0 +1,88 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Brandt and Hoffmann 1987)
+
+Brandt, Ahasver von, and Erich Hoffmann. 1987. “Die nordischen Länder
+von der Mitte des 11. Jahrhunderts bis 1448.” In *Europa im Hoch- und
+Spätmittelalter*, edited by Ferdinand Seibt, 884–917. Handbuch der
+europäischen Geschichte 2. Stuttgart: Klett-Cotta.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Brandt & Hoffmann, 1987)
+
+Brandt, A. von, & Hoffmann, E. (1987). Die nordischen Länder von der
+Mitte des 11. Jahrhunderts bis 1448. In F. Seibt (ed.), *Europa im Hoch-
+und Spätmittelalter* (pp. 884–917). Stuttgart: Klett-Cotta.
+
+
+}
+
+@InCollection{brandt,
+  author       = {von Brandt, Ahasver and Erich Hoffmann},
+  editor       = {Ferdinand Seibt},
+  title        = {Die nordischen L{\"a}nder von der Mitte des 11.~Jahrhunderts
+                  bis 1448},
+  date         = 1987,
+  booktitle    = {Europa im Hoch- und Sp{\"a}tmittelalter},
+  series       = {Handbuch der europ{\"a}ischen Geschichte},
+  number       = 2,
+  publisher    = {Klett-Cotta},
+  location     = {Stuttgart},
+  pages        = {884-917},
+  options      = {useprefix=false},
+  hyphenation  = {german},
+  indexsorttitle= {Nordischen Lander von der Mitte des 11. Jahrhunderts bis
+                  1448},
+  indextitle   = {Nordischen L{\"a}nder von der Mitte des 11.~Jahrhunderts bis
+                  1448, Die},
+  shorttitle   = {Die nordischen L{\"a}nder},
+  annotation   = {An incollection entry with a series and a
+                  number. Note the format of the printed name and
+                  compare the useprefix option in the options
+                  field as well as vangennep. Also note the
+                  indextitle, and indexsorttitle fields},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: An incollection entry with a series and a number. Note the
+    format of the printed name and compare the useprefix option in the
+    options field as well as vangennep. Also note the indextitle, and
+    indexsorttitle fields
+  author:
+  - dropping-particle: von
+    family: Brandt
+    given: Ahasver
+  - family: Hoffmann
+    given: Erich
+  collection-number: 2
+  collection-title: Handbuch der europäischen Geschichte
+  container-title: Europa im Hoch- und Spätmittelalter
+  editor:
+  - family: Seibt
+    given: Ferdinand
+  id: brandt
+  issued: 1987
+  language: de-DE
+  page: 884-917
+  publisher: Klett-Cotta
+  publisher-place: Stuttgart
+  title: Die nordischen Länder von der Mitte des 11. Jahrhunderts bis
+    1448
+  title-short: Die nordischen Länder
+  type: chapter
+---
+
+
+```
diff --git a/test/command/biblatex-britannica.md b/test/command/biblatex-britannica.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-britannica.md
@@ -0,0 +1,85 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Preece 2003)
+
+Preece, Warren E., ed. 2003. *The New EncyclopæDia Britannica*. 15th ed.
+32. Chicago, Ill.: Encyclopædia Britannica.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Preece, 2003)
+
+Preece, W. E. (Ed.). (2003). *The new encyclopædia Britannica* (15th
+ed., 1-32). Chicago, Ill.: Encyclopædia Britannica.
+
+
+NOTES:
+
+- biblio2yaml
+	- spurious <span> in Encyclopædia
+	- options = {useeditor=false} has no equivalent in CSL, so citing and alphabetizing by title even though there is an editor does not seem to be possible
+
+- citeproc
+	- incorrect camel case: "EncyclopæDia"
+	- term "vols." missing
+
+}
+
+@Collection{britannica,
+  editor       = {Preece, Warren E.},
+  title        = {The New Encyclop{\ae}dia {Britannica}},
+  date         = 2003,
+  edition      = 15,
+  volumes      = 32,
+  publisher    = {Encyclop{\ae}dia Britannica},
+  location     = {Chicago, Ill.},
+  options      = {useeditor=false},
+  label        = {EB},
+  hyphenation  = {british},
+  sorttitle    = {Encyclop{\ae}dia Britannica},
+  indextitle   = {Encyclop{\ae}dia Britannica, The New},
+  shorttitle   = {Encyclop{\ae}dia {Britannica}},
+  annotation   = {This is a collection entry for an encyclopedia. Note
+                  the useeditor option in the options field as
+                  well as the sorttitle field. We want this entry to be
+                  cited and alphabetized by title even though there is an
+                  editor. In addition to that, we want the title to be
+                  alphabetized under \enquote*{E} rather than \enquote*{T}. Also
+                  note the label field which is provided for
+                  author-year citation styles},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a collection entry for an encyclopedia. Note the
+    useeditor option in the options field as well as the sorttitle
+    field. We want this entry to be cited and alphabetized by title even
+    though there is an editor. In addition to that, we want the title to
+    be alphabetized under 'E' rather than 'T'. Also note the label field
+    which is provided for author-year citation styles
+  edition: 15
+  editor:
+  - family: Preece
+    given: Warren E.
+  id: britannica
+  issued: 2003
+  language: en-GB
+  number-of-volumes: 32
+  publisher: Encyclopædia Britannica
+  publisher-place: Chicago, Ill.
+  title: The new encyclopædia Britannica
+  title-short: Encyclopædia Britannica
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-chiu.md b/test/command/biblatex-chiu.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-chiu.md
@@ -0,0 +1,77 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Chiu and Chow 1978)
+
+Chiu, Willy W., and We Min Chow. 1978. “A Hybrid Hierarchical Model of a
+Multiple Virtual Storage (MVS) Operating System.” Research report
+RC-6947. IBM.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Chiu & Chow, 1978)
+
+Chiu, W. W., & Chow, W. M. (1978). *A hybrid hierarchical model of a
+multiple virtual storage (MVS) operating system* (research report No.
+RC-6947). IBM.
+
+
+NOTES:
+
+- biblio2yaml
+	- "MVS", when not wrapped in {}, gives "mVS", which is probably never intended, or useful (latex converts the whole word to lowercase if unprotected ("MVS" -> "mvs"))
+
+}
+
+@Report{chiu,
+  author       = {Chiu, Willy W. and Chow, We Min},
+  title        = {A Hybrid Hierarchical Model of a Multiple Virtual Storage
+                  ({MVS}) Operating System},
+  type         = {resreport},
+  institution  = {IBM},
+  date         = 1978,
+  number       = {RC-6947},
+  hyphenation  = {american},
+  sorttitle    = {Hybrid Hierarchical Model of a Multiple Virtual Storage (MVS)
+                  Operating System},
+  indextitle   = {Hybrid Hierarchical Model, A},
+  annotation   = {This is a report entry for a research report. Note
+                  the format of the type field in the database file
+                  which uses a localization key. The number of the report is
+                  given in the number field. Also note the
+                  sorttitle and indextitle fields},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a report entry for a research report. Note the format
+    of the type field in the database file which uses a localization
+    key. The number of the report is given in the number field. Also
+    note the sorttitle and indextitle fields
+  author:
+  - family: Chiu
+    given: Willy W.
+  - family: Chow
+    given: We Min
+  genre: research report
+  id: chiu
+  issued: 1978
+  language: en-US
+  number: RC-6947
+  publisher: IBM
+  title: A hybrid hierarchical model of a multiple virtual storage (MVS)
+    operating system
+  type: report
+---
+
+
+```
diff --git a/test/command/biblatex-cicero.md b/test/command/biblatex-cicero.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-cicero.md
@@ -0,0 +1,82 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Cicero 1995)
+
+Cicero, Marcus Tullius. 1995. *De natura deorum. Über das Wesen der
+Götter*. Ursula Blank-Sangmeister. Stuttgart: Reclam.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Cicero, 1995)
+
+Cicero, M. T. (1995). *De natura deorum. Über das Wesen der Götter*. (U.
+Blank-Sangmeister). Stuttgart: Reclam.
+
+
+NOTES:
+
+- biblio2yaml
+	- afterword, language: no CSL variables available
+
+- citeproc:
+	- term such as "edited and translated by" should appear
+
+}
+
+@Book{cicero,
+  author       = {Cicero, Marcus Tullius},
+  title        = {De natura deorum. {\"U}ber das Wesen der G{\"o}tter},
+  date         = 1995,
+  editor       = {Blank-Sangmeister, Ursula},
+  translator   = {Blank-Sangmeister, Ursula},
+  afterword    = {Thraede, Klaus},
+  language     = {langlatin and langgerman},
+  publisher    = {Reclam},
+  location     = {Stuttgart},
+  hyphenation  = {german},
+  indextitle   = {De natura deorum},
+  shorttitle   = {De natura deorum},
+  annotation   = {A bilingual edition of Cicero's \emph{De natura deorum}, with
+                  a German translation. Note the format of the language
+                  field in the database file, the concatenation of the
+                  editor and translator fields, and the
+                  afterword field},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A bilingual edition of Cicero's *De natura deorum*, with a
+    German translation. Note the format of the language field in the
+    database file, the concatenation of the editor and translator
+    fields, and the afterword field
+  author:
+  - family: Cicero
+    given: Marcus Tullius
+  editor:
+  - family: Blank-Sangmeister
+    given: Ursula
+  id: cicero
+  issued: 1995
+  language: de-DE
+  publisher: Reclam
+  publisher-place: Stuttgart
+  title: De natura deorum. Über das Wesen der Götter
+  title-short: De natura deorum
+  translator:
+  - family: Blank-Sangmeister
+    given: Ursula
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-cms.md b/test/command/biblatex-cms.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-cms.md
@@ -0,0 +1,81 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(*The Chicago Manual of Style: The Essential Guide for Writers, Editors,
+and Publishers* 2003)
+
+*The Chicago Manual of Style: The Essential Guide for Writers, Editors,
+and Publishers*. 2003. 15th ed. Chicago, Ill.: University of Chicago
+Press.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(*Chicago manual of style*, 2003)
+
+*The Chicago manual of style: The essential guide for writers, editors,
+and publishers*. (2003) (15th ed.). Chicago, Ill.: University of Chicago
+Press.
+
+
+NOTES:
+
+- chicago-author-date.csl should have as in-text citation: 
+  (*Chicago Manual of Style* 2003)
+  Same behaviour in Zotero; most probably a style file issue.
+
+}
+
+@Manual{cms,
+  title        = {The {Chicago} Manual of Style},
+  date         = 2003,
+  subtitle     = {The Essential Guide for Writers, Editors, and Publishers},
+  edition      = 15,
+  publisher    = {University of Chicago Press},
+  location     = {Chicago, Ill.},
+  isbn         = {0-226-10403-6},
+  label        = {CMS},
+  hyphenation  = {american},
+  sorttitle    = {Chicago Manual of Style},
+  indextitle   = {Chicago Manual of Style, The},
+  shorttitle   = {Chicago Manual of Style},
+  annotation   = {This is a manual entry without an author or
+                  editor. Note the label field in the database
+                  file which is provided for author-year citation styles. Also
+                  note the sorttitle and indextitle fields. By
+                  default, all entries without an author or
+                  editor are alphabetized by title but we want
+                  this entry to be alphabetized under \enquote*{C} rather than
+                  \enquote*{T}. There's also an isbn field},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a manual entry without an author or editor. Note the
+    label field in the database file which is provided for author-year
+    citation styles. Also note the sorttitle and indextitle fields. By
+    default, all entries without an author or editor are alphabetized by
+    title but we want this entry to be alphabetized under 'C' rather
+    than 'T'. There's also an isbn field
+  edition: 15
+  id: cms
+  isbn: 0-226-10403-6
+  issued: 2003
+  language: en-US
+  publisher: University of Chicago Press
+  publisher-place: Chicago, Ill.
+  title: "The Chicago manual of style: The essential guide for writers,
+    editors, and publishers"
+  title-short: Chicago manual of style
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-coleridge.md b/test/command/biblatex-coleridge.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-coleridge.md
@@ -0,0 +1,86 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2015-03-08:
+
+(Coleridge 1983)
+
+Coleridge, Samuel Taylor. 1983. *The Collected Works of Samuel Taylor
+Coleridge*. Edited by Kathleen Coburn, James Engell, and W. Jackson
+Bate. Vol. 7.2. Bollingen Series 75. London: Routledge and Kegan Paul.
+
+Formatted with pandoc and apa.csl, 2015-03-08:
+
+(Coleridge, 1983)
+
+Coleridge, S. T. (1983). *The collected works of Samuel Taylor
+Coleridge*. (K. Coburn, J. Engell, & W. J. Bate, Eds.) (Vol. 7.2).
+London: Routledge and Kegan Paul.
+
+NOTES:
+
+- volume-title currently not implemented by chicago-author-date.csl and apa.csl.
+
+}
+
+@Book{coleridge,
+  author       = {Coleridge, Samuel Taylor},
+  title        = {Biographia literaria, or {Biographical} sketches of my literary
+                  life and opinions},
+  date         = 1983,
+  editor       = {Coburn, Kathleen and Engell, James and Bate, W. Jackson},
+  maintitle    = {The collected works of {Samuel Taylor Coleridge}},
+  volume       = 7,
+  part         = 2,
+  series       = {Bollingen Series},
+  number       = 75,
+  publisher    = {Routledge {and} Kegan Paul},
+  location     = {London},
+  hyphenation  = {british},
+  indextitle   = {Biographia literaria},
+  shorttitle   = {Biographia literaria},
+  annotation   = {One (partial) volume of a multivolume book. This is a
+                  book entry with a volume and a part
+                  field which explicitly refers to the second (physical) part of
+                  the seventh (logical) volume. Also note the series
+                  and number fields},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: One (partial) volume of a multivolume book. This is a book
+    entry with a volume and a part field which explicitly refers to the
+    second (physical) part of the seventh (logical) volume. Also note
+    the series and number fields
+  author:
+  - family: Coleridge
+    given: Samuel Taylor
+  collection-number: 75
+  collection-title: Bollingen series
+  editor:
+  - family: Coburn
+    given: Kathleen
+  - family: Engell
+    given: James
+  - family: Bate
+    given: W. Jackson
+  id: coleridge
+  issued: 1983
+  language: en-GB
+  publisher: Routledge and Kegan Paul
+  publisher-place: London
+  title: The collected works of Samuel Taylor Coleridge
+  type: book
+  volume: 7.2
+  volume-title: Biographia literaria, or Biographical sketches of my
+    literary life and opinions
+---
+
+
+```
diff --git a/test/command/biblatex-companion.md b/test/command/biblatex-companion.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-companion.md
@@ -0,0 +1,70 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Goossens, Mittelbach, and Samarin 1994)
+
+Goossens, Michel, Frank Mittelbach, and Alexander Samarin. 1994. *The
+LaTeX Companion*. 1st ed. Reading, Mass.: Addison-Wesley.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Goossens, Mittelbach, & Samarin, 1994)
+
+Goossens, M., Mittelbach, F., & Samarin, A. (1994). *The LaTeX
+companion* (1st ed.). Reading, Mass.: Addison-Wesley.
+
+
+}
+
+@Book{companion,
+  author       = {Goossens, Michel and Mittelbach, Frank and Samarin, Alexander},
+  title        = {The {LaTeX} Companion},
+  date         = 1994,
+  edition      = 1,
+  publisher    = {Addison-Wesley},
+  location     = {Reading, Mass.},
+  pagetotal    = 528,
+  hyphenation  = {american},
+  sorttitle    = {LaTeX Companion},
+  indextitle   = {LaTeX Companion, The},
+  shorttitle   = {LaTeX Companion},
+  annotation   = {A book with three authors. Note the formatting of the author
+                  list. By default, only the first name is reversed in the
+                  bibliography},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A book with three authors. Note the formatting of the author
+    list. By default, only the first name is reversed in the
+    bibliography
+  author:
+  - family: Goossens
+    given: Michel
+  - family: Mittelbach
+    given: Frank
+  - family: Samarin
+    given: Alexander
+  edition: 1
+  id: companion
+  issued: 1994
+  language: en-US
+  number-of-pages: 528
+  publisher: Addison-Wesley
+  publisher-place: Reading, Mass.
+  title: The LaTeX companion
+  title-short: LaTeX companion
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-cotton.md b/test/command/biblatex-cotton.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-cotton.md
@@ -0,0 +1,69 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Cotton et al. 1999)
+
+Cotton, Frank Albert, Geoffrey Wilkinson, Carlos A. Murillio, and
+Manfred Bochmann. 1999. *Advanced Inorganic Chemistry*. 6th ed.
+Chichester: Wiley.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Cotton, Wilkinson, Murillio, & Bochmann, 1999)
+
+Cotton, F. A., Wilkinson, G., Murillio, C. A., & Bochmann, M. (1999).
+*Advanced inorganic chemistry* (6th ed.). Chichester: Wiley.
+
+
+}
+
+@Book{cotton,
+  author       = {Cotton, Frank Albert and Wilkinson, Geoffrey and Murillio,
+                  Carlos A. and Bochmann, Manfred},
+  title        = {Advanced inorganic chemistry},
+  date         = 1999,
+  edition      = 6,
+  publisher    = {Wiley},
+  location     = {Chichester},
+  hyphenation  = {british},
+  annotation   = {A book entry with \arabic{author} authors and an
+                  edition field. By default, long author and
+                  editor lists are automatically truncated. This is
+                  configurable},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A book entry with author authors and an edition field. By
+    default, long author and editor lists are automatically truncated.
+    This is configurable
+  author:
+  - family: Cotton
+    given: Frank Albert
+  - family: Wilkinson
+    given: Geoffrey
+  - family: Murillio
+    given: Carlos A.
+  - family: Bochmann
+    given: Manfred
+  edition: 6
+  id: cotton
+  issued: 1999
+  language: en-GB
+  publisher: Wiley
+  publisher-place: Chichester
+  title: Advanced inorganic chemistry
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-crossref-inbook-mvbook.md b/test/command/biblatex-crossref-inbook-mvbook.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-crossref-inbook-mvbook.md
@@ -0,0 +1,58 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+crossref, directly from inbook to mvbook
+
+}
+
+@inbook{inbook-1,
+    Crossref = {mvbook-1},
+    Title = {Macbeth [title field of inbook-1]},
+    Date = {1975},
+    Volume = {3},
+    Chapter = {7},
+    Pages = {100-200},
+}
+
+@mvbook{mvbook-1,
+    Author = {Shakespeare},
+    Date = {1970/1980},
+    Title = {Collected Works [title field of mvbook-1]},
+    Location = {Location},
+    Publisher = {Publisher},
+    Volumes = {4},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Shakespeare
+  chapter-number: 7
+  container-author:
+  - family: Shakespeare
+  container-title: Collected works \[title field of mvbook-1\]
+  id: inbook-1
+  issued: 1975
+  number-of-volumes: 4
+  page: 100-200
+  publisher: Publisher
+  publisher-place: Location
+  title: Macbeth \[title field of inbook-1\]
+  type: chapter
+  volume: 3
+- author:
+  - family: Shakespeare
+  id: mvbook-1
+  issued: 1970/1980
+  number-of-volumes: 4
+  publisher: Publisher
+  publisher-place: Location
+  title: Collected works \[title field of mvbook-1\]
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-crossref-nested.md b/test/command/biblatex-crossref-nested.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-crossref-nested.md
@@ -0,0 +1,100 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Nested crossreferences (see biber manual v 1.7)
+
+}
+
+@bookinbook{bookinbook-1,
+    Crossref = {book-1},
+    Title = {Macbeth [title field of bookinbook-1]},
+    Chapter = {7},
+    Pages = {100-200},
+}
+
+@inbook{inbook-1,
+    Crossref = {book-1},
+    Title = {Macbeth [title field of inbook-1]},
+    Chapter = {7},
+    Pages = {100-200},
+}
+
+@book{book-1,
+    Crossref = {mvbook-1},
+    Date = {1975},
+    Title = {Tragedies [title field of book-1]},
+    Volume = {3}
+}
+
+@mvbook{mvbook-1,
+    Author = {Shakespeare},
+    Date = {1970/1980},
+    Title = {Collected Works [title field of mvbook-1]},
+    Location = {Location},
+    Publisher = {Publisher},
+    Volumes = {4}
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Shakespeare
+  chapter-number: 7
+  container-author:
+  - family: Shakespeare
+  container-title: Collected works \[title field of mvbook-1\]
+  id: bookinbook-1
+  issued: 1975
+  number-of-volumes: 4
+  page: 100-200
+  publisher: Publisher
+  publisher-place: Location
+  title: Macbeth \[title field of bookinbook-1\]
+  type: chapter
+  volume: 3
+  volume-title: Tragedies \[title field of book-1\]
+- author:
+  - family: Shakespeare
+  chapter-number: 7
+  container-author:
+  - family: Shakespeare
+  container-title: Collected works \[title field of mvbook-1\]
+  id: inbook-1
+  issued: 1975
+  number-of-volumes: 4
+  page: 100-200
+  publisher: Publisher
+  publisher-place: Location
+  title: Macbeth \[title field of inbook-1\]
+  type: chapter
+  volume: 3
+  volume-title: Tragedies \[title field of book-1\]
+- author:
+  - family: Shakespeare
+  container-author:
+  - family: Shakespeare
+  id: book-1
+  issued: 1975
+  number-of-volumes: 4
+  publisher: Publisher
+  publisher-place: Location
+  title: Collected works \[title field of mvbook-1\]
+  type: book
+  volume: 3
+  volume-title: Tragedies \[title field of book-1\]
+- author:
+  - family: Shakespeare
+  id: mvbook-1
+  issued: 1970/1980
+  number-of-volumes: 4
+  publisher: Publisher
+  publisher-place: Location
+  title: Collected works \[title field of mvbook-1\]
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-ctan.md b/test/command/biblatex-ctan.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-ctan.md
@@ -0,0 +1,73 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(“CTAN: The Comprehensive TeX Archive Network” 2006)
+
+“CTAN: The Comprehensive TeX Archive Network.” 2006.
+<http://www.ctan.org>.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(“CTAN: The Comprehensive TeX Archive Network,” 2006)
+
+CTAN: The Comprehensive TeX Archive Network. (2006). Retrieved October
+01, 2006, from <http://www.ctan.org>
+
+
+NOTES:
+
+- biblio2yaml
+	- if there is no shorttitle, but title and subtitle, the title alone should also be mapped to title-short
+
+- citeproc
+	- citeproc should use title-short (if available) instead of title for in-text citations when there is no author
+
+}
+
+@Online{ctan,
+  title        = {{CTAN}},
+  date         = 2006,
+  url          = {http://www.ctan.org},
+  subtitle     = {{The Comprehensive TeX Archive Network}},
+  urldate      = {2006-10-01},
+  label        = {CTAN},
+  hyphenation  = {american},
+  annotation   = {This is an online entry. The \textsc{url}, which is
+                  given in the url field, is transformed into a
+                  clickable link if hyperref support has been
+                  enabled. Note the format of the urldate field
+                  (yyyy-mm-dd) in the database file. Also note the
+                  label field which may be used as a fallback by
+                  citation styles which need an author and\slash or a
+                  year},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- accessed: 2006-10-01
+  annote: This is an online entry. The [url]{.smallcaps}, which is given
+    in the url field, is transformed into a clickable link if hyperref
+    support has been enabled. Note the format of the urldate field
+    (yyyy-mm-dd) in the database file. Also note the label field which
+    may be used as a fallback by citation styles which need an author
+    and/or a year
+  id: ctan
+  issued: 2006
+  language: en-US
+  title: "CTAN: The Comprehensive TeX Archive Network"
+  title-short: CTAN
+  type: webpage
+  url: "http://www.ctan.org"
+---
+
+
+```
diff --git a/test/command/biblatex-dates.md b/test/command/biblatex-dates.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-dates.md
@@ -0,0 +1,162 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+    - Dates
+    - Not included in tests:
+        - malformed dates and date ranges
+        - literal dates ("13th century"; not supported by biblatex)
+        - seasons (would have to come from parsing the issue field)
+        - uncertain dates (use "doubtfuldate" from biblatex-apa?)
+        - dates with single-digit day or month (not supported by biblatex)
+        - negative dates (not supported by biblatex)
+    - Note: biblatex supports years < 1000 but only if padded with leading zeros
+    - TODO:
+        - either biblio2yaml or, probably better, citeproc should strip leading zeros
+         from days and months (CSL can add leading zeros to its output, but not remove
+         them when they are in its input data)
+}
+
+@article{year-month-old,
+    Author = {Author, Al},
+    Journal = {Journal},
+    Month = aug,
+    Title = {Year and Month, bibtex style, supported by biblatex for backwards compatibility},
+    Year = {1999}}
+
+@article{year-month-new,
+    Author = {Author, Al},
+    Journal = {Journal},
+    Month = {08},
+    Title = {Year and Month, biblatex style; note that biblatex does not have a ``day'' field},
+    Year = {1999}}
+
+@article{dates,
+    Author = {Author, Al},
+    Date = {2012-12-13},
+    Eventdate = {2011-10-03},
+    Journal = {Journal},
+    Month = may,
+    Origdate = {1888-10-01},
+    Title = {Dates, default biblatex style; year, month to be ignored if date exists},
+    Urldate = {1999-05-23},
+    Year = {9999}}
+
+@article{date-ranges-different-years,
+    Author = {Author, Al},
+    Date = {1999-10-14/2010-01-23},
+    Eventdate = {1999-12/2000-01},
+    Journal = {Journal},
+    Origdate = {1888-01-02/1913-12-13},
+    Title = {Date ranges; different years},
+    Urldate = {2012-10-12/2013-01-31}}
+
+@article{date-ranges-same-year,
+    Author = {Author, Al},
+    Date = {1999-10-14/1999-10-15},
+    Eventdate = {1999-10/1999-11},
+    Journal = {Journal},
+    Origdate = {1888-01-02/1888-12-13},
+    Title = {Date ranges; same year},
+    Urldate = {2012-10-31/2012-11-01}}
+
+@article{date-ranges-open,
+    Author = {Author, Al},
+    Date = {1999-10-14/},
+    Eventdate = {1999-10/},
+    Journal = {Journal},
+    Origdate = {1888-01-02/},
+    Title = {Date ranges, open-ended},
+    Urldate = {2012-10-31/}}
+
+@article{dates-very-old,
+    Author = {Author, Al},
+    Date = {0712-12-13},
+    Eventdate = {0311-10-03},
+    Journal = {Journal},
+    Month = may,
+    Origdate = {0088-10-01},
+    Title = {Dates, year less than 1000},
+    Urldate = {0999-12-14}}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Author
+    given: Al
+  container-title: Journal
+  id: year-month-old
+  issued: 1999-08
+  title: Year and month, bibtex style, supported by biblatex for
+    backwards compatibility
+  type: article-journal
+- author:
+  - family: Author
+    given: Al
+  container-title: Journal
+  id: year-month-new
+  issued: 1999-08
+  title: Year and month, biblatex style; note that biblatex does not
+    have a "day" field
+  type: article-journal
+- accessed: 1999-05-23
+  author:
+  - family: Author
+    given: Al
+  container-title: Journal
+  event-date: 2011-10-03
+  id: dates
+  issued: 2012-12-13
+  original-date: 1888-10-01
+  title: Dates, default biblatex style; year, month to be ignored if
+    date exists
+  type: article-journal
+- accessed: 2012-10-12/2013-01-31
+  author:
+  - family: Author
+    given: Al
+  container-title: Journal
+  event-date: 1999-12/2000-01
+  id: date-ranges-different-years
+  issued: 1999-10-14/2010-01-23
+  original-date: 1888-01-02/1913-12-13
+  title: Date ranges; different years
+  type: article-journal
+- accessed: 2012-10-31/2012-11-01
+  author:
+  - family: Author
+    given: Al
+  container-title: Journal
+  event-date: 1999-10/1999-11
+  id: date-ranges-same-year
+  issued: 1999-10-14/1999-10-15
+  original-date: 1888-01-02/1888-12-13
+  title: Date ranges; same year
+  type: article-journal
+- accessed: 2012-10-31/
+  author:
+  - family: Author
+    given: Al
+  container-title: Journal
+  event-date: 1999-10/
+  id: date-ranges-open
+  issued: 1999-10-14/
+  original-date: 1888-01-02/
+  title: Date ranges, open-ended
+  type: article-journal
+- accessed: 0999-12-14
+  author:
+  - family: Author
+    given: Al
+  container-title: Journal
+  event-date: 0311-10-03
+  id: dates-very-old
+  issued: 0712-12-13
+  original-date: 0088-10-01
+  title: Dates, year less than 1000
+  type: article-journal
+---
+
+
+```
diff --git a/test/command/biblatex-doody.md b/test/command/biblatex-doody.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-doody.md
@@ -0,0 +1,101 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Doody 1974) (Matuz 1990)
+
+Doody, Terrence. 1974. “Hemingway’s Style and Jake’s Narration.” *The
+Journal of Narrative Technique* 4 (3): 212–225.
+
+Matuz, Roger, ed. 1990. *Contemporary Literary Criticism*. Vol. 61.
+Detroit: Gale.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Doody, 1974) (Matuz, 1990)
+
+Doody, T. (1974). Hemingway’s style and Jake’s narration. *The Journal
+of Narrative Technique*, *4*(3), 212–225.
+
+Matuz, R. (Ed.). (1990). *Contemporary literary criticism* (Vol. 61, pp.
+204–208). Detroit: Gale.
+
+
+NOTES
+
+- biblio2yaml
+	- contains fields “related” and “relatedstring”. In principle, these could be appended to CSL "note", if citeproc can handle citations in the bibliography ...
+
+}
+
+@Article{doody,
+  author       = {Doody, Terrence},
+  title        = {Hemingway's Style and {Jake}'s Narration},
+  year         = 1974,
+  volume       = 4,
+  number       = 3,
+  pages        = {212-225},
+  hyphenation  = {american},
+  related      = {matuz:doody},
+  relatedstring= {\autocap{e}xcerpt in},
+  journal      = {The Journal of Narrative Technique},
+  annotation   = {An article entry cited as an excerpt from a
+                  collection entry. Note the format of the
+                  related and relatedstring fields},
+}
+
+@Collection{matuz:doody,
+  editor       = {Matuz, Roger},
+  title        = {Contemporary Literary Criticism},
+  year         = 1990,
+  volume       = 61,
+  publisher    = {Gale},
+  location     = {Detroit},
+  pages        = {204-208},
+  hyphenation  = {american},
+  annotation   = {A collection entry providing the excerpt information
+                  for the doody entry. Note the format of the
+                  pages field},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: An article entry cited as an excerpt from a collection entry.
+    Note the format of the related and relatedstring fields
+  author:
+  - family: Doody
+    given: Terrence
+  container-title: The Journal of Narrative Technique
+  id: doody
+  issue: 3
+  issued: 1974
+  language: en-US
+  page: 212-225
+  title: Hemingway's style and Jake's narration
+  type: article-journal
+  volume: 4
+- annote: A collection entry providing the excerpt information for the
+    doody entry. Note the format of the pages field
+  editor:
+  - family: Matuz
+    given: Roger
+  id: "matuz:doody"
+  issued: 1990
+  language: en-US
+  page: 204-208
+  publisher: Gale
+  publisher-place: Detroit
+  title: Contemporary literary criticism
+  type: book
+  volume: 61
+---
+
+
+```
diff --git a/test/command/biblatex-edtf-date.md b/test/command/biblatex-edtf-date.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-edtf-date.md
@@ -0,0 +1,72 @@
+```
+% pandoc -f biblatex -t markdown -s
+Note that current CSL doesn't give us a way
+to distinguish between /open and /unknown,
+so item3-3 and item3-4 get parsed similarly.
+That should change in CSL 1.1, and then this
+test should be revised.
+
+@article{item3-3, date={1998/unknown}}
+@article{item3-4, date={1999/open}}
+@article{item3-10, date={2004-04-05T14:34:00}}
+@article{item5-1, date={0000}}
+@article{item5-2, date={-0876}}
+@article{item5-3, date={-0877/-0866}}
+@article{item5-5, date={-0343-02}}
+@article{item5-8, date={1723~}}
+@article{item5-9, date={1723?}}
+@article{item5-10, date={1723?~}}
+@article{item5-11, date={2004-22}}
+@article{item5-12, date={2004-24}}
+@article{item5-13, date={20uu}}
+@article{item5-14, date={y-123456789}}
+
+^D
+---
+nocite: "[@*]"
+references:
+- id: item3-3
+  issued: 1998/
+  type: article-journal
+- id: item3-4
+  issued: 1999/
+  type: article-journal
+- id: item3-10
+  issued: 2004-04-05
+  type: article-journal
+- id: item5-1
+  type: article-journal
+- id: item5-2
+  issued: "-0876"
+  type: article-journal
+- id: item5-3
+  issued: "-0877/-0866"
+  type: article-journal
+- id: item5-5
+  issued: "-0343-02"
+  type: article-journal
+- id: item5-8
+  issued: 1723\~
+  type: article-journal
+- id: item5-9
+  issued: 1723
+  type: article-journal
+- id: item5-10
+  issued: 1723\~
+  type: article-journal
+- id: item5-11
+  issued: 2004-22
+  type: article-journal
+- id: item5-12
+  issued: 2004-24
+  type: article-journal
+- id: item5-13
+  issued: 2000/2099
+  type: article-journal
+- id: item5-14
+  issued: y-123456789
+  type: article-journal
+---
+
+
+```
diff --git a/test/command/biblatex-escapedquotes.md b/test/command/biblatex-escapedquotes.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-escapedquotes.md
@@ -0,0 +1,51 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{From jgm/pandoc#1568.  Double quotes escaped using {"}.}
+
+@ARTICLE{Koff2009-gn,
+  title       = "Pan-Canadian evaluation of irreversible compression ratios
+                 ({"}lossy{"} compression) for development of national
+                 guidelines",
+  author      = "Koff, David and Bak, Peter and Brownrigg, Paul and
+                 Hosseinzadeh, Danoush and Khademi, April and Kiss, Alex and
+                 Lepanto, Luigi and Michalak, Tracy and Shulman, Harry and
+                 Volkening, Andrew",
+  affiliation = "Sunnybrook Health Sciences Centre, 2075 Bayview Ave., Toronto,
+                 ON, M4N 3M5, Canada. dkoffmcmaster.ca",
+  journal     = "Journal of digital imaging",
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Koff
+    given: David
+  - family: Bak
+    given: Peter
+  - family: Brownrigg
+    given: Paul
+  - family: Hosseinzadeh
+    given: Danoush
+  - family: Khademi
+    given: April
+  - family: Kiss
+    given: Alex
+  - family: Lepanto
+    given: Luigi
+  - family: Michalak
+    given: Tracy
+  - family: Shulman
+    given: Harry
+  - family: Volkening
+    given: Andrew
+  container-title: Journal of digital imaging
+  id: Koff2009-gn
+  title: Pan-canadian evaluation of irreversible compression ratios
+    (\"lossy\" compression) for development of national guidelines
+  type: article-journal
+---
+
+
+```
diff --git a/test/command/biblatex-examples.bib b/test/command/biblatex-examples.bib
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-examples.bib
@@ -0,0 +1,1674 @@
+@string{anch-ie = {Angew.~Chem. Int.~Ed.}}
+@string{cup     = {Cambridge University Press}}
+@string{dtv     = {Deutscher Taschenbuch-Verlag}}
+@string{hup     = {Harvard University Press}}
+@string{jams    = {J.~Amer. Math. Soc.}}
+@string{jchph   = {J.~Chem. Phys.}}
+@string{jomch   = {J.~Organomet. Chem.}}
+@string{pup     = {Princeton University Press}}
+
+@incollection{westfahl:space,
+  author       = {Westfahl, Gary},
+  title        = {The True Frontier},
+  subtitle     = {Confronting and Avoiding the Realities of Space in {American}
+                  Science Fiction Films},
+  pages        = {55-65},
+  crossref     = {westfahl:frontier},
+  langid       = {english},
+  langidopts   = {variant=american},
+  indextitle   = {True Frontier, The},
+  annotation   = {A cross-referenced article from a \texttt{collection}. This is
+                  an \texttt{incollection} entry with a \texttt{crossref}
+                  field. Note the \texttt{subtitle} and \texttt{indextitle}
+                  fields},
+}
+
+@set{set,
+  entryset     = {herrmann,aksin,yoon},
+  annotation   = {A \texttt{set} with three members. The \texttt{crossref} field
+                  in the \texttt{@set} entry and the \texttt{entryset} field in
+                  each set member entry is needed only when using BibTeX as the
+                  backend},
+}
+
+@set{stdmodel,
+  entryset     = {glashow,weinberg,salam},
+  annotation   = {A \texttt{set} with three members discussing the standard
+                  model of particle physics. The \texttt{crossref} field
+                  in the \texttt{@set} entry and the \texttt{entryset} field in
+                  each set member entry is needed only when using BibTeX as the
+                  backend},
+}
+
+@article{aksin,
+  author       = {Aks{\i}n, {\"O}zge and T{\"u}rkmen, Hayati and Artok, Levent
+                  and {\c{C}}etinkaya, Bekir and Ni, Chaoying and
+                  B{\"u}y{\"u}kg{\"u}ng{\"o}r, Orhan and {\"O}zkal, Erhan},
+  title        = {Effect of immobilization on catalytic characteristics of
+                  saturated {Pd-N}-heterocyclic carbenes in {Mizoroki-Heck}
+                  reactions},
+  journaltitle = jomch,
+  date         = 2006,
+  volume       = 691,
+  number       = 13,
+  pages        = {3027-3036},
+  indextitle   = {Effect of immobilization on catalytic characteristics},
+}
+
+@article{angenendt,
+  author       = {Angenendt, Arnold},
+  title        = {In Honore Salvatoris~-- Vom Sinn und Unsinn der
+                  Patrozinienkunde},
+  journaltitle = {Revue d'Histoire Eccl{\'e}siastique},
+  date         = 2002,
+  volume       = 97,
+  pages        = {431--456, 791--823},
+  langid       = {german},
+  indextitle   = {In Honore Salvatoris},
+  shorttitle   = {In Honore Salvatoris},
+  annotation   = {A German article in a French journal. Apart from that, a
+                  typical \texttt{article} entry. Note the \texttt{indextitle}
+                  field},
+}
+
+@article{baez/article,
+  author       = {Baez, John C. and Lauda, Aaron D.},
+  title        = {Higher-Dimensional Algebra {V}: 2-Groups},
+  journaltitle = {Theory and Applications of Categories},
+  date         = 2004,
+  volume       = 12,
+  pages        = {423-491},
+  version      = 3,
+  eprint       = {math/0307200v3},
+  eprinttype   = {arxiv},
+  langid       = {english},
+  langidopts   = {variant=american},
+  annotation   = {An \texttt{article} with \texttt{eprint} and
+                  \texttt{eprinttype} fields. Note that the arXiv reference is
+                  transformed into a clickable link if \texttt{hyperref} support
+                  has been enabled.  Compare \texttt{baez\slash online}, which
+                  is the same item given as an \texttt{online} entry},
+}
+
+@article{bertram,
+  author       = {Bertram, Aaron and Wentworth, Richard},
+  title        = {Gromov invariants for holomorphic maps on {Riemann} surfaces},
+  journaltitle = jams,
+  date         = 1996,
+  volume       = 9,
+  number       = 2,
+  pages        = {529-571},
+  langid       = {english},
+  langidopts   = {variant=american},
+  shorttitle   = {Gromov invariants},
+  annotation   = {An \texttt{article} entry with a \texttt{volume} and a
+                  \texttt{number} field},
+}
+
+@article{doody,
+  author       = {Doody, Terrence},
+  title        = {Hemingway's Style and {Jake's} Narration},
+  year         = 1974,
+  volume       = 4,
+  number       = 3,
+  pages        = {212-225},
+  langid       = {english},
+  langidopts   = {variant=american},
+  related      = {matuz:doody},
+  relatedstring= {\autocap{e}xcerpt in},
+  journal      = {The Journal of Narrative Technique},
+  annotation   = {An \texttt{article} entry cited as an excerpt from a
+                  \texttt{collection} entry. Note the format of the
+                  \texttt{related} and \texttt{relatedstring} fields},
+}
+
+@collection{matuz:doody,
+  editor       = {Matuz, Roger},
+  title        = {Contemporary Literary Criticism},
+  year         = 1990,
+  volume       = 61,
+  publisher    = {Gale},
+  location     = {Detroit},
+  pages        = {204-208},
+  langid       = {english},
+  langidopts   = {variant=american},
+  annotation   = {A \texttt{collection} entry providing the excerpt information
+                  for the \texttt{doody} entry. Note the format of the
+                  \texttt{pages} field},
+}
+
+@article{gillies,
+  author       = {Gillies, Alexander},
+  title        = {Herder and the Preparation of {Goethe's} Idea of World
+                  Literature},
+  journaltitle = {Publications of the English Goethe Society},
+  date         = 1933,
+  series       = {newseries},
+  volume       = 9,
+  pages        = {46-67},
+  langid       = {english},
+  langidopts   = {variant=british},
+  annotation   = {An \texttt{article} entry with a \texttt{series} and a
+                  \texttt{volume} field. Note that format of the \texttt{series}
+                  field in the database file},
+}
+
+@article{glashow,
+  author       = {Glashow, Sheldon},
+  title        = {Partial Symmetries of Weak Interactions},
+  journaltitle = {Nucl.~Phys.},
+  date         = 1961,
+  volume       = 22,
+  pages        = {579-588},
+}
+
+@article{herrmann,
+  author       = {Herrmann, Wolfgang A. and {\"O}fele, Karl and Schneider,
+                  Sabine K.  and Herdtweck, Eberhardt and Hoffmann, Stephan D.},
+  title        = {A carbocyclic carbene as an efficient catalyst ligand for {C--C}
+                  coupling reactions},
+  journaltitle = anch-ie,
+  date         = 2006,
+  volume       = 45,
+  number       = 23,
+  pages        = {3859-3862},
+  indextitle   = {Carbocyclic carbene as an efficient catalyst, A},
+}
+
+@article{kastenholz,
+  author       = {Kastenholz, M. A. and H{\"u}nenberger, Philippe H.},
+  title        = {Computation of methodology\hyphen independent ionic solvation
+                  free energies from molecular simulations},
+  journaltitle = jchph,
+  date         = 2006,
+  subtitle     = {{I}. {The} electrostatic potential in molecular liquids},
+  volume       = 124,
+  eid          = 124106,
+  doi          = {10.1063/1.2172593},
+  langid       = {english},
+  langidopts   = {variant=american},
+  indextitle   = {Computation of ionic solvation free energies},
+  annotation   = {An \texttt{article} entry with an \texttt{eid} and a
+                  \texttt{doi} field. Note that the \textsc{doi} is transformed
+                  into a clickable link if \texttt{hyperref} support has been
+                  enabled},
+  abstract     = {The computation of ionic solvation free energies from
+                  atomistic simulations is a surprisingly difficult problem that
+                  has found no satisfactory solution for more than 15 years. The
+                  reason is that the charging free energies evaluated from such
+                  simulations are affected by very large errors. One of these is
+                  related to the choice of a specific convention for summing up
+                  the contributions of solvent charges to the electrostatic
+                  potential in the ionic cavity, namely, on the basis of point
+                  charges within entire solvent molecules (M scheme) or on the
+                  basis of individual point charges (P scheme). The use of an
+                  inappropriate convention may lead to a charge-independent
+                  offset in the calculated potential, which depends on the
+                  details of the summation scheme, on the quadrupole-moment
+                  trace of the solvent molecule, and on the approximate form
+                  used to represent electrostatic interactions in the
+                  system. However, whether the M or P scheme (if any) represents
+                  the appropriate convention is still a matter of on-going
+                  debate. The goal of the present article is to settle this
+                  long-standing controversy by carefully analyzing (both
+                  analytically and numerically) the properties of the
+                  electrostatic potential in molecular liquids (and inside
+                  cavities within them).},
+}
+
+@article{murray,
+  author       = {Hostetler, Michael J. and Wingate, Julia E. and Zhong,
+                  Chuan-Jian and Harris, Jay E. and Vachet, Richard W. and
+                  Clark, Michael R.  and Londono, J. David and Green, Stephen
+                  J. and Stokes, Jennifer J.  and Wignall, George D. and Glish,
+                  Gary L. and Porter, Marc D.  and Evans, Neal D. and Murray,
+                  Royce W.},
+  title        = {Alkanethiolate gold cluster molecules with core diameters from
+                  1.5 to 5.2~{nm}},
+  journaltitle = {Langmuir},
+  date         = 1998,
+  subtitle     = {Core and monolayer properties as a function of core size},
+  volume       = 14,
+  number       = 1,
+  pages        = {17-30},
+  langid       = {english},
+  langidopts   = {variant=american},
+  indextitle   = {Alkanethiolate gold cluster molecules},
+  shorttitle   = {Alkanethiolate gold cluster molecules},
+  annotation   = {An \texttt{article} entry with \arabic{author} authors. By
+                  default, long author and editor lists are automatically
+                  truncated. This is configurable},
+}
+
+@article{reese,
+  author       = {Reese, Trevor R.},
+  title        = {Georgia in {Anglo-Spanish} Diplomacy, 1736--1739},
+  journaltitle = {William and Mary Quarterly},
+  date         = 1958,
+  series       = 3,
+  volume       = 15,
+  pages        = {168-190},
+  langid       = {english},
+  langidopts   = {variant=american},
+  annotation   = {An \texttt{article} entry with a \texttt{series} and a
+                  \texttt{volume} field. Note the format of the series. If the
+                  value of the \texttt{series} field is an integer, this number
+                  is printed as an ordinal and the string \enquote*{series} is
+                  appended automatically},
+}
+
+@article{sarfraz,
+  author       = {M. Sarfraz and M. F. A. Razzak},
+  title        = {Technical section: {An} algorithm for automatic capturing of
+                  the font outlines},
+  year         = 2002,
+  volume       = 26,
+  number       = 5,
+  pages        = {795-804},
+  issn         = {0097-8493},
+  journal      = {Computers and Graphics},
+  annotation   = {An \texttt{article} entry with an \texttt{issn} field},
+}
+
+@article{shore,
+  author       = {Shore, Bradd},
+  title        = {Twice-Born, Once Conceived},
+  journaltitle = {American Anthropologist},
+  date         = {1991-03},
+  subtitle     = {Meaning Construction and Cultural Cognition},
+  series       = {newseries},
+  volume       = 93,
+  number       = 1,
+  pages        = {9-27},
+  annotation   = {An \texttt{article} entry with \texttt{series},
+                  \texttt{volume}, and \texttt{number} fields. Note the format
+                  of the \texttt{series} which is a localization key},
+}
+
+@article{sigfridsson,
+  author       = {Sigfridsson, Emma and Ryde, Ulf},
+  title        = {Comparison of methods for deriving atomic charges from the
+                  electrostatic potential and moments},
+  journaltitle = {Journal of Computational Chemistry},
+  date         = 1998,
+  volume       = 19,
+  number       = 4,
+  pages        = {377-395},
+  doi          = {10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P},
+  langid       = {english},
+  langidopts   = {variant=american},
+  indextitle   = {Methods for deriving atomic charges},
+  annotation   = {An \texttt{article} entry with \texttt{volume},
+                  \texttt{number}, and \texttt{doi} fields. Note that the
+                  \textsc{doi} is transformed into a clickable link if
+                  \texttt{hyperref} support has been enabled},
+  abstract     = {Four methods for deriving partial atomic charges from the
+                  quantum chemical electrostatic potential (CHELP, CHELPG,
+                  Merz-Kollman, and RESP) have been compared and critically
+                  evaluated. It is shown that charges strongly depend on how and
+                  where the potential points are selected. Two alternative
+                  methods are suggested to avoid the arbitrariness in the
+                  point-selection schemes and van der Waals exclusion radii:
+                  CHELP-BOW, which also estimates the charges from the
+                  electrostatic potential, but with potential points that are
+                  Boltzmann-weighted after their occurrence in actual
+                  simulations using the energy function of the program in which
+                  the charges will be used, and CHELMO, which estimates the
+                  charges directly from the electrostatic multipole
+                  moments. Different criteria for the quality of the charges are
+                  discussed.},
+}
+
+@article{spiegelberg,
+  author       = {Spiegelberg, Herbert},
+  title        = {\mkbibquote{Intention} und \mkbibquote{Intentionalit{\"a}t} in
+                  der Scholastik, bei Brentano und Husserl},
+  journaltitle = {Studia Philosophica},
+  date         = 1969,
+  volume       = 29,
+  pages        = {189-216},
+  langid       = {german},
+  sorttitle    = {Intention und Intentionalitat in der Scholastik, bei Brentano
+                  und Husserl},
+  indexsorttitle= {Intention und Intentionalitat in der Scholastik, bei Brentano
+                  und Husserl},
+  shorttitle   = {Intention und Intentionalit{\"a}t},
+  annotation   = {An \texttt{article} entry. Note the \texttt{sorttitle} and
+                  \texttt{indexsorttitle} fields and the markup of the quotes in
+                  the database file},
+}
+
+@article{springer,
+  author       = {Springer, Otto},
+  title        = {Mediaeval Pilgrim Routes from {Scandinavia} to {Rome}},
+  journaltitle = {Mediaeval Studies},
+  date         = 1950,
+  volume       = 12,
+  pages        = {92-122},
+  langid       = {english},
+  langidopts   = {variant=british},
+  shorttitle   = {Mediaeval Pilgrim Routes},
+  annotation   = {A plain \texttt{article} entry},
+}
+
+@article{weinberg,
+  author       = {Weinberg, Steven},
+  title        = {A Model of Leptons},
+  journaltitle = {Phys.~Rev.~Lett.},
+  date         = 1967,
+  volume       = 19,
+  pages        = {1264-1266},
+}
+
+@article{yoon,
+  author       = {Yoon, Myeong S. and Ryu, Dowook and Kim, Jeongryul and Ahn,
+                  Kyo Han},
+  title        = {Palladium pincer complexes with reduced bond angle strain:
+                  efficient catalysts for the {Heck} reaction},
+  journaltitle = {Organometallics},
+  date         = 2006,
+  volume       = 25,
+  number       = 10,
+  pages        = {2409-2411},
+  indextitle   = {Palladium pincer complexes},
+}
+
+@book{aristotle:anima,
+  author       = {Aristotle},
+  title        = {De Anima},
+  date         = 1907,
+  editor       = {Hicks, Robert Drew},
+  publisher    = cup,
+  location     = {Cambridge},
+  keywords     = {primary},
+  langid       = {english},
+  langidopts   = {variant=british},
+  annotation   = {A \texttt{book} entry with an \texttt{author} and an
+                  \texttt{editor}},
+}
+
+@book{aristotle:physics,
+  author       = {Aristotle},
+  title        = {Physics},
+  date         = 1929,
+  translator   = {Wicksteed, P. H. and Cornford, F. M.},
+  publisher    = {G. P. Putnam},
+  location     = {New York},
+  keywords     = {primary},
+  langid       = {english},
+  langidopts   = {variant=american},
+  shorttitle   = {Physics},
+  annotation   = {A \texttt{book} entry with a \texttt{translator} field},
+}
+
+@book{aristotle:poetics,
+  author       = {Aristotle},
+  title        = {Poetics},
+  date         = 1968,
+  editor       = {Lucas, D. W.},
+  series       = {Clarendon {Aristotle}},
+  publisher    = {Clarendon Press},
+  location     = {Oxford},
+  keywords     = {primary},
+  langid       = {english},
+  langidopts   = {variant=british},
+  shorttitle   = {Poetics},
+  annotation   = {A \texttt{book} entry with an \texttt{author} and an
+                  \texttt{editor} as well as a \texttt{series} field},
+}
+
+@book{aristotle:rhetoric,
+  author       = {Aristotle},
+  title        = {The Rhetoric of {Aristotle} with a commentary by the late {Edward
+                  Meredith Cope}},
+  date         = 1877,
+  editor       = {Cope, Edward Meredith},
+  commentator  = {Cope, Edward Meredith},
+  volumes      = 3,
+  publisher    = cup,
+  keywords     = {primary},
+  langid       = {english},
+  langidopts   = {variant=british},
+  sorttitle    = {Rhetoric of Aristotle},
+  indextitle   = {Rhetoric of {Aristotle}, The},
+  shorttitle   = {Rhetoric},
+  annotation   = {A commented edition. Note the concatenation of the
+                  \texttt{editor} and \texttt{commentator} fields as well as the
+                  \texttt{volumes}, \texttt{sorttitle}, and \texttt{indextitle}
+                  fields},
+}
+
+@book{augustine,
+  author       = {Augustine, Robert L.},
+  title        = {Heterogeneous catalysis for the synthetic chemist},
+  date         = 1995,
+  publisher    = {Marcel Dekker},
+  location     = {New York},
+  langid       = {english},
+  langidopts   = {variant=american},
+  shorttitle   = {Heterogeneous catalysis},
+  annotation   = {A plain \texttt{book} entry},
+}
+
+@book{averroes/bland,
+  author       = {Averroes},
+  title        = {The Epistle on the Possibility of Conjunction with the Active
+                  Intellect by {Ibn Rushd} with the Commentary of {Moses Narboni}},
+  date         = 1982,
+  editor       = {Bland, Kalman P.},
+  translator   = {Bland, Kalman P.},
+  series       = {Moreshet: Studies in {Jewish} History, Literature and Thought},
+  number       = 7,
+  publisher    = {Jewish Theological Seminary of America},
+  location     = {New York},
+  keywords     = {primary},
+  langid       = {english},
+  langidopts   = {variant=american},
+  indextitle   = {Epistle on the Possibility of Conjunction, The},
+  shorttitle   = {Possibility of Conjunction},
+  annotation   = {A \texttt{book} entry with a \texttt{series} and a
+                  \texttt{number}. Note the concatenation of the \texttt{editor}
+                  and \texttt{translator} fields as well as the
+                  \texttt{indextitle} field},
+}
+
+@book{averroes/hannes,
+  author       = {Averroes},
+  title        = {Des Averro{\"e}s Abhandlung: \mkbibquote{{\"U}ber die
+                  M{\"o}glichkeit der Conjunktion} oder \mkbibquote{{\"U}ber den
+                  materiellen Intellekt}},
+  date         = 1892,
+  editor       = {Hannes, Ludwig},
+  translator   = {Hannes, Ludwig},
+  annotator    = {Hannes, Ludwig},
+  publisher    = {C.~A. Kaemmerer},
+  location     = {Halle an der Saale},
+  keywords     = {primary},
+  langid       = {german},
+  sorttitle    = {Uber die Moglichkeit der Conjunktion},
+  indexsorttitle= {Uber die Moglichkeit der Conjunktion},
+  indextitle   = {{\"U}ber die M{\"o}glichkeit der Conjunktion},
+  shorttitle   = {{\"U}ber die M{\"o}glichkeit der Conjunktion},
+  annotation   = {An annotated edition. Note the concatenation of the
+                  \texttt{editor}, \texttt{translator}, and \texttt{annotator}
+                  fields. Also note the \texttt{shorttitle},
+                  \texttt{indextitle}, \texttt{sorttitle}, and
+                  \texttt{indexsorttitle} fields},
+}
+
+@book{averroes/hercz,
+  author       = {Averroes},
+  title        = {Drei Abhandlungen {\"u}ber die Conjunction des separaten
+                  Intellects mit dem Menschen},
+  date         = 1869,
+  editor       = {Hercz, J.},
+  translator   = {Hercz, J.},
+  publisher    = {S.~Hermann},
+  location     = {Berlin},
+  keywords     = {primary},
+  langid       = {german},
+  indexsorttitle= {Drei Abhandlungen uber die Conjunction},
+  indextitle   = {Drei Abhandlungen {\"u}ber die Conjunction},
+  subtitle     = {Von Averroes (Vater und Sohn), aus dem Arabischen
+                  {\"u}bersetzt von Samuel Ibn Tibbon},
+  shorttitle   = {Drei Abhandlungen},
+  annotation   = {A \texttt{book} entry. Note the concatenation of the
+                  \texttt{editor} and \texttt{translator} fields as well as the
+                  \texttt{indextitle} and \texttt{indexsorttitle} fields},
+}
+
+@book{cicero,
+  author       = {Cicero, Marcus Tullius},
+  title        = {De natura deorum. {\"U}ber das Wesen der G{\"o}tter},
+  date         = 1995,
+  editor       = {Blank-Sangmeister, Ursula},
+  translator   = {Blank-Sangmeister, Ursula},
+  afterword    = {Thraede, Klaus},
+  language     = {langlatin and langgerman},
+  publisher    = {Reclam},
+  location     = {Stuttgart},
+  langid       = {german},
+  indextitle   = {De natura deorum},
+  shorttitle   = {De natura deorum},
+  annotation   = {A bilingual edition of Cicero's \emph{De natura deorum}, with
+                  a German translation. Note the format of the \texttt{language}
+                  field in the database file, the concatenation of the
+                  \texttt{editor} and \texttt{translator} fields, and the
+                  \texttt{afterword} field},
+}
+
+@book{coleridge,
+  author       = {Coleridge, Samuel Taylor},
+  title        = {Biographia literaria, or {Biographical} sketches of my literary
+                  life and opinions},
+  date         = 1983,
+  editor       = {Coburn, Kathleen and Engell, James and Bate, W. Jackson},
+  maintitle    = {The collected works of {Samuel Taylor Coleridge}},
+  volume       = 7,
+  part         = 2,
+  series       = {Bollingen Series},
+  number       = 75,
+  publisher    = {Routledge {and} Kegan Paul},
+  location     = {London},
+  langid       = {english},
+  langidopts   = {variant=british},
+  indextitle   = {Biographia literaria},
+  shorttitle   = {Biographia literaria},
+  annotation   = {One (partial) volume of a multivolume book. This is a
+                  \texttt{book} entry with a \texttt{volume} and a \texttt{part}
+                  field which explicitly refers to the second (physical) part of
+                  the seventh (logical) volume. Also note the \texttt{series}
+                  and \texttt{number} fields},
+}
+
+@book{companion,
+  author       = {Goossens, Michel and Mittelbach, Frank and Samarin, Alexander},
+  title        = {The {LaTeX} Companion},
+  date         = 1994,
+  edition      = 1,
+  publisher    = {Addison-Wesley},
+  location     = {Reading, Mass.},
+  pagetotal    = 528,
+  langid       = {english},
+  langidopts   = {variant=american},
+  sorttitle    = {LaTeX Companion},
+  indextitle   = {LaTeX Companion, The},
+  shorttitle   = {LaTeX Companion},
+  annotation   = {A book with three authors. Note the formatting of the author
+                  list. By default, only the first name is reversed in the
+                  bibliography},
+}
+
+@book{cotton,
+  author       = {Cotton, Frank Albert and Wilkinson, Geoffrey and Murillio,
+                  Carlos A. and Bochmann, Manfred},
+  title        = {Advanced inorganic chemistry},
+  date         = 1999,
+  edition      = 6,
+  publisher    = {Wiley},
+  location     = {Chichester},
+  langid       = {english},
+  langidopts   = {variant=british},
+  annotation   = {A \texttt{book} entry with \arabic{author} authors and an
+                  \texttt{edition} field. By default, long \texttt{author} and
+                  \texttt{editor} lists are automatically truncated. This is
+                  configurable},
+}
+
+@book{gerhardt,
+  author       = {Gerhardt, Michael J.},
+  title        = {The Federal Appointments Process},
+  date         = 2000,
+  publisher    = {Duke University Press},
+  location     = {Durham and London},
+  langid       = {english},
+  langidopts   = {variant=american},
+  sorttitle    = {Federal Appointments Process},
+  indextitle   = {Federal Appointments Process, The},
+  subtitle     = {A Constitutional and Historical Analysis},
+  shorttitle   = {Federal Appointments Process},
+  annotation   = {This is a \texttt{book} entry. Note the format of the
+                  \texttt{location} field as well as the \texttt{sorttitle} and
+                  \texttt{indextitle} fields},
+}
+
+@book{gonzalez,
+  author       = {Gonzalez, Ray},
+  title        = {The Ghost of {John Wayne} and Other Stories},
+  date         = 2001,
+  publisher    = {The University of Arizona Press},
+  location     = {Tucson},
+  isbn         = {0-816-52066-6},
+  langid       = {english},
+  langidopts   = {variant=american},
+  sorttitle    = {Ghost of John Wayne and Other Stories},
+  indextitle   = {Ghost of {John Wayne} and Other Stories, The},
+  shorttitle   = {Ghost of {John Wayne}},
+  annotation   = {A collection of short stories. This is a \texttt{book} entry.
+                  Note the \texttt{sorttitle} and \texttt{indextitle} fields in
+                  the database file. There's also an \texttt{isbn} field},
+}
+
+@book{hammond,
+  author       = {Hammond, Christopher},
+  title        = {The basics of crystallography and diffraction},
+  date         = 1997,
+  publisher    = {International Union of Crystallography and Oxford University
+                  Press},
+  location     = {Oxford},
+  langid       = {english},
+  langidopts   = {variant=british},
+  sorttitle    = {Basics of crystallography and diffraction},
+  indextitle   = {Basics of crystallography and diffraction, The},
+  shorttitle   = {Crystallography and diffraction},
+  annotation   = {A \texttt{book} entry. Note the \texttt{sorttitle} and
+                  \texttt{indextitle} fields as well as the format of the
+                  \texttt{publisher} field},
+}
+
+@book{iliad,
+  author       = {Homer},
+  title        = {Die Ilias},
+  date         = 2004,
+  translator   = {Schadewaldt, Wolfgang},
+  introduction = {Latacz, Joachim},
+  edition      = 3,
+  publisher    = {Artemis \& Winkler},
+  location     = {D{\"u}sseldorf and Z{\"u}rich},
+  langid       = {german},
+  sorttitle    = {Ilias},
+  indextitle   = {Ilias, Die},
+  shorttitle   = {Ilias},
+  annotation   = {A German translation of the \emph{Iliad}. Note the
+                  \texttt{translator} and \texttt{introduction} fields and the
+                  format of the \texttt{location} field in the database
+                  file. Also note the \texttt{sorttitle} and \texttt{indextitle}
+                  fields},
+}
+
+@book{knuth:ct,
+  author       = {Knuth, Donald E.},
+  title        = {Computers \& Typesetting},
+  date         = {1984/1986},
+  volumes      = 5,
+  publisher    = {Addison-Wesley},
+  location     = {Reading, Mass.},
+  langid       = {english},
+  langidopts   = {variant=american},
+  sortyear     = {1984-0},
+  sorttitle    = {Computers & Typesetting},
+  indexsorttitle= {Computers & Typesetting},
+  annotation   = {A five-volume book cited as a whole. This is a \texttt{book}
+                  entry, note the \texttt{volumes} field},
+}
+
+@book{knuth:ct:a,
+  author       = {Knuth, Donald E.},
+  title        = {The {\TeX} book},
+  date         = 1984,
+  maintitle    = {Computers \& Typesetting},
+  volume       = {A},
+  publisher    = {Addison-Wesley},
+  location     = {Reading, Mass.},
+  langid       = {english},
+  langidopts   = {variant=american},
+  sortyear     = {1984-1},
+  sorttitle    = {Computers & Typesetting A},
+  indexsorttitle= {The TeXbook},
+  indextitle   = {\protect\TeX book, The},
+  shorttitle   = {\TeX book},
+  annotation   = {The first volume of a five-volume book. Note the
+                  \texttt{sorttitle} and \texttt{sortyear} fields. We want this
+                  volume to be listed after the entry referring to the entire
+                  five-volume set. Also note the \texttt{indextitle} and
+                  \texttt{indexsorttitle} fields. Indexing packages that don't
+                  generate robust index entries require some control sequences
+                  to be protected from expansion},
+}
+
+@book{knuth:ct:b,
+  author       = {Knuth, Donald E.},
+  title        = {\TeX: The Program},
+  date         = 1986,
+  maintitle    = {Computers \& Typesetting},
+  volume       = {B},
+  publisher    = {Addison-Wesley},
+  location     = {Reading, Mass.},
+  langid       = {english},
+  langidopts   = {variant=american},
+  sortyear     = {1986-1},
+  sorttitle    = {Computers & Typesetting B},
+  indexsorttitle= {TeX: The Program},
+  shorttitle   = {\TeX},
+  annotation   = {The second volume of a five-volume book. Note the
+                  \texttt{sorttitle} and \texttt{sortyear} fields. Also note the
+                  \texttt{indexsorttitle} field},
+}
+
+@book{knuth:ct:c,
+  author       = {Knuth, Donald E.},
+  title        = {The {METAFONTbook}},
+  date         = 1986,
+  maintitle    = {Computers \& Typesetting},
+  volume       = {C},
+  publisher    = {Addison-Wesley},
+  location     = {Reading, Mass.},
+  langid       = {english},
+  langidopts   = {variant=american},
+  sortyear     = {1986-2},
+  sorttitle    = {Computers & Typesetting C},
+  indextitle   = {METAFONTbook, The},
+  shorttitle   = {METAFONTbook},
+  annotation   = {The third volume of a five-volume book. Note the
+                  \texttt{sorttitle} and \texttt{sortyear} fields as well as the
+                  \texttt{indextitle} field},
+}
+
+@book{knuth:ct:d,
+  author       = {Knuth, Donald E.},
+  title        = {METAFONT: The Program},
+  date         = 1986,
+  maintitle    = {Computers \& Typesetting},
+  volume       = {D},
+  publisher    = {Addison-Wesley},
+  location     = {Reading, Mass.},
+  langid       = {english},
+  langidopts   = {variant=american},
+  sortyear     = {1986-3},
+  sorttitle    = {Computers & Typesetting D},
+  shorttitle   = {METAFONT},
+  annotation   = {The fourth volume of a five-volume book. Note the
+                  \texttt{sorttitle} and \texttt{sortyear} fields},
+}
+
+@book{knuth:ct:e,
+  author       = {Knuth, Donald E.},
+  title        = {{Computer Modern} Typefaces},
+  date         = 1986,
+  maintitle    = {Computers \& Typesetting},
+  volume       = {E},
+  publisher    = {Addison-Wesley},
+  location     = {Reading, Mass.},
+  langid       = {english},
+  langidopts   = {variant=american},
+  sortyear     = {1986-4},
+  sorttitle    = {Computers & Typesetting E},
+  annotation   = {The fifth volume of a five-volume book. Note the
+                  \texttt{sorttitle} and \texttt{sortyear} fields},
+}
+
+@book{knuth:ct:related,
+  author       = {Knuth, Donald E.},
+  title        = {Computers \& Typesetting},
+  date         = {1984/1986},
+  volumes      = 5,
+  publisher    = {Addison-Wesley},
+  location     = {Reading, Mass.},
+  langid       = {english},
+  langidopts   = {variant=american},
+  sortyear     = {1984-0},
+  sorttitle    = {Computers & Typesetting},
+  indexsorttitle= {Computers & Typesetting},
+  related      = {knuth:ct:a,knuth:ct:b,knuth:ct:c,knuth:ct:d,knuth:ct:e},
+  relatedtype  = {multivolume},
+  annotation   = {A five-volume book cited as a whole and related to its
+                  individual volumes. Note the \texttt{related} and
+                  \texttt{relatedtype} fields},
+}
+
+@book{kullback,
+  author       = {Kullback, Solomon},
+  title        = {Information Theory and Statistics},
+  year         = 1959,
+  publisher    = {John Wiley \& Sons},
+  location     = {New York},
+  langid       = {english},
+  langidopts   = {variant=american},
+}
+
+@book{kullback:reprint,
+  author       = {Kullback, Solomon},
+  title        = {Information Theory and Statistics},
+  year         = 1997,
+  publisher    = {Dover Publications},
+  location     = {New York},
+  origyear     = 1959,
+  origpublisher= {John Wiley \& Sons},
+  langid       = {english},
+  langidopts   = {variant=american},
+  annotation   = {A reprint of the \texttt{kullback} entry. Note the format of
+                  \texttt{origyear} and \texttt{origpublisher}. These fields are
+                  not used by the standard bibliography styles},
+}
+
+@book{kullback:related,
+  author       = {Kullback, Solomon},
+  title        = {Information Theory and Statistics},
+  year         = 1997,
+  publisher    = {Dover Publications},
+  location     = {New York},
+  langid       = {english},
+  langidopts   = {variant=american},
+  related      = {kullback},
+  relatedtype  = {origpubin},
+  annotation   = {A reprint of the \texttt{kullback} entry. Note the format of
+                  the \texttt{related} and \texttt{relatedtype} fields},
+}
+
+@book{malinowski,
+  author       = {Malinowski, Bronis{\l}aw},
+  title        = {Argonauts of the {Western Pacific}},
+  date         = 1972,
+  edition      = 8,
+  publisher    = {Routledge {and} Kegan Paul},
+  location     = {London},
+  langid       = {english},
+  langidopts   = {variant=british},
+  subtitle     = {An account of native enterprise and adventure in the
+                  Archipelagoes of {Melanesian New Guinea}},
+  shorttitle   = {Argonauts},
+  annotation   = {This is a \texttt{book} entry. Note the format of the
+                  \texttt{publisher} and \texttt{edition} fields as well as the
+                  \texttt{subtitle} field},
+}
+
+@book{maron,
+  author       = {Maron, Monika},
+  title        = {Animal Triste},
+  date         = 2000,
+  translator   = {Brigitte Goldstein},
+  origlanguage = {german},
+  publisher    = {University of Nebraska Press},
+  location     = {Lincoln},
+  langid       = {english},
+  langidopts   = {variant=american},
+  shorttitle   = {Animal Triste},
+  annotation   = {An English translation of a German novel with a French title.
+                  In other words: a \texttt{book} entry with a
+                  \texttt{translator} field.  Note the \texttt{origlanguage}
+                  field which is concatenated with the \texttt{translator}},
+}
+
+@book{massa,
+  author       = {Werner Massa},
+  title        = {Crystal structure determination},
+  date         = 2004,
+  edition      = 2,
+  publisher    = {Spinger},
+  location     = {Berlin},
+  langid       = {english},
+  langidopts   = {variant=british},
+  annotation   = {A \texttt{book} entry with an \texttt{edition} field},
+}
+
+@article{moore,
+  author       = {Moore, Gordon E.},
+  title        = {Cramming more components onto integrated circuits},
+  journaltitle = {Electronics},
+  year         = 1965,
+  volume       = 38,
+  number       = 8,
+  pages        = {114-117},
+  langid       = {english},
+  langidopts   = {variant=american},
+}
+
+@article{moore:related,
+  author       = {Moore, Gordon E.},
+  title        = {Cramming more components onto integrated circuits},
+  journaltitle = {Proceedings of the {IEEE}},
+  year         = 1998,
+  volume       = 86,
+  number       = 1,
+  pages        = {82-85},
+  langid       = {english},
+  langidopts   = {variant=american},
+  related      = {moore},
+  relatedtype  = {reprintfrom},
+  annotation   = {A reprint of Moore's law. Note the \texttt{related} and
+                  \texttt{relatedtype} fields},
+}
+
+@book{nietzsche:ksa,
+  author       = {Nietzsche, Friedrich},
+  title        = {S{\"a}mtliche Werke},
+  date         = 1988,
+  editor       = {Colli, Giorgio and Montinari, Mazzino},
+  edition      = 2,
+  volumes      = 15,
+  publisher    = dtv # { and Walter de Gruyter},
+  location     = {M{\"u}nchen and Berlin and New York},
+  langid       = {german},
+  sortyear     = {1988-0},
+  sorttitle    = {Werke-00-000},
+  indexsorttitle= {Samtliche Werke},
+  subtitle     = {Kritische Studienausgabe},
+  annotation   = {The critical edition of Nietzsche's works. This is a
+                  \texttt{book} entry referring to a 15-volume work as a
+                  whole. Note the \texttt{volumes} field and the format of the
+                  \texttt{publisher} and \texttt{location} fields in the
+                  database file. Also note the \texttt{sorttitle} and
+                  \texttt{sortyear} fields which are used to fine-tune the
+                  sorting order of the bibliography. We want this item listed
+                  first in the bibliography},
+}
+
+@book{nietzsche:ksa1,
+  author       = {Nietzsche, Friedrich},
+  title        = {Die Geburt der Trag{\"o}die. Unzeitgem{\"a}{\ss}e
+                  Betrachtungen I--IV. Nachgelassene Schriften 1870--1973},
+  date         = 1988,
+  editor       = {Colli, Giorgio and Montinari, Mazzino},
+  maintitle    = {S{\"a}mtliche Werke},
+  mainsubtitle = {Kritische Studienausgabe},
+  volume       = 1,
+  edition      = 2,
+  publisher    = dtv # { and Walter de Gruyter},
+  location     = {M{\"u}nchen and Berlin and New York},
+  langid       = {german},
+  sortyear     = {1988-1},
+  sorttitle    = {Werke-01-000},
+  indexsorttitle= {Samtliche Werke I},
+  bookauthor   = {Nietzsche, Friedrich},
+  indextitle   = {S{\"a}mtliche Werke I},
+  shorttitle   = {S{\"a}mtliche Werke I},
+  annotation   = {A single volume from the critical edition of Nietzsche's
+                  works. This \texttt{book} entry explicitly refers to the first
+                  volume only. Note the \texttt{title} and \texttt{maintitle}
+                  fields. Also note the \texttt{sorttitle} and \texttt{sortyear}
+                  fields. We want this entry to be listed after the entry
+                  referring to the entire edition},
+}
+
+@book{nussbaum,
+  author       = {Nussbaum, Martha},
+  title        = {Aristotle's \mkbibquote{De Motu Animalium}},
+  date         = 1978,
+  publisher    = pup,
+  location     = {Princeton},
+  keywords     = {secondary},
+  langid       = {english},
+  langidopts   = {variant=american},
+  sorttitle    = {Aristotle's De Motu Animalium},
+  indexsorttitle= {Aristotle's De Motu Animalium},
+  annotation   = {A \texttt{book} entry. Note the \texttt{sorttitle} and
+                  \texttt{indexsorttitle} fields and the markup of the quotes in
+                  the database file},
+}
+
+@book{piccato,
+  author       = {Piccato, Pablo},
+  title        = {City of Suspects},
+  date         = 2001,
+  publisher    = {Duke University Press},
+  location     = {Durham and London},
+  langid       = {english},
+  langidopts   = {variant=american},
+  subtitle     = {Crime in {Mexico City}, 1900--1931},
+  shorttitle   = {City of Suspects},
+  annotation   = {This is a \texttt{book} entry. Note the format of the
+                  \texttt{location} field in the database file},
+}
+
+@book{vangennep,
+  author       = {van Gennep, Arnold},
+  title        = {Les rites de passage},
+  date         = 1909,
+  publisher    = {Nourry},
+  location     = {Paris},
+  options      = {useprefix},
+  langid       = {french},
+  sorttitle    = {Rites de passage},
+  indextitle   = {Rites de passage, Les},
+  shorttitle   = {Rites de passage},
+  annotation   = {A \texttt{book} entry. Note the format of the printed name and
+                  compare the \texttt{useprefix} option in the \texttt{options}
+                  field as well as \texttt{brandt} and \texttt{geer}},
+}
+
+@book{vangennep:trans,
+  author       = {van Gennep, Arnold},
+  title        = {The Rites of Passage},
+  year         = 1960,
+  translator   = {Vizedom, Monika B. and Caffee, Gabrielle L.},
+  language     = {english},
+  origlanguage = {french},
+  publisher    = {University of Chicago Press},
+  options      = {useprefix},
+  indextitle   = {Rites of Passage, The},
+  sorttitle    = {Rites of Passage},
+  shorttitle   = {Rites of Passage},
+  langid       = {english},
+  langidopts   = {variant=american},
+  annotation   = {A translation of the \texttt{vangennep} entry. Note the
+                  \texttt{translator} and \texttt{origlanguage} fields. Compare
+                  with the \texttt{vangennep:related} entry.},
+}
+
+@book{vangennep:related,
+  author       = {van Gennep, Arnold},
+  title        = {Les rites de passage},
+  date         = 1909,
+  publisher    = {Nourry},
+  location     = {Paris},
+  options      = {useprefix},
+  langid       = {french},
+  related      = {vizedom:related},
+  relatedtype  = {bytranslator},
+  sorttitle    = {Rites de passage},
+  indextitle   = {Rites de passage, Les},
+  shorttitle   = {Rites de passage},
+  annotation   = {A variant of the \texttt{vangennep} entry related to its
+                  translation. Note the format of the \texttt{related} and
+                  \texttt{relatedtype} fields},
+}
+
+@book{vizedom:related,
+  title        = {The Rites of Passage},
+  year         = 1960,
+  translator   = {Vizedom, Monika B. and Caffee, Gabrielle L.},
+  language     = {english},
+  publisher    = {University of Chicago Press},
+  langid       = {english},
+  langidopts   = {variant=american},
+  options      = {usetranslator},
+  related      = {vangennep},
+  relatedtype  = {translationof},
+  indextitle   = {Rites of Passage, The},
+  sorttitle    = {Rites of Passage},
+  shorttitle   = {Rites of Passage},
+  annotation   = {A translated work from \texttt{vangennep}. Note the format of
+                  the \texttt{related} and \texttt{relatedtype} fields},
+}
+
+@book{vazques-de-parga,
+  author       = {V{\'a}zques{ de }Parga, Luis and Lacarra, Jos{\'e} Mar{\'i}a
+                  and Ur{\'i}a R{\'i}u, Juan},
+  title        = {Las Peregrinaciones a Santiago de Compostela},
+  date         = 1993,
+  volumes      = 3,
+  note         = {Ed. facs. de la realizada en 1948--49},
+  publisher    = {Iberdrola},
+  location     = {Pamplona},
+  langid       = {spanish},
+  sorttitle    = {Peregrinaciones a Santiago de Compostela},
+  indextitle   = {Peregrinaciones a Santiago de Compostela, Las},
+  shorttitle   = {Peregrinaciones},
+  annotation   = {A multivolume book cited as a whole. This is a \texttt{book}
+                  entry with \texttt{volumes}, \texttt{note},
+                  \texttt{sorttitle}, and \texttt{indextitle} fields},
+}
+
+@book{wilde,
+  author       = {Wilde, Oscar},
+  title        = {The Importance of Being Earnest: A Trivial Comedy for Serious
+                  People},
+  year         = 1899,
+  series       = {English and {American} drama of the Nineteenth Century},
+  publisher    = {Leonard Smithers {and} Company},
+  eprint       = {4HIWAAAAYAAJ},
+  eprinttype   = {googlebooks},
+  annotation   = {A \texttt{book} with \texttt{eprint} and \texttt{eprinttype}
+                  fields.},
+}
+
+@book{worman,
+  author       = {Worman, Nancy},
+  title        = {The Cast of Character},
+  date         = 2002,
+  publisher    = {University of Texas Press},
+  location     = {Austin},
+  langid       = {english},
+  langidopts   = {variant=american},
+  sorttitle    = {Cast of Character},
+  indextitle   = {Cast of Character, The},
+  subtitle     = {Style in {Greek} Literature},
+  shorttitle   = {Cast of Character},
+  annotation   = {A \texttt{book} entry. Note the \texttt{sorttitle} and
+                  \texttt{indextitle} fields},
+}
+
+@collection{britannica,
+  editor       = {Preece, Warren E.},
+  title        = {The {New Encyclop{\ae}dia Britannica}},
+  date         = 2003,
+  edition      = 15,
+  volumes      = 32,
+  publisher    = {Encyclop{\ae}dia Britannica},
+  location     = {Chicago, Ill.},
+  options      = {useeditor=false},
+  label        = {EB},
+  langid       = {english},
+  langidopts   = {variant=british},
+  sorttitle    = {Encyclop{\ae}dia Britannica},
+  indextitle   = {{Encyclop{\ae}dia Britannica}, The {New}},
+  shorttitle   = {{Encyclop{\ae}dia Britannica}},
+  annotation   = {This is a \texttt{collection} entry for an encyclopedia. Note
+                  the \texttt{useeditor} option in the \texttt{options} field as
+                  well as the \texttt{sorttitle} field. We want this entry to be
+                  cited and alphabetized by title even though there is an
+                  editor. In addition to that, we want the title to be
+                  alphabetized under \enquote*{E} rather than \enquote*{T}. Also
+                  note the \texttt{label} field which is provided for
+                  author-year citation styles},
+}
+
+@collection{gaonkar,
+  editor       = {Gaonkar, Dilip Parameshwar},
+  title        = {Alternative Modernities},
+  date         = 2001,
+  publisher    = {Duke University Press},
+  location     = {Durham and London},
+  isbn         = {0-822-32714-7},
+  langid       = {english},
+  langidopts   = {variant=american},
+  annotation   = {This is a \texttt{collection} entry. Note the format of the
+                  \texttt{location} field in the database file as well as the
+                  \texttt{isbn} field},
+}
+
+@InCollection{gaonkar:in,
+  author       = {Gaonkar, Dilip Parameshwar},
+  editor       = {Gaonkar, Dilip Parameshwar},
+  title        = {On Alternative Modernities},
+  date         = 2001,
+  booktitle    = {Alternative Modernities},
+  publisher    = {Duke University Press},
+  location     = {Durham and London},
+  isbn         = {0-822-32714-7},
+  pages        = {1-23},
+}
+
+@collection{jaffe,
+  editor       = {Jaff{\'e}, Philipp},
+  title        = {Regesta Pontificum Romanorum ab condita ecclesia ad annum post
+                  Christum natum \textsc{mcxcviii}},
+  date         = {1885/1888},
+  editora      = {Loewenfeld, Samuel and Kaltenbrunner, Ferdinand and Ewald,
+                  Paul},
+  edition      = 2,
+  volumes      = 2,
+  location     = {Leipzig},
+  langid       = {latin},
+  editoratype  = {redactor},
+  indextitle   = {Regesta Pontificum Romanorum},
+  shorttitle   = {Regesta Pontificum Romanorum},
+  annotation   = {A \texttt{collection} entry with \texttt{edition} and
+                  \texttt{volumes} fields. Note the \texttt{editora} and
+                  \texttt{editoratype} fields},
+}
+
+@collection{westfahl:frontier,
+  editor       = {Westfahl, Gary},
+  title        = {Space and Beyond},
+  date         = 2000,
+  subtitle     = {The Frontier Theme in Science Fiction},
+  publisher    = {Greenwood},
+  location     = {Westport, Conn. and London},
+  langid       = {english},
+  langidopts   = {variant=american},
+  booktitle    = {Space and Beyond},
+  booksubtitle = {The Frontier Theme in Science Fiction},
+  annotation   = {This is a \texttt{collection} entry. Note the format of the
+                  \texttt{location} field as well as the \texttt{subtitle} and
+                  \texttt{booksubtitle} fields},
+}
+
+@inbook{kant:kpv,
+  title        = {Kritik der praktischen Vernunft},
+  date         = 1968,
+  author       = {Kant, Immanuel},
+  booktitle    = {Kritik der praktischen Vernunft. Kritik der Urtheilskraft},
+  bookauthor   = {Kant, Immanuel},
+  maintitle    = {Kants Werke. Akademie Textausgabe},
+  volume       = 5,
+  publisher    = {Walter de Gruyter},
+  location     = {Berlin},
+  pages        = {1-163},
+  shorthand    = {KpV},
+  langid       = {german},
+  shorttitle   = {Kritik der praktischen Vernunft},
+  annotation   = {An edition of Kant's \emph{Collected Works}, volume five. This
+                  is an \texttt{inbook} entry which explicitly refers to the
+                  \emph{Critique of Practical Reason} only, not to the entire
+                  fifth volume. Note the \texttt{author} and \texttt{bookauthor}
+                  fields in the database file. By default, the
+                  \texttt{bookauthor} is omitted if the values of the
+                  \texttt{author} and \texttt{bookauthor} fields are identical},
+}
+
+@inbook{kant:ku,
+  title        = {Kritik der Urtheilskraft},
+  date         = 1968,
+  author       = {Kant, Immanuel},
+  booktitle    = {Kritik der praktischen Vernunft. Kritik der Urtheilskraft},
+  bookauthor   = {Kant, Immanuel},
+  maintitle    = {Kants Werke. Akademie Textausgabe},
+  volume       = 5,
+  publisher    = {Walter de Gruyter},
+  location     = {Berlin},
+  pages        = {165-485},
+  shorthand    = {KU},
+  langid       = {german},
+  annotation   = {An edition of Kant's \emph{Collected Works}, volume five. This
+                  is an \texttt{inbook} entry which explicitly refers to the
+                  \emph{Critique of Judgment} only, not to the entire fifth
+                  volume},
+}
+
+@inbook{nietzsche:historie,
+  title        = {Unzeitgem{\"a}sse Betrachtungen. Zweites St{\"u}ck},
+  date         = 1988,
+  author       = {Nietzsche, Friedrich},
+  booktitle    = {Die Geburt der Trag{\"o}die. Unzeitgem{\"a}{\ss}e
+                  Betrachtungen I--IV. Nachgelassene Schriften 1870--1973},
+  bookauthor   = {Nietzsche, Friedrich},
+  editor       = {Colli, Giorgio and Montinari, Mazzino},
+  subtitle     = {Vom Nutzen und Nachtheil der Historie f{\"u}r das Leben},
+  maintitle    = {S{\"a}mtliche Werke},
+  mainsubtitle = {Kritische Studienausgabe},
+  volume       = 1,
+  publisher    = dtv # { and Walter de Gruyter},
+  location     = {M{\"u}nchen and Berlin and New York},
+  pages        = {243-334},
+  langid       = {german},
+  sortyear     = {1988-2},
+  sorttitle    = {Werke-01-243},
+  indexsorttitle= {Vom Nutzen und Nachtheil der Historie fur das Leben},
+  indextitle   = {Vom Nutzen und Nachtheil der Historie f{\"u}r das Leben},
+  shorttitle   = {Vom Nutzen und Nachtheil der Historie},
+  annotation   = {A single essay from the critical edition of Nietzsche's works.
+                  This \texttt{inbook} entry explicitly refers to an essay found
+                  in the first volume. Note the \texttt{title},
+                  \texttt{booktitle}, and \texttt{maintitle} fields. Also note
+                  the \texttt{sorttitle} and \texttt{sortyear} fields. We want
+                  this entry to be listed after the entry referring to the
+                  entire first volume},
+}
+
+@incollection{brandt,
+  author       = {von Brandt, Ahasver and Erich Hoffmann},
+  editor       = {Ferdinand Seibt},
+  title        = {Die nordischen L{\"a}nder von der Mitte des 11.~Jahrhunderts
+                  bis 1448},
+  date         = 1987,
+  booktitle    = {Europa im Hoch- und Sp{\"a}tmittelalter},
+  series       = {Handbuch der europ{\"a}ischen Geschichte},
+  number       = 2,
+  publisher    = {Klett-Cotta},
+  location     = {Stuttgart},
+  pages        = {884-917},
+  options      = {useprefix=false},
+  langid       = {german},
+  indexsorttitle= {Nordischen Lander von der Mitte des 11. Jahrhunderts bis
+                  1448},
+  indextitle   = {Nordischen L{\"a}nder von der Mitte des 11.~Jahrhunderts bis
+                  1448, Die},
+  shorttitle   = {Die nordischen L{\"a}nder},
+  annotation   = {An \texttt{incollection} entry with a \texttt{series} and a
+                  \texttt{number}. Note the format of the printed name and
+                  compare the \texttt{useprefix} option in the \texttt{options}
+                  field as well as \texttt{vangennep}. Also note the
+                  \texttt{indextitle, and \texttt{indexsorttitle} fields}},
+}
+
+@incollection{hyman,
+  author       = {Arthur Hyman},
+  editor       = {O'Meara, Dominic J.},
+  title        = {Aristotle's Theory of the Intellect and its Interpretation by
+                  {Averroes}},
+  date         = 1981,
+  booktitle    = {Studies in {Aristotle}},
+  series       = {Studies in Philosophy and the History of Philosophy},
+  number       = 9,
+  publisher    = {The Catholic University of America Press},
+  location     = {Washington, D.C.},
+  pages        = {161-191},
+  keywords     = {secondary},
+  langid       = {english},
+  langidopts   = {variant=american},
+  indextitle   = {Aristotle's Theory of the Intellect},
+  shorttitle   = {Aristotle's Theory of the Intellect},
+  annotation   = {An \texttt{incollection} entry with a \texttt{series} and
+                  \texttt{number} field},
+}
+
+@incollection{pines,
+  author       = {Pines, Shlomo},
+  editor       = {Twersky, Isadore},
+  title        = {The Limitations of Human Knowledge According to {Al-Farabi}, {ibn
+                  Bajja}, and {Maimonides}},
+  date         = 1979,
+  booktitle    = {Studies in Medieval {Jewish} History and Literature},
+  publisher    = hup,
+  location     = {Cambridge, Mass.},
+  pages        = {82-109},
+  keywords     = {secondary},
+  langid       = {english},
+  langidopts   = {variant=american},
+  indextitle   = {Limitations of Human Knowledge According to {Al-Farabi}, {ibn
+                  Bajja}, and {Maimonides}, The},
+  shorttitle   = {Limitations of Human Knowledge},
+  annotation   = {A typical \texttt{incollection} entry. Note the
+                  \texttt{indextitle} field},
+}
+
+@inproceedings{moraux,
+  author       = {Moraux, Paul},
+  editor       = {Lloyd, G. E. R. and Owen, G. E. L.},
+  title        = {Le \emph{De Anima} dans la tradition gr{\`e}cque},
+  date         = 1979,
+  booktitle    = {Aristotle on Mind and the Senses},
+  subtitle     = {Quelques aspects de l'interpretation du trait{\'e}, de
+                  Theophraste {\`a} Themistius},
+  booktitleaddon= {Proceedings of the Seventh Symposium Aristotelicum},
+  eventdate    = 1975,
+  publisher    = cup,
+  location     = {Cambridge},
+  pages        = {281-324},
+  keywords     = {secondary},
+  langid       = {french},
+  indexsorttitle= {De Anima dans la tradition grecque},
+  indextitle   = {\emph{De Anima} dans la tradition gr{\`e}cque, Le},
+  shorttitle   = {\emph{De Anima} dans la tradition gr{\`e}cque},
+  annotation   = {This is a typical \texttt{inproceedings} entry. Note the
+                  \texttt{booksubtitle}, \texttt{shorttitle},
+                  \texttt{indextitle}, and \texttt{indexsorttitle} fields. Also
+                  note the \texttt{eventdate} field.},
+}
+
+@inproceedings{salam,
+  author       = {Salam, Abdus},
+  editor       = {Svartholm, Nils},
+  title        = {Weak and Electromagnetic Interactions},
+  date         = 1968,
+  booktitle    = {Elementary particle theory},
+  booksubtitle = {Relativistic groups and analyticity},
+  booktitleaddon= {Proceedings of the {Eighth Nobel Symposium}},
+  eventdate    = {1968-05-19/1968-05-25},
+  venue        = {Aspen{\"a}sgarden, Lerum},
+  publisher    = {Almquist \& Wiksell},
+  location     = {Stockholm},
+  pages        = {367-377},
+}
+
+@manual{cms,
+  title        = {The {Chicago} Manual of Style},
+  date         = 2003,
+  subtitle     = {The Essential Guide for Writers, Editors, and Publishers},
+  edition      = 15,
+  publisher    = {University of Chicago Press},
+  location     = {Chicago, Ill.},
+  isbn         = {0-226-10403-6},
+  label        = {CMS},
+  langid       = {english},
+  langidopts   = {variant=american},
+  sorttitle    = {Chicago Manual of Style},
+  indextitle   = {Chicago Manual of Style, The},
+  shorttitle   = {Chicago Manual of Style},
+  annotation   = {This is a \texttt{manual} entry without an \texttt{author} or
+                  \texttt{editor}. Note the \texttt{label} field in the database
+                  file which is provided for author-year citation styles. Also
+                  note the \texttt{sorttitle} and \texttt{indextitle} fields. By
+                  default, all entries without an \texttt{author} or
+                  \texttt{editor} are alphabetized by \texttt{title} but we want
+                  this entry to be alphabetized under \enquote*{C} rather than
+                  \enquote*{T}. There's also an \texttt{isbn} field},
+}
+
+@online{baez/online,
+  author       = {Baez, John C. and Lauda, Aaron D.},
+  title        = {Higher-Dimensional Algebra {V}: 2-Groups},
+  date         = {2004-10-27},
+  version      = 3,
+  langid       = {english},
+  langidopts   = {variant=american},
+  eprinttype   = {arxiv},
+  eprint       = {math/0307200v3},
+  annotation   = {An \texttt{online} reference from arXiv. Note the
+                  \texttt{eprint} and \texttt{eprinttype} fields. Compare
+                  \texttt{baez\slash article} which is the same item given as an
+                  \texttt{article} entry with eprint information},
+}
+
+@online{ctan,
+  title        = {CTAN},
+  date         = 2006,
+  url          = {http://www.ctan.org},
+  subtitle     = {The {Comprehensive TeX Archive Network}},
+  urldate      = {2006-10-01},
+  label        = {CTAN},
+  langid       = {english},
+  langidopts   = {variant=american},
+  annotation   = {This is an \texttt{online} entry. The \textsc{url}, which is
+                  given in the \texttt{url} field, is transformed into a
+                  clickable link if \texttt{hyperref} support has been
+                  enabled. Note the format of the \texttt{urldate} field
+                  (\texttt{yyyy-mm-dd}) in the database file. Also note the
+                  \texttt{label} field which may be used as a fallback by
+                  citation styles which need an \texttt{author} and\slash or a
+                  \texttt{year}},
+}
+
+@online{itzhaki,
+  author       = {Itzhaki, Nissan},
+  title        = {Some remarks on {'t Hooft's} {S}-matrix for black holes},
+  date         = {1996-03-11},
+  version      = 1,
+  langid       = {english},
+  langidopts   = {variant=american},
+  eprinttype   = {arxiv},
+  eprint       = {hep-th/9603067},
+  annotation   = {An \texttt{online} reference from arXiv. Note the
+                  \texttt{eprint} and \texttt{eprinttype} fields. Also note that
+                  the arXiv reference is transformed into a clickable link if
+                  \texttt{hyperref} support has been enabled},
+  abstract     = {We discuss the limitations of 't Hooft's proposal for the
+                  black hole S-matrix. We find that the validity of the S-matrix
+                  implies violation of the semi-classical approximation at
+                  scales large compared to the Planck scale. We also show that
+                  the effect of the centrifugal barrier on the S-matrix is
+                  crucial even for large transverse distances.},
+}
+
+@online{markey,
+  author       = {Markey, Nicolas},
+  title        = {Tame the {BeaST}},
+  date         = {2005-10-16},
+  url          = {http://mirror.ctan.org/info/bibtex/tamethebeast/ttb_en.pdf},
+  subtitle     = {The {B} to {X} of {BibTeX}},
+  version      = {1.3},
+  urldate      = {2006-10-01},
+  langid       = {english},
+  langidopts   = {variant=american},
+  sorttitle    = {Tame the Beast},
+  annotation   = {An \texttt{online} entry for a tutorial. Note the format of
+                  the \texttt{date} field (\texttt{yyyy-mm-dd}) in the database
+                  file.},
+}
+
+@online{wassenberg,
+  author       = {Wassenberg, Jan and Sanders, Peter},
+  title        = {Faster Radix Sort via Virtual Memory and Write-Combining},
+  date         = {2010-08-17},
+  version      = 1,
+  langid       = {english},
+  langidopts   = {variant=american},
+  eprinttype   = {arxiv},
+  eprintclass  = {cs.DS},
+  eprint       = {1008.2849v1},
+  annotation   = {A recent \texttt{online} reference from arXiv using the new
+                  (April 2007 onward) identifier format. Note the
+                  \texttt{eprint}, \texttt{eprinttype}, and \texttt{eprintclass}
+                  fields. Also note that the arXiv reference is transformed into
+                  a clickable link if \texttt{hyperref} support has been
+                  enabled},
+  abstract     = {Sorting algorithms are the deciding factor for the performance
+                  of common operations such as removal of duplicates or database
+                  sort-merge joins. This work focuses on 32-bit integer keys,
+                  optionally paired with a 32-bit value. We present a fast radix
+                  sorting algorithm that builds upon a microarchitecture-aware
+                  variant of counting sort},
+}
+
+@patent{almendro,
+  author       = {Almendro, Jos{\'e} L. and Mart{\'i}n, Jacinto and S{\'a}nchez,
+                  Alberto and Nozal, Fernando},
+  title        = {Elektromagnetisches Signalhorn},
+  number       = {EU-29702195U},
+  date         = 1998,
+  location     = {countryfr and countryuk and countryde},
+  langid       = {german},
+  annotation   = {This is a \texttt{patent} entry with a \texttt{location}
+                  field. The number is given in the \texttt{number} field. Note
+                  the format of the \texttt{location} field in the database
+                  file. Compare \texttt{laufenberg}, \texttt{sorace}, and
+                  \texttt{kowalik}},
+}
+
+@patent{kowalik,
+  author       = {Kowalik, F. and Isard, M.},
+  title        = {Estimateur d'un d{\'e}faut de fonctionnement d'un modulateur
+                  en quadrature et {\'e}tage de modulation l'utilisant},
+  number       = 9500261,
+  date         = {1995-01-11},
+  type         = {patreqfr},
+  langid       = {french},
+  indextitle   = {Estimateur d'un d{\'e}faut de fonctionnement},
+  annotation   = {This is a \texttt{patent} entry for a French patent request
+                  with a full date. The number is given in the \texttt{number}
+                  field. Note the format of the \texttt{type} and \texttt{date}
+                  fields in the database file. Compare \texttt{almendro},
+                  \texttt{laufenberg}, and \texttt{sorace}},
+}
+
+@patent{laufenberg,
+  author       = {Laufenberg, Xaver and Eynius, Dominique and Suelzle, Helmut
+                  and Usbeck, Stephan and Spaeth, Matthias and Neuser-Hoffmann,
+                  Miriam and Myrzik, Christian and Schmid, Manfred and Nietfeld,
+                  Franz and Thiel, Alexander and Braun, Harald and Ebner,
+                  Norbert},
+  title        = {Elektrische Einrichtung und Betriebsverfahren},
+  number       = 1700367,
+  date         = {2006-09-13},
+  holder       = {{Robert Bosch GmbH} and {Daimler Chrysler AG} and {Bayerische
+                  Motoren Werke AG}},
+  type         = {patenteu},
+  langid       = {german},
+  annotation   = {This is a \texttt{patent} entry with a \texttt{holder} field.
+                  Note the format of the \texttt{type} and \texttt{location}
+                  fields in the database file. Compare \texttt{almendro},
+                  \texttt{sorace}, and \texttt{kowalik}},
+  abstract     = {The invention relates to an electric device comprising a
+                  generator, in particular for use in the vehicle electric
+                  system of a motor vehicle and a controller for controlling the
+                  generator voltage. The device is equipped with a control zone,
+                  in which the voltage is controlled and zones, in which the
+                  torque is controlled. The invention also relates to methods
+                  for operating a device of this type.},
+  file         = {http://v3.espacenet.com/textdoc?IDX=EP1700367},
+}
+
+@patent{sorace,
+  author       = {Sorace, Ronald E. and Reinhardt, Victor S. and Vaughn, Steven
+                  A.},
+  title        = {High-Speed Digital-to-{RF} Converter},
+  number       = 5668842,
+  date         = {1997-09-16},
+  holder       = {{Hughes Aircraft Company}},
+  type         = {patentus},
+  langid       = {english},
+  langidopts   = {variant=american},
+  annotation   = {This is a \texttt{patent} entry with a \texttt{holder} field.
+                  Note the format of the \texttt{type} and \texttt{date} fields
+                  in the database file. Compare \texttt{almendro},
+                  \texttt{laufenberg}, and \texttt{kowalik}},
+}
+
+@periodical{jcg,
+  title        = {Computers and Graphics},
+  year         = 2011,
+  issuetitle   = {Semantic {3D} Media and Content},
+  volume       = 35,
+  number       = 4,
+  issn         = {0097-8493},
+  annotation   = {This is a \texttt{periodical} entry with an \texttt{issn}
+                  field.},
+}
+
+@report{chiu,
+  author       = {Chiu, Willy W. and Chow, We Min},
+  title        = {A Hybrid Hierarchical Model of a {Multiple Virtual Storage}
+                  ({MVS}) Operating System},
+  type         = {resreport},
+  institution  = {IBM},
+  date         = 1978,
+  number       = {RC-6947},
+  langid       = {english},
+  langidopts   = {variant=american},
+  sorttitle    = {Hybrid Hierarchical Model of a Multiple Virtual Storage (MVS)
+                  Operating System},
+  indextitle   = {Hybrid Hierarchical Model, A},
+  annotation   = {This is a \texttt{report} entry for a research report. Note
+                  the format of the \texttt{type} field in the database file
+                  which uses a localization key. The number of the report is
+                  given in the \texttt{number} field. Also note the
+                  \texttt{sorttitle} and \texttt{indextitle} fields},
+}
+
+@report{padhye,
+  author       = {Padhye, Jitendra and Firoiu, Victor and Towsley, Don},
+  title        = {A Stochastic Model of {TCP Reno} Congestion Avoidance and
+                  Control},
+  type         = {techreport},
+  institution  = {University of Massachusetts},
+  date         = 1999,
+  number       = {99-02},
+  location     = {Amherst, Mass.},
+  langid       = {english},
+  langidopts   = {variant=american},
+  sorttitle    = {A Stochastic Model of TCP Reno Congestion Avoidance and
+                  Control},
+  indextitle   = {Stochastic Model of {TCP Reno} Congestion Avoidance and Control,
+                  A},
+  annotation   = {This is a \texttt{report} entry for a technical report. Note
+                  the format of the \texttt{type} field in the database file
+                  which uses a localization key. The number of the report is
+                  given in the \texttt{number} field. Also note the
+                  \texttt{sorttitle} and \texttt{indextitle} fields},
+  abstract     = {The steady state performance of a bulk transfer TCP flow
+                  (i.e. a flow with a large amount of data to send, such as FTP
+                  transfers) may be characterized by three quantities. The first
+                  is the send rate, which is the amount of data sent by the
+                  sender in unit time. The second is the throughput, which is
+                  the amount of data received by the receiver in unit time. Note
+                  that the throughput will always be less than or equal to the
+                  send rate due to losses. Finally, the number of non-duplicate
+                  packets received by the receiver in unit time gives us the
+                  goodput of the connection. The goodput is always less than or
+                  equal to the throughput, since the receiver may receive two
+                  copies of the same packet due to retransmissions by the
+                  sender. In a previous paper, we presented a simple model for
+                  predicting the steady state send rate of a bulk transfer TCP
+                  flow as a function of loss rate and round trip time. In this
+                  paper, we extend that work in two ways. First, we analyze the
+                  performance of bulk transfer TCP flows using more precise,
+                  stochastic analysis. Second, we build upon the previous
+                  analysis to provide both an approximate formula as well as a
+                  more accurate stochastic model for the steady state throughput
+                  of a bulk transfer TCP flow.},
+  file         = {ftp://gaia.cs.umass.edu/pub/Padhey99-markov.ps},
+}
+
+@thesis{geer,
+  author       = {de Geer, Ingrid},
+  title        = {Earl, Saint, Bishop, Skald~-- and Music},
+  type         = {phdthesis},
+  institution  = {Uppsala Universitet},
+  date         = 1985,
+  subtitle     = {The {Orkney Earldom} of the Twelfth Century. {A} Musicological
+                  Study},
+  location     = {Uppsala},
+  options      = {useprefix=false},
+  langid       = {english},
+  langidopts   = {variant=british},
+  annotation   = {This is a typical \texttt{thesis} entry for a PhD thesis. Note
+                  the \texttt{type} field in the database file which uses a
+                  localization key. Also note the format of the printed name and
+                  compare the \texttt{useprefix} option in the \texttt{options}
+                  field as well as \texttt{vangennep}},
+}
+
+@thesis{loh,
+  author       = {Loh, Nin C.},
+  title        = {High-Resolution Micromachined Interferometric Accelerometer},
+  type         = {mathesis},
+  institution  = {Massachusetts Institute of Technology},
+  date         = 1992,
+  location     = {Cambridge, Mass.},
+  langid       = {english},
+  langidopts   = {variant=american},
+  annotation   = {This is a typical \texttt{thesis} entry for an MA thesis. Note
+                  the \texttt{type} field in the database file which uses a
+                  localization key},
+}
diff --git a/test/command/biblatex-formatting.md b/test/command/biblatex-formatting.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-formatting.md
@@ -0,0 +1,23 @@
+```
+% pandoc -f biblatex -t markdown -s
+@article{item1,
+    Title = {The Title:
+     \textit{italics},
+     \textbf{bold},
+     \textsubscript{subscript},
+     \textsuperscript{superscript},
+     \textsc{small-caps}}
+}
+^D
+---
+nocite: "[@*]"
+references:
+- id: item1
+  title: "The title: *Italics*, **bold**, ~subscript~, ^superscript^,
+    [small-caps]{.smallcaps}"
+  title-short: The title
+  type: article-journal
+---
+
+
+```
diff --git a/test/command/biblatex-gaonkar-in.md b/test/command/biblatex-gaonkar-in.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-gaonkar-in.md
@@ -0,0 +1,62 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Gaonkar 2001)
+
+Gaonkar, Dilip Parameshwar. 2001. “On Alternative Modernities.” In
+*Alternative Modernities*, edited by Dilip Parameshwar Gaonkar, 1–23.
+Durham; London: Duke University Press.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Gaonkar, 2001)
+
+Gaonkar, D. P. (2001). On alternative modernities. In D. P. Gaonkar
+(Ed.), *Alternative modernities* (pp. 1–23). Durham; London: Duke
+University Press.
+
+
+}
+
+@InCollection{gaonkar:in,
+  author       = {Gaonkar, Dilip Parameshwar},
+  editor       = {Gaonkar, Dilip Parameshwar},
+  title        = {On Alternative Modernities},
+  date         = 2001,
+  booktitle    = {Alternative Modernities},
+  publisher    = {Duke University Press},
+  location     = {Durham and London},
+  isbn         = {0-822-32714-7},
+  pages        = {1-23},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Gaonkar
+    given: Dilip Parameshwar
+  container-title: Alternative modernities
+  editor:
+  - family: Gaonkar
+    given: Dilip Parameshwar
+  id: "gaonkar:in"
+  isbn: 0-822-32714-7
+  issued: 2001
+  page: 1-23
+  publisher: Duke University Press
+  publisher-place: Durham; London
+  title: On alternative modernities
+  type: chapter
+---
+
+
+```
diff --git a/test/command/biblatex-gaonkar.md b/test/command/biblatex-gaonkar.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-gaonkar.md
@@ -0,0 +1,59 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Gaonkar 2001)
+
+Gaonkar, Dilip Parameshwar, ed. 2001. *Alternative Modernities*. Durham;
+London: Duke University Press.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Gaonkar, 2001)
+
+Gaonkar, D. P. (Ed.). (2001). *Alternative modernities*. Durham; London:
+Duke University Press.
+
+
+}
+
+@Collection{gaonkar,
+  editor       = {Gaonkar, Dilip Parameshwar},
+  title        = {Alternative Modernities},
+  date         = 2001,
+  publisher    = {Duke University Press},
+  location     = {Durham and London},
+  isbn         = {0-822-32714-7},
+  hyphenation  = {american},
+  annotation   = {This is a collection entry. Note the format of the
+                  location field in the database file as well as the
+                  isbn field},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a collection entry. Note the format of the location
+    field in the database file as well as the isbn field
+  editor:
+  - family: Gaonkar
+    given: Dilip Parameshwar
+  id: gaonkar
+  isbn: 0-822-32714-7
+  issued: 2001
+  language: en-US
+  publisher: Duke University Press
+  publisher-place: Durham; London
+  title: Alternative modernities
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-geer.md b/test/command/biblatex-geer.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-geer.md
@@ -0,0 +1,70 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Geer 1985)
+
+Geer, Ingrid de. 1985. “Earl, Saint, Bishop, Skald – and Music: The
+Orkney Earldom of the Twelfth Century. A Musicological Study.” PhD
+thesis, Uppsala: Uppsala Universitet.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Geer, 1985)
+
+Geer, I. de. (1985). *Earl, saint, bishop, skald – and music: The Orkney
+earldom of the twelfth century. A musicological study* (PhD thesis).
+Uppsala Universitet, Uppsala.
+
+
+}
+
+@Thesis{geer,
+  author       = {de Geer, Ingrid},
+  title        = {Earl, Saint, Bishop, Skald~-- and Music},
+  type         = {phdthesis},
+  institution  = {Uppsala Universitet},
+  date         = 1985,
+  subtitle     = {The {Orkney} Earldom of the Twelfth Century. {A} Musicological
+                  Study},
+  location     = {Uppsala},
+  options      = {useprefix=false},
+  hyphenation  = {british},
+  annotation   = {This is a typical thesis entry for a PhD thesis. Note
+                  the type field in the database file which uses a
+                  localization key. Also note the format of the printed name and
+                  compare the useprefix option in the options
+                  field as well as vangennep},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a typical thesis entry for a PhD thesis. Note the type
+    field in the database file which uses a localization key. Also note
+    the format of the printed name and compare the useprefix option in
+    the options field as well as vangennep
+  author:
+  - dropping-particle: de
+    family: Geer
+    given: Ingrid
+  genre: PhD thesis
+  id: geer
+  issued: 1985
+  language: en-GB
+  publisher: Uppsala Universitet
+  publisher-place: Uppsala
+  title: "Earl, saint, bishop, skald -- and music: The Orkney earldom of
+    the twelfth century. A musicological study"
+  title-short: Earl, saint, bishop, skald -- and music
+  type: thesis
+---
+
+
+```
diff --git a/test/command/biblatex-gerhardt.md b/test/command/biblatex-gerhardt.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-gerhardt.md
@@ -0,0 +1,64 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Gerhardt 2000)
+
+Gerhardt, Michael J. 2000. *The Federal Appointments Process: A
+Constitutional and Historical Analysis*. Durham; London: Duke University
+Press.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Gerhardt, 2000)
+
+Gerhardt, M. J. (2000). *The federal appointments process: A
+constitutional and historical analysis*. Durham; London: Duke University
+Press.
+
+
+}
+
+@Book{gerhardt,
+  author       = {Gerhardt, Michael J.},
+  title        = {The Federal Appointments Process},
+  date         = 2000,
+  publisher    = {Duke University Press},
+  location     = {Durham and London},
+  hyphenation  = {american},
+  sorttitle    = {Federal Appointments Process},
+  indextitle   = {Federal Appointments Process, The},
+  subtitle     = {A Constitutional and Historical Analysis},
+  shorttitle   = {Federal Appointments Process},
+  annotation   = {This is a book entry. Note the format of the
+                  location field as well as the sorttitle and
+                  indextitle fields},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a book entry. Note the format of the location field as
+    well as the sorttitle and indextitle fields
+  author:
+  - family: Gerhardt
+    given: Michael J.
+  id: gerhardt
+  issued: 2000
+  language: en-US
+  publisher: Duke University Press
+  publisher-place: Durham; London
+  title: "The federal appointments process: A constitutional and
+    historical analysis"
+  title-short: Federal appointments process
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-gillies.md b/test/command/biblatex-gillies.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-gillies.md
@@ -0,0 +1,69 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Gillies 1933)
+
+Gillies, Alexander. 1933. “Herder and the Preparation of Goethe’s Idea
+of World Literature.” *Publications of the English Goethe Society, New
+Series* 9: 46–67.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Gillies, 1933)
+
+Gillies, A. (1933). Herder and the preparation of Goethe’s idea of world
+literature. *Publications of the English Goethe Society, new series*,
+*9*, 46–67.
+
+
+NOTES:
+
+- biblio2yaml
+	- "new series" is not pretty, but it’s the best we can do at the moment, given the limitations of CSL.
+
+}
+
+@Article{gillies,
+  author       = {Gillies, Alexander},
+  title        = {Herder and the Preparation of {Goethe}'s Idea of World
+                  Literature},
+  journaltitle = {Publications of the English Goethe Society},
+  date         = 1933,
+  series       = {newseries},
+  volume       = 9,
+  pages        = {46-67},
+  hyphenation  = {british},
+  annotation   = {An article entry with a series and a
+                  volume field. Note that format of the series
+                  field in the database file},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: An article entry with a series and a volume field. Note that
+    format of the series field in the database file
+  author:
+  - family: Gillies
+    given: Alexander
+  collection-title: new series
+  container-title: Publications of the English Goethe Society
+  id: gillies
+  issued: 1933
+  language: en-GB
+  page: 46-67
+  title: Herder and the preparation of Goethe's idea of world literature
+  type: article-journal
+  volume: 9
+---
+
+
+```
diff --git a/test/command/biblatex-glashow.md b/test/command/biblatex-glashow.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-glashow.md
@@ -0,0 +1,51 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Glashow 1961)
+
+Glashow, Sheldon. 1961. “Partial Symmetries of Weak Interactions.”
+*Nucl. Phys.* 22: 579–588.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Glashow, 1961)
+
+Glashow, S. (1961). Partial symmetries of weak interactions.
+*Nucl. Phys.*, *22*, 579–588.
+
+
+}
+
+@Article{glashow,
+  author       = {Glashow, Sheldon},
+  title        = {Partial Symmetries of Weak Interactions},
+  journaltitle = {Nucl.~Phys.},
+  date         = 1961,
+  volume       = 22,
+  pages        = {579-588},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Glashow
+    given: Sheldon
+  container-title: Nucl. Phys.
+  id: glashow
+  issued: 1961
+  page: 579-588
+  title: Partial symmetries of weak interactions
+  type: article-journal
+  volume: 22
+---
+
+
+```
diff --git a/test/command/biblatex-gonzalez.md b/test/command/biblatex-gonzalez.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-gonzalez.md
@@ -0,0 +1,62 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Gonzalez 2001)
+
+Gonzalez, Ray. 2001. *The Ghost of John Wayne and Other Stories*.
+Tucson: The University of Arizona Press.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Gonzalez, 2001)
+
+Gonzalez, R. (2001). *The ghost of John Wayne and other stories*.
+Tucson: The University of Arizona Press.
+
+}
+
+@Book{gonzalez,
+  author       = {Gonzalez, Ray},
+  title        = {The Ghost of {John Wayne} and Other Stories},
+  date         = 2001,
+  publisher    = {The University of Arizona Press},
+  location     = {Tucson},
+  isbn         = {0-816-52066-6},
+  hyphenation  = {american},
+  sorttitle    = {Ghost of John Wayne and Other Stories},
+  indextitle   = {Ghost of {John Wayne} and Other Stories, The},
+  shorttitle   = {Ghost of {John Wayne}},
+  annotation   = {A collection of short stories. This is a book entry.
+                  Note the sorttitle and indextitle fields in
+                  the database file. There's also an isbn field},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A collection of short stories. This is a book entry. Note the
+    sorttitle and indextitle fields in the database file. There's also
+    an isbn field
+  author:
+  - family: Gonzalez
+    given: Ray
+  id: gonzalez
+  isbn: 0-816-52066-6
+  issued: 2001
+  language: en-US
+  publisher: The University of Arizona Press
+  publisher-place: Tucson
+  title: The ghost of John Wayne and other stories
+  title-short: Ghost of John Wayne
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-hammond.md b/test/command/biblatex-hammond.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-hammond.md
@@ -0,0 +1,63 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Hammond 1997)
+
+Hammond, Christopher. 1997. *The Basics of Crystallography and
+Diffraction*. Oxford: International Union of Crystallography; Oxford
+University Press.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Hammond, 1997)
+
+Hammond, C. (1997). *The basics of crystallography and diffraction*.
+Oxford: International Union of Crystallography; Oxford University Press.
+
+
+}
+
+@Book{hammond,
+  author       = {Hammond, Christopher},
+  title        = {The basics of crystallography and diffraction},
+  date         = 1997,
+  publisher    = {International Union of Crystallography and Oxford University
+                  Press},
+  location     = {Oxford},
+  hyphenation  = {british},
+  sorttitle    = {Basics of crystallography and diffraction},
+  indextitle   = {Basics of crystallography and diffraction, The},
+  shorttitle   = {Crystallography and diffraction},
+  annotation   = {A book entry. Note the sorttitle and
+                  indextitle fields as well as the format of the
+                  publisher field},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A book entry. Note the sorttitle and indextitle fields as well
+    as the format of the publisher field
+  author:
+  - family: Hammond
+    given: Christopher
+  id: hammond
+  issued: 1997
+  language: en-GB
+  publisher: International Union of Crystallography; Oxford University
+    Press
+  publisher-place: Oxford
+  title: The basics of crystallography and diffraction
+  title-short: Crystallography and diffraction
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-herrmann.md b/test/command/biblatex-herrmann.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-herrmann.md
@@ -0,0 +1,70 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Herrmann et al. 2006)
+
+Herrmann, Wolfgang A., Karl Öfele, Sabine K. Schneider, Eberhardt
+Herdtweck, and Stephan D. Hoffmann. 2006. “A Carbocyclic Carbene as an
+Efficient Catalyst Ligand for C–C Coupling Reactions.” *Angew. Chem.
+Int. Ed.* 45 (23): 3859–3862.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Herrmann, Öfele, Schneider, Herdtweck, & Hoffmann, 2006)
+
+Herrmann, W. A., Öfele, K., Schneider, S. K., Herdtweck, E., & Hoffmann,
+S. D. (2006). A carbocyclic carbene as an efficient catalyst ligand for
+C–C coupling reactions. *Angew. Chem. Int. Ed.*, *45*(23), 3859–3862.
+
+
+}
+
+@string{ anch-ie = {Angew.~Chem. Int.~Ed.} }
+
+@Article{herrmann,
+  author       = {Herrmann, Wolfgang A. and {\"O}fele, Karl and Schneider,
+                  Sabine K.  and Herdtweck, Eberhardt and Hoffmann, Stephan D.},
+  title        = {A carbocyclic carbene as an efficient catalyst ligand for {C--C}
+                  coupling reactions},
+  journaltitle = anch-ie,
+  date         = 2006,
+  volume       = 45,
+  number       = 23,
+  pages        = {3859-3862},
+  indextitle   = {Carbocyclic carbene as an efficient catalyst, A},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Herrmann
+    given: Wolfgang A.
+  - family: Öfele
+    given: Karl
+  - family: Schneider
+    given: Sabine K.
+  - family: Herdtweck
+    given: Eberhardt
+  - family: Hoffmann
+    given: Stephan D.
+  container-title: Angew. Chem. Int. Ed.
+  id: herrmann
+  issue: 23
+  issued: 2006
+  page: 3859-3862
+  title: A carbocyclic carbene as an efficient catalyst ligand for C--C
+    coupling reactions
+  type: article-journal
+  volume: 45
+---
+
+
+```
diff --git a/test/command/biblatex-hyman.md b/test/command/biblatex-hyman.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-hyman.md
@@ -0,0 +1,79 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Hyman 1981)
+
+Hyman, Arthur. 1981. “Aristotle’s Theory of the Intellect and Its
+Interpretation by Averroes.” In *Studies in Aristotle*, edited by
+Dominic J. O’Meara, 161–191. Studies in Philosophy and the History of
+Philosophy 9. Washington, D.C.: The Catholic University of America
+Press.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Hyman, 1981)
+
+Hyman, A. (1981). Aristotle’s theory of the intellect and its
+interpretation by Averroes. In D. J. O’Meara (Ed.), *Studies in
+Aristotle* (pp. 161–191). Washington, D.C.: The Catholic University of
+America Press.
+
+
+}
+
+@InCollection{hyman,
+  author       = {Arthur Hyman},
+  editor       = {O'Meara, Dominic J.},
+  title        = {Aristotle's Theory of the Intellect and its Interpretation by
+                  {Averroes}},
+  date         = 1981,
+  booktitle    = {Studies in {Aristotle}},
+  series       = {Studies in Philosophy and the History of Philosophy},
+  number       = 9,
+  publisher    = {The Catholic University of America Press},
+  location     = {Washington, D.C.},
+  pages        = {161-191},
+  keywords     = {secondary},
+  hyphenation  = {american},
+  indextitle   = {Aristotle's Theory of the Intellect},
+  shorttitle   = {Aristotle's Theory of the Intellect},
+  annotation   = {An incollection entry with a series and
+                  number field},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: An incollection entry with a series and number field
+  author:
+  - family: Hyman
+    given: Arthur
+  collection-number: 9
+  collection-title: Studies in philosophy and the history of philosophy
+  container-title: Studies in Aristotle
+  editor:
+  - family: O'Meara
+    given: Dominic J.
+  id: hyman
+  issued: 1981
+  keyword: secondary
+  language: en-US
+  page: 161-191
+  publisher: The Catholic University of America Press
+  publisher-place: Washington, D.C.
+  title: Aristotle's theory of the intellect and its interpretation by
+    Averroes
+  title-short: Aristotle's theory of the intellect
+  type: chapter
+---
+
+
+```
diff --git a/test/command/biblatex-iliad.md b/test/command/biblatex-iliad.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-iliad.md
@@ -0,0 +1,68 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Homer 2004)
+
+Homer. 2004. *Die Ilias*. Translated by Wolfgang Schadewaldt. 3rd ed.
+Düsseldorf; Zürich: Artemis & Winkler.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Homer, 2004)
+
+Homer. (2004). *Die Ilias*. (W. Schadewaldt, trans.) (3rd ed.).
+Düsseldorf; Zürich: Artemis & Winkler.
+
+}
+
+@Book{iliad,
+  author       = {Homer},
+  title        = {Die Ilias},
+  date         = 2004,
+  translator   = {Schadewaldt, Wolfgang},
+  introduction = {Latacz, Joachim},
+  edition      = 3,
+  publisher    = {Artemis \& Winkler},
+  location     = {D{\"u}sseldorf and Z{\"u}rich},
+  hyphenation  = {german},
+  sorttitle    = {Ilias},
+  indextitle   = {Ilias, Die},
+  shorttitle   = {Ilias},
+  annotation   = {A German translation of the \emph{Iliad}. Note the
+                  translator and introduction fields and the
+                  format of the location field in the database
+                  file. Also note the sorttitle and indextitle
+                  fields},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A German translation of the *Iliad*. Note the translator and
+    introduction fields and the format of the location field in the
+    database file. Also note the sorttitle and indextitle fields
+  author:
+  - family: Homer
+  edition: 3
+  id: iliad
+  issued: 2004
+  language: de-DE
+  publisher: Artemis & Winkler
+  publisher-place: Düsseldorf; Zürich
+  title: Die Ilias
+  title-short: Ilias
+  translator:
+  - family: Schadewaldt
+    given: Wolfgang
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-inbook-title-booktitle-maintitle-series-2.md b/test/command/biblatex-inbook-title-booktitle-maintitle-series-2.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-inbook-title-booktitle-maintitle-series-2.md
@@ -0,0 +1,48 @@
+```
+% pandoc -f biblatex -t markdown -s
+@inbook{item1,
+	Author = {Author, Al},
+	Bookauthor = {Bookauthor, Bob},
+	Booksubtitle = {Booksubtitle},
+	Booktitle = {Booktitle},
+	Booktitleaddon = {Booktitleaddon},
+	Date = {2011},
+	Hyphenation = {french},
+	Location = {Location},
+	Mainsubtitle = {Mainsubtitle},
+	Maintitle = {Maintitle},
+	Maintitleaddon = {Maintitleaddon},
+	Number = {3},
+	Publisher = {Publisher},
+	Series = {Series},
+	Subtitle = {Subtitle},
+	Title = {Title of the ``inbook'' Entry},
+	Titleaddon = {Titleaddon},
+	Volume = {4}}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Author
+    given: Al
+  collection-number: 3
+  collection-title: Series
+  container-author:
+  - family: Bookauthor
+    given: Bob
+  container-title: "Maintitle: Mainsubtitle. Maintitleaddon"
+  id: item1
+  issued: 2011
+  language: fr-FR
+  publisher: Publisher
+  publisher-place: Location
+  title: "Title of the \"inbook\" Entry: Subtitle. Titleaddon"
+  type: chapter
+  volume: 4
+  volume-title: "Booktitle: Booksubtitle. Booktitleaddon"
+---
+
+
+```
diff --git a/test/command/biblatex-inbook-title-booktitle-maintitle-series.md b/test/command/biblatex-inbook-title-booktitle-maintitle-series.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-inbook-title-booktitle-maintitle-series.md
@@ -0,0 +1,44 @@
+```
+% pandoc -f biblatex -t markdown -s
+@inbook{item1,
+	Author = {Author, Al},
+	Booksubtitle = {Booksubtitle},
+	Booktitle = {Booktitle},
+	Booktitleaddon = {Booktitleaddon},
+	Date = {2011},
+	Hyphenation = {french},
+	Location = {Location},
+	Mainsubtitle = {Mainsubtitle},
+	Maintitle = {Maintitle},
+	Maintitleaddon = {Maintitleaddon},
+	Number = {3},
+	Publisher = {Publisher},
+	Series = {Series},
+	Subtitle = {Subtitle},
+	Title = {Title of the ``inbook'' Entry},
+	Titleaddon = {Titleaddon},
+	Volume = {4}}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Author
+    given: Al
+  collection-number: 3
+  collection-title: Series
+  container-title: "Maintitle: Mainsubtitle. Maintitleaddon"
+  id: item1
+  issued: 2011
+  language: fr-FR
+  publisher: Publisher
+  publisher-place: Location
+  title: "Title of the \"inbook\" Entry: Subtitle. Titleaddon"
+  type: chapter
+  volume: 4
+  volume-title: "Booktitle: Booksubtitle. Booktitleaddon"
+---
+
+
+```
diff --git a/test/command/biblatex-inbook.md b/test/command/biblatex-inbook.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-inbook.md
@@ -0,0 +1,147 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+adapted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib
+
+TODO / citeproc: in biblatex "inbook" entries, citeproc should suppress bookauthor = CSL container-author if identical with author. -- See annotation in kant:kpv.
+}
+
+@string{dtv = {Deutscher Taschenbuch-Verlag}}
+
+@inbook{kant:kpv,
+	Annotation = {An edition of Kant's \emph{Collected Works}, volume five. This is an inbook entry which explicitly refers to the \emph{Critique of Practical Reason} only, not to the entire fifth volume. Note the author and bookauthor fields in the database file. By default, the bookauthor is omitted if the values of the author and bookauthor fields are identical},
+	Author = {Kant, Immanuel},
+	Bookauthor = {Kant, Immanuel},
+	Booktitle = {Kritik der praktischen Vernunft. Kritik der Urtheilskraft},
+	Date = 1968,
+	Hyphenation = {german},
+	Location = {Berlin},
+	Maintitle = {Kants Werke. Akademie Textausgabe},
+	Pages = {1-163},
+	Publisher = {Walter de Gruyter},
+	Shorthand = {KpV},
+	Shorttitle = {Kritik der praktischen Vernunft},
+	Title = {Kritik der praktischen Vernunft},
+	Volume = 5}
+
+@inbook{kant:ku,
+	Annotation = {An edition of Kant's \emph{Collected Works}, volume five. This is an inbook entry which explicitly refers to the \emph{Critique of Judgment} only, not to the entire fifth volume},
+	Author = {Kant, Immanuel},
+	Bookauthor = {Kant, Immanuel},
+	Booktitle = {Kritik der praktischen Vernunft. Kritik der Urtheilskraft},
+	Date = 1968,
+	Hyphenation = {german},
+	Location = {Berlin},
+	Maintitle = {Kants Werke. Akademie Textausgabe},
+	Pages = {165-485},
+	Publisher = {Walter de Gruyter},
+	Shorthand = {KU},
+	Title = {Kritik der Urtheilskraft},
+	Volume = 5}
+
+@inbook{nietzsche:historie,
+	Annotation = {A single essay from the critical edition of Nietzsche's works. This inbook entry explicitly refers to an essay found in the first volume. Note the title, booktitle, and maintitle fields. Also note the sorttitle and sortyear fields. We want this entry to be listed after the entry referring to the entire first volume},
+	Author = {Nietzsche, Friedrich},
+	Bookauthor = {Nietzsche, Friedrich},
+	Booktitle = {Die Geburt der Tragödie. Unzeitgemäße Betrachtungen I--IV. Nachgelassene Schriften 1870--1973},
+	Date = 1988,
+	Editor = {Colli, Giorgio and Montinari, Mazzino},
+	Hyphenation = {german},
+	Indexsorttitle = {Vom Nutzen und Nachtheil der Historie fur das Leben},
+	Indextitle = {Vom Nutzen und Nachtheil der Historie für das Leben},
+	Location = {München and Berlin and New York},
+	Mainsubtitle = {Kritische Studienausgabe},
+	Maintitle = {Sämtliche Werke},
+	Pages = {243-334},
+	Publisher = dtv # { and Walter de Gruyter},
+	Shorttitle = {Vom Nutzen und Nachtheil der Historie},
+	Sorttitle = {Werke-01-243},
+	Sortyear = {1988-2},
+	Subtitle = {Vom Nutzen und Nachtheil der Historie für das Leben},
+	Title = {Unzeitgemässe Betrachtungen. Zweites Stück},
+	Volume = 1}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: An edition of Kant's *Collected Works*, volume five. This is
+    an inbook entry which explicitly refers to the *Critique of
+    Practical Reason* only, not to the entire fifth volume. Note the
+    author and bookauthor fields in the database file. By default, the
+    bookauthor is omitted if the values of the author and bookauthor
+    fields are identical
+  author:
+  - family: Kant
+    given: Immanuel
+  container-author:
+  - family: Kant
+    given: Immanuel
+  container-title: Kants Werke. Akademie Textausgabe
+  id: "kant:kpv"
+  issued: 1968
+  language: de-DE
+  page: 1-163
+  publisher: Walter de Gruyter
+  publisher-place: Berlin
+  title: Kritik der praktischen Vernunft
+  title-short: Kritik der praktischen Vernunft
+  type: chapter
+  volume: 5
+  volume-title: Kritik der praktischen Vernunft. Kritik der
+    Urtheilskraft
+- annote: An edition of Kant's *Collected Works*, volume five. This is
+    an inbook entry which explicitly refers to the *Critique of
+    Judgment* only, not to the entire fifth volume
+  author:
+  - family: Kant
+    given: Immanuel
+  container-author:
+  - family: Kant
+    given: Immanuel
+  container-title: Kants Werke. Akademie Textausgabe
+  id: "kant:ku"
+  issued: 1968
+  language: de-DE
+  page: 165-485
+  publisher: Walter de Gruyter
+  publisher-place: Berlin
+  title: Kritik der Urtheilskraft
+  type: chapter
+  volume: 5
+  volume-title: Kritik der praktischen Vernunft. Kritik der
+    Urtheilskraft
+- annote: A single essay from the critical edition of Nietzsche's works.
+    This inbook entry explicitly refers to an essay found in the first
+    volume. Note the title, booktitle, and maintitle fields. Also note
+    the sorttitle and sortyear fields. We want this entry to be listed
+    after the entry referring to the entire first volume
+  author:
+  - family: Nietzsche
+    given: Friedrich
+  container-author:
+  - family: Nietzsche
+    given: Friedrich
+  container-title: "Sämtliche Werke: Kritische Studienausgabe"
+  editor:
+  - family: Colli
+    given: Giorgio
+  - family: Montinari
+    given: Mazzino
+  id: "nietzsche:historie"
+  issued: 1988
+  language: de-DE
+  page: 243-334
+  publisher: Deutscher Taschenbuch-Verlag; Walter de Gruyter
+  publisher-place: München; Berlin; New York
+  title: "Unzeitgemässe Betrachtungen. Zweites Stück: Vom Nutzen und
+    Nachtheil der Historie für das Leben"
+  title-short: Vom Nutzen und Nachtheil der Historie
+  type: chapter
+  volume: 1
+  volume-title: Die Geburt der Tragödie. Unzeitgemäße Betrachtungen
+    I--IV. Nachgelassene Schriften 1870--1973
+---
+
+
+```
diff --git a/test/command/biblatex-incollection-2.md b/test/command/biblatex-incollection-2.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-incollection-2.md
@@ -0,0 +1,98 @@
+```
+% pandoc -f biblatex -t markdown -s
+
+@comment{adapted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib}
+
+
+@string{hup = {Harvard University Press}}
+
+
+@incollection{westfahl:space,
+	Annotation = {A cross-referenced article from a collection. This is an incollection entry with a crossref field. Note the subtitle and indextitle fields},
+	Author = {Westfahl, Gary},
+	Crossref = {westfahl:frontier},
+	Hyphenation = {american},
+	Indextitle = {True Frontier, The},
+	Pages = {55-65},
+	Subtitle = {Confronting and Avoiding the Realities of Space in {American} Science Fiction Films},
+	Title = {The True Frontier}}
+
+@incollection{gaonkar:in,
+	Author = {Gaonkar, Dilip Parameshwar},
+	Booktitle = {Alternative Modernities},
+	Date = 2001,
+	Editor = {Gaonkar, Dilip Parameshwar},
+	Isbn = {0-822-32714-7},
+	Location = {Durham and London},
+	Pages = {1-23},
+	Publisher = {Duke University Press},
+	Title = {On Alternative Modernities}}
+
+@collection{westfahl:frontier,
+	Annotation = {This is a collection entry. Note the format of the location field as well as the subtitle and booksubtitle fields},
+	Booksubtitle = {The Frontier Theme in Science Fiction},
+	Booktitle = {Space and Beyond},
+	Date = 2000,
+	Editor = {Westfahl, Gary},
+	Hyphenation = {american},
+	Location = {Westport, Conn. and London},
+	Publisher = {Greenwood},
+	Subtitle = {The Frontier Theme in Science Fiction},
+	Title = {Space and Beyond}}
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A cross-referenced article from a collection. This is an
+    incollection entry with a crossref field. Note the subtitle and
+    indextitle fields
+  author:
+  - family: Westfahl
+    given: Gary
+  container-title: "Space and beyond: The frontier theme in science
+    fiction"
+  editor:
+  - family: Westfahl
+    given: Gary
+  id: "westfahl:space"
+  issued: 2000
+  language: en-US
+  page: 55-65
+  publisher: Greenwood
+  publisher-place: Westport, Conn.; London
+  title: "The true frontier: Confronting and avoiding the realities of
+    space in American science fiction films"
+  title-short: The true frontier
+  type: chapter
+- author:
+  - family: Gaonkar
+    given: Dilip Parameshwar
+  container-title: Alternative modernities
+  editor:
+  - family: Gaonkar
+    given: Dilip Parameshwar
+  id: "gaonkar:in"
+  isbn: 0-822-32714-7
+  issued: 2001
+  page: 1-23
+  publisher: Duke University Press
+  publisher-place: Durham; London
+  title: On alternative modernities
+  type: chapter
+- annote: This is a collection entry. Note the format of the location
+    field as well as the subtitle and booksubtitle fields
+  editor:
+  - family: Westfahl
+    given: Gary
+  id: "westfahl:frontier"
+  issued: 2000
+  language: en-US
+  publisher: Greenwood
+  publisher-place: Westport, Conn.; London
+  title: "Space and beyond: The frontier theme in science fiction"
+  title-short: Space and beyond
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-incollection.md b/test/command/biblatex-incollection.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-incollection.md
@@ -0,0 +1,130 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{adapted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib}
+
+@string{hup = {Harvard University Press}}
+
+@incollection{brandt,
+	Annotation = {An incollection entry with a series and a number. Note the format of the printed name and compare the useprefix option in the options field as well as vangennep. Also note the indextitle, and indexsorttitle fields},
+	Author = {von Brandt, Ahasver and Hoffmann, Erich},
+	Booktitle = {Europa im Hoch- und Spätmittelalter},
+	Date = 1987,
+	Editor = {Seibt, Ferdinand},
+	Hyphenation = {german},
+	Indexsorttitle = {Nordischen Lander von der Mitte des 11. Jahrhunderts bis 1448},
+	Indextitle = {Nordischen Länder von der Mitte des 11.~Jahrhunderts bis 1448, Die},
+	Location = {Stuttgart},
+	Number = 2,
+	Options = {useprefix=false},
+	Pages = {884-917},
+	Publisher = {Klett-Cotta},
+	Series = {Handbuch der europäischen Geschichte},
+	Shorttitle = {Die nordischen Länder},
+	Title = {Die nordischen Länder von der Mitte des 11.~Jahrhunderts bis 1448}}
+
+@incollection{hyman,
+	Annotation = {An incollection entry with a series and number field},
+	Author = {Hyman, Arthur},
+	Booktitle = {Studies in {Aristotle}},
+	Date = 1981,
+	Editor = {O'Meara, Dominic J.},
+	Hyphenation = {american},
+	Indextitle = {Aristotle's Theory of the Intellect},
+	Keywords = {secondary},
+	Location = {Washington, D.C.},
+	Number = 9,
+	Pages = {161-191},
+	Publisher = {The Catholic University of America Press},
+	Series = {Studies in Philosophy and the History of Philosophy},
+	Shorttitle = {Aristotle's Theory of the Intellect},
+	Title = {Aristotle's Theory of the Intellect and its Interpretation by {Averroes}}}
+
+@incollection{pines,
+	Annotation = {A typical incollection entry. Note the indextitle field},
+	Author = {Pines, Shlomo},
+	Booktitle = {Studies in Medieval {Jewish} History and Literature},
+	Date = 1979,
+	Editor = {Twersky, Isadore},
+	Hyphenation = {american},
+	Indextitle = {Limitations of Human Knowledge According to Al-Farabi, ibn Bajja, and Maimonides, The},
+	Keywords = {secondary},
+	Location = {Cambridge, Mass.},
+	Pages = {82-109},
+	Publisher = hup,
+	Shorttitle = {Limitations of Human Knowledge},
+	Title = {The Limitations of Human Knowledge According to {Al-Farabi}, {ibn Bajja}, and {Maimonides}}}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: An incollection entry with a series and a number. Note the
+    format of the printed name and compare the useprefix option in the
+    options field as well as vangennep. Also note the indextitle, and
+    indexsorttitle fields
+  author:
+  - dropping-particle: von
+    family: Brandt
+    given: Ahasver
+  - family: Hoffmann
+    given: Erich
+  collection-number: 2
+  collection-title: Handbuch der europäischen Geschichte
+  container-title: Europa im Hoch- und Spätmittelalter
+  editor:
+  - family: Seibt
+    given: Ferdinand
+  id: brandt
+  issued: 1987
+  language: de-DE
+  page: 884-917
+  publisher: Klett-Cotta
+  publisher-place: Stuttgart
+  title: Die nordischen Länder von der Mitte des 11. Jahrhunderts bis
+    1448
+  title-short: Die nordischen Länder
+  type: chapter
+- annote: An incollection entry with a series and number field
+  author:
+  - family: Hyman
+    given: Arthur
+  collection-number: 9
+  collection-title: Studies in philosophy and the history of philosophy
+  container-title: Studies in Aristotle
+  editor:
+  - family: O'Meara
+    given: Dominic J.
+  id: hyman
+  issued: 1981
+  keyword: secondary
+  language: en-US
+  page: 161-191
+  publisher: The Catholic University of America Press
+  publisher-place: Washington, D.C.
+  title: Aristotle's theory of the intellect and its interpretation by
+    Averroes
+  title-short: Aristotle's theory of the intellect
+  type: chapter
+- annote: A typical incollection entry. Note the indextitle field
+  author:
+  - family: Pines
+    given: Shlomo
+  container-title: Studies in medieval Jewish history and literature
+  editor:
+  - family: Twersky
+    given: Isadore
+  id: pines
+  issued: 1979
+  keyword: secondary
+  language: en-US
+  page: 82-109
+  publisher: Harvard University Press
+  publisher-place: Cambridge, Mass.
+  title: The limitations of human knowledge according to Al-Farabi, [ibn
+    Bajja]{.nocase}, and Maimonides
+  title-short: Limitations of human knowledge
+  type: chapter
+---
+
+
+```
diff --git a/test/command/biblatex-inproceedings.md b/test/command/biblatex-inproceedings.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-inproceedings.md
@@ -0,0 +1,88 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{adapted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib}
+
+@string{cup = {Cambridge University Press}}
+
+@inproceedings{moraux,
+	Annotation = {This is a typical inproceedings entry. Note the booksubtitle, shorttitle, indextitle, and indexsorttitle fields. Also note the eventdate field.},
+	Author = {Moraux, Paul},
+	Booktitle = {Aristotle on Mind and the Senses},
+	Booktitleaddon = {Proceedings of the Seventh Symposium Aristotelicum},
+	Date = 1979,
+	Editor = {Lloyd, G. E. R. and Owen, G. E. L.},
+	Eventdate = 1975,
+	Hyphenation = {french},
+	Indexsorttitle = {De Anima dans la tradition grecque},
+	Indextitle = {\emph{De Anima} dans la tradition grècque, Le},
+	Keywords = {secondary},
+	Location = {Cambridge},
+	Pages = {281-324},
+	Publisher = cup,
+	Shorttitle = {\emph{De Anima} dans la tradition grècque},
+	Subtitle = {Quelques aspects de l'interpretation du traité, de Theophraste à Themistius},
+	Title = {Le \emph{De Anima} dans la tradition grècque}}
+
+@inproceedings{salam,
+	Author = {Salam, Abdus},
+	Booksubtitle = {Relativistic groups and analyticity},
+	Booktitle = {Elementary particle theory},
+	Booktitleaddon = {Proceedings of the Eighth {Nobel} Symposium},
+	Date = 1968,
+	Editor = {Svartholm, Nils},
+	Eventdate = {1968-05-19/1968-05-25},
+	Location = {Stockholm},
+	Pages = {367-377},
+	Publisher = {Almquist \& Wiksell},
+	Title = {Weak and Electromagnetic Interactions},
+	Venue = {Aspenäsgarden, Lerum}}
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a typical inproceedings entry. Note the booksubtitle,
+    shorttitle, indextitle, and indexsorttitle fields. Also note the
+    eventdate field.
+  author:
+  - family: Moraux
+    given: Paul
+  container-title: Aristotle on Mind and the Senses. Proceedings of the
+    Seventh Symposium Aristotelicum
+  editor:
+  - family: Lloyd
+    given: G. E. R.
+  - family: Owen
+    given: G. E. L.
+  event-date: 1975
+  id: moraux
+  issued: 1979
+  keyword: secondary
+  language: fr-FR
+  page: 281-324
+  publisher: Cambridge University Press
+  publisher-place: Cambridge
+  title: "Le *De Anima* dans la tradition grècque: Quelques aspects de
+    l'interpretation du traité, de Theophraste à Themistius"
+  title-short: *De Anima* dans la tradition grècque
+  type: paper-conference
+- author:
+  - family: Salam
+    given: Abdus
+  container-title: "Elementary particle theory: Relativistic groups and
+    analyticity. Proceedings of the eighth Nobel symposium"
+  editor:
+  - family: Svartholm
+    given: Nils
+  event-date: 1968-05-19/1968-05-25
+  event-place: Aspenäsgarden, Lerum
+  id: salam
+  issued: 1968
+  page: 367-377
+  publisher: Almquist & Wiksell
+  publisher-place: Stockholm
+  title: Weak and electromagnetic interactions
+  type: paper-conference
+---
+
+
+```
diff --git a/test/command/biblatex-issue288.md b/test/command/biblatex-issue288.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-issue288.md
@@ -0,0 +1,35 @@
+```
+% pandoc -f biblatex -t markdown -s
+@thesis{Leavitt_2016,
+location = {{Los Angeles, CA}},
+title = {Upvoting the News: {{Breaking}} News Aggregation, Crowd Collaboration,
+and Algorithm-Driven Attention on Reddit.Com},
+timestamp = {2017-04-06T14:13:22Z},
+langid = {english},
+institution = {{University of Southern California}},
+type = {Dissertation},
+author = {Leavitt, Alex},
+date = {2016-08},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Leavitt
+    given: Alex
+  genre: Dissertation
+  id: Leavitt_2016
+  issued: 2016-08
+  language: en-US
+  publisher: University of Southern California
+  publisher-place: Los Angeles, CA
+  title: "Upvoting the news: Breaking news aggregation, crowd
+    collaboration, and algorithm-driven attention on reddit.com"
+  title-short: Upvoting the news
+  type: thesis
+---
+
+
+```
diff --git a/test/command/biblatex-itzhaki.md b/test/command/biblatex-itzhaki.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-itzhaki.md
@@ -0,0 +1,82 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Itzhaki 1996)
+
+Itzhaki, Nissan. 1996. “Some Remarks on ’t Hooft’s S-matrix for Black
+Holes” (version 1). March 11.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Itzhaki, 1996)
+
+Itzhaki, N. (1996, March 11). Some remarks on ’t Hooft’s S-matrix for
+black holes.
+
+
+NOTES:
+
+- biblio2yaml:
+	- eprinttype = {arxiv}, eprint = {hep-th/9603067}, 
+	  should be converted to a url: http://arxiv.org/abs/hep-th/9603067
+	  (prefix http://arxiv.org/abs/ seems to work for all arxiv material)
+
+- citeproc:
+	- obtaining correct case of "'t Hooft's" in title is possible but awkward:
+	  '{t Hooft's} works; {'t Hooft}'s or '{t Hooft}'s do not
+
+}
+
+@Online{itzhaki,
+  author       = {Itzhaki, Nissan},
+  title        = {Some remarks on '{t Hooft's} {S}-matrix for black holes},
+  date         = {1996-03-11},
+  version      = 1,
+  hyphenation  = {american},
+  eprinttype   = {arxiv},
+  eprint       = {hep-th/9603067},
+  annotation   = {An online reference from arXiv. Note the
+                  eprint and eprinttype fields. Also note that
+                  the arXiv reference is transformed into a clickable link if
+                  hyperref support has been enabled},
+  abstract     = {We discuss the limitations of 't Hooft's proposal for the
+                  black hole S-matrix. We find that the validity of the S-matrix
+                  implies violation of the semi-classical approximation at
+                  scales large compared to the Planck scale. We also show that
+                  the effect of the centrifugal barrier on the S-matrix is
+                  crucial even for large transverse distances.},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- abstract: We discuss the limitations of 't Hooft's proposal for the
+    black hole S-matrix. We find that the validity of the S-matrix
+    implies violation of the semi-classical approximation at scales
+    large compared to the Planck scale. We also show that the effect of
+    the centrifugal barrier on the S-matrix is crucial even for large
+    transverse distances.
+  annote: An online reference from arXiv. Note the eprint and eprinttype
+    fields. Also note that the arXiv reference is transformed into a
+    clickable link if hyperref support has been enabled
+  author:
+  - family: Itzhaki
+    given: Nissan
+  id: itzhaki
+  issued: 1996-03-11
+  language: en-US
+  title: Some remarks on '[t Hooft's]{.nocase} S-matrix for black holes
+  type: webpage
+  url: "http://arxiv.org/abs/hep-th/9603067"
+  version: 1
+---
+
+
+```
diff --git a/test/command/biblatex-jaffe.md b/test/command/biblatex-jaffe.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-jaffe.md
@@ -0,0 +1,82 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Jaffé 1885–1888)
+
+Jaffé, Philipp, ed. 1885–1888. *Regesta Pontificum Romanorum ab condita
+ecclesia ad annum post Christum natum \<span
+Style="font-variant:small-caps;"\>mcxcviii\</span\>*. 2nd ed. 2.
+Leipzig.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Jaffé, 1885–1888)
+
+Jaffé, P. (Ed.). (1885–1888). *Regesta Pontificum Romanorum ab condita
+ecclesia ad annum post Christum natum \<span
+style="font-variant:small-caps;"\>mcxcviii\</span\>* (2nd ed., 1-2).
+Leipzig.
+
+
+NOTES:
+
+- biblatex conversion:
+	- hyphenation = {latin}
+- citeproc:
+	- "vols." is missing
+		- works in Zotero
+		- This does not show up in the tests from the citeproc test suite that currently fail.
+	- "\<span ...\> needs to be fixed.
+		- maybe add markdown syntax ^^small caps^^ ?
+		- in pandoc "plain" output, small caps could be converted to uppercase chars: "MCXCVIII" would definitely look better here.
+
+}
+
+@Collection{jaffe,
+  editor       = {Jaff{\'e}, Philipp},
+  title        = {Regesta Pontificum Romanorum ab condita ecclesia ad annum post
+                  Christum natum \textsc{mcxcviii}},
+  date         = {1885/1888},
+  editora      = {Loewenfeld, Samuel and Kaltenbrunner, Ferdinand and Ewald,
+                  Paul},
+  edition      = 2,
+  volumes      = 2,
+  location     = {Leipzig},
+  editoratype  = {redactor},
+  indextitle   = {Regesta Pontificum Romanorum},
+  shorttitle   = {Regesta Pontificum Romanorum},
+  annotation   = {A collection entry with edition and
+                  volumes fields. Note the editora and
+                  editoratype fields},
+  hyphenation  = {latin},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A collection entry with edition and volumes fields. Note the
+    editora and editoratype fields
+  edition: 2
+  editor:
+  - family: Jaffé
+    given: Philipp
+  id: jaffe
+  issued: 1885/1888
+  language: la
+  number-of-volumes: 2
+  publisher-place: Leipzig
+  title: "Regesta Pontificum Romanorum ab condita ecclesia ad annum post
+    Christum natum [mcxcviii]{.smallcaps}"
+  title-short: Regesta Pontificum Romanorum
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-jcg.md b/test/command/biblatex-jcg.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-jcg.md
@@ -0,0 +1,54 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(“Semantic 3D Media and Content” 2011)
+
+“Semantic 3D Media and Content.” 2011. *Computers and Graphics* 35 (4).
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(“Semantic 3D media and content,” 2011)
+
+Semantic 3D media and content. (2011). *Computers and Graphics*,
+*35*(4).
+
+
+NOTES:
+	- output looks OK even if indistinguishable from article without page numbers
+
+}
+
+@Periodical{jcg,
+  title        = {Computers and Graphics},
+  year         = 2011,
+  issuetitle   = {Semantic {3D} Media and Content},
+  volume       = 35,
+  number       = 4,
+  issn         = {0097-8493},
+  annotation   = {This is a periodical entry with an issn
+                  field.},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a periodical entry with an issn field.
+  container-title: Computers and Graphics
+  id: jcg
+  issn: 0097-8493
+  issue: 4
+  issued: 2011
+  title: Semantic 3D media and content
+  type: article-journal
+  volume: 35
+---
+
+
+```
diff --git a/test/command/biblatex-kant-kpv.md b/test/command/biblatex-kant-kpv.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-kant-kpv.md
@@ -0,0 +1,90 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Kant 1968)
+
+Kant, Immanuel. 1968. “Kritik der praktischen Vernunft.” In *Kants
+Werke. Akademie Textausgabe*, by Immanuel Kant, 5:1–163. Berlin: Walter
+de Gruyter.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Kant, 1968)
+
+Kant, I. (1968). Kritik der praktischen Vernunft. In *Kants Werke.
+Akademie Textausgabe* (Vol. 5, pp. 1–163). Berlin: Walter de Gruyter.
+
+
+NOTES:
+
+- citeproc
+	- support for the not yet official "volume-title" is missing
+
+- csl style file
+	- if author and container-author are identical, container-author should be suppressed (apparently csl style file issue; zotero shows same behaviour)
+
+}
+
+@InBook{kant:kpv,
+  title        = {Kritik der praktischen Vernunft},
+  date         = 1968,
+  author       = {Kant, Immanuel},
+  booktitle    = {Kritik der praktischen Vernunft. Kritik der Urtheilskraft},
+  bookauthor   = {Kant, Immanuel},
+  maintitle    = {Kants Werke. Akademie Textausgabe},
+  volume       = 5,
+  publisher    = {Walter de Gruyter},
+  location     = {Berlin},
+  pages        = {1-163},
+  shorthand    = {KpV},
+  hyphenation  = {german},
+  shorttitle   = {Kritik der praktischen Vernunft},
+  annotation   = {An edition of Kant's \emph{Collected Works}, volume five. This
+                  is an inbook entry which explicitly refers to the
+                  \emph{Critique of Practical Reason} only, not to the entire
+                  fifth volume. Note the author and bookauthor
+                  fields in the database file. By default, the
+                  bookauthor is omitted if the values of the
+                  author and bookauthor fields are identical},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: An edition of Kant's *Collected Works*, volume five. This is
+    an inbook entry which explicitly refers to the *Critique of
+    Practical Reason* only, not to the entire fifth volume. Note the
+    author and bookauthor fields in the database file. By default, the
+    bookauthor is omitted if the values of the author and bookauthor
+    fields are identical
+  author:
+  - family: Kant
+    given: Immanuel
+  container-author:
+  - family: Kant
+    given: Immanuel
+  container-title: Kants Werke. Akademie Textausgabe
+  id: "kant:kpv"
+  issued: 1968
+  language: de-DE
+  page: 1-163
+  publisher: Walter de Gruyter
+  publisher-place: Berlin
+  title: Kritik der praktischen Vernunft
+  title-short: Kritik der praktischen Vernunft
+  type: chapter
+  volume: 5
+  volume-title: Kritik der praktischen Vernunft. Kritik der
+    Urtheilskraft
+---
+
+
+```
diff --git a/test/command/biblatex-kant-ku.md b/test/command/biblatex-kant-ku.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-kant-ku.md
@@ -0,0 +1,82 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Kant 1968)
+
+Kant, Immanuel. 1968. “Kritik der Urtheilskraft.” In *Kants Werke.
+Akademie Textausgabe*, by Immanuel Kant, 5:165–485. Berlin: Walter de
+Gruyter.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Kant, 1968)
+
+Kant, I. (1968). Kritik der Urtheilskraft. In *Kants Werke. Akademie
+Textausgabe* (Vol. 5, pp. 165–485). Berlin: Walter de Gruyter.
+
+
+NOTES:
+
+- citeproc
+	- support for the not yet official "volume-title" is missing
+	
+- CSL style file
+	- if author and container-author are identical, container-author should be suppressed (apparently csl style file issue; zotero shows same behaviour)
+
+}
+
+@InBook{kant:ku,
+  title        = {Kritik der Urtheilskraft},
+  date         = 1968,
+  author       = {Kant, Immanuel},
+  booktitle    = {Kritik der praktischen Vernunft. Kritik der Urtheilskraft},
+  bookauthor   = {Kant, Immanuel},
+  maintitle    = {Kants Werke. Akademie Textausgabe},
+  volume       = 5,
+  publisher    = {Walter de Gruyter},
+  location     = {Berlin},
+  pages        = {165-485},
+  shorthand    = {KU},
+  hyphenation  = {german},
+  annotation   = {An edition of Kant's \emph{Collected Works}, volume five. This
+                  is an inbook entry which explicitly refers to the
+                  \emph{Critique of Judgment} only, not to the entire fifth
+                  volume},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: An edition of Kant's *Collected Works*, volume five. This is
+    an inbook entry which explicitly refers to the *Critique of
+    Judgment* only, not to the entire fifth volume
+  author:
+  - family: Kant
+    given: Immanuel
+  container-author:
+  - family: Kant
+    given: Immanuel
+  container-title: Kants Werke. Akademie Textausgabe
+  id: "kant:ku"
+  issued: 1968
+  language: de-DE
+  page: 165-485
+  publisher: Walter de Gruyter
+  publisher-place: Berlin
+  title: Kritik der Urtheilskraft
+  type: chapter
+  volume: 5
+  volume-title: Kritik der praktischen Vernunft. Kritik der
+    Urtheilskraft
+---
+
+
+```
diff --git a/test/command/biblatex-kastenholz.md b/test/command/biblatex-kastenholz.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-kastenholz.md
@@ -0,0 +1,126 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Kastenholz and Hünenberger 2006)
+
+Kastenholz, M. A., and Philippe H. Hünenberger. 2006. “Computation of
+Methodologyindependent Ionic Solvation Free Energies from Molecular
+Simulations: I. the Electrostatic Potential in Molecular Liquids.”
+*J. Chem. Phys.* 124.
+doi:[10.1063/1.2172593](https://doi.org/10.1063/1.2172593 "10.1063/1.2172593").
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Kastenholz & Hünenberger, 2006)
+
+Kastenholz, M. A., & Hünenberger, P. H. (2006). Computation of
+methodologyindependent ionic solvation free energies from molecular
+simulations: I. the electrostatic potential in molecular liquids.
+*J. Chem. Phys.*, *124*.
+doi:[10.1063/1.2172593](https://doi.org/10.1063/1.2172593 "10.1063/1.2172593")
+
+
+NOTES:
+
+- biblio2xaml
+	- fix conversion of "\hyphen”
+	- the string "doi:" should not appear as part of the content of the "doi" field 
+
+}
+
+@string{ jchph   = {J.~Chem. Phys.} }
+
+@Article{kastenholz,
+  author       = {Kastenholz, M. A. and H{\"u}nenberger, Philippe H.},
+  title        = {Computation of methodology\hyphen independent ionic solvation
+                  free energies from molecular simulations},
+  journaltitle = jchph,
+  date         = 2006,
+  subtitle     = {I. {The} electrostatic potential in molecular liquids},
+  volume       = 124,
+  eid          = 124106,
+  doi          = {10.1063/1.2172593},
+  hyphenation  = {american},
+  indextitle   = {Computation of ionic solvation free energies},
+  annotation   = {An article entry with an eid and a
+                  doi field. Note that the \textsc{doi} is transformed
+                  into a clickable link if hyperref support has been
+                  enabled},
+  abstract     = {The computation of ionic solvation free energies from
+                  atomistic simulations is a surprisingly difficult problem that
+                  has found no satisfactory solution for more than 15 years. The
+                  reason is that the charging free energies evaluated from such
+                  simulations are affected by very large errors. One of these is
+                  related to the choice of a specific convention for summing up
+                  the contributions of solvent charges to the electrostatic
+                  potential in the ionic cavity, namely, on the basis of point
+                  charges within entire solvent molecules (M scheme) or on the
+                  basis of individual point charges (P scheme). The use of an
+                  inappropriate convention may lead to a charge-independent
+                  offset in the calculated potential, which depends on the
+                  details of the summation scheme, on the quadrupole-moment
+                  trace of the solvent molecule, and on the approximate form
+                  used to represent electrostatic interactions in the
+                  system. However, whether the M or P scheme (if any) represents
+                  the appropriate convention is still a matter of on-going
+                  debate. The goal of the present article is to settle this
+                  long-standing controversy by carefully analyzing (both
+                  analytically and numerically) the properties of the
+                  electrostatic potential in molecular liquids (and inside
+                  cavities within them).},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- abstract: The computation of ionic solvation free energies from
+    atomistic simulations is a surprisingly difficult problem that has
+    found no satisfactory solution for more than 15 years. The reason is
+    that the charging free energies evaluated from such simulations are
+    affected by very large errors. One of these is related to the choice
+    of a specific convention for summing up the contributions of solvent
+    charges to the electrostatic potential in the ionic cavity, namely,
+    on the basis of point charges within entire solvent molecules (M
+    scheme) or on the basis of individual point charges (P scheme). The
+    use of an inappropriate convention may lead to a charge-independent
+    offset in the calculated potential, which depends on the details of
+    the summation scheme, on the quadrupole-moment trace of the solvent
+    molecule, and on the approximate form used to represent
+    electrostatic interactions in the system. However, whether the M or
+    P scheme (if any) represents the appropriate convention is still a
+    matter of on-going debate. The goal of the present article is to
+    settle this long-standing controversy by carefully analyzing (both
+    analytically and numerically) the properties of the electrostatic
+    potential in molecular liquids (and inside cavities within them).
+  annote: An article entry with an eid and a doi field. Note that the
+    [doi]{.smallcaps} is transformed into a clickable link if hyperref
+    support has been enabled
+  author:
+  - family: Kastenholz
+    given: M. A.
+  - family: Hünenberger
+    given: Philippe H.
+  container-title: J. Chem. Phys.
+  doi: 10.1063/1.2172593
+  id: kastenholz
+  issued: 2006
+  language: en-US
+  title: "Computation of methodology-independent ionic solvation free
+    energies from molecular simulations: I. The electrostatic potential
+    in molecular liquids"
+  title-short: Computation of methodology-independent ionic solvation
+    free energies from molecular simulations
+  type: article-journal
+  volume: 124
+---
+
+
+```
diff --git a/test/command/biblatex-knuth-ct-a.md b/test/command/biblatex-knuth-ct-a.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-knuth-ct-a.md
@@ -0,0 +1,78 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Knuth 1984)
+
+Knuth, Donald E. 1984. *Computers & Typesetting*. Vol. A. Reading,
+Mass.: Addison-Wesley.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Knuth, 1984)
+
+Knuth, D. E. (1984). *Computers & typesetting* (Vol. A). Reading, Mass.:
+Addison-Wesley.
+
+
+NOTES:
+
+- volume-title currently not implemented by chicago-author-date.csl and apa.csl.
+
+}
+
+@Book{knuth:ct:a,
+  author       = {Knuth, Donald E.},
+  title        = {The {\TeX} book},
+  date         = 1984,
+  maintitle    = {Computers \& Typesetting},
+  volume       = {A},
+  publisher    = {Addison-Wesley},
+  location     = {Reading, Mass.},
+  hyphenation  = {american},
+  sortyear     = {1984-1},
+  sorttitle    = {Computers & Typesetting A},
+  indexsorttitle= {The TeXbook},
+  indextitle   = {\protect\TeX book, The},
+  shorttitle   = {\TeX book},
+  annotation   = {The first volume of a five-volume book. Note the
+                  sorttitle and sortyear fields. We want this
+                  volume to be listed after the entry referring to the entire
+                  five-volume set. Also note the indextitle and
+                  indexsorttitle fields. Indexing packages that don't
+                  generate robust index entries require some control sequences
+                  to be protected from expansion},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: The first volume of a five-volume book. Note the sorttitle and
+    sortyear fields. We want this volume to be listed after the entry
+    referring to the entire five-volume set. Also note the indextitle
+    and indexsorttitle fields. Indexing packages that don't generate
+    robust index entries require some control sequences to be protected
+    from expansion
+  author:
+  - family: Knuth
+    given: Donald E.
+  id: "knuth:ct:a"
+  issued: 1984
+  language: en-US
+  publisher: Addison-Wesley
+  publisher-place: Reading, Mass.
+  title: Computers & typesetting
+  type: book
+  volume: A
+  volume-title: The TeX book
+---
+
+
+```
diff --git a/test/command/biblatex-knuth-ct-b.md b/test/command/biblatex-knuth-ct-b.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-knuth-ct-b.md
@@ -0,0 +1,70 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2015-03-08:
+
+(Knuth 1986)
+
+Knuth, Donald E. 1986. *Computers & Typesetting*. Vol. B. Reading,
+Mass.: Addison-Wesley.
+
+
+Formatted with pandoc and apa.csl, 2015-03-08:
+
+(Knuth, 1986)
+
+Knuth, D. E. (1986). *Computers & typesetting* (Vol. B). Reading, Mass.:
+Addison-Wesley.
+
+
+NOTES:
+
+- volume-title currently not implemented by chicago-author-date.csl and apa.csl.
+
+}
+
+@Book{knuth:ct:b,
+  author       = {Knuth, Donald E.},
+  title        = {\TeX: {T}he Program},
+  date         = 1986,
+  maintitle    = {Computers \& Typesetting},
+  volume       = {B},
+  publisher    = {Addison-Wesley},
+  location     = {Reading, Mass.},
+  hyphenation  = {american},
+  sortyear     = {1986-1},
+  sorttitle    = {Computers & Typesetting B},
+  indexsorttitle= {TeX: The Program},
+  shorttitle   = {\TeX},
+  annotation   = {The second volume of a five-volume book. Note the
+                  sorttitle and sortyear fields. Also note the
+                  indexsorttitle field},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: The second volume of a five-volume book. Note the sorttitle
+    and sortyear fields. Also note the indexsorttitle field
+  author:
+  - family: Knuth
+    given: Donald E.
+  id: "knuth:ct:b"
+  issued: 1986
+  language: en-US
+  publisher: Addison-Wesley
+  publisher-place: Reading, Mass.
+  title: Computers & typesetting
+  title-short: TeX
+  type: book
+  volume: B
+  volume-title: "TeX: The program"
+---
+
+
+```
diff --git a/test/command/biblatex-knuth-ct-c.md b/test/command/biblatex-knuth-ct-c.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-knuth-ct-c.md
@@ -0,0 +1,69 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2015-03-08:
+
+(Knuth 1986)
+
+Knuth, Donald E. 1986. *Computers & Typesetting*. Vol. C. Reading,
+Mass.: Addison-Wesley.
+
+
+Formatted with pandoc and apa.csl, 2015-03-08:
+
+(Knuth, 1986)
+
+Knuth, D. E. (1986). *Computers & typesetting* (Vol. C). Reading, Mass.:
+Addison-Wesley.
+
+
+NOTES:
+
+- volume-title currently not implemented by chicago-author-date.csl and apa.csl.
+
+}
+
+@Book{knuth:ct:c,
+  author       = {Knuth, Donald E.},
+  title        = {The {METAFONTbook}},
+  date         = 1986,
+  maintitle    = {Computers \& Typesetting},
+  volume       = {C},
+  publisher    = {Addison-Wesley},
+  location     = {Reading, Mass.},
+  hyphenation  = {american},
+  sortyear     = {1986-2},
+  sorttitle    = {Computers & Typesetting C},
+  indextitle   = {METAFONTbook, The},
+  shorttitle   = {{METAFONTbook}},
+  annotation   = {The third volume of a five-volume book. Note the
+                  sorttitle and sortyear fields as well as the
+                  indextitle field},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: The third volume of a five-volume book. Note the sorttitle and
+    sortyear fields as well as the indextitle field
+  author:
+  - family: Knuth
+    given: Donald E.
+  id: "knuth:ct:c"
+  issued: 1986
+  language: en-US
+  publisher: Addison-Wesley
+  publisher-place: Reading, Mass.
+  title: Computers & typesetting
+  type: book
+  volume: C
+  volume-title: The METAFONTbook
+---
+
+
+```
diff --git a/test/command/biblatex-knuth-ct-d.md b/test/command/biblatex-knuth-ct-d.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-knuth-ct-d.md
@@ -0,0 +1,71 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2015-03-08:
+
+(Knuth 1986)
+
+Knuth, Donald E. 1986. *Computers & Typesetting*. Vol. D. Reading,
+Mass.: Addison-Wesley.
+
+
+Formatted with pandoc and apa.csl, 2015-03-08:
+
+(Knuth, 1986)
+
+Knuth, D. E. (1986). *Computers & typesetting* (Vol. D). Reading, Mass.:
+Addison-Wesley.
+
+
+NOTES:
+
+- biblio2yaml
+	- Should letters following a colon, such as the "T" in "{{METAFONT}: {T}he Program}" be protected by default? -- I'm not sure ...
+
+- volume-title currently not implemented by chicago-author-date.csl and apa.csl.
+
+}
+
+@Book{knuth:ct:d,
+  author       = {Knuth, Donald E.},
+  title        = {{METAFONT}: {T}he Program},
+  date         = 1986,
+  maintitle    = {Computers \& Typesetting},
+  volume       = {D},
+  publisher    = {Addison-Wesley},
+  location     = {Reading, Mass.},
+  hyphenation  = {american},
+  sortyear     = {1986-3},
+  sorttitle    = {Computers & Typesetting D},
+  shorttitle   = {{METAFONT}},
+  annotation   = {The fourth volume of a five-volume book. Note the
+                  sorttitle and sortyear fields},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: The fourth volume of a five-volume book. Note the sorttitle
+    and sortyear fields
+  author:
+  - family: Knuth
+    given: Donald E.
+  id: "knuth:ct:d"
+  issued: 1986
+  language: en-US
+  publisher: Addison-Wesley
+  publisher-place: Reading, Mass.
+  title: Computers & typesetting
+  title-short: METAFONT
+  type: book
+  volume: D
+  volume-title: "METAFONT: The program"
+---
+
+
+```
diff --git a/test/command/biblatex-knuth-ct-e.md b/test/command/biblatex-knuth-ct-e.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-knuth-ct-e.md
@@ -0,0 +1,66 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2015-03-08:
+
+(Knuth 1986)
+
+Knuth, Donald E. 1986. *Computers & Typesetting*. Vol. E. Reading,
+Mass.: Addison-Wesley.
+
+
+Formatted with pandoc and apa.csl, 2015-03-08:
+
+(Knuth, 1986)
+
+Knuth, D. E. (1986). *Computers & typesetting* (Vol. E). Reading, Mass.:
+Addison-Wesley.
+
+
+NOTES:
+
+- volume-title currently not implemented by chicago-author-date.csl and apa.csl.
+
+}
+
+@Book{knuth:ct:e,
+  author       = {Knuth, Donald E.},
+  title        = {Computer Modern Typefaces},
+  date         = 1986,
+  maintitle    = {Computers \& Typesetting},
+  volume       = {E},
+  publisher    = {Addison-Wesley},
+  location     = {Reading, Mass.},
+  hyphenation  = {american},
+  sortyear     = {1986-4},
+  sorttitle    = {Computers & Typesetting E},
+  annotation   = {The fifth volume of a five-volume book. Note the
+                  sorttitle and sortyear fields},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: The fifth volume of a five-volume book. Note the sorttitle and
+    sortyear fields
+  author:
+  - family: Knuth
+    given: Donald E.
+  id: "knuth:ct:e"
+  issued: 1986
+  language: en-US
+  publisher: Addison-Wesley
+  publisher-place: Reading, Mass.
+  title: Computers & typesetting
+  type: book
+  volume: E
+  volume-title: Computer modern typefaces
+---
+
+
+```
diff --git a/test/command/biblatex-knuth-ct-related.md b/test/command/biblatex-knuth-ct-related.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-knuth-ct-related.md
@@ -0,0 +1,72 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Knuth 1984–1986)
+
+Knuth, Donald E. 1984–1986. *Computers & Typesetting*. 5. Reading,
+Mass.: Addison-Wesley.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Knuth, 1984–1986)
+
+Knuth, D. E. (1984–1986). *Computers & typesetting* (1-5). Reading,
+Mass.: Addison-Wesley.
+
+
+NOTES:
+
+- biblio2yaml
+	- related = {...}, relatedtype  = {multivolume}, -- no counterpart in CSL 
+
+- citeproc
+	- term "vols." missing
+
+}
+
+@Book{knuth:ct:related,
+  author       = {Knuth, Donald E.},
+  title        = {Computers \& Typesetting},
+  date         = {1984/1986},
+  volumes      = 5,
+  publisher    = {Addison-Wesley},
+  location     = {Reading, Mass.},
+  hyphenation  = {american},
+  sortyear     = {1984-0},
+  sorttitle    = {Computers & Typesetting},
+  indexsorttitle= {Computers & Typesetting},
+  related      = {knuth:ct:a,knuth:ct:b,knuth:ct:c,knuth:ct:d,knuth:ct:e},
+  relatedtype  = {multivolume},
+  annotation   = {A five-volume book cited as a whole and related to its
+                  individual volumes. Note the related and
+                  relatedtype fields},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A five-volume book cited as a whole and related to its
+    individual volumes. Note the related and relatedtype fields
+  author:
+  - family: Knuth
+    given: Donald E.
+  id: "knuth:ct:related"
+  issued: 1984/1986
+  language: en-US
+  number-of-volumes: 5
+  publisher: Addison-Wesley
+  publisher-place: Reading, Mass.
+  title: Computers & typesetting
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-knuth-ct.md b/test/command/biblatex-knuth-ct.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-knuth-ct.md
@@ -0,0 +1,66 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Knuth 1984–1986)
+
+Knuth, Donald E. 1984–1986. *Computers & Typesetting*. 5. Reading,
+Mass.: Addison-Wesley.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Knuth, 1984–1986)
+
+Knuth, D. E. (1984–1986). *Computers & typesetting* (1-5). Reading,
+Mass.: Addison-Wesley.
+
+
+NOTES:
+
+- citeproc
+	- term "vols." is missing
+
+}
+
+@Book{knuth:ct,
+  author       = {Knuth, Donald E.},
+  title        = {Computers \& Typesetting},
+  date         = {1984/1986},
+  volumes      = 5,
+  publisher    = {Addison-Wesley},
+  location     = {Reading, Mass.},
+  hyphenation  = {american},
+  sortyear     = {1984-0},
+  sorttitle    = {Computers & Typesetting},
+  indexsorttitle= {Computers & Typesetting},
+  annotation   = {A five-volume book cited as a whole. This is a book
+                  entry, note the volumes field},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A five-volume book cited as a whole. This is a book entry,
+    note the volumes field
+  author:
+  - family: Knuth
+    given: Donald E.
+  id: "knuth:ct"
+  issued: 1984/1986
+  language: en-US
+  number-of-volumes: 5
+  publisher: Addison-Wesley
+  publisher-place: Reading, Mass.
+  title: Computers & typesetting
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-kowalik.md b/test/command/biblatex-kowalik.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-kowalik.md
@@ -0,0 +1,68 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Kowalik and Isard 1995)
+
+Kowalik, F., and M. Isard. 1995. “Estimateur d’un défaut de
+fonctionnement d’un modulateur en quadrature et étage de modulation
+l’utilisant.” French patent request.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Kowalik & Isard, 1995)
+
+Kowalik, F., & Isard, M. (1995, January 11). Estimateur d’un défaut de
+fonctionnement d’un modulateur en quadrature et étage de modulation
+l’utilisant. French patent request.
+
+
+}
+
+@Patent{kowalik,
+  author       = {Kowalik, F. and Isard, M.},
+  title        = {Estimateur d'un d{\'e}faut de fonctionnement d'un modulateur
+                  en quadrature et {\'e}tage de modulation l'utilisant},
+  number       = 9500261,
+  date         = {1995-01-11},
+  type         = {patreqfr},
+  hyphenation  = {french},
+  indextitle   = {Estimateur d'un d{\'e}faut de fonctionnement},
+  annotation   = {This is a patent entry for a French patent request
+                  with a full date. The number is given in the number
+                  field. Note the format of the type and date
+                  fields in the database file. Compare almendro,
+                  laufenberg, and sorace},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a patent entry for a French patent request with a full
+    date. The number is given in the number field. Note the format of
+    the type and date fields in the database file. Compare almendro,
+    laufenberg, and sorace
+  author:
+  - family: Kowalik
+    given: F.
+  - family: Isard
+    given: M.
+  genre: French patent request
+  id: kowalik
+  issued: 1995-01-11
+  language: fr-FR
+  number: 9500261
+  title: Estimateur d'un défaut de fonctionnement d'un modulateur en
+    quadrature et étage de modulation l'utilisant
+  type: patent
+---
+
+
+```
diff --git a/test/command/biblatex-kullback-related.md b/test/command/biblatex-kullback-related.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-kullback-related.md
@@ -0,0 +1,62 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Kullback 1997)
+
+Kullback, Solomon. 1997. *Information Theory and Statistics*. New York:
+Dover Publications.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Kullback, 1997)
+
+Kullback, S. (1997). *Information theory and statistics*. New York:
+Dover Publications.
+
+
+NOTES:
+
+- related = {kullback}, relatedtype = {origpubin}, -- not possible in CSL
+
+}
+
+@Book{kullback:related,
+  author       = {Kullback, Solomon},
+  title        = {Information Theory and Statistics},
+  year         = 1997,
+  publisher    = {Dover Publications},
+  location     = {New York},
+  hyphenation  = {american},
+  related      = {kullback},
+  relatedtype  = {origpubin},
+  annotation   = {A reprint of the kullback entry. Note the format of
+                  the related and relatedtype fields},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A reprint of the kullback entry. Note the format of the
+    related and relatedtype fields
+  author:
+  - family: Kullback
+    given: Solomon
+  id: "kullback:related"
+  issued: 1997
+  language: en-US
+  publisher: Dover Publications
+  publisher-place: New York
+  title: Information theory and statistics
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-kullback-reprint.md b/test/command/biblatex-kullback-reprint.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-kullback-reprint.md
@@ -0,0 +1,71 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Kullback 1997)
+
+Kullback, Solomon. 1997. *Information Theory and Statistics*. New York:
+Dover Publications.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Kullback, 1997)
+
+Kullback, S. (1997). *Information theory and statistics*. New York:
+Dover Publications.
+
+
+NOTES:
+
+Formatted with chicago-author-date-TEST-20131018.csl 
+
+(Kullback [1959] 1997)
+
+Kullback, Solomon. (1959) 1997. *Information Theory and Statistics*. New
+York: Dover Publications.
+
+}
+
+@Book{kullback:reprint,
+  author       = {Kullback, Solomon},
+  title        = {Information Theory and Statistics},
+  year         = 1997,
+  publisher    = {Dover Publications},
+  location     = {New York},
+  origyear     = 1959,
+  origpublisher= {John Wiley \& Sons},
+  hyphenation  = {american},
+  annotation   = {A reprint of the kullback entry. Note the format of
+                  origyear and origpublisher. These fields are
+                  not used by the standard bibliography styles},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A reprint of the kullback entry. Note the format of origyear
+    and origpublisher. These fields are not used by the standard
+    bibliography styles
+  author:
+  - family: Kullback
+    given: Solomon
+  id: "kullback:reprint"
+  issued: 1997
+  language: en-US
+  original-date: 1959
+  original-publisher: John Wiley & Sons
+  publisher: Dover Publications
+  publisher-place: New York
+  title: Information theory and statistics
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-kullback.md b/test/command/biblatex-kullback.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-kullback.md
@@ -0,0 +1,52 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Kullback 1959)
+
+Kullback, Solomon. 1959. *Information Theory and Statistics*. New York:
+John Wiley & Sons.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Kullback, 1959)
+
+Kullback, S. (1959). *Information theory and statistics*. New York: John
+Wiley & Sons.
+
+
+}
+
+@Book{kullback,
+  author       = {Kullback, Solomon},
+  title        = {Information Theory and Statistics},
+  year         = 1959,
+  publisher    = {John Wiley \& Sons},
+  location     = {New York},
+  hyphenation  = {american},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Kullback
+    given: Solomon
+  id: kullback
+  issued: 1959
+  language: en-US
+  publisher: John Wiley & Sons
+  publisher-place: New York
+  title: Information theory and statistics
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-laufenberg.md b/test/command/biblatex-laufenberg.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-laufenberg.md
@@ -0,0 +1,109 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Laufenberg et al. 2006)
+
+Laufenberg, Xaver, Dominique Eynius, Helmut Suelzle, Stephan Usbeck,
+Matthias Spaeth, Miriam Neuser-Hoffmann, Christian Myrzik, et al. 2006.
+“Elektrische Einrichtung und Betriebsverfahren.” European patent.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Laufenberg et al., 2006)
+
+Laufenberg, X., Eynius, D., Suelzle, H., Usbeck, S., Spaeth, M.,
+Neuser-Hoffmann, M., … Ebner, N. (2006, September 13). Elektrische
+Einrichtung und Betriebsverfahren. European patent.
+
+
+NOTES:
+
+- biblio2yaml
+	- Is there any equivalent of "holder" in CSL?
+
+}
+
+@Patent{laufenberg,
+  author       = {Laufenberg, Xaver and Eynius, Dominique and Suelzle, Helmut
+                  and Usbeck, Stephan and Spaeth, Matthias and Neuser-Hoffmann,
+                  Miriam and Myrzik, Christian and Schmid, Manfred and Nietfeld,
+                  Franz and Thiel, Alexander and Braun, Harald and Ebner,
+                  Norbert},
+  title        = {Elektrische Einrichtung und Betriebsverfahren},
+  number       = 1700367,
+  date         = {2006-09-13},
+  holder       = {{Robert Bosch GmbH} and {Daimler Chrysler AG} and {Bayerische
+                  Motoren Werke AG}},
+  type         = {patenteu},
+  hyphenation  = {german},
+  annotation   = {This is a patent entry with a holder field.
+                  Note the format of the type and location
+                  fields in the database file. Compare almendro,
+                  sorace, and kowalik},
+  abstract     = {The invention relates to an electric device comprising a
+                  generator, in particular for use in the vehicle electric
+                  system of a motor vehicle and a controller for controlling the
+                  generator voltage. The device is equipped with a control zone,
+                  in which the voltage is controlled and zones, in which the
+                  torque is controlled. The invention also relates to methods
+                  for operating a device of this type.},
+  file         = {http://v3.espacenet.com/textdoc?IDX=EP1700367},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- abstract: The invention relates to an electric device comprising a
+    generator, in particular for use in the vehicle electric system of a
+    motor vehicle and a controller for controlling the generator
+    voltage. The device is equipped with a control zone, in which the
+    voltage is controlled and zones, in which the torque is controlled.
+    The invention also relates to methods for operating a device of this
+    type.
+  annote: This is a patent entry with a holder field. Note the format of
+    the type and location fields in the database file. Compare almendro,
+    sorace, and kowalik
+  author:
+  - family: Laufenberg
+    given: Xaver
+  - family: Eynius
+    given: Dominique
+  - family: Suelzle
+    given: Helmut
+  - family: Usbeck
+    given: Stephan
+  - family: Spaeth
+    given: Matthias
+  - family: Neuser-Hoffmann
+    given: Miriam
+  - family: Myrzik
+    given: Christian
+  - family: Schmid
+    given: Manfred
+  - family: Nietfeld
+    given: Franz
+  - family: Thiel
+    given: Alexander
+  - family: Braun
+    given: Harald
+  - family: Ebner
+    given: Norbert
+  genre: European patent
+  id: laufenberg
+  issued: 2006-09-13
+  language: de-DE
+  number: 1700367
+  title: Elektrische Einrichtung und Betriebsverfahren
+  type: patent
+---
+
+
+```
diff --git a/test/command/biblatex-loh.md b/test/command/biblatex-loh.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-loh.md
@@ -0,0 +1,65 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Loh 1992)
+
+Loh, Nin C. 1992. “High-resolution Micromachined Interferometric
+Accelerometer.” Master’s thesis, Cambridge, Mass.: Massachusetts
+Institute of Technology.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Loh, 1992)
+
+Loh, N. C. (1992). *High-resolution micromachined interferometric
+accelerometer* (Master’s thesis). Massachusetts Institute of Technology,
+Cambridge, Mass.
+
+
+NOTES:
+
+- biblio2yaml
+	- At some point, actual localization of "localization keys" will have to be implemented
+
+}
+
+@Thesis{loh,
+  author       = {Loh, Nin C.},
+  title        = {High-Resolution Micromachined Interferometric Accelerometer},
+  type         = {mathesis},
+  institution  = {Massachusetts Institute of Technology},
+  date         = 1992,
+  location     = {Cambridge, Mass.},
+  hyphenation  = {american},
+  annotation   = {This is a typical thesis entry for an MA thesis. Note
+                  the type field in the database file which uses a
+                  localization key},
+}
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a typical thesis entry for an MA thesis. Note the type
+    field in the database file which uses a localization key
+  author:
+  - family: Loh
+    given: Nin C.
+  genre: Master's thesis
+  id: loh
+  issued: 1992
+  language: en-US
+  publisher: Massachusetts Institute of Technology
+  publisher-place: Cambridge, Mass.
+  title: High-resolution micromachined interferometric accelerometer
+  type: thesis
+---
+
+
+```
diff --git a/test/command/biblatex-malinowski.md b/test/command/biblatex-malinowski.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-malinowski.md
@@ -0,0 +1,67 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Malinowski 1972)
+
+Malinowski, Bronisław. 1972. *Argonauts of the Western Pacific: An
+Account of Native Enterprise and Adventure in the Archipelagoes of
+Melanesian New Guinea*. 8th ed. London: Routledge and Kegan Paul.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Malinowski, 1972)
+
+Malinowski, B. (1972). *Argonauts of the Western Pacific: An account of
+native enterprise and adventure in the Archipelagoes of Melanesian New
+Guinea* (8th ed.). London: Routledge and Kegan Paul.
+
+
+}
+
+@Book{malinowski,
+  author       = {Malinowski, Bronis{\l}aw},
+  title        = {Argonauts of the {Western Pacific}},
+  date         = 1972,
+  edition      = 8,
+  publisher    = {Routledge {and} Kegan Paul},
+  location     = {London},
+  hyphenation  = {british},
+  subtitle     = {An account of native enterprise and adventure in the
+                  {Archipelagoes of Melanesian New Guinea}},
+  shorttitle   = {Argonauts},
+  annotation   = {This is a book entry. Note the format of the
+                  publisher and edition fields as well as the
+                  subtitle field},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a book entry. Note the format of the publisher and
+    edition fields as well as the subtitle field
+  author:
+  - family: Malinowski
+    given: Bronisław
+  edition: 8
+  id: malinowski
+  issued: 1972
+  language: en-GB
+  publisher: Routledge and Kegan Paul
+  publisher-place: London
+  title: "Argonauts of the Western Pacific: An account of native
+    enterprise and adventure in the [Archipelagoes of Melanesian New
+    Guinea]{.nocase}"
+  title-short: Argonauts
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-manual.md b/test/command/biblatex-manual.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-manual.md
@@ -0,0 +1,51 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{adapted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib}
+
+@Manual{cms,
+  title        = {The {Chicago} Manual of Style},
+  date         = 2003,
+  subtitle     = {The Essential Guide for Writers, Editors, and Publishers},
+  edition      = 15,
+  publisher    = {University of Chicago Press},
+  location     = {Chicago, Ill.},
+  isbn         = {0-226-10403-6},
+  label        = {CMS},
+  hyphenation  = {american},
+  sorttitle    = {Chicago Manual of Style},
+  indextitle   = {Chicago Manual of Style, The},
+  shorttitle   = {Chicago Manual of Style},
+  annotation   = {This is a manual entry without an author or
+                  editor. Note the label field in the database
+                  file which is provided for author-year citation styles. Also
+                  note the sorttitle and indextitle fields. By
+                  default, all entries without an author or
+                  editor are alphabetized by title but we want
+                  this entry to be alphabetized under \enquote*{C} rather than
+                  \enquote*{T}. There's also an isbn field},
+}
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a manual entry without an author or editor. Note the
+    label field in the database file which is provided for author-year
+    citation styles. Also note the sorttitle and indextitle fields. By
+    default, all entries without an author or editor are alphabetized by
+    title but we want this entry to be alphabetized under 'C' rather
+    than 'T'. There's also an isbn field
+  edition: 15
+  id: cms
+  isbn: 0-226-10403-6
+  issued: 2003
+  language: en-US
+  publisher: University of Chicago Press
+  publisher-place: Chicago, Ill.
+  title: "The Chicago manual of style: The essential guide for writers,
+    editors, and publishers"
+  title-short: Chicago manual of style
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-markey.md b/test/command/biblatex-markey.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-markey.md
@@ -0,0 +1,65 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Markey 2005)
+
+Markey, Nicolas. 2005. “Tame the BeaST: The B to X of BibTeX” (version
+1.3). October 16.
+<http://tug.ctan.org/tex-archive/info/bibtex/tamethebeast/ttb_en.pdf>.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Markey, 2005)
+
+Markey, N. (2005, October 16). Tame the BeaST: The B to X of BibTeX.
+Retrieved October 01, 2006, from
+<http://tug.ctan.org/tex-archive/info/bibtex/tamethebeast/ttb_en.pdf>
+
+
+}
+
+@Online{markey,
+  author       = {Markey, Nicolas},
+  title        = {Tame the {BeaST}},
+  date         = {2005-10-16},
+  url          =
+                  {http://tug.ctan.org/tex-archive/info/bibtex/tamethebeast/ttb_en.pdf},
+  subtitle     = {The {B} to {X} of {BibTeX}},
+  version      = {1.3},
+  urldate      = {2006-10-01},
+  hyphenation  = {american},
+  sorttitle    = {Tame the Beast},
+  annotation   = {An online entry for a tutorial. Note the format of
+                  the date field (yyyy-mm-dd) in the database
+                  file.},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- accessed: 2006-10-01
+  annote: An online entry for a tutorial. Note the format of the date
+    field (yyyy-mm-dd) in the database file.
+  author:
+  - family: Markey
+    given: Nicolas
+  id: markey
+  issued: 2005-10-16
+  language: en-US
+  title: "Tame the BeaST: The B to X of BibTeX"
+  title-short: Tame the BeaST
+  type: webpage
+  url: "http://tug.ctan.org/tex-archive/info/bibtex/tamethebeast/ttb_en.pdf"
+  version: 1.3
+---
+
+
+```
diff --git a/test/command/biblatex-maron.md b/test/command/biblatex-maron.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-maron.md
@@ -0,0 +1,70 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Maron 2000)
+
+Maron, Monika. 2000. *Animal Triste*. Translated by Brigitte Goldstein.
+Lincoln: University of Nebraska Press.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Maron, 2000)
+
+Maron, M. (2000). *Animal triste*. (B. Goldstein, Trans.). Lincoln:
+University of Nebraska Press.
+
+
+NOTES:
+
+-   origlanguage concatenated with translator, e.g. “translated from the German by …” not possible in CSL
+
+}
+
+@Book{maron,
+  author       = {Maron, Monika},
+  title        = {Animal Triste},
+  date         = 2000,
+  translator   = {Brigitte Goldstein},
+  origlanguage = {german},
+  publisher    = {University of Nebraska Press},
+  location     = {Lincoln},
+  hyphenation  = {american},
+  shorttitle   = {Animal Triste},
+  annotation   = {An English translation of a German novel with a French title.
+                  In other words: a book entry with a
+                  translator field.  Note the origlanguage
+                  field which is concatenated with the translator},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: "An English translation of a German novel with a French title.
+    In other words: a book entry with a translator field. Note the
+    origlanguage field which is concatenated with the translator"
+  author:
+  - family: Maron
+    given: Monika
+  id: maron
+  issued: 2000
+  language: en-US
+  publisher: University of Nebraska Press
+  publisher-place: Lincoln
+  title: Animal triste
+  title-short: Animal triste
+  translator:
+  - family: Goldstein
+    given: Brigitte
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-massa.md b/test/command/biblatex-massa.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-massa.md
@@ -0,0 +1,56 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Massa 2004)
+
+Massa, Werner. 2004. *Crystal Structure Determination*. 2nd ed. Berlin:
+Spinger.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Massa, 2004)
+
+Massa, W. (2004). *Crystal structure determination* (2nd ed.). Berlin:
+Spinger.
+
+
+}
+
+@Book{massa,
+  author       = {Werner Massa},
+  title        = {Crystal structure determination},
+  date         = 2004,
+  edition      = 2,
+  publisher    = {Spinger},
+  location     = {Berlin},
+  hyphenation  = {british},
+  annotation   = {A book entry with an edition field},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A book entry with an edition field
+  author:
+  - family: Massa
+    given: Werner
+  edition: 2
+  id: massa
+  issued: 2004
+  language: en-GB
+  publisher: Spinger
+  publisher-place: Berlin
+  title: Crystal structure determination
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-moore-related.md b/test/command/biblatex-moore-related.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-moore-related.md
@@ -0,0 +1,66 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Moore 1998)
+
+Moore, Gordon E. 1998. “Cramming More Components onto Integrated
+Circuits.” *Proceedings of the IEEE* 86 (1): 82–85.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Moore, 1998)
+
+Moore, G. E. (1998). Cramming more components onto integrated circuits.
+*Proceedings of the IEEE*, *86*(1), 82–85.
+
+
+NOTES:
+
+- "related = {moore}, relatedtype = {reprintfrom}," – no equivalent implemented in CSL
+
+}
+
+@Article{moore:related,
+  author       = {Moore, Gordon E.},
+  title        = {Cramming more components onto integrated circuits},
+  journaltitle = {Proceedings of the {IEEE}},
+  year         = 1998,
+  volume       = 86,
+  number       = 1,
+  pages        = {82-85},
+  hyphenation  = {american},
+  related      = {moore},
+  relatedtype  = {reprintfrom},
+  annotation   = {A reprint of Moore's law. Note the related and
+                  relatedtype fields},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A reprint of Moore's law. Note the related and relatedtype
+    fields
+  author:
+  - family: Moore
+    given: Gordon E.
+  container-title: Proceedings of the IEEE
+  id: "moore:related"
+  issue: 1
+  issued: 1998
+  language: en-US
+  page: 82-85
+  title: Cramming more components onto integrated circuits
+  type: article-journal
+  volume: 86
+---
+
+
+```
diff --git a/test/command/biblatex-moore.md b/test/command/biblatex-moore.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-moore.md
@@ -0,0 +1,56 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Moore 1965)
+
+Moore, Gordon E. 1965. “Cramming More Components onto Integrated
+Circuits.” *Electronics* 38 (8): 114–117.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Moore, 1965)
+
+Moore, G. E. (1965). Cramming more components onto integrated circuits.
+*Electronics*, *38*(8), 114–117.
+
+
+}
+
+@Article{moore,
+  author       = {Moore, Gordon E.},
+  title        = {Cramming more components onto integrated circuits},
+  journaltitle = {Electronics},
+  year         = 1965,
+  volume       = 38,
+  number       = 8,
+  pages        = {114-117},
+  hyphenation  = {american},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Moore
+    given: Gordon E.
+  container-title: Electronics
+  id: moore
+  issue: 8
+  issued: 1965
+  language: en-US
+  page: 114-117
+  title: Cramming more components onto integrated circuits
+  type: article-journal
+  volume: 38
+---
+
+
+```
diff --git a/test/command/biblatex-moraux.md b/test/command/biblatex-moraux.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-moraux.md
@@ -0,0 +1,94 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Moraux 1979)
+
+Moraux, Paul. 1979. “Le *De Anima* dans la tradition grècque: Quelques
+aspects de l’interpretation du traité, de Theophraste à Themistius.” In
+*Aristotle on Mind and the Senses. Proceedings of the Seventh Symposium
+Aristotelicum*, edited by G. E. R. Lloyd and G. E. L. Owen, 281–324.
+Cambridge: Cambridge University Press.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Moraux, 1979)
+
+Moraux, P. (1979). Le *De Anima* dans la tradition grècque: Quelques
+aspects de l’interpretation du traité, de Theophraste à Themistius. In
+G. E. R. Lloyd & G. E. L. Owen (eds.), *Aristotle on Mind and the
+Senses. Proceedings of the Seventh Symposium Aristotelicum* (pp.
+281–324). Cambridge: Cambridge University Press.
+
+
+NOTES:
+
+- Since case (conversion) can only be specified per entry, not per field, for apa.csl the case of container-title would have to be adjusted manually.
+
+}
+
+@string{ cup     = {Cambridge University Press} }
+
+@InProceedings{moraux,
+  author       = {Moraux, Paul},
+  editor       = {Lloyd, G. E. R. and Owen, G. E. L.},
+  title        = {Le \emph{De Anima} dans la tradition gr{\`e}cque},
+  date         = 1979,
+  booktitle    = {Aristotle on Mind and the Senses},
+  subtitle     = {Quelques aspects de l'interpretation du trait{\'e}, de
+                  Theophraste {\`a} Themistius},
+  booktitleaddon= {Proceedings of the Seventh Symposium Aristotelicum},
+  eventdate    = 1975,
+  publisher    = cup,
+  location     = {Cambridge},
+  pages        = {281-324},
+  keywords     = {secondary},
+  hyphenation  = {french},
+  indexsorttitle= {De Anima dans la tradition grecque},
+  indextitle   = {\emph{De Anima} dans la tradition gr{\`e}cque, Le},
+  shorttitle   = {\emph{De Anima} dans la tradition gr{\`e}cque},
+  annotation   = {This is a typical inproceedings entry. Note the
+                  booksubtitle, shorttitle,
+                  indextitle, and indexsorttitle fields. Also
+                  note the eventdate field.},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a typical inproceedings entry. Note the booksubtitle,
+    shorttitle, indextitle, and indexsorttitle fields. Also note the
+    eventdate field.
+  author:
+  - family: Moraux
+    given: Paul
+  container-title: Aristotle on Mind and the Senses. Proceedings of the
+    Seventh Symposium Aristotelicum
+  editor:
+  - family: Lloyd
+    given: G. E. R.
+  - family: Owen
+    given: G. E. L.
+  event-date: 1975
+  id: moraux
+  issued: 1979
+  keyword: secondary
+  language: fr-FR
+  page: 281-324
+  publisher: Cambridge University Press
+  publisher-place: Cambridge
+  title: "Le *De Anima* dans la tradition grècque: Quelques aspects de
+    l'interpretation du traité, de Theophraste à Themistius"
+  title-short: *De Anima* dans la tradition grècque
+  type: paper-conference
+---
+
+
+```
diff --git a/test/command/biblatex-murray.md b/test/command/biblatex-murray.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-murray.md
@@ -0,0 +1,104 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Hostetler et al. 1998)
+
+Hostetler, Michael J., Julia E. Wingate, Chuan-Jian Zhong, Jay E.
+Harris, Richard W. Vachet, Michael R. Clark, J. David Londono, et al.
+1998. “Alkanethiolate Gold Cluster Molecules with Core Diameters from
+1.5 to 5.2 nm: Core and Monolayer Properties as a Function of Core
+Size.” *Langmuir* 14 (1): 17–30.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Hostetler et al., 1998)
+
+Hostetler, M. J., Wingate, J. E., Zhong, C.-J., Harris, J. E., Vachet,
+R. W., Clark, M. R., … Murray, R. W. (1998). Alkanethiolate gold cluster
+molecules with core diameters from 1.5 to 5.2 nm: Core and monolayer
+properties as a function of core size. *Langmuir*, *14*(1), 17–30.
+
+
+}
+
+@Article{murray,
+  author       = {Hostetler, Michael J. and Wingate, Julia E. and Zhong,
+                  Chuan-Jian and Harris, Jay E. and Vachet, Richard W. and
+                  Clark, Michael R.  and Londono, J. David and Green, Stephen
+                  J. and Stokes, Jennifer J.  and Wignall, George D. and Glish,
+                  Gary L. and Porter, Marc D.  and Evans, Neal D. and Murray,
+                  Royce W.},
+  title        = {Alkanethiolate gold cluster molecules with core diameters from
+                  1.5 to 5.2~{nm}},
+  journaltitle = {Langmuir},
+  date         = 1998,
+  subtitle     = {Core and monolayer properties as a function of core size},
+  volume       = 14,
+  number       = 1,
+  pages        = {17-30},
+  hyphenation  = {american},
+  indextitle   = {Alkanethiolate gold cluster molecules},
+  shorttitle   = {Alkanethiolate gold cluster molecules},
+  annotation   = {An article entry with \arabic{author} authors. By
+                  default, long author and editor lists are automatically
+                  truncated. This is configurable},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: An article entry with author authors. By default, long author
+    and editor lists are automatically truncated. This is configurable
+  author:
+  - family: Hostetler
+    given: Michael J.
+  - family: Wingate
+    given: Julia E.
+  - family: Zhong
+    given: Chuan-Jian
+  - family: Harris
+    given: Jay E.
+  - family: Vachet
+    given: Richard W.
+  - family: Clark
+    given: Michael R.
+  - family: Londono
+    given: J. David
+  - family: Green
+    given: Stephen J.
+  - family: Stokes
+    given: Jennifer J.
+  - family: Wignall
+    given: George D.
+  - family: Glish
+    given: Gary L.
+  - family: Porter
+    given: Marc D.
+  - family: Evans
+    given: Neal D.
+  - family: Murray
+    given: Royce W.
+  container-title: Langmuir
+  id: murray
+  issue: 1
+  issued: 1998
+  language: en-US
+  page: 17-30
+  title: "Alkanethiolate gold cluster molecules with core diameters from
+    1.5 to 5.2 [nm]{.nocase}: Core and monolayer properties as a
+    function of core size"
+  title-short: Alkanethiolate gold cluster molecules
+  type: article-journal
+  volume: 14
+---
+
+
+```
diff --git a/test/command/biblatex-nietzsche-historie.md b/test/command/biblatex-nietzsche-historie.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-nietzsche-historie.md
@@ -0,0 +1,100 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Nietzsche 1988)
+
+Nietzsche, Friedrich. 1988. “Unzeitgemässe Betrachtungen. Zweites Stück:
+Vom Nutzen und Nachtheil der Historie für das Leben.” In *Sämtliche
+Werke: Kritische Studienausgabe*, by Friedrich Nietzsche, edited by
+Giorgio Colli and Mazzino Montinari, 1:243–334. München; Berlin; New
+York: Deutscher Taschenbuch-Verlag; Walter de Gruyter.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Nietzsche, 1988)
+
+Nietzsche, F. (1988). Unzeitgemässe Betrachtungen. Zweites Stück: Vom
+Nutzen und Nachtheil der Historie für das Leben. In G. Colli & M.
+Montinari (eds.), *Sämtliche Werke: Kritische Studienausgabe* (Vol. 1,
+pp. 243–334). München; Berlin; New York: Deutscher Taschenbuch-Verlag;
+Walter de Gruyter.
+
+
+}
+
+@string{ dtv     = {Deutscher Taschenbuch-Verlag} }
+
+@InBook{nietzsche:historie,
+  title        = {Unzeitgem{\"a}sse Betrachtungen. Zweites St{\"u}ck},
+  date         = 1988,
+  author       = {Nietzsche, Friedrich},
+  booktitle    = {Die Geburt der Trag{\"o}die. Unzeitgem{\"a}{\ss}e
+                  Betrachtungen I--IV. Nachgelassene Schriften 1870--1973},
+  bookauthor   = {Nietzsche, Friedrich},
+  editor       = {Colli, Giorgio and Montinari, Mazzino},
+  subtitle     = {Vom Nutzen und Nachtheil der Historie f{\"u}r das Leben},
+  maintitle    = {S{\"a}mtliche Werke},
+  mainsubtitle = {Kritische Studienausgabe},
+  volume       = 1,
+  publisher    = dtv # { and Walter de Gruyter},
+  location     = {M{\"u}nchen and Berlin and New York},
+  pages        = {243-334},
+  hyphenation  = {german},
+  sortyear     = {1988-2},
+  sorttitle    = {Werke-01-243},
+  indexsorttitle= {Vom Nutzen und Nachtheil der Historie fur das Leben},
+  indextitle   = {Vom Nutzen und Nachtheil der Historie f{\"u}r das Leben},
+  shorttitle   = {Vom Nutzen und Nachtheil der Historie},
+  annotation   = {A single essay from the critical edition of Nietzsche's works.
+                  This inbook entry explicitly refers to an essay found
+                  in the first volume. Note the title,
+                  booktitle, and maintitle fields. Also note
+                  the sorttitle and sortyear fields. We want
+                  this entry to be listed after the entry referring to the
+                  entire first volume},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A single essay from the critical edition of Nietzsche's works.
+    This inbook entry explicitly refers to an essay found in the first
+    volume. Note the title, booktitle, and maintitle fields. Also note
+    the sorttitle and sortyear fields. We want this entry to be listed
+    after the entry referring to the entire first volume
+  author:
+  - family: Nietzsche
+    given: Friedrich
+  container-author:
+  - family: Nietzsche
+    given: Friedrich
+  container-title: "Sämtliche Werke: Kritische Studienausgabe"
+  editor:
+  - family: Colli
+    given: Giorgio
+  - family: Montinari
+    given: Mazzino
+  id: "nietzsche:historie"
+  issued: 1988
+  language: de-DE
+  page: 243-334
+  publisher: Deutscher Taschenbuch-Verlag; Walter de Gruyter
+  publisher-place: München; Berlin; New York
+  title: "Unzeitgemässe Betrachtungen. Zweites Stück: Vom Nutzen und
+    Nachtheil der Historie für das Leben"
+  title-short: Vom Nutzen und Nachtheil der Historie
+  type: chapter
+  volume: 1
+  volume-title: Die Geburt der Tragödie. Unzeitgemäße Betrachtungen
+    I--IV. Nachgelassene Schriften 1870--1973
+---
+
+
+```
diff --git a/test/command/biblatex-nietzsche-ksa.md b/test/command/biblatex-nietzsche-ksa.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-nietzsche-ksa.md
@@ -0,0 +1,89 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Nietzsche 1988)
+
+Nietzsche, Friedrich. 1988. *Sämtliche Werke: Kritische Studienausgabe*.
+Edited by Giorgio Colli and Mazzino Montinari. 2nd ed. 15. München;
+Berlin; New York: Deutscher Taschenbuch-Verlag; Walter de Gruyter.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Nietzsche, 1988)
+
+Nietzsche, F. (1988). *Sämtliche Werke: Kritische Studienausgabe*. (G.
+Colli & M. Montinari, eds.) (2nd ed., 1-15). München; Berlin; New York:
+Deutscher Taschenbuch-Verlag; Walter de Gruyter.
+
+
+NOTES:
+
+- biblio2yaml
+	- term "vols." missing
+
+}
+
+@string{ dtv     = {Deutscher Taschenbuch-Verlag} }
+
+@Book{nietzsche:ksa,
+  author       = {Nietzsche, Friedrich},
+  title        = {S{\"a}mtliche Werke},
+  date         = 1988,
+  editor       = {Colli, Giorgio and Montinari, Mazzino},
+  edition      = 2,
+  volumes      = 15,
+  publisher    = dtv # { and Walter de Gruyter},
+  location     = {M{\"u}nchen and Berlin and New York},
+  hyphenation  = {german},
+  sortyear     = {1988-0},
+  sorttitle    = {Werke-00-000},
+  indexsorttitle= {Samtliche Werke},
+  subtitle     = {Kritische Studienausgabe},
+  annotation   = {The critical edition of Nietzsche's works. This is a
+                  book entry referring to a 15-volume work as a
+                  whole. Note the volumes field and the format of the
+                  publisher and location fields in the
+                  database file. Also note the sorttitle and
+                  sortyear fields which are used to fine-tune the
+                  sorting order of the bibliography. We want this item listed
+                  first in the bibliography},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: The critical edition of Nietzsche's works. This is a book
+    entry referring to a 15-volume work as a whole. Note the volumes
+    field and the format of the publisher and location fields in the
+    database file. Also note the sorttitle and sortyear fields which are
+    used to fine-tune the sorting order of the bibliography. We want
+    this item listed first in the bibliography
+  author:
+  - family: Nietzsche
+    given: Friedrich
+  edition: 2
+  editor:
+  - family: Colli
+    given: Giorgio
+  - family: Montinari
+    given: Mazzino
+  id: "nietzsche:ksa"
+  issued: 1988
+  language: de-DE
+  number-of-volumes: 15
+  publisher: Deutscher Taschenbuch-Verlag; Walter de Gruyter
+  publisher-place: München; Berlin; New York
+  title: "Sämtliche Werke: Kritische Studienausgabe"
+  title-short: Sämtliche Werke
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-nietzsche-ksa1.md b/test/command/biblatex-nietzsche-ksa1.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-nietzsche-ksa1.md
@@ -0,0 +1,95 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2015-03-08:
+
+(Nietzsche 1988)
+
+Nietzsche, Friedrich. 1988. *Sämtliche Werke: Kritische Studienausgabe*.
+Edited by Giorgio Colli and Mazzino Montinari. 2nd ed. Vol. 1. München;
+Berlin; New York: Deutscher Taschenbuch-Verlag; Walter de Gruyter.
+
+
+Formatted with pandoc and apa.csl, 2015-03-08:
+
+(Nietzsche, 1988)
+
+Nietzsche, F. (1988). *Sämtliche Werke: Kritische Studienausgabe*. (G.
+Colli & M. Montinari, eds., F. Nietzsche) (2nd ed., Vol. 1). München;
+Berlin; New York: Deutscher Taschenbuch-Verlag; Walter de Gruyter.
+
+
+NOTES:
+
+- volume-title currently not implemented by chicago-author-date.csl and apa.csl.
+
+}
+
+@string{ dtv     = {Deutscher Taschenbuch-Verlag} }
+
+@Book{nietzsche:ksa1,
+  author       = {Nietzsche, Friedrich},
+  title        = {Die Geburt der Trag{\"o}die. Unzeitgem{\"a}{\ss}e
+                  Betrachtungen I--IV. Nachgelassene Schriften 1870--1973},
+  date         = 1988,
+  editor       = {Colli, Giorgio and Montinari, Mazzino},
+  maintitle    = {S{\"a}mtliche Werke},
+  mainsubtitle = {Kritische Studienausgabe},
+  volume       = 1,
+  edition      = 2,
+  publisher    = dtv # { and Walter de Gruyter},
+  location     = {M{\"u}nchen and Berlin and New York},
+  hyphenation  = {german},
+  sortyear     = {1988-1},
+  sorttitle    = {Werke-01-000},
+  indexsorttitle= {Samtliche Werke I},
+  bookauthor   = {Nietzsche, Friedrich},
+  indextitle   = {S{\"a}mtliche Werke I},
+  shorttitle   = {S{\"a}mtliche Werke I},
+  annotation   = {A single volume from the critical edition of Nietzsche's
+                  works. This book entry explicitly refers to the first
+                  volume only. Note the title and maintitle
+                  fields. Also note the sorttitle and sortyear
+                  fields. We want this entry to be listed after the entry
+                  referring to the entire edition},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A single volume from the critical edition of Nietzsche's
+    works. This book entry explicitly refers to the first volume only.
+    Note the title and maintitle fields. Also note the sorttitle and
+    sortyear fields. We want this entry to be listed after the entry
+    referring to the entire edition
+  author:
+  - family: Nietzsche
+    given: Friedrich
+  container-author:
+  - family: Nietzsche
+    given: Friedrich
+  edition: 2
+  editor:
+  - family: Colli
+    given: Giorgio
+  - family: Montinari
+    given: Mazzino
+  id: "nietzsche:ksa1"
+  issued: 1988
+  language: de-DE
+  publisher: Deutscher Taschenbuch-Verlag; Walter de Gruyter
+  publisher-place: München; Berlin; New York
+  title: "Sämtliche Werke: Kritische Studienausgabe"
+  type: book
+  volume: 1
+  volume-title: Die Geburt der Tragödie. Unzeitgemäße Betrachtungen
+    I--IV. Nachgelassene Schriften 1870--1973
+---
+
+
+```
diff --git a/test/command/biblatex-nussbaum.md b/test/command/biblatex-nussbaum.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-nussbaum.md
@@ -0,0 +1,63 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Nussbaum 1978)
+
+Nussbaum, Martha. 1978. *Aristotle’s “De Motu Animalium”*. Princeton:
+Princeton University Press.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Nussbaum, 1978)
+
+Nussbaum, M. (1978). *Aristotle’s “De Motu Animalium”*. Princeton:
+Princeton University Press.
+
+
+}
+
+@string{ pup     = {Princeton University Press} }
+
+@Book{nussbaum,
+  author       = {Nussbaum, Martha},
+  title        = {Aristotle's \mkbibquote{De Motu Animalium}},
+  date         = 1978,
+  publisher    = pup,
+  location     = {Princeton},
+  keywords     = {secondary},
+  hyphenation  = {american},
+  sorttitle    = {Aristotle's De Motu Animalium},
+  indexsorttitle= {Aristotle's De Motu Animalium},
+  annotation   = {A book entry. Note the sorttitle and
+                  indexsorttitle fields and the markup of the quotes in
+                  the database file},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A book entry. Note the sorttitle and indexsorttitle fields and
+    the markup of the quotes in the database file
+  author:
+  - family: Nussbaum
+    given: Martha
+  id: nussbaum
+  issued: 1978
+  keyword: secondary
+  language: en-US
+  publisher: Princeton University Press
+  publisher-place: Princeton
+  title: "Aristotle's \"De Motu Animalium\""
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-online.md b/test/command/biblatex-online.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-online.md
@@ -0,0 +1,64 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{adapted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib}
+
+@online{markey,
+	Annotation = {An online entry for a tutorial. Note the format of the date field (yyyy-mm-dd) in the database file.},
+	Author = {Markey, Nicolas},
+	Date = {2005-10-16},
+	Hyphenation = {american},
+	Sorttitle = {Tame the Beast},
+	Subtitle = {The {B} to {X} of {BibTeX}},
+	Title = {Tame the {BeaST}},
+	Url = {http://tug.ctan.org/tex-archive/info/bibtex/tamethebeast/ttb_en.pdf},
+	Urldate = {2006-10-01},
+	Version = {1.3},
+}
+
+@online{CTAN,
+	Annotation = {This is an online entry. The \textsc{url}, which is given in the url field, is transformed into a clickable link if hyperref support has been enabled. Note the format of the urldate field (yyyy-mm-dd) in the database file. Also note the label field which may be used as a fallback by citation styles which need an author and\slash or a year},
+	Date = 2006,
+	Hyphenation = {american},
+	Label = {CTAN},
+	Subtitle = {The {Comprehensive TeX Archive Network}},
+	Title = {{CTAN}},
+	Url = {http://www.ctan.org},
+	Urldate = {2006-10-01},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- accessed: 2006-10-01
+  annote: An online entry for a tutorial. Note the format of the date
+    field (yyyy-mm-dd) in the database file.
+  author:
+  - family: Markey
+    given: Nicolas
+  id: markey
+  issued: 2005-10-16
+  language: en-US
+  title: "Tame the BeaST: The B to X of BibTeX"
+  title-short: Tame the BeaST
+  type: webpage
+  url: "http://tug.ctan.org/tex-archive/info/bibtex/tamethebeast/ttb_en.pdf"
+  version: 1.3
+- accessed: 2006-10-01
+  annote: This is an online entry. The [url]{.smallcaps}, which is given
+    in the url field, is transformed into a clickable link if hyperref
+    support has been enabled. Note the format of the urldate field
+    (yyyy-mm-dd) in the database file. Also note the label field which
+    may be used as a fallback by citation styles which need an author
+    and/or a year
+  id: CTAN
+  issued: 2006
+  language: en-US
+  title: "CTAN: The Comprehensive TeX Archive Network"
+  title-short: CTAN
+  type: webpage
+  url: "http://www.ctan.org"
+---
+
+
+```
diff --git a/test/command/biblatex-options-url-false-doi-false.md b/test/command/biblatex-options-url-false-doi-false.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-options-url-false-doi-false.md
@@ -0,0 +1,57 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Entry contains url and doi fields; these should be discarded since the
+options field specifies url=false, doi=false.
+
+Exception: As in standard biblatex, in online entries url should never be
+discarded, even if options contains url=false.
+
+}
+
+@article{item1,
+    Author = {Author, Andy},
+    Date = {2012},
+    Doi = {1234/5678.90},
+    Journal = {Journal},
+    Options = {url=false, doi=false},
+    Title = {Title, Any Entry Type Except online},
+    Url = {http://foo.bar}
+}
+
+@online{item2,
+    Author = {Author, Andy},
+    Date = {2012},
+    Doi = {1234/5678.90},
+    Journal = {Journal},
+    Options = {url=false, doi=false},
+    Title = {Title, Entry Type online},
+    Url = {http://foo.bar}
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Author
+    given: Andy
+  container-title: Journal
+  id: item1
+  issued: 2012
+  title: Title, any entry type except online
+  type: article-journal
+- author:
+  - family: Author
+    given: Andy
+  container-title: Journal
+  id: item2
+  issued: 2012
+  title: Title, entry type online
+  type: webpage
+  url: "http://foo.bar"
+---
+
+
+```
diff --git a/test/command/biblatex-padhye.md b/test/command/biblatex-padhye.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-padhye.md
@@ -0,0 +1,117 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Padhye, Firoiu, and Towsley 1999)
+
+Padhye, Jitendra, Victor Firoiu, and Don Towsley. 1999. “A Stochastic
+Model of TCP Reno Congestion Avoidance and Control.” Technical report
+99-02. Amherst, Mass.: University of Massachusetts.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Padhye, Firoiu, & Towsley, 1999)
+
+Padhye, J., Firoiu, V., & Towsley, D. (1999). *A stochastic model of TCP
+Reno congestion avoidance and control* (technical report No. 99-02).
+Amherst, Mass.: University of Massachusetts.
+
+}
+
+@Report{padhye,
+  author       = {Padhye, Jitendra and Firoiu, Victor and Towsley, Don},
+  title        = {A Stochastic Model of {TCP Reno} Congestion Avoidance and
+                  Control},
+  type         = {techreport},
+  institution  = {University of Massachusetts},
+  date         = 1999,
+  number       = {99-02},
+  location     = {Amherst, Mass.},
+  hyphenation  = {american},
+  sorttitle    = {A Stochastic Model of TCP Reno Congestion Avoidance and
+                  Control},
+  indextitle   = {Stochastic Model of {TCP Reno} Congestion Avoidance and Control,
+                  A},
+  annotation   = {This is a report entry for a technical report. Note
+                  the format of the type field in the database file
+                  which uses a localization key. The number of the report is
+                  given in the number field. Also note the
+                  sorttitle and indextitle fields},
+  abstract     = {The steady state performance of a bulk transfer TCP flow
+                  (i.e., a flow with a large amount of data to send, such as FTP
+                  transfers) may be characterized by three quantities. The first
+                  is the send rate, which is the amount of data sent by the
+                  sender in unit time. The second is the throughput, which is
+                  the amount of data received by the receiver in unit time. Note
+                  that the throughput will always be less than or equal to the
+                  send rate due to losses. Finally, the number of non-duplicate
+                  packets received by the receiver in unit time gives us the
+                  goodput of the connection. The goodput is always less than or
+                  equal to the throughput, since the receiver may receive two
+                  copies of the same packet due to retransmissions by the
+                  sender. In a previous paper, we presented a simple model for
+                  predicting the steady state send rate of a bulk transfer TCP
+                  flow as a function of loss rate and round trip time. In this
+                  paper, we extend that work in two ways. First, we analyze the
+                  performance of bulk transfer TCP flows using more precise,
+                  stochastic analysis. Second, we build upon the previous
+                  analysis to provide both an approximate formula as well as a
+                  more accurate stochastic model for the steady state throughput
+                  of a bulk transfer TCP flow.},
+  file         = {ftp://gaia.cs.umass.edu/pub/Padhey99-markov.ps},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- abstract: The steady state performance of a bulk transfer TCP flow
+    (i.e., a flow with a large amount of data to send, such as FTP
+    transfers) may be characterized by three quantities. The first is
+    the send rate, which is the amount of data sent by the sender in
+    unit time. The second is the throughput, which is the amount of data
+    received by the receiver in unit time. Note that the throughput will
+    always be less than or equal to the send rate due to losses.
+    Finally, the number of non-duplicate packets received by the
+    receiver in unit time gives us the goodput of the connection. The
+    goodput is always less than or equal to the throughput, since the
+    receiver may receive two copies of the same packet due to
+    retransmissions by the sender. In a previous paper, we presented a
+    simple model for predicting the steady state send rate of a bulk
+    transfer TCP flow as a function of loss rate and round trip time. In
+    this paper, we extend that work in two ways. First, we analyze the
+    performance of bulk transfer TCP flows using more precise,
+    stochastic analysis. Second, we build upon the previous analysis to
+    provide both an approximate formula as well as a more accurate
+    stochastic model for the steady state throughput of a bulk transfer
+    TCP flow.
+  annote: This is a report entry for a technical report. Note the format
+    of the type field in the database file which uses a localization
+    key. The number of the report is given in the number field. Also
+    note the sorttitle and indextitle fields
+  author:
+  - family: Padhye
+    given: Jitendra
+  - family: Firoiu
+    given: Victor
+  - family: Towsley
+    given: Don
+  genre: technical report
+  id: padhye
+  issued: 1999
+  language: en-US
+  number: 99-02
+  publisher: University of Massachusetts
+  publisher-place: Amherst, Mass.
+  title: A stochastic model of TCP Reno congestion avoidance and control
+  type: report
+---
+
+
+```
diff --git a/test/command/biblatex-patent.md b/test/command/biblatex-patent.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-patent.md
@@ -0,0 +1,158 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{adapted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib
+
+TODO: Is there a CSL counterpart for the biblatex field "holder"?}
+
+
+@patent{almendro,
+	Annotation = {This is a patent entry with a location field. The number is given in the number field. Note the format of the location field in the database file. Compare laufenberg, sorace, and kowalik},
+	Author = {Almendro, José L. and Martín, Jacinto and Sánchez, Alberto and Nozal, Fernando},
+	Date = 1998,
+	Hyphenation = {german},
+	Location = {countryfr and countryuk and countryde},
+	Number = {EU-29702195U},
+	Title = {Elektromagnetisches Signalhorn}}
+
+@patent{kowalik,
+	Annotation = {This is a patent entry for a French patent request with a full date. The number is given in the number field. Note the format of the type and date fields in the database file. Compare almendro, laufenberg, and sorace},
+	Author = {Kowalik, F. and Isard, M.},
+	Date = {1995-01-11},
+	Hyphenation = {french},
+	Indextitle = {Estimateur d'un défaut de fonctionnement},
+	Number = 9500261,
+	Title = {Estimateur d'un défaut de fonctionnement d'un modulateur en quadrature et étage de modulation l'utilisant},
+	Type = {patreqfr}}
+
+@patent{laufenberg,
+	Annotation = {This is a patent entry with a holder field. Note the format of the type and location fields in the database file. Compare almendro, sorace, and kowalik},
+	Author = {Laufenberg, Xaver and Eynius, Dominique and Suelzle, Helmut and Usbeck, Stephan and Spaeth, Matthias and Neuser-Hoffmann, Miriam and Myrzik, Christian and Schmid, Manfred and Nietfeld, Franz and Thiel, Alexander and Braun, Harald and Ebner, Norbert},
+	Date = {2006-09-13},
+	File = {http://v3.espacenet.com/textdoc?IDX=EP1700367},
+	Holder = {{Robert Bosch GmbH} and {Daimler Chrysler AG} and {Bayerische Motoren Werke AG}},
+	Hyphenation = {german},
+	Number = 1700367,
+	Title = {Elektrische Einrichtung und Betriebsverfahren},
+	Type = {patenteu},
+	Abstract = {The invention relates to an electric device comprising a
+                  generator, in particular for use in the vehicle electric
+                  system of a motor vehicle and a controller for controlling the
+                  generator voltage. The device is equipped with a control zone,
+                  in which the voltage is controlled and zones, in which the
+                  torque is controlled. The invention also relates to methods
+                  for operating a device of this type.}}
+
+@patent{sorace,
+	Annotation = {This is a patent entry with a holder field. Note the format of the type and date fields in the database file. Compare almendro, laufenberg, and kowalik},
+	Author = {Sorace, Ronald E. and Reinhardt, Victor S. and Vaughn, Steven A.},
+	Date = {1997-09-16},
+	Date-Modified = {2013-10-16 13:44:15 +0000},
+	Holder = {{Hughes Aircraft Company}},
+	Hyphenation = {american},
+	Number = 5668842,
+	Title = {High-Speed Digital-to-{RF} Converter},
+	Type = {patentus}}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a patent entry with a location field. The number is
+    given in the number field. Note the format of the location field in
+    the database file. Compare laufenberg, sorace, and kowalik
+  author:
+  - family: Almendro
+    given: José L.
+  - family: Martín
+    given: Jacinto
+  - family: Sánchez
+    given: Alberto
+  - family: Nozal
+    given: Fernando
+  id: almendro
+  issued: 1998
+  jurisdiction: France; United Kingdom; Germany
+  language: de-DE
+  number: EU-29702195U
+  title: Elektromagnetisches Signalhorn
+  type: patent
+- annote: This is a patent entry for a French patent request with a full
+    date. The number is given in the number field. Note the format of
+    the type and date fields in the database file. Compare almendro,
+    laufenberg, and sorace
+  author:
+  - family: Kowalik
+    given: F.
+  - family: Isard
+    given: M.
+  genre: French patent request
+  id: kowalik
+  issued: 1995-01-11
+  language: fr-FR
+  number: 9500261
+  title: Estimateur d'un défaut de fonctionnement d'un modulateur en
+    quadrature et étage de modulation l'utilisant
+  type: patent
+- abstract: The invention relates to an electric device comprising a
+    generator, in particular for use in the vehicle electric system of a
+    motor vehicle and a controller for controlling the generator
+    voltage. The device is equipped with a control zone, in which the
+    voltage is controlled and zones, in which the torque is controlled.
+    The invention also relates to methods for operating a device of this
+    type.
+  annote: This is a patent entry with a holder field. Note the format of
+    the type and location fields in the database file. Compare almendro,
+    sorace, and kowalik
+  author:
+  - family: Laufenberg
+    given: Xaver
+  - family: Eynius
+    given: Dominique
+  - family: Suelzle
+    given: Helmut
+  - family: Usbeck
+    given: Stephan
+  - family: Spaeth
+    given: Matthias
+  - family: Neuser-Hoffmann
+    given: Miriam
+  - family: Myrzik
+    given: Christian
+  - family: Schmid
+    given: Manfred
+  - family: Nietfeld
+    given: Franz
+  - family: Thiel
+    given: Alexander
+  - family: Braun
+    given: Harald
+  - family: Ebner
+    given: Norbert
+  genre: European patent
+  id: laufenberg
+  issued: 2006-09-13
+  language: de-DE
+  number: 1700367
+  title: Elektrische Einrichtung und Betriebsverfahren
+  type: patent
+- annote: This is a patent entry with a holder field. Note the format of
+    the type and date fields in the database file. Compare almendro,
+    laufenberg, and kowalik
+  author:
+  - family: Sorace
+    given: Ronald E.
+  - family: Reinhardt
+    given: Victor S.
+  - family: Vaughn
+    given: Steven A.
+  genre: U.S. patent
+  id: sorace
+  issued: 1997-09-16
+  language: en-US
+  number: 5668842
+  title: High-speed digital-to-RF converter
+  type: patent
+---
+
+
+```
diff --git a/test/command/biblatex-periodical.md b/test/command/biblatex-periodical.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-periodical.md
@@ -0,0 +1,31 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{excerpt from
+http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib}
+
+@periodical{jcg,
+	Annotation = {This is a periodical entry with an issn field.},
+	Issn = {0097-8493},
+	Issuetitle = {Semantic {3D} Media and Content},
+	Number = 4,
+	Title = {Computers and Graphics},
+	Volume = 35,
+	Year = 2011}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a periodical entry with an issn field.
+  container-title: Computers and Graphics
+  id: jcg
+  issn: 0097-8493
+  issue: 4
+  issued: 2011
+  title: Semantic 3D media and content
+  type: article-journal
+  volume: 35
+---
+
+
+```
diff --git a/test/command/biblatex-piccato.md b/test/command/biblatex-piccato.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-piccato.md
@@ -0,0 +1,59 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Piccato 2001)
+
+Piccato, Pablo. 2001. *City of Suspects: Crime in Mexico City,
+1900–1931*. Durham; London: Duke University Press.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Piccato, 2001)
+
+Piccato, P. (2001). *City of suspects: Crime in Mexico City, 1900–1931*.
+Durham; London: Duke University Press.
+
+
+}
+
+@Book{piccato,
+  author       = {Piccato, Pablo},
+  title        = {City of Suspects},
+  date         = 2001,
+  publisher    = {Duke University Press},
+  location     = {Durham and London},
+  hyphenation  = {american},
+  subtitle     = {Crime in {Mexico City}, 1900--1931},
+  shorttitle   = {City of Suspects},
+  annotation   = {This is a book entry. Note the format of the
+                  location field in the database file},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a book entry. Note the format of the location field in
+    the database file
+  author:
+  - family: Piccato
+    given: Pablo
+  id: piccato
+  issued: 2001
+  language: en-US
+  publisher: Duke University Press
+  publisher-place: Durham; London
+  title: "City of suspects: Crime in Mexico City, 1900--1931"
+  title-short: City of suspects
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-pines.md b/test/command/biblatex-pines.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-pines.md
@@ -0,0 +1,77 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Pines 1979)
+
+Pines, Shlomo. 1979. “The Limitations of Human Knowledge According to
+Al-Farabi, ibn Bajja, and Maimonides.” In *Studies in Medieval Jewish
+History and Literature*, edited by Isadore Twersky, 82–109. Cambridge,
+Mass.: Harvard University Press.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Pines, 1979)
+
+Pines, S. (1979). The limitations of human knowledge according to
+Al-Farabi, ibn Bajja, and Maimonides. In I. Twersky (Ed.), *Studies in
+medieval Jewish history and literature* (pp. 82–109). Cambridge, Mass.:
+Harvard University Press.
+
+
+}
+
+@string{ hup     = {Harvard University Press} }
+
+@InCollection{pines,
+  author       = {Pines, Shlomo},
+  editor       = {Twersky, Isadore},
+  title        = {The Limitations of Human Knowledge According to {Al-Farabi}, {ibn
+                  Bajja}, and {Maimonides}},
+  date         = 1979,
+  booktitle    = {Studies in Medieval {Jewish} History and Literature},
+  publisher    = hup,
+  location     = {Cambridge, Mass.},
+  pages        = {82-109},
+  keywords     = {secondary},
+  hyphenation  = {american},
+  indextitle   = {Limitations of Human Knowledge According to {Al-Farabi}, {ibn
+                  Bajja}, and {Maimonides}, The},
+  shorttitle   = {Limitations of Human Knowledge},
+  annotation   = {A typical incollection entry. Note the
+                  indextitle field},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A typical incollection entry. Note the indextitle field
+  author:
+  - family: Pines
+    given: Shlomo
+  container-title: Studies in medieval Jewish history and literature
+  editor:
+  - family: Twersky
+    given: Isadore
+  id: pines
+  issued: 1979
+  keyword: secondary
+  language: en-US
+  page: 82-109
+  publisher: Harvard University Press
+  publisher-place: Cambridge, Mass.
+  title: The limitations of human knowledge according to Al-Farabi, [ibn
+    Bajja]{.nocase}, and Maimonides
+  title-short: Limitations of human knowledge
+  type: chapter
+---
+
+
+```
diff --git a/test/command/biblatex-quotes.md b/test/command/biblatex-quotes.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-quotes.md
@@ -0,0 +1,44 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{excerpt from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib
+
+\mkbibquote{} should be replaced by a matching set of quotation marks that can be used by citeproc for quote substitution and flipflopping. English smart double quotation marks seem best, as they cannot be confused with apostrophes.
+
+\enquote{}, \enquote*{} should be replaced by a matching set of quotation marks, too: “foo”, ‘bar’.
+}
+
+@string{pup = {Princeton University Press}}
+
+@book{nussbaum,
+	Annotation = {A book entry. Note the sorttitle and indexsorttitle fields and the markup of the quotes in the database file},
+	Author = {Nussbaum, Martha},
+	Date = 1978,
+	Hyphenation = {american},
+	Indexsorttitle = {Aristotle's De Motu Animalium},
+	Keywords = {secondary},
+	Location = {Princeton},
+	Publisher = pup,
+	Sorttitle = {Aristotle's De Motu Animalium},
+	Title = {Aristotle's \mkbibquote{De Motu Animalium}}}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A book entry. Note the sorttitle and indexsorttitle fields and
+    the markup of the quotes in the database file
+  author:
+  - family: Nussbaum
+    given: Martha
+  id: nussbaum
+  issued: 1978
+  keyword: secondary
+  language: en-US
+  publisher: Princeton University Press
+  publisher-place: Princeton
+  title: "Aristotle's \"De Motu Animalium\""
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-reese.md b/test/command/biblatex-reese.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-reese.md
@@ -0,0 +1,71 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Reese 1958)
+
+Reese, Trevor R. 1958. “Georgia in Anglo-Spanish Diplomacy, 1736-1739.”
+*William and Mary Quarterly, 3* 15: 168–190.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Reese, 1958)
+
+Reese, T. R. (1958). Georgia in Anglo-Spanish diplomacy, 1736-1739.
+*William and Mary Quarterly, 3*, *15*, 168–190.
+
+
+NOTES:
+
+- biblio2yaml
+	- series field: still not entirely satisfactory.
+	  Could we map this to some existing CSL variable, and have the CSL styles handle this? "edition", maybe ??
+
+}
+
+@Article{reese,
+  author       = {Reese, Trevor R.},
+  title        = {Georgia in {Anglo-Spanish} Diplomacy, 1736-1739},
+  journaltitle = {William and Mary Quarterly},
+  date         = 1958,
+  series       = 3,
+  volume       = 15,
+  pages        = {168-190},
+  hyphenation  = {american},
+  annotation   = {An article entry with a series and a
+                  volume field. Note the format of the series. If the
+                  value of the series field is an integer, this number
+                  is printed as an ordinal and the string \enquote*{series} is
+                  appended automatically},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: An article entry with a series and a volume field. Note the
+    format of the series. If the value of the series field is an
+    integer, this number is printed as an ordinal and the string
+    'series' is appended automatically
+  author:
+  - family: Reese
+    given: Trevor R.
+  collection-title: 3rd series
+  container-title: William and Mary Quarterly
+  id: reese
+  issued: 1958
+  language: en-US
+  page: 168-190
+  title: Georgia in Anglo-Spanish diplomacy, 1736-1739
+  type: article-journal
+  volume: 15
+---
+
+
+```
diff --git a/test/command/biblatex-report.md b/test/command/biblatex-report.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-report.md
@@ -0,0 +1,119 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{excerpt from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib
+
+TODO: Where to map "file" field?
+}
+
+@report{chiu,
+	Annotation = {This is a report entry for a research report. Note the format of the type field in the database file which uses a localization key. The number of the report is given in the number field. Also note the sorttitle and indextitle fields},
+	Author = {Chiu, Willy W. and Chow, We Min},
+	Date = 1978,
+	Hyphenation = {american},
+	Indextitle = {Hybrid Hierarchical Model, A},
+	Institution = {IBM},
+	Number = {RC-6947},
+	Sorttitle = {Hybrid Hierarchical Model of a Multiple Virtual Storage (MVS) Operating System},
+	Title = {A Hybrid Hierarchical Model of a {Multiple Virtual Storage} ({MVS}) Operating System},
+	Type = {resreport}}
+
+@report{padhye,
+	Annotation = {This is a report entry for a technical report. Note the format of the type field in the database file which uses a localization key. The number of the report is given in the number field. Also note the sorttitle and indextitle fields},
+	Author = {Padhye, Jitendra and Firoiu, Victor and Towsley, Don},
+	Date = 1999,
+	File = {ftp://gaia.cs.umass.edu/pub/Padhey99-markov.ps},
+	Hyphenation = {american},
+	Indextitle = {Stochastic Model of TCP Reno Congestion Avoidance and Control, A},
+	Institution = {University of Massachusetts},
+	Location = {Amherst, Mass.},
+	Number = {99-02},
+	Sorttitle = {A Stochastic Model of TCP Reno Congestion Avoidance and Control},
+	Title = {A Stochastic Model of {TCP Reno} Congestion Avoidance and Control},
+	Type = {techreport},
+	Abstract = {The steady state performance of a bulk transfer TCP flow
+                  (i.e., a flow with a large amount of data to send, such as FTP
+                  transfers) may be characterized by three quantities. The first
+                  is the send rate, which is the amount of data sent by the
+                  sender in unit time. The second is the throughput, which is
+                  the amount of data received by the receiver in unit time. Note
+                  that the throughput will always be less than or equal to the
+                  send rate due to losses. Finally, the number of non-duplicate
+                  packets received by the receiver in unit time gives us the
+                  goodput of the connection. The goodput is always less than or
+                  equal to the throughput, since the receiver may receive two
+                  copies of the same packet due to retransmissions by the
+                  sender. In a previous paper, we presented a simple model for
+                  predicting the steady state send rate of a bulk transfer TCP
+                  flow as a function of loss rate and round trip time. In this
+                  paper, we extend that work in two ways. First, we analyze the
+                  performance of bulk transfer TCP flows using more precise,
+                  stochastic analysis. Second, we build upon the previous
+                  analysis to provide both an approximate formula as well as a
+                  more accurate stochastic model for the steady state throughput
+                  of a bulk transfer TCP flow.}}
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a report entry for a research report. Note the format
+    of the type field in the database file which uses a localization
+    key. The number of the report is given in the number field. Also
+    note the sorttitle and indextitle fields
+  author:
+  - family: Chiu
+    given: Willy W.
+  - family: Chow
+    given: We Min
+  genre: research report
+  id: chiu
+  issued: 1978
+  language: en-US
+  number: RC-6947
+  publisher: IBM
+  title: A hybrid hierarchical model of a Multiple Virtual Storage (MVS)
+    operating system
+  type: report
+- abstract: The steady state performance of a bulk transfer TCP flow
+    (i.e., a flow with a large amount of data to send, such as FTP
+    transfers) may be characterized by three quantities. The first is
+    the send rate, which is the amount of data sent by the sender in
+    unit time. The second is the throughput, which is the amount of data
+    received by the receiver in unit time. Note that the throughput will
+    always be less than or equal to the send rate due to losses.
+    Finally, the number of non-duplicate packets received by the
+    receiver in unit time gives us the goodput of the connection. The
+    goodput is always less than or equal to the throughput, since the
+    receiver may receive two copies of the same packet due to
+    retransmissions by the sender. In a previous paper, we presented a
+    simple model for predicting the steady state send rate of a bulk
+    transfer TCP flow as a function of loss rate and round trip time. In
+    this paper, we extend that work in two ways. First, we analyze the
+    performance of bulk transfer TCP flows using more precise,
+    stochastic analysis. Second, we build upon the previous analysis to
+    provide both an approximate formula as well as a more accurate
+    stochastic model for the steady state throughput of a bulk transfer
+    TCP flow.
+  annote: This is a report entry for a technical report. Note the format
+    of the type field in the database file which uses a localization
+    key. The number of the report is given in the number field. Also
+    note the sorttitle and indextitle fields
+  author:
+  - family: Padhye
+    given: Jitendra
+  - family: Firoiu
+    given: Victor
+  - family: Towsley
+    given: Don
+  genre: technical report
+  id: padhye
+  issued: 1999
+  language: en-US
+  number: 99-02
+  publisher: University of Massachusetts
+  publisher-place: Amherst, Mass.
+  title: A stochastic model of TCP Reno congestion avoidance and control
+  type: report
+---
+
+
+```
diff --git a/test/command/biblatex-salam.md b/test/command/biblatex-salam.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-salam.md
@@ -0,0 +1,69 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Salam 1968)
+
+Salam, Abdus. 1968. “Weak and Electromagnetic Interactions.” In
+*Elementary Particle Theory: Relativistic Groups and Analyticity.
+Proceedings of the Eighth Nobel Symposium*, edited by Nils Svartholm,
+367–377. Stockholm: Almquist & Wiksell.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Salam, 1968)
+
+Salam, A. (1968). Weak and electromagnetic interactions. In N. Svartholm
+(Ed.), *Elementary particle theory: Relativistic groups and analyticity.
+Proceedings of the eighth Nobel symposium* (pp. 367–377). Stockholm:
+Almquist & Wiksell.
+
+
+}
+
+@InProceedings{salam,
+  author       = {Salam, Abdus},
+  editor       = {Svartholm, Nils},
+  title        = {Weak and Electromagnetic Interactions},
+  date         = 1968,
+  booktitle    = {Elementary particle theory},
+  booksubtitle = {Relativistic groups and analyticity},
+  booktitleaddon= {Proceedings of the Eighth {Nobel} Symposium},
+  eventdate    = {1968-05-19/1968-05-25},
+  venue        = {Aspen{\"a}sgarden, Lerum},
+  publisher    = {Almquist \& Wiksell},
+  location     = {Stockholm},
+  pages        = {367-377},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Salam
+    given: Abdus
+  container-title: "Elementary particle theory: Relativistic groups and
+    analyticity. Proceedings of the eighth Nobel symposium"
+  editor:
+  - family: Svartholm
+    given: Nils
+  event-date: 1968-05-19/1968-05-25
+  event-place: Aspenäsgarden, Lerum
+  id: salam
+  issued: 1968
+  page: 367-377
+  publisher: Almquist & Wiksell
+  publisher-place: Stockholm
+  title: Weak and electromagnetic interactions
+  type: paper-conference
+---
+
+
+```
diff --git a/test/command/biblatex-sarfraz.md b/test/command/biblatex-sarfraz.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-sarfraz.md
@@ -0,0 +1,65 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Sarfraz and Razzak 2002)
+
+Sarfraz, M., and M. F. A. Razzak. 2002. “Technical Section: An Algorithm
+for Automatic Capturing of the Font Outlines.” *Computers and Graphics*
+26 (5): 795–804.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Sarfraz & Razzak, 2002)
+
+Sarfraz, M., & Razzak, M. F. A. (2002). Technical section: An algorithm
+for automatic capturing of the font outlines. *Computers and Graphics*,
+*26*(5), 795–804.
+
+
+}
+
+@Article{sarfraz,
+  author       = {M. Sarfraz and M. F. A. Razzak},
+  title        = {Technical section: {An} algorithm for automatic capturing of
+                  the font outlines},
+  year         = 2002,
+  volume       = 26,
+  number       = 5,
+  pages        = {795-804},
+  issn         = {0097-8493},
+  journal      = {Computers and Graphics},
+  annotation   = {An article entry with an issn field},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: An article entry with an issn field
+  author:
+  - family: Sarfraz
+    given: M.
+  - family: Razzak
+    given: M. F. A.
+  container-title: Computers and Graphics
+  id: sarfraz
+  issn: 0097-8493
+  issue: 5
+  issued: 2002
+  page: 795-804
+  title: "Technical section: An algorithm for automatic capturing of the
+    font outlines"
+  title-short: Technical section
+  type: article-journal
+  volume: 26
+---
+
+
+```
diff --git a/test/command/biblatex-shore.md b/test/command/biblatex-shore.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-shore.md
@@ -0,0 +1,66 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Shore 1991)
+
+Shore, Bradd. 1991. “Twice-born, Once Conceived: Meaning Construction
+and Cultural Cognition.” *American Anthropologist, New Series* 93 (1)
+(March): 9–27.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Shore, 1991)
+
+Shore, B. (1991). Twice-born, once conceived: Meaning construction and
+cultural cognition. *American Anthropologist, new series*, *93*(1),
+9–27.
+
+
+}
+
+@Article{shore,
+  author       = {Shore, Bradd},
+  title        = {Twice-Born, Once Conceived},
+  journaltitle = {American Anthropologist},
+  date         = {1991-03},
+  subtitle     = {Meaning Construction and Cultural Cognition},
+  series       = {newseries},
+  volume       = 93,
+  number       = 1,
+  pages        = {9-27},
+  annotation   = {An article entry with series,
+                  volume, and number fields. Note the format
+                  of the series which is a localization key},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: An article entry with series, volume, and number fields. Note
+    the format of the series which is a localization key
+  author:
+  - family: Shore
+    given: Bradd
+  collection-title: new series
+  container-title: American Anthropologist
+  id: shore
+  issue: 1
+  issued: 1991-03
+  page: 9-27
+  title: "Twice-born, once conceived: Meaning construction and cultural
+    cognition"
+  title-short: Twice-born, once conceived
+  type: article-journal
+  volume: 93
+---
+
+
+```
diff --git a/test/command/biblatex-sigfridsson.md b/test/command/biblatex-sigfridsson.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-sigfridsson.md
@@ -0,0 +1,106 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Sigfridsson and Ryde 1998)
+
+Sigfridsson, Emma, and Ulf Ryde. 1998. “Comparison of Methods for
+Deriving Atomic Charges from the Electrostatic Potential and Moments.”
+*Journal of Computational Chemistry* 19 (4): 377–395.
+doi:[10.1002/(SICI)1096-987X(199803)19:4\<377::AID-JCC1\>3.0.CO;2-P](https://doi.org/10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P "10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P").
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Sigfridsson & Ryde, 1998)
+
+Sigfridsson, E., & Ryde, U. (1998). Comparison of methods for deriving
+atomic charges from the electrostatic potential and moments. *Journal of
+Computational Chemistry*, *19*(4), 377–395.
+doi:[10.1002/(SICI)1096-987X(199803)19:4\<377::AID-JCC1\>3.0.CO;2-P](https://doi.org/10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P "10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P")
+
+
+NOTES:
+
+- biblio2xaml
+	- the string "doi:" should not appear as part of the content of the "doi" field 
+
+}
+
+@Article{sigfridsson,
+  author       = {Sigfridsson, Emma and Ryde, Ulf},
+  title        = {Comparison of methods for deriving atomic charges from the
+                  electrostatic potential and moments},
+  journaltitle = {Journal of Computational Chemistry},
+  date         = 1998,
+  volume       = 19,
+  number       = 4,
+  pages        = {377-395},
+  doi          = {10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P},
+  hyphenation  = {american},
+  indextitle   = {Methods for deriving atomic charges},
+  annotation   = {An article entry with volume,
+                  number, and doi fields. Note that the
+                  \textsc{doi} is transformed into a clickable link if
+                  hyperref support has been enabled},
+  abstract     = {Four methods for deriving partial atomic charges from the
+                  quantum chemical electrostatic potential (CHELP, CHELPG,
+                  Merz-Kollman, and RESP) have been compared and critically
+                  evaluated. It is shown that charges strongly depend on how and
+                  where the potential points are selected. Two alternative
+                  methods are suggested to avoid the arbitrariness in the
+                  point-selection schemes and van der Waals exclusion radii:
+                  CHELP-BOW, which also estimates the charges from the
+                  electrostatic potential, but with potential points that are
+                  Boltzmann-weighted after their occurrence in actual
+                  simulations using the energy function of the program in which
+                  the charges will be used, and CHELMO, which estimates the
+                  charges directly from the electrostatic multipole
+                  moments. Different criteria for the quality of the charges are
+                  discussed.},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- abstract: "Four methods for deriving partial atomic charges from the
+    quantum chemical electrostatic potential (CHELP, CHELPG,
+    Merz-Kollman, and RESP) have been compared and critically evaluated.
+    It is shown that charges strongly depend on how and where the
+    potential points are selected. Two alternative methods are suggested
+    to avoid the arbitrariness in the point-selection schemes and van
+    der Waals exclusion radii: CHELP-BOW, which also estimates the
+    charges from the electrostatic potential, but with potential points
+    that are Boltzmann-weighted after their occurrence in actual
+    simulations using the energy function of the program in which the
+    charges will be used, and CHELMO, which estimates the charges
+    directly from the electrostatic multipole moments. Different
+    criteria for the quality of the charges are discussed."
+  annote: An article entry with volume, number, and doi fields. Note
+    that the [doi]{.smallcaps} is transformed into a clickable link if
+    hyperref support has been enabled
+  author:
+  - family: Sigfridsson
+    given: Emma
+  - family: Ryde
+    given: Ulf
+  container-title: Journal of Computational Chemistry
+  doi: "10.1002/(SICI)1096-987X(199803)19:4\\<377::AID-JCC1\\>3.0.CO;2-P"
+  id: sigfridsson
+  issue: 4
+  issued: 1998
+  language: en-US
+  page: 377-395
+  title: Comparison of methods for deriving atomic charges from the
+    electrostatic potential and moments
+  type: article-journal
+  volume: 19
+---
+
+
+```
diff --git a/test/command/biblatex-sorace.md b/test/command/biblatex-sorace.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-sorace.md
@@ -0,0 +1,65 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Sorace, Reinhardt, and Vaughn 1997)
+
+Sorace, Ronald E., Victor S. Reinhardt, and Steven A. Vaughn. 1997.
+“High-speed Digital-to-RF Converter.” U.S. patent.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Sorace, Reinhardt, & Vaughn, 1997)
+
+Sorace, R. E., Reinhardt, V. S., & Vaughn, S. A. (1997, September 16).
+High-speed digital-to-RF converter. U.S. patent.
+
+
+}
+
+@Patent{sorace,
+  author       = {Sorace, Ronald E. and Reinhardt, Victor S. and Vaughn, Steven
+                  A.},
+  title        = {High-Speed Digital-to-{RF} Converter},
+  number       = 5668842,
+  date         = {1997-09-16},
+  holder       = {{Hughes Aircraft Company}},
+  type         = {patentus},
+  hyphenation  = {american},
+  annotation   = {This is a patent entry with a holder field.
+                  Note the format of the type and date fields
+                  in the database file. Compare almendro,
+                  laufenberg, and kowalik},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a patent entry with a holder field. Note the format of
+    the type and date fields in the database file. Compare almendro,
+    laufenberg, and kowalik
+  author:
+  - family: Sorace
+    given: Ronald E.
+  - family: Reinhardt
+    given: Victor S.
+  - family: Vaughn
+    given: Steven A.
+  genre: U.S. patent
+  id: sorace
+  issued: 1997-09-16
+  language: en-US
+  number: 5668842
+  title: High-speed digital-to-RF converter
+  type: patent
+---
+
+
+```
diff --git a/test/command/biblatex-spiegelberg.md b/test/command/biblatex-spiegelberg.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-spiegelberg.md
@@ -0,0 +1,74 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Spiegelberg 1969)
+
+Spiegelberg, Herbert. 1969. ““Intention” und “Intentionalität” in der
+Scholastik, bei Brentano und Husserl.” *Studia Philosophica* 29:
+189–216.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Spiegelberg, 1969)
+
+Spiegelberg, H. (1969). “Intention” und “Intentionalität” in der
+Scholastik, bei Brentano und Husserl. *Studia Philosophica*, *29*,
+189–216.
+
+
+NOTES:
+
+- citeproc
+	- flipflopping of quotes incorrect
+
+}
+
+@Article{spiegelberg,
+  author       = {Spiegelberg, Herbert},
+  title        = {\mkbibquote{Intention} und \mkbibquote{Intentionalit{\"a}t} in
+                  der Scholastik, bei Brentano und Husserl},
+  journaltitle = {Studia Philosophica},
+  date         = 1969,
+  volume       = 29,
+  pages        = {189-216},
+  hyphenation  = {german},
+  sorttitle    = {Intention und Intentionalitat in der Scholastik, bei Brentano
+                  und Husserl},
+  indexsorttitle= {Intention und Intentionalitat in der Scholastik, bei Brentano
+                  und Husserl},
+  shorttitle   = {Intention und Intentionalit{\"a}t},
+  annotation   = {An article entry. Note the sorttitle and
+                  indexsorttitle fields and the markup of the quotes in
+                  the database file},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: An article entry. Note the sorttitle and indexsorttitle fields
+    and the markup of the quotes in the database file
+  author:
+  - family: Spiegelberg
+    given: Herbert
+  container-title: Studia Philosophica
+  id: spiegelberg
+  issued: 1969
+  language: de-DE
+  page: 189-216
+  title: "Intention" und "Intentionalität" in der Scholastik, bei
+    Brentano und Husserl
+  title-short: Intention und Intentionalität
+  type: article-journal
+  volume: 29
+---
+
+
+```
diff --git a/test/command/biblatex-springer.md b/test/command/biblatex-springer.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-springer.md
@@ -0,0 +1,58 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Springer 1950)
+
+Springer, Otto. 1950. “Mediaeval Pilgrim Routes from Scandinavia to
+Rome.” *Mediaeval Studies* 12: 92–122.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Springer, 1950)
+
+Springer, O. (1950). Mediaeval pilgrim routes from Scandinavia to Rome.
+*Mediaeval Studies*, *12*, 92–122.
+
+
+}
+
+@Article{springer,
+  author       = {Springer, Otto},
+  title        = {Mediaeval Pilgrim Routes from {Scandinavia} to {Rome}},
+  journaltitle = {Mediaeval Studies},
+  date         = 1950,
+  volume       = 12,
+  pages        = {92-122},
+  hyphenation  = {british},
+  shorttitle   = {Mediaeval Pilgrim Routes},
+  annotation   = {A plain article entry},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A plain article entry
+  author:
+  - family: Springer
+    given: Otto
+  container-title: Mediaeval Studies
+  id: springer
+  issued: 1950
+  language: en-GB
+  page: 92-122
+  title: Mediaeval pilgrim routes from Scandinavia to Rome
+  title-short: Mediaeval pilgrim routes
+  type: article-journal
+  volume: 12
+---
+
+
+```
diff --git a/test/command/biblatex-strings.md b/test/command/biblatex-strings.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-strings.md
@@ -0,0 +1,46 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{excerpt from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib}
+
+@string{anch-ie = {Angew.~Chem. Int.~Ed.}}
+
+@article{herrmann,
+	Author = {Herrmann, Wolfgang A. and Öfele, Karl and Schneider, Sabine K. and Herdtweck, Eberhardt and Hoffmann, Stephan D.},
+	Date = 2006,
+	Hyphenation = {english},
+	Indextitle = {Carbocyclic carbene as an efficient catalyst, A},
+	Journaltitle = anch-ie,
+	Number = 23,
+	Pages = {3859-3862},
+	Title = {A Carbocyclic Carbene as an Efficient Catalyst Ligand for {C--C} Coupling Reactions},
+	Volume = 45}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Herrmann
+    given: Wolfgang A.
+  - family: Öfele
+    given: Karl
+  - family: Schneider
+    given: Sabine K.
+  - family: Herdtweck
+    given: Eberhardt
+  - family: Hoffmann
+    given: Stephan D.
+  container-title: Angew. Chem. Int. Ed.
+  id: herrmann
+  issue: 23
+  issued: 2006
+  language: en-US
+  page: 3859-3862
+  title: A carbocyclic carbene as an efficient catalyst ligand for C--C
+    coupling reactions
+  type: article-journal
+  volume: 45
+---
+
+
+```
diff --git a/test/command/biblatex-test-case-conversion.md b/test/command/biblatex-test-case-conversion.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-test-case-conversion.md
@@ -0,0 +1,73 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+    - bibtex and biblatex
+        - expect titles in title case
+        - styles use titles as is, or convert them to sentence case
+        - strings wrapped {} are not converted
+    - all CSL styles at <http://github.com/citation-style-language/styles>
+      and <https://www.zotero.org/styles/>
+        - expect titles in sentence case
+        - styles use titles as is, or convert them to title case
+        - except for (hardcoded) list of stop words, see
+          <http://citationstyles.org/downloads/specification.html#title-case-conversion>
+        - citeproc-js (MLZ only?) also recognizes a markup syntax for
+          suppressing title-case changes on a range of text (see
+          <https://forums.zotero.org/discussion/21991/excessive-capitalization-of-citation-titles/#Item_22>):
+            - `<span class="nocase"/>lowercase</span>`
+    - Proposal:
+        - When converting to yaml, convert English titles to sentence case,
+            - for all strings wrapped in {} where {} is not part of a latex
+              command, ...
+            - ... when starting with an uppercase letter: suppress
+conversion, remove the {}
+            - ... when starting with a lowercase letter ("nm", "iPod"):
+              suppress conversion, replace the {} with
+              <span class="nocase"/></span>
+            - Note: Camel case ("iPod") needs to be protected in
+              bibtex/biblatex anyway; the only "extension" (wrt bibtex/biblatex
+              specs) we'd be introducing is wrapping lowercase-only strings in
+              {}, something that is never necessary on the latex side but
+              won't break anything there either.
+        - citeproc-hs/pandoc-citeproc should be modified to honour this new
+          syntax and suppress conversion to title case for strings wrapped
+          in `<span class="nocase"/></span>`.
+        - Expected output, using one of the title-case CSL styles, here
+          chicago-author-date.csl:
+
+            Author, Ann. 2013. “A Title, in English, with a Proper Name and
+an
+            ACRONYM and a camelCase Word and Some Units, 400 nm, 3 cm, and
+a Quote,
+            *Alea iacta est*.” *Journal*.
+    }
+
+@article{item1,
+    Author = {Author, Ann},
+    Date = {2013},
+    Hyphenation = {english},
+    Journaltitle = {Journal},
+    Title = {A Title, in {English}, with a {Proper Name} and an {ACRONYM}
+and a {camelCase} Word and Some Units, 400~{nm}, 3~{cm}, and a Quote,
+\textit{{Alea} {iacta est}}}
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Author
+    given: Ann
+  container-title: Journal
+  id: item1
+  issued: 2013
+  language: en-US
+  title: "A title, in English, with a Proper Name and an ACRONYM and a
+    [camelCase]{.nocase} word and some units, 400 [nm]{.nocase},
+    3 [cm]{.nocase}, and a quote, *Alea [iacta est]{.nocase}*"
+  type: article-journal
+---
+
+
+```
diff --git a/test/command/biblatex-textnormal.md b/test/command/biblatex-textnormal.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-textnormal.md
@@ -0,0 +1,17 @@
+```
+% pandoc -f biblatex -t markdown -s
+@book{item1,
+	Title = {The Title \textnormal{of this book}},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- id: item1
+  title: "The title [of this book]{.nodecor}"
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-thesis.md b/test/command/biblatex-thesis.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-thesis.md
@@ -0,0 +1,68 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{excerpted from http://mirrors.ctan.org/macros/latex/contrib/biblatex/doc/examples/biblatex-examples.bib
+
+TODO: Uppercase letters follwing hyphens need to be converted to lowercase, too (e.g., "r" in "High-Resolution". -- Same for citeproc when doing title-case conversion!)
+}
+
+@thesis{geer,
+	Annotation = {This is a typical thesis entry for a PhD thesis. Note the type field in the database file which uses a localization key. Also note the format of the printed name and compare the useprefix option in the options field as well as vangennep},
+	Author = {de Geer, Ingrid},
+	Date = 1985,
+	Hyphenation = {british},
+	Institution = {Uppsala Universitet},
+	Location = {Uppsala},
+	Options = {useprefix=false},
+	Subtitle = {The {Orkney} Earldom of the Twelfth Century. {A} Musicological Study},
+	Title = {Earl, Saint, Bishop, Skald~-- and Music},
+	Type = {phdthesis}}
+
+@thesis{loh,
+	Annotation = {This is a typical thesis entry for an MA thesis. Note the type field in the database file which uses a localization key},
+	Author = {Loh, Nin C.},
+	Date = 1992,
+	Hyphenation = {american},
+	Institution = {Massachusetts Institute of Technology},
+	Location = {Cambridge, Mass.},
+	Title = {High-Resolution Micromachined Interferometric Accelerometer},
+	Type = {mathesis}}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a typical thesis entry for a PhD thesis. Note the type
+    field in the database file which uses a localization key. Also note
+    the format of the printed name and compare the useprefix option in
+    the options field as well as vangennep
+  author:
+  - dropping-particle: de
+    family: Geer
+    given: Ingrid
+  genre: PhD thesis
+  id: geer
+  issued: 1985
+  language: en-GB
+  publisher: Uppsala Universitet
+  publisher-place: Uppsala
+  title: "Earl, saint, bishop, skald -- and music: The Orkney earldom of
+    the twelfth century. A musicological study"
+  title-short: Earl, saint, bishop, skald -- and music
+  type: thesis
+- annote: This is a typical thesis entry for an MA thesis. Note the type
+    field in the database file which uses a localization key
+  author:
+  - family: Loh
+    given: Nin C.
+  genre: Master's thesis
+  id: loh
+  issued: 1992
+  language: en-US
+  publisher: Massachusetts Institute of Technology
+  publisher-place: Cambridge, Mass.
+  title: High-resolution micromachined interferometric accelerometer
+  type: thesis
+---
+
+
+```
diff --git a/test/command/biblatex-title-and-shorttitle.md b/test/command/biblatex-title-and-shorttitle.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-title-and-shorttitle.md
@@ -0,0 +1,76 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+TODO:
+Slight inconsistency:
+When a biblatex “title” field contains a colon, the part before the colon is mapped to CSL “title-short”.
+When there’s a biblatex “title” and a “subtitle” field, CSL “title-short” is not set, though it would make at least as much sense to map “title” (without “subtitle”) to CSL “title-short” in this case.
+
+CSL “container-title-short” could also be set
+- from biblatex “shortjournal”
+- for inbook, incollection etc. from the “shorttitle” field of the crossreferenced book, collection etc. entry (see item5, item6)
+... but it might not really be worth it, “container-title-short” not being used once in my sample of 70+ CSL styles.
+
+}
+
+@book{item4,
+	Shorttitle = {The Shorttitle},
+	Subtitle = {And a Subtitle, in Two Separate Fields; plus a Separate “Shorttitle” Field},
+	Title = {The Title: With a Colon in the “Title” Field}}
+
+@book{item3,
+	Subtitle = {And a Subtitle, in two separate fields},
+	Title = {The Title: With a Colon in the “title” field}}
+
+@book{item2,
+	Subtitle = {The Subtitle, In Two Separate fields},
+	Title = {The Title}}
+
+@book{item1,
+	Title = {The Title: And the Subtitle, all in the “title” Field}}
+
+@inbook{item5,
+	Title = {The inbook Title: And the Subtitle, all in the “title” Field},
+	Crossref = {item6}}
+
+@book{item6,
+	Title = {The Title: And the Subtitle, all in the “title” Field},
+	Shorttitle = {The Shorttitle},
+}
+^D
+---
+nocite: "[@*]"
+references:
+- id: item4
+  title: "The title: With a colon in the \"title\" field: And a subtitle,
+    in two separate fields; plus a separate \"shorttitle\" field"
+  title-short: The shorttitle
+  type: book
+- id: item3
+  title: "The title: With a colon in the \"title\" field: And a subtitle,
+    in two separate fields"
+  title-short: The title
+  type: book
+- id: item2
+  title: "The title: The subtitle, in two separate fields"
+  title-short: The title
+  type: book
+- id: item1
+  title: "The title: And the subtitle, all in the \"title\" field"
+  title-short: The title
+  type: book
+- container-title: "The title: And the subtitle, all in the \"title\"
+    field"
+  id: item5
+  title: "The inbook title: And the subtitle, all in the \"title\" field"
+  title-short: The inbook title
+  type: chapter
+- id: item6
+  title: "The title: And the subtitle, all in the \"title\" field"
+  title-short: The shorttitle
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-vangennep-related.md b/test/command/biblatex-vangennep-related.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-vangennep-related.md
@@ -0,0 +1,69 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(van Gennep 1909)
+
+van Gennep, Arnold. 1909. *Les rites de passage*. Paris: Nourry.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(van Gennep, 1909)
+
+van Gennep, A. (1909). *Les rites de passage*. Paris: Nourry.
+
+NOTES:
+
+- biblio2yaml
+	- "related = {vizedom:related}, relatedtype = {bytranslator}": no equivalent implemented in CSL
+	- "options = {useprefix}," is shorthand for "options = {useprefix=true},"
+
+
+}
+
+@Book{vangennep:related,
+  author       = {van Gennep, Arnold},
+  title        = {Les rites de passage},
+  date         = 1909,
+  publisher    = {Nourry},
+  location     = {Paris},
+  options      = {useprefix},
+  hyphenation  = {french},
+  related      = {vizedom:related},
+  relatedtype  = {bytranslator},
+  sorttitle    = {Rites de passage},
+  indextitle   = {Rites de passage, Les},
+  shorttitle   = {Rites de passage},
+  annotation   = {A variant of the vangennep entry related to its
+                  translation. Note the format of the related and
+                  relatedtype fields},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A variant of the vangennep entry related to its translation.
+    Note the format of the related and relatedtype fields
+  author:
+  - family: Gennep
+    given: Arnold
+    non-dropping-particle: van
+  id: "vangennep:related"
+  issued: 1909
+  language: fr-FR
+  publisher: Nourry
+  publisher-place: Paris
+  title: Les rites de passage
+  title-short: Rites de passage
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-vangennep-trans.md b/test/command/biblatex-vangennep-trans.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-vangennep-trans.md
@@ -0,0 +1,69 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(van Gennep 1960)
+
+van Gennep, Arnold. 1960. *The Rites of Passage*. Translated by Monika
+B. Vizedom and Gabrielle L. Caffee. University of Chicago Press.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(van Gennep, 1960)
+
+van Gennep, A. (1960). *The rites of passage*. (M. B. Vizedom & G. L.
+Caffee, Trans.). University of Chicago Press.
+
+
+}
+
+@Book{vangennep:trans,
+  author       = {van Gennep, Arnold},
+  title        = {The Rites of Passage},
+  year         = 1960,
+  translator   = {Vizedom, Monika B. and Caffee, Gabrielle L.},
+  language     = {english},
+  origlanguage = {french},
+  publisher    = {University of Chicago Press},
+  options      = {useprefix},
+  indextitle   = {Rites of Passage, The},
+  sorttitle    = {Rites of Passage},
+  shorttitle   = {Rites of Passage},
+  hyphenation  = {american},
+  annotation   = {A translation of the vangennep entry. Note the
+                  translator and origlanguage fields. Compare
+                  with the vangennep:related entry.},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: "A translation of the vangennep entry. Note the translator and
+    origlanguage fields. Compare with the vangennep:related entry."
+  author:
+  - family: Gennep
+    given: Arnold
+    non-dropping-particle: van
+  id: "vangennep:trans"
+  issued: 1960
+  language: en-US
+  publisher: University of Chicago Press
+  title: The rites of passage
+  title-short: Rites of passage
+  translator:
+  - family: Vizedom
+    given: Monika B.
+  - family: Caffee
+    given: Gabrielle L.
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-vangennep.md b/test/command/biblatex-vangennep.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-vangennep.md
@@ -0,0 +1,61 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(van Gennep 1909)
+
+van Gennep, Arnold. 1909. *Les rites de passage*. Paris: Nourry.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(van Gennep, 1909)
+
+van Gennep, A. (1909). *Les rites de passage*. Paris: Nourry.
+
+
+}
+
+@Book{vangennep,
+  author       = {van Gennep, Arnold},
+  title        = {Les rites de passage},
+  date         = 1909,
+  publisher    = {Nourry},
+  location     = {Paris},
+  options      = {useprefix},
+  hyphenation  = {french},
+  sorttitle    = {Rites de passage},
+  indextitle   = {Rites de passage, Les},
+  shorttitle   = {Rites de passage},
+  annotation   = {A book entry. Note the format of the printed name and
+                  compare the useprefix option in the options
+                  field as well as brandt and geer},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A book entry. Note the format of the printed name and compare
+    the useprefix option in the options field as well as brandt and geer
+  author:
+  - family: Gennep
+    given: Arnold
+    non-dropping-particle: van
+  id: vangennep
+  issued: 1909
+  language: fr-FR
+  publisher: Nourry
+  publisher-place: Paris
+  title: Les rites de passage
+  title-short: Rites de passage
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-vazques-de-parga-mvbook.md b/test/command/biblatex-vazques-de-parga-mvbook.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-vazques-de-parga-mvbook.md
@@ -0,0 +1,75 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Vázques de Parga, Lacarra, and Uría Ríu 1993)
+
+Vázques de Parga, Luis, José María Lacarra, and Juan Uría Ríu. 1993.
+*Las Peregrinaciones a Santiago de Compostela*. 3. Pamplona: Iberdrola.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Vázques de Parga, Lacarra, & Uría Ríu, 1993)
+
+Vázques de Parga, L., Lacarra, J. M., & Uría Ríu, J. (1993). *Las
+Peregrinaciones a Santiago de Compostela* (1-3). Pamplona: Iberdrola.
+
+
+NOTES:
+
+- citeproc
+	- term "vols." missing
+
+}
+
+@mvbook{vazques-de-parga,
+  author       = {V{\'a}zques{ de }Parga, Luis and Lacarra, Jos{\'e} Mar{\'i}a
+                  and Ur{\'i}a R{\'i}u, Juan},
+  title        = {Las Peregrinaciones a Santiago de Compostela},
+  date         = 1993,
+  volumes      = 3,
+  note         = {Ed. facs. de la realizada en 1948--49},
+  publisher    = {Iberdrola},
+  location     = {Pamplona},
+  hyphenation  = {spanish},
+  sorttitle    = {Peregrinaciones a Santiago de Compostela},
+  indextitle   = {Peregrinaciones a Santiago de Compostela, Las},
+  shorttitle   = {Peregrinaciones},
+  annotation   = {A multivolume book cited as a whole. This is a book
+                  entry with volumes, note,
+                  sorttitle, and indextitle fields},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A multivolume book cited as a whole. This is a book entry with
+    volumes, note, sorttitle, and indextitle fields
+  author:
+  - family: Vázques de Parga
+    given: Luis
+  - family: Lacarra
+    given: José María
+  - family: Uría Ríu
+    given: Juan
+  id: vazques-de-parga
+  issued: 1993
+  language: es-ES
+  note: Ed. facs. de la realizada en 1948--49
+  number-of-volumes: 3
+  publisher: Iberdrola
+  publisher-place: Pamplona
+  title: Las Peregrinaciones a Santiago de Compostela
+  title-short: Peregrinaciones
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-vazques-de-parga.md b/test/command/biblatex-vazques-de-parga.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-vazques-de-parga.md
@@ -0,0 +1,74 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Vázques de Parga, Lacarra, and Uría Ríu 1993)
+
+Vázques de Parga, Luis, José María Lacarra, and Juan Uría Ríu. 1993.
+*Las Peregrinaciones a Santiago de Compostela*. 3. Pamplona: Iberdrola.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Vázques de Parga, Lacarra, & Uría Ríu, 1993)
+
+Vázques de Parga, L., Lacarra, J. M., & Uría Ríu, J. (1993). *Las
+Peregrinaciones a Santiago de Compostela* (1-3). Pamplona: Iberdrola.
+
+
+NOTES:
+
+- citeproc
+	- term "vols." missing
+
+}
+
+@Book{vazques-de-parga,
+  author       = {V{\'a}zques{ de }Parga, Luis and Lacarra, Jos{\'e} Mar{\'i}a
+                  and Ur{\'i}a R{\'i}u, Juan},
+  title        = {Las Peregrinaciones a Santiago de Compostela},
+  date         = 1993,
+  volumes      = 3,
+  note         = {Ed. facs. de la realizada en 1948--49},
+  publisher    = {Iberdrola},
+  location     = {Pamplona},
+  hyphenation  = {spanish},
+  sorttitle    = {Peregrinaciones a Santiago de Compostela},
+  indextitle   = {Peregrinaciones a Santiago de Compostela, Las},
+  shorttitle   = {Peregrinaciones},
+  annotation   = {A multivolume book cited as a whole. This is a book
+                  entry with volumes, note,
+                  sorttitle, and indextitle fields},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A multivolume book cited as a whole. This is a book entry with
+    volumes, note, sorttitle, and indextitle fields
+  author:
+  - family: Vázques de Parga
+    given: Luis
+  - family: Lacarra
+    given: José María
+  - family: Uría Ríu
+    given: Juan
+  id: vazques-de-parga
+  issued: 1993
+  language: es-ES
+  note: Ed. facs. de la realizada en 1948--49
+  number-of-volumes: 3
+  publisher: Iberdrola
+  publisher-place: Pamplona
+  title: Las Peregrinaciones a Santiago de Compostela
+  title-short: Peregrinaciones
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-video.md b/test/command/biblatex-video.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-video.md
@@ -0,0 +1,19 @@
+```
+% pandoc -f biblatex -t markdown -s
+@video{x1,title={blah}}
+@movie{x2,title={blah}}
+
+^D
+---
+nocite: "[@*]"
+references:
+- id: x1
+  title: Blah
+  type: motion_picture
+- id: x2
+  title: Blah
+  type: motion_picture
+---
+
+
+```
diff --git a/test/command/biblatex-vizedom-related.md b/test/command/biblatex-vizedom-related.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-vizedom-related.md
@@ -0,0 +1,68 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Vizedom and Caffee 1960)
+
+Vizedom, Monika B., and Gabrielle L. Caffee, trans. 1960. *The Rites of
+Passage*. University of Chicago Press.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Vizedom & Caffee, 1960)
+
+Vizedom, M. B., & Caffee, G. L. (Trans.). (1960). *The rites of
+passage*. University of Chicago Press.
+
+
+NOTES:
+
+- biblio2yaml
+	- "related = {vangennep}, relatedtype = {translationof}": no equivalent implemented in CSL
+
+}
+
+@Book{vizedom:related,
+  title        = {The Rites of Passage},
+  year         = 1960,
+  translator   = {Vizedom, Monika B. and Caffee, Gabrielle L.},
+  language     = {english},
+  publisher    = {University of Chicago Press},
+  hyphenation  = {american},
+  options      = {usetranslator},
+  related      = {vangennep},
+  relatedtype  = {translationof},
+  indextitle   = {Rites of Passage, The},
+  sorttitle    = {Rites of Passage},
+  shorttitle   = {Rites of Passage},
+  annotation   = {A translated work from vangennep. Note the format of
+                  the related and relatedtype fields},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A translated work from vangennep. Note the format of the
+    related and relatedtype fields
+  id: "vizedom:related"
+  issued: 1960
+  language: en-US
+  publisher: University of Chicago Press
+  title: The rites of passage
+  title-short: Rites of passage
+  translator:
+  - family: Vizedom
+    given: Monika B.
+  - family: Caffee
+    given: Gabrielle L.
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-wassenberg.md b/test/command/biblatex-wassenberg.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-wassenberg.md
@@ -0,0 +1,83 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Wassenberg and Sanders 2010)
+
+Wassenberg, Jan, and Peter Sanders. 2010. “Faster Radix Sort via Virtual
+Memory and Write-combining” (version 1). August 17.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Wassenberg & Sanders, 2010)
+
+Wassenberg, J., & Sanders, P. (2010, August 17). Faster radix sort via
+virtual memory and write-combining.
+
+
+NOTES:
+
+- biblio2yaml
+	- "eprinttype = {arxiv}, eprintclass = {cs.DS}, eprint = {1008.2849v1}" should be used to reconstruct a Url: http://arxiv.org/abs/1008.2849v1 ("cs.DS" does not seem to be essential)
+
+}
+
+@Online{wassenberg,
+  author       = {Wassenberg, Jan and Sanders, Peter},
+  title        = {Faster Radix Sort via Virtual Memory and Write-Combining},
+  date         = {2010-08-17},
+  version      = 1,
+  hyphenation  = {american},
+  eprinttype   = {arxiv},
+  eprintclass  = {cs.DS},
+  eprint       = {1008.2849v1},
+  annotation   = {A recent online reference from arXiv using the new
+                  (April 2007 onward) identifier format. Note the
+                  eprint, eprinttype, and eprintclass
+                  fields. Also note that the arXiv reference is transformed into
+                  a clickable link if hyperref support has been
+                  enabled},
+  abstract     = {Sorting algorithms are the deciding factor for the performance
+                  of common operations such as removal of duplicates or database
+                  sort-merge joins. This work focuses on 32-bit integer keys,
+                  optionally paired with a 32-bit value. We present a fast radix
+                  sorting algorithm that builds upon a microarchitecture-aware
+                  variant of counting sort},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- abstract: Sorting algorithms are the deciding factor for the
+    performance of common operations such as removal of duplicates or
+    database sort-merge joins. This work focuses on 32-bit integer keys,
+    optionally paired with a 32-bit value. We present a fast radix
+    sorting algorithm that builds upon a microarchitecture-aware variant
+    of counting sort
+  annote: A recent online reference from arXiv using the new (April 2007
+    onward) identifier format. Note the eprint, eprinttype, and
+    eprintclass fields. Also note that the arXiv reference is
+    transformed into a clickable link if hyperref support has been
+    enabled
+  author:
+  - family: Wassenberg
+    given: Jan
+  - family: Sanders
+    given: Peter
+  id: wassenberg
+  issued: 2010-08-17
+  language: en-US
+  title: Faster radix sort via virtual memory and write-combining
+  type: webpage
+  url: "http://arxiv.org/abs/1008.2849v1"
+  version: 1
+---
+
+
+```
diff --git a/test/command/biblatex-weinberg.md b/test/command/biblatex-weinberg.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-weinberg.md
@@ -0,0 +1,52 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Weinberg 1967)
+
+Weinberg, Steven. 1967. “A Model of Leptons.” *Phys. Rev. Lett.* 19:
+1264–1266.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Weinberg, 1967)
+
+Weinberg, S. (1967). A model of leptons. *Phys. Rev. Lett.*, *19*,
+1264–1266.
+
+
+}
+
+@Article{weinberg,
+  author       = {Weinberg, Steven},
+  title        = {A Model of Leptons},
+  journaltitle = {Phys.~Rev.~Lett.},
+  date         = 1967,
+  volume       = 19,
+  pages        = {1264-1266},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Weinberg
+    given: Steven
+  container-title: Phys. Rev. Lett.
+  id: weinberg
+  issued: 1967
+  page: 1264-1266
+  title: A model of leptons
+  type: article-journal
+  volume: 19
+---
+
+
+```
diff --git a/test/command/biblatex-westfahl-frontier.md b/test/command/biblatex-westfahl-frontier.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-westfahl-frontier.md
@@ -0,0 +1,60 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Westfahl 2000)
+
+Westfahl, Gary, ed. 2000. *Space and Beyond: The Frontier Theme in
+Science Fiction*. Westport, Conn.; London: Greenwood.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Westfahl, 2000)
+
+Westfahl, G. (Ed.). (2000). *Space and beyond: The frontier theme in
+science fiction*. Westport, Conn.; London: Greenwood.
+
+
+}
+
+@Collection{westfahl:frontier,
+  editor       = {Westfahl, Gary},
+  title        = {Space and Beyond},
+  date         = 2000,
+  subtitle     = {The Frontier Theme in Science Fiction},
+  publisher    = {Greenwood},
+  location     = {Westport, Conn. and London},
+  hyphenation  = {american},
+  booktitle    = {Space and Beyond},
+  booksubtitle = {The Frontier Theme in Science Fiction},
+  annotation   = {This is a collection entry. Note the format of the
+                  location field as well as the subtitle and
+                  booksubtitle fields},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: This is a collection entry. Note the format of the location
+    field as well as the subtitle and booksubtitle fields
+  editor:
+  - family: Westfahl
+    given: Gary
+  id: "westfahl:frontier"
+  issued: 2000
+  language: en-US
+  publisher: Greenwood
+  publisher-place: Westport, Conn.; London
+  title: "Space and beyond: The frontier theme in science fiction"
+  title-short: Space and beyond
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-westfahl-space.md b/test/command/biblatex-westfahl-space.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-westfahl-space.md
@@ -0,0 +1,106 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Westfahl 2000a) (Westfahl 2000b)
+
+Westfahl, Gary. 2000a. “The True Frontier: Confronting and Avoiding the
+Realities of Space in American Science Fiction Films.” In *Space and
+Beyond: The Frontier Theme in Science Fiction*, edited by Gary Westfahl,
+55–65. Westport, Conn.; London: Greenwood.
+
+———, ed. 2000b. *Space and Beyond: The Frontier Theme in Science
+Fiction*. Westport, Conn.; London: Greenwood.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Westfahl, 2000) (Westfahl, 2000)
+
+Westfahl, G. (2000). The true frontier: Confronting and avoiding the
+realities of space in American science fiction films. In G. Westfahl
+(Ed.), *Space and beyond: The frontier theme in science fiction* (pp.
+55–65). Westport, Conn.; London: Greenwood.
+
+Westfahl, G. (Ed.). (2000). *Space and beyond: The frontier theme in
+science fiction*. Westport, Conn.; London: Greenwood.
+
+
+}
+
+@InCollection{westfahl:space,
+  author       = {Westfahl, Gary},
+  title        = {The True Frontier},
+  subtitle     = {Confronting and Avoiding the Realities of Space in {American}
+                  Science Fiction Films},
+  pages        = {55-65},
+  crossref     = {westfahl:frontier},
+  hyphenation  = {american},
+  indextitle   = {True Frontier, The},
+  annotation   = {A cross-referenced article from a collection. This is
+                  an incollection entry with a crossref
+                  field. Note the subtitle and indextitle
+                  fields},
+}
+
+@Collection{westfahl:frontier,
+  editor       = {Westfahl, Gary},
+  title        = {Space and Beyond},
+  date         = 2000,
+  subtitle     = {The Frontier Theme in Science Fiction},
+  publisher    = {Greenwood},
+  location     = {Westport, Conn. and London},
+  hyphenation  = {american},
+  booktitle    = {Space and Beyond},
+  booksubtitle = {The Frontier Theme in Science Fiction},
+  annotation   = {This is a collection entry. Note the format of the
+                  location field as well as the subtitle and
+                  booksubtitle fields},
+}
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A cross-referenced article from a collection. This is an
+    incollection entry with a crossref field. Note the subtitle and
+    indextitle fields
+  author:
+  - family: Westfahl
+    given: Gary
+  container-title: "Space and beyond: The frontier theme in science
+    fiction"
+  editor:
+  - family: Westfahl
+    given: Gary
+  id: "westfahl:space"
+  issued: 2000
+  language: en-US
+  page: 55-65
+  publisher: Greenwood
+  publisher-place: Westport, Conn.; London
+  title: "The true frontier: Confronting and avoiding the realities of
+    space in American science fiction films"
+  title-short: The true frontier
+  type: chapter
+- annote: This is a collection entry. Note the format of the location
+    field as well as the subtitle and booksubtitle fields
+  editor:
+  - family: Westfahl
+    given: Gary
+  id: "westfahl:frontier"
+  issued: 2000
+  language: en-US
+  publisher: Greenwood
+  publisher-place: Westport, Conn.; London
+  title: "Space and beyond: The frontier theme in science fiction"
+  title-short: Space and beyond
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-wilde.md b/test/command/biblatex-wilde.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-wilde.md
@@ -0,0 +1,65 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Wilde 1899)
+
+Wilde, Oscar. 1899. *The Importance of Being Earnest: A Trivial Comedy
+for Serious People*. English and American Drama of the Nineteenth
+Century. Leonard Smithers and Company.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Wilde, 1899)
+
+Wilde, O. (1899). *The importance of being earnest: A trivial comedy for
+serious people*. Leonard Smithers and Company.
+
+
+NOTES:
+
+- biblio2yaml
+	- From "eprint = {4HIWAAAAYAAJ}, eprinttype = {googlebooks}", a url could be reconstructed, shortest form: http://books.google.com?id=4HIWAAAAYAAJ
+
+}
+
+@Book{wilde,
+  author       = {Wilde, Oscar},
+  title        = {The Importance of Being Earnest: {A} Trivial Comedy for Serious
+                  People},
+  year         = 1899,
+  series       = {English and American drama of the Nineteenth Century},
+  publisher    = {Leonard Smithers {and} Company},
+  eprint       = {4HIWAAAAYAAJ},
+  eprinttype   = {googlebooks},
+  annotation   = {A book with eprint and eprinttype
+                  fields.},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A book with eprint and eprinttype fields.
+  author:
+  - family: Wilde
+    given: Oscar
+  collection-title: English and american drama of the nineteenth century
+  id: wilde
+  issued: 1899
+  publisher: Leonard Smithers and Company
+  title: "The importance of being earnest: A trivial comedy for serious
+    people"
+  title-short: The importance of being earnest
+  type: book
+  url: "http://books.google.com?id=4HIWAAAAYAAJ"
+---
+
+
+```
diff --git a/test/command/biblatex-worman.md b/test/command/biblatex-worman.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-worman.md
@@ -0,0 +1,60 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Worman 2002)
+
+Worman, Nancy. 2002. *The Cast of Character: Style in Greek Literature*.
+Austin: University of Texas Press.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Worman, 2002)
+
+Worman, N. (2002). *The cast of character: Style in Greek literature*.
+Austin: University of Texas Press.
+
+
+}
+
+@Book{worman,
+  author       = {Worman, Nancy},
+  title        = {The Cast of Character},
+  date         = 2002,
+  publisher    = {University of Texas Press},
+  location     = {Austin},
+  hyphenation  = {american},
+  sorttitle    = {Cast of Character},
+  indextitle   = {Cast of Character, The},
+  subtitle     = {Style in {Greek} Literature},
+  shorttitle   = {Cast of Character},
+  annotation   = {A book entry. Note the sorttitle and
+                  indextitle fields},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- annote: A book entry. Note the sorttitle and indextitle fields
+  author:
+  - family: Worman
+    given: Nancy
+  id: worman
+  issued: 2002
+  language: en-US
+  publisher: University of Texas Press
+  publisher-place: Austin
+  title: "The cast of character: Style in Greek literature"
+  title-short: Cast of character
+  type: book
+---
+
+
+```
diff --git a/test/command/biblatex-yoon.md b/test/command/biblatex-yoon.md
new file mode 100644
--- /dev/null
+++ b/test/command/biblatex-yoon.md
@@ -0,0 +1,67 @@
+```
+% pandoc -f biblatex -t markdown -s
+@comment{
+
+Adapted from biblatex-example.bib
+
+
+Formatted with pandoc and chicago-author-date.csl, 2013-10-23:
+
+(Yoon et al. 2006)
+
+Yoon, Myeong S., Dowook Ryu, Jeongryul Kim, and Kyo Han Ahn. 2006.
+“Palladium Pincer Complexes with Reduced Bond Angle Strain: Efficient
+Catalysts for the Heck Reaction.” *Organometallics* 25 (10): 2409–2411.
+
+
+Formatted with pandoc and apa.csl, 2013-10-23:
+
+(Yoon, Ryu, Kim, & Ahn, 2006)
+
+Yoon, M. S., Ryu, D., Kim, J., & Ahn, K. H. (2006). Palladium pincer
+complexes with reduced bond angle strain: Efficient catalysts for the
+Heck reaction. *Organometallics*, *25*(10), 2409–2411.
+
+
+}
+
+@Article{yoon,
+  author       = {Yoon, Myeong S. and Ryu, Dowook and Kim, Jeongryul and Ahn,
+                  Kyo Han},
+  title        = {Palladium pincer complexes with reduced bond angle strain:
+                  efficient catalysts for the {Heck} reaction},
+  journaltitle = {Organometallics},
+  date         = 2006,
+  volume       = 25,
+  number       = 10,
+  pages        = {2409-2411},
+  indextitle   = {Palladium pincer complexes},
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Yoon
+    given: Myeong S.
+  - family: Ryu
+    given: Dowook
+  - family: Kim
+    given: Jeongryul
+  - family: Ahn
+    given: Kyo Han
+  container-title: Organometallics
+  id: yoon
+  issue: 10
+  issued: 2006
+  page: 2409-2411
+  title: "Palladium pincer complexes with reduced bond angle strain:
+    Efficient catalysts for the Heck reaction"
+  title-short: Palladium pincer complexes with reduced bond angle strain
+  type: article-journal
+  volume: 25
+---
+
+
+```
diff --git a/test/command/biblio.bib b/test/command/biblio.bib
new file mode 100644
--- /dev/null
+++ b/test/command/biblio.bib
@@ -0,0 +1,26 @@
+@Book{item1,
+author="John Doe",
+title="First Book",
+year="2005",
+address="Cambridge",
+publisher="Cambridge University Press"
+}
+
+@Article{item2,
+author="John Doe",
+title="Article",
+year="2006",
+journal="Journal of Generic Studies",
+volume="6",
+pages="33-34"
+}
+
+@InCollection{пункт3,
+author="John Doe and Jenny Roe",
+title="Why Water Is Wet",
+booktitle="Third Book",
+editor="Sam Smith",
+publisher="Oxford University Press",
+address="Oxford",
+year="2007"
+}
diff --git a/test/command/bibtex-basic.md b/test/command/bibtex-basic.md
new file mode 100644
--- /dev/null
+++ b/test/command/bibtex-basic.md
@@ -0,0 +1,71 @@
+```
+% pandoc -f biblatex -t markdown -s
+@Book{item1,
+author="John Doe",
+title="First Book",
+year="2005",
+address="Cambridge",
+publisher="Cambridge University Press"
+}
+
+@Article{item2,
+author="John Doe",
+title="Article",
+year="2006",
+journal="Journal of Generic Studies",
+volume="6",
+pages="33-34"
+}
+
+@InCollection{пункт3,
+author="John Doe and Jenny Roe",
+title="Why Water Is Wet",
+booktitle="Third Book",
+editor="Sam Smith",
+publisher="Oxford University Press",
+address="Oxford",
+year="2007"
+}
+
+^D
+---
+nocite: "[@*]"
+references:
+- author:
+  - family: Doe
+    given: John
+  id: item1
+  issued: 2005
+  publisher: Cambridge University Press
+  publisher-place: Cambridge
+  title: First book
+  type: book
+- author:
+  - family: Doe
+    given: John
+  container-title: Journal of Generic Studies
+  id: item2
+  issued: 2006
+  page: 33-34
+  title: Article
+  type: article-journal
+  volume: 6
+- author:
+  - family: Doe
+    given: John
+  - family: Roe
+    given: Jenny
+  container-title: Third book
+  editor:
+  - family: Smith
+    given: Sam
+  id: пункт3
+  issued: 2007
+  publisher: Oxford University Press
+  publisher-place: Oxford
+  title: Why water is wet
+  type: chapter
+---
+
+
+```
diff --git a/test/command/bioethics.csl b/test/command/bioethics.csl
new file mode 100644
--- /dev/null
+++ b/test/command/bioethics.csl
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="note" version="1.0" page-range-format="minimal-two" demote-non-dropping-particle="never" default-locale="en-GB">
+  <info>
+    <title>Bioethics</title>
+    <id>http://www.zotero.org/styles/bioethics</id>
+    <link href="http://www.zotero.org/styles/bioethics" rel="self"/>
+    <link href="http://www.zotero.org/styles/journal-of-roman-archaeology-b" rel="template"/>
+    <link href="http://onlinelibrary.wiley.com/journal/10.1111/(ISSN)1467-8519/homepage/ForAuthors.html" rel="documentation"/>
+    <author>
+      <name>Patrick O'Brien</name>
+    </author>
+    <category citation-format="note"/>
+    <category field="anthropology"/>
+    <issn>0269-9702</issn>
+    <eissn>1467-8519</eissn>
+    <updated>2017-07-12T11:26:44+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <macro name="editor">
+    <names variable="editor">
+      <name sort-separator=", " initialize-with="." delimiter=", "/>
+      <label form="short" prefix=", "/>
+      <substitute>
+        <text macro="container-author"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="container-author">
+    <names variable="container-author" delimiter=", ">
+      <name sort-separator=", " initialize-with="." delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="author">
+    <names variable="author">
+      <name initialize-with="."/>
+      <substitute>
+        <text macro="editor"/>
+        <text variable="title"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="editor-short">
+    <names variable="editor">
+      <name form="short" sort-separator=", " delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="container-author-short">
+    <names variable="container-author" delimiter=", ">
+      <name form="short" sort-separator=", " delimiter=", "/>
+      <et-al font-style="italic"/>
+    </names>
+  </macro>
+  <macro name="author-short">
+    <names variable="author">
+      <name form="short" sort-separator=", " delimiter=", "/>
+      <et-al font-style="italic"/>
+      <substitute>
+        <text macro="editor-short"/>
+        <text macro="container-author-short"/>
+        <text variable="title-short" font-style="italic"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="collection">
+    <group delimiter=" " suffix=", ">
+      <text variable="collection-title"/>
+      <text variable="collection-number"/>
+    </group>
+  </macro>
+  <macro name="encyclopedia">
+    <group delimiter=" ">
+      <choose>
+        <if variable="title-short" match="any">
+          <text variable="title" form="short" font-style="italic"/>
+        </if>
+        <else>
+          <text variable="container-title" font-style="italic"/>
+        </else>
+      </choose>
+      <text variable="volume"/>
+      <date variable="issued" prefix="(" suffix=")">
+        <date-part name="year"/>
+      </date>
+      <text variable="page" suffix=","/>
+      <text variable="title" prefix="s.v. " quotes="true"/>
+      <text macro="author" prefix="(" suffix=")"/>
+    </group>
+  </macro>
+  <macro name="title">
+    <choose>
+      <if type="book thesis" match="any">
+        <text variable="title" font-style="italic"/>
+      </if>
+      <else-if type="webpage post-weblog" match="any">
+        <date form="text" variable="issued" suffix=". "/>
+        <text variable="title" font-style="italic" suffix=". "/>
+        <text variable="container-title" font-style="italic"/>
+      </else-if>
+      <else-if type="article-journal article-magazine article-newspaper" match="any">
+        <group delimiter=". ">
+          <text variable="title" quotes="false"/>
+          <group delimiter=" ">
+            <text variable="container-title" form="short" strip-periods="true" font-style="italic"/>
+            <group delimiter="; ">
+              <text macro="year-date"/>
+              <group delimiter=": ">
+                <group>
+                  <text variable="volume"/>
+                  <text variable="issue" prefix="(" suffix=")"/>
+                </group>
+                <text variable="page"/>
+              </group>
+            </group>
+          </group>
+        </group>
+      </else-if>
+      <else-if type="chapter paper-conference" match="any">
+        <group delimiter=". " suffix=". ">
+          <text macro="year-date"/>
+          <text variable="title" quotes="false"/>
+        </group>
+        <group delimiter=". ">
+          <group delimiter=" ">
+            <text term="in" text-case="capitalize-first"/>
+            <text macro="editor"/>
+          </group>
+          <text variable="container-title"/>
+        </group>
+      </else-if>
+      <else>
+        <text variable="title" font-style="italic" font-weight="bold"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="publisher">
+    <choose>
+      <if variable="collection-title" match="any">
+        <text macro="collection"/>
+      </if>
+      <else-if type="thesis">
+        <text variable="genre" suffix=","/>
+        <text variable="publisher"/>
+      </else-if>
+      <else>
+        <group delimiter=": ">
+          <text variable="publisher-place"/>
+          <text variable="publisher"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="year-date">
+    <choose>
+      <if variable="issued">
+        <date variable="issued">
+          <date-part name="year"/>
+        </date>
+      </if>
+      <else>
+        <text term="no date" form="short"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="locator">
+    <choose>
+      <if locator="page">
+        <text variable="locator" prefix=": "/>
+      </if>
+      <else-if locator="paragraph">
+        <text variable="locator" prefix="§"/>
+      </else-if>
+      <else-if type="webpage post-weblog" match="any">
+        <group delimiter=" " prefix=". ">
+          <group delimiter=": ">
+            <text term="available at" text-case="capitalize-first"/>
+            <text variable="URL"/>
+          </group>
+          <group delimiter=" " prefix="[" suffix="]">
+            <text term="accessed" text-case="capitalize-first"/>
+            <date form="text" variable="accessed"/>
+          </group>
+        </group>
+      </else-if>
+      <else>
+        <text variable="page" prefix=": "/>
+      </else>
+    </choose>
+  </macro>
+  <citation and="symbol" delimiter-precedes-et-al="always" delimiter-precedes-last="always" et-al-min="3" et-al-use-first="1">
+    <layout delimiter="; " suffix=".">
+      <choose>
+        <if type="entry-dictionary entry-encyclopedia" match="any">
+          <text macro="encyclopedia"/>
+        </if>
+        <else-if position="ibid-with-locator">
+          <group delimiter=" ">
+            <text term="ibid" suffix="."/>
+            <text macro="locator"/>
+          </group>
+        </else-if>
+        <else-if position="ibid">
+          <text term="ibid" suffix="."/>
+        </else-if>
+        <else-if position="subsequent">
+          <group delimiter=" ">
+            <text macro="author-short"/>
+            <group prefix="(" suffix=")" delimiter=" ">
+              <text term="cited"/>
+              <group delimiter="&#160;">
+                <text term="note" form="short"/>
+                <text variable="first-reference-note-number"/>
+              </group>
+            </group>
+            <text macro="locator"/>
+          </group>
+        </else-if>
+        <else>
+          <text macro="author" suffix=". "/>
+          <text macro="title"/>
+          <text macro="publisher" prefix=". "/>
+          <text macro="locator"/>
+        </else>
+      </choose>
+    </layout>
+  </citation>
+</style>
diff --git a/test/command/chicago-annotated-bibliography.csl b/test/command/chicago-annotated-bibliography.csl
new file mode 100644
--- /dev/null
+++ b/test/command/chicago-annotated-bibliography.csl
@@ -0,0 +1,1207 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="note" version="1.0" demote-non-dropping-particle="never" page-range-format="chicago">
+  <info>
+    <title>Chicago Manual of Style 16th edition (note, annotated bibliography)</title>
+    <id>http://www.zotero.org/styles/chicago-annotated-bibliography</id>
+    <link href="http://www.zotero.org/styles/chicago-annotated-bibliography" rel="self"/>
+    <link href="http://www.chicagomanualofstyle.org/tools_citationguide.html" rel="documentation"/>
+    <author>
+      <name>Julian Onions</name>
+      <email>julian.onions@gmail.com</email>
+    </author>
+    <contributor>
+      <name>Simon Kornblith</name>
+      <email>simon@simonster.com</email>
+    </contributor>
+    <contributor>
+      <name>Elena Razlogova</name>
+      <email>elena.razlogova@gmail.com</email>
+    </contributor>
+    <contributor>
+      <name>Frank Bennett</name>
+      <email>biercenator@gmail.com</email>
+    </contributor>
+    <contributor>
+      <name>Andrew Dunning</name>
+      <email>andrew.dunning@utoronto.ca</email>
+    </contributor>
+    <category citation-format="note"/>
+    <category field="generic-base"/>
+    <summary>Chicago format with short notes and annotated bibliography</summary>
+    <updated>2012-10-25T21:15:26+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="en">
+    <terms>
+      <term name="editor" form="verb-short">ed.</term>
+      <term name="translator" form="verb-short">trans.</term>
+      <term name="editortranslator" form="verb-short">
+        <single>ed. and trans.</single>
+        <multiple>ed. and trans.</multiple>
+      </term>
+      <term name="editortranslator" form="verb">
+        <single>Edited and translated by</single>
+        <multiple>Edited and translated by</multiple>
+      </term>
+      <term name="translator" form="short">trans.</term>
+    </terms>
+  </locale>
+  <macro name="editor-translator">
+    <group delimiter=", ">
+      <group delimiter=" ">
+        <choose>
+          <if variable="container-author reviewed-author" match="any">
+            <group>
+              <names variable="container-author reviewed-author">
+                <label form="verb-short" text-case="lowercase" suffix=" "/>
+                <name and="text" delimiter=", "/>
+              </names>
+            </group>
+          </if>
+        </choose>
+      </group>
+      <names variable="editor translator" delimiter=", ">
+        <label form="verb-short" text-case="lowercase" suffix=" "/>
+        <name and="text" delimiter=", "/>
+      </names>
+    </group>
+  </macro>
+  <macro name="secondary-contributors-note">
+    <choose>
+      <if type="chapter paper-conference" match="none">
+        <text macro="editor-translator"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="container-contributors-note">
+    <choose>
+      <if type="chapter paper-conference" match="any">
+        <text macro="editor-translator"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="secondary-contributors">
+    <choose>
+      <if type="chapter paper-conference" match="none">
+        <names variable="editor translator" delimiter=". ">
+          <label form="verb" text-case="capitalize-first" suffix=" "/>
+          <name and="text" delimiter=", "/>
+        </names>
+      </if>
+    </choose>
+  </macro>
+  <macro name="container-contributors">
+    <choose>
+      <if type="chapter paper-conference" match="any">
+        <group delimiter=", ">
+          <choose>
+            <if variable="author">
+              <choose>
+                <if variable="container-author" match="any">
+                  <names variable="container-author">
+                    <label form="verb-short" text-case="lowercase" suffix=" "/>
+                    <name and="text" delimiter=", "/>
+                  </names>
+                </if>
+              </choose>
+              <!--This includes page numers after the container author, e.g. for Introductions -->
+              <choose>
+                <if variable="container-author author" match="all">
+                  <group delimiter=". ">
+                    <text variable="page"/>
+                    <names variable="editor translator" delimiter=", ">
+                      <label form="verb" suffix=" "/>
+                      <name and="text" delimiter=", "/>
+                    </names>
+                  </group>
+                </if>
+                <else>
+                  <names variable="editor translator" delimiter=", ">
+                    <label form="verb" text-case="lowercase" suffix=" "/>
+                    <name and="text" delimiter=", "/>
+                  </names>
+                </else>
+              </choose>
+            </if>
+          </choose>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="recipient-note">
+    <names variable="recipient" delimiter=", ">
+      <label form="verb" text-case="lowercase" suffix=" "/>
+      <name and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="contributors-note">
+    <group delimiter=" ">
+      <names variable="author">
+        <name and="text" sort-separator=", " delimiter=", "/>
+        <label form="short" prefix=", "/>
+        <substitute>
+          <names variable="editor"/>
+          <names variable="translator"/>
+        </substitute>
+      </names>
+      <text macro="recipient-note"/>
+    </group>
+  </macro>
+  <macro name="editor">
+    <names variable="editor">
+      <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="short" prefix=", "/>
+    </names>
+  </macro>
+  <macro name="translator">
+    <names variable="translator">
+      <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="verb-short" prefix=", "/>
+    </names>
+  </macro>
+  <macro name="recipient">
+    <group delimiter=" ">
+      <choose>
+        <if type="personal_communication">
+          <choose>
+            <if variable="genre">
+              <text variable="genre" text-case="capitalize-first"/>
+            </if>
+            <else>
+              <text term="letter" text-case="capitalize-first"/>
+            </else>
+          </choose>
+        </if>
+      </choose>
+      <text macro="recipient-note"/>
+    </group>
+  </macro>
+  <macro name="contributors">
+    <group delimiter=". ">
+      <names variable="author">
+        <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+        <substitute>
+          <text macro="editor"/>
+          <text macro="translator"/>
+        </substitute>
+      </names>
+      <text macro="recipient"/>
+    </group>
+  </macro>
+  <macro name="recipient-short">
+    <names variable="recipient">
+      <label form="verb" text-case="lowercase" suffix=" "/>
+      <name form="short" and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="contributors-short">
+    <group delimiter=" ">
+      <names variable="author">
+        <name form="short" and="text" delimiter=", "/>
+        <substitute>
+          <names variable="editor"/>
+          <names variable="translator"/>
+        </substitute>
+      </names>
+      <text macro="recipient-short"/>
+    </group>
+  </macro>
+  <macro name="contributors-sort">
+    <names variable="author">
+      <name name-as-sort-order="all" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+      <substitute>
+        <names variable="editor"/>
+        <names variable="translator"/>
+        <text macro="title"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="interviewer-note">
+    <names variable="interviewer" delimiter=", ">
+      <label form="verb" text-case="lowercase" suffix=" "/>
+      <name and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="interviewer">
+    <names variable="interviewer" delimiter=", ">
+      <label form="verb" text-case="capitalize-first" suffix=" "/>
+      <name and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="title-note">
+    <choose>
+      <if variable="title" match="none">
+        <text variable="genre"/>
+      </if>
+      <else-if type="bill book graphic  legislation motion_picture report song" match="any">
+        <text variable="title" text-case="title" font-style="italic"/>
+        <group delimiter=" " prefix=", ">
+          <text term="version"/>
+          <text variable="version"/>
+        </group>
+      </else-if>
+      <else-if type="legal_case interview" match="any">
+        <text variable="title"/>
+      </else-if>
+      <else-if variable="reviewed-author">
+        <text variable="title" font-style="italic" prefix="review of "/>
+      </else-if>
+      <else>
+        <text variable="title" text-case="title" quotes="true"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="title">
+    <choose>
+      <if variable="title" match="none">
+        <choose>
+          <if type="personal_communication" match="none">
+            <text variable="genre" text-case="capitalize-first"/>
+          </if>
+        </choose>
+      </if>
+      <else-if type="bill book graphic legislation motion_picture report song" match="any">
+        <text variable="title" text-case="title" font-style="italic"/>
+        <group prefix=" (" suffix=")" delimiter=" ">
+          <text term="version"/>
+          <text variable="version"/>
+        </group>
+      </else-if>
+      <else-if variable="reviewed-author">
+        <group delimiter=", ">
+          <text variable="title" font-style="italic" prefix="Review of "/>
+          <names variable="reviewed-author">
+            <label form="verb-short" text-case="lowercase" suffix=" "/>
+            <name and="text" delimiter=", "/>
+          </names>
+        </group>
+      </else-if>
+      <else-if type="legal_case interview" match="any">
+        <text variable="title"/>
+      </else-if>
+      <else>
+        <text variable="title" text-case="title" quotes="true"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="title-short">
+    <choose>
+      <if variable="title" match="none">
+        <choose>
+          <if type="interview">
+            <text term="interview"/>
+          </if>
+          <else-if type="manuscript speech" match="any">
+            <text variable="genre" form="short"/>
+          </else-if>
+          <else-if type="personal_communication">
+            <text macro="issued"/>
+          </else-if>
+        </choose>
+      </if>
+      <else-if type="bill book graphic legislation motion_picture report song" match="any">
+        <text variable="title" text-case="title" form="short" font-style="italic"/>
+      </else-if>
+      <else-if type="legal_case interview" match="any">
+        <text variable="title"/>
+      </else-if>
+      <else>
+        <text variable="title" text-case="title" form="short" quotes="true"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="date-disambiguate">
+    <choose>
+      <if disambiguate="true">
+        <text macro="issued"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="description-note">
+    <group delimiter=", ">
+      <text macro="interviewer-note"/>
+      <text variable="medium"/>
+      <choose>
+        <if variable="title" match="none"/>
+        <else-if type="manuscript thesis speech" match="any"/>
+        <else>
+          <text variable="genre"/>
+        </else>
+      </choose>
+    </group>
+  </macro>
+  <macro name="description">
+    <group delimiter=", ">
+      <group delimiter=". ">
+        <text macro="interviewer"/>
+        <text variable="medium" text-case="capitalize-first"/>
+      </group>
+      <choose>
+        <if variable="title" match="none"/>
+        <else-if type="thesis speech" match="any"/>
+        <else>
+          <text variable="genre" text-case="capitalize-first"/>
+        </else>
+      </choose>
+    </group>
+  </macro>
+  <macro name="container-title-note">
+    <group delimiter=" ">
+      <choose>
+        <if type="chapter paper-conference" match="any">
+          <text term="in"/>
+        </if>
+      </choose>
+      <choose>
+        <if type="legal_case" match="none">
+          <text variable="container-title" text-case="title" font-style="italic"/>
+        </if>
+      </choose>
+    </group>
+  </macro>
+  <macro name="container-title">
+    <group delimiter=" ">
+      <choose>
+        <if type="chapter paper-conference" match="any">
+          <text term="in" text-case="capitalize-first"/>
+        </if>
+      </choose>
+      <choose>
+        <if type="legal_case" match="none">
+          <text variable="container-title" text-case="title" font-style="italic"/>
+        </if>
+      </choose>
+    </group>
+  </macro>
+  <macro name="collection-title">
+    <choose>
+      <if match="none" type="article-journal">
+        <choose>
+          <if match="none" is-numeric="collection-number">
+            <group delimiter=", ">
+              <text variable="collection-title" text-case="title"/>
+              <text variable="collection-number"/>
+            </group>
+          </if>
+          <else>
+            <group delimiter=" ">
+              <text variable="collection-title" text-case="title"/>
+              <text variable="collection-number"/>
+            </group>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="collection-title-journal">
+    <choose>
+      <if type="article-journal">
+        <group delimiter=" ">
+          <text variable="collection-title"/>
+          <text variable="collection-number"/>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="edition-note">
+    <choose>
+      <if type="bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="any">
+        <choose>
+          <if is-numeric="edition">
+            <group delimiter=" ">
+              <number variable="edition" form="ordinal"/>
+              <text term="edition" form="short"/>
+            </group>
+          </if>
+          <else>
+            <text variable="edition"/>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="edition">
+    <choose>
+      <if type="bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="any">
+        <choose>
+          <if is-numeric="edition">
+            <group delimiter=" ">
+              <number variable="edition" form="ordinal"/>
+              <text term="edition" form="short"/>
+            </group>
+          </if>
+          <else>
+            <text variable="edition" text-case="capitalize-first" suffix="."/>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators-note-join-with-space">
+    <choose>
+      <if type="article-journal" variable="volume" match="all">
+        <choose>
+          <if match="none" variable="collection-title">
+            <text macro="locators-note"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators-note-join-with-comma">
+    <choose>
+      <if type="article-journal" match="none">
+        <text macro="locators-note"/>
+      </if>
+      <else-if type="article-journal">
+        <choose>
+          <if variable="volume" match="none">
+            <text macro="locators-note"/>
+          </if>
+          <else-if match="any" variable="collection-title">
+            <text macro="locators-note"/>
+          </else-if>
+        </choose>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="locators-note">
+    <choose>
+      <if type="article-journal">
+        <group delimiter=", ">
+          <text macro="collection-title-journal"/>
+          <number variable="volume"/>
+          <group delimiter=" ">
+            <text term="issue" form="short"/>
+            <number variable="issue"/>
+          </group>
+        </group>
+      </if>
+      <else-if type="legal_case">
+        <group delimiter=", ">
+          <group delimiter=" ">
+            <number variable="volume"/>
+            <text variable="container-title"/>
+            <text variable="page"/>
+          </group>
+          <text variable="locator"/>
+        </group>
+      </else-if>
+      <else-if type="bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="any">
+        <group delimiter=", ">
+          <text macro="edition-note"/>
+          <group delimiter=" ">
+            <text term="volume" form="short"/>
+            <number variable="volume" form="numeric"/>
+          </group>
+          <choose>
+            <if variable="locator" match="none">
+              <group delimiter=" ">
+                <number variable="number-of-volumes" form="numeric"/>
+                <text term="volume" form="short" plural="true"/>
+              </group>
+            </if>
+          </choose>
+        </group>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="locators-join-with-space">
+    <choose>
+      <if type="article-journal" variable="volume" match="all">
+        <choose>
+          <if match="none" variable="collection-title">
+            <text macro="locators"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators-join-with-comma">
+    <choose>
+      <if type="legal_case chapter paper-conference" match="any">
+        <text macro="locators"/>
+      </if>
+      <else-if type="article-journal">
+        <choose>
+          <if variable="volume" match="none">
+            <text macro="locators"/>
+          </if>
+          <else-if match="any" variable="collection-title">
+            <text macro="locators"/>
+          </else-if>
+        </choose>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="locators-join-with-period">
+    <choose>
+      <if type="legal_case article-journal chapter paper-conference" match="none">
+        <text macro="locators"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators">
+    <choose>
+      <if type="article-journal">
+        <group delimiter=", ">
+          <text macro="collection-title-journal"/>
+          <number variable="volume"/>
+          <group delimiter=" ">
+            <text term="issue" form="short"/>
+            <number variable="issue"/>
+          </group>
+        </group>
+      </if>
+      <else-if type="legal_case">
+        <group delimiter=" ">
+          <number variable="volume"/>
+          <text variable="container-title"/>
+          <text variable="page"/>
+        </group>
+      </else-if>
+      <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+        <group delimiter=". ">
+          <text macro="edition"/>
+          <group delimiter=" ">
+            <text term="volume" form="short" text-case="capitalize-first"/>
+            <number variable="volume" form="numeric"/>
+          </group>
+          <group delimiter=" ">
+            <number variable="number-of-volumes" form="numeric"/>
+            <text term="volume" form="short" plural="true"/>
+          </group>
+        </group>
+      </else-if>
+      <else-if type="chapter paper-conference" match="any">
+        <group delimiter=". ">
+          <text macro="edition"/>
+          <choose>
+            <if variable="page" match="none">
+              <group delimiter=" ">
+                <text term="volume" form="short" text-case="capitalize-first"/>
+                <number variable="volume" form="numeric"/>
+              </group>
+            </if>
+          </choose>
+        </group>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="locators-newspaper">
+    <choose>
+      <if type="article-newspaper">
+        <group delimiter=", ">
+          <group delimiter=" ">
+            <number variable="edition"/>
+            <text term="edition"/>
+          </group>
+          <group delimiter=" ">
+            <text term="section" form="short"/>
+            <text variable="section"/>
+          </group>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="event-note">
+    <text variable="event"/>
+  </macro>
+  <macro name="event">
+    <choose>
+      <if variable="title">
+        <group delimiter=" ">
+          <text term="presented at"/>
+          <text variable="event"/>
+        </group>
+      </if>
+      <else>
+        <group delimiter=" ">
+          <text term="presented at" text-case="capitalize-first"/>
+          <text variable="event"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="originally-published">
+    <group delimiter=", ">
+      <group delimiter=": ">
+        <text variable="original-publisher-place"/>
+        <text variable="original-publisher"/>
+      </group>
+      <date variable="original-date" form="text" date-parts="year"/>
+    </group>
+  </macro>
+  <macro name="reprint-note">
+    <!--needs localization-->
+    <choose>
+      <if variable="original-date issued" match="all">
+        <choose>
+          <!--for whatever reason in notes, when we have both original and new publishers, reprint doesn't appear-->
+          <if variable="original-publisher original-publisher-place" match="none">
+            <text value="repr."/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="reprint">
+    <!--needs localization-->
+    <choose>
+      <if variable="original-date issued" match="all">
+        <text value="reprint" text-case="capitalize-first"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="publisher">
+    <choose>
+      <if type="thesis">
+        <text variable="publisher"/>
+      </if>
+      <else-if type="speech">
+        <text variable="event-place"/>
+      </else-if>
+      <else>
+        <group delimiter=": ">
+          <text variable="publisher-place"/>
+          <text variable="publisher"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="issued">
+    <choose>
+      <if variable="issued">
+        <choose>
+          <if type="graphic report" match="any">
+            <date variable="issued" form="text"/>
+          </if>
+          <else-if type="legal_case">
+            <group delimiter=" ">
+              <text variable="authority"/>
+              <date variable="issued">
+                <date-part name="year"/>
+              </date>
+            </group>
+          </else-if>
+          <else-if type="bill book chapter graphic legal_case legislation motion_picture paper-conference report song thesis" match="any">
+            <date variable="issued">
+              <date-part name="year"/>
+            </date>
+          </else-if>
+          <else>
+            <date variable="issued" form="text"/>
+          </else>
+        </choose>
+      </if>
+      <else-if variable="status">
+        <text variable="status"/>
+      </else-if>
+      <else-if variable="accessed URL" match="all"/>
+      <else>
+        <text term="no date" form="short"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="point-locators-subsequent">
+    <choose>
+      <if type="legal_case"/>
+      <else-if variable="locator">
+        <choose>
+          <if locator="page" match="none">
+            <group delimiter=" ">
+              <choose>
+                <if type="bill book graphic legislation motion_picture report song" match="any">
+                  <choose>
+                    <if variable="volume">
+                      <group delimiter=", ">
+                        <group delimiter=" ">
+                          <text term="volume" form="short"/>
+                          <number variable="volume" form="numeric"/>
+                        </group>
+                        <label variable="locator" form="short"/>
+                      </group>
+                    </if>
+                    <else>
+                      <label variable="locator" form="short"/>
+                    </else>
+                  </choose>
+                </if>
+                <else>
+                  <label variable="locator" form="short"/>
+                </else>
+              </choose>
+              <text variable="locator"/>
+            </group>
+          </if>
+          <else-if type="bill book graphic legislation motion_picture report song" match="any">
+            <group delimiter=":">
+              <number variable="volume" form="numeric"/>
+              <text variable="locator"/>
+            </group>
+          </else-if>
+          <else>
+            <text variable="locator"/>
+          </else>
+        </choose>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="point-locators-join-with-colon">
+    <choose>
+      <if type="article-journal">
+        <choose>
+          <if variable="locator page" match="any">
+            <choose>
+              <if variable="volume issue" match="any">
+                <text macro="point-locators"/>
+              </if>
+            </choose>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="point-locators-join-with-comma">
+    <choose>
+      <if type="article-journal" match="none">
+        <text macro="point-locators"/>
+      </if>
+      <else-if variable="volume issue" match="none">
+        <text macro="point-locators"/>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="point-locators">
+    <choose>
+      <if variable="locator" match="none">
+        <choose>
+          <if type="article-journal chapter paper-conference" match="any">
+            <text variable="page"/>
+          </if>
+        </choose>
+      </if>
+      <else-if type="article-journal">
+        <group delimiter=" ">
+          <choose>
+            <if locator="page" match="none">
+              <label variable="locator" form="short" suffix=" "/>
+            </if>
+          </choose>
+          <text variable="locator"/>
+        </group>
+      </else-if>
+      <else-if type="legal_case"/>
+      <else>
+        <group delimiter=" ">
+          <choose>
+            <if locator="page" match="none">
+              <label variable="locator" form="short"/>
+            </if>
+          </choose>
+          <text variable="locator"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="locators-chapter">
+    <choose>
+      <if type="chapter paper-conference" match="any">
+        <choose>
+          <if variable="author container-author" match="all"/>
+          <else>
+            <choose>
+              <if variable="page">
+                <number variable="volume" suffix=":"/>
+                <text variable="page"/>
+              </if>
+            </choose>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators-journal-join-with-colon">
+    <choose>
+      <if type="article-journal">
+        <choose>
+          <if variable="volume issue" match="any">
+            <text variable="page"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators-journal-join-with-comma">
+    <choose>
+      <if type="article-journal">
+        <choose>
+          <if variable="volume issue" match="none">
+            <text variable="page"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="archive-note">
+    <choose>
+      <if type="thesis">
+        <group delimiter=" ">
+          <text variable="archive"/>
+          <text variable="archive_location" prefix="(" suffix=")"/>
+        </group>
+      </if>
+      <else>
+        <group delimiter=", ">
+          <text variable="archive_location"/>
+          <text variable="archive"/>
+          <text variable="archive-place"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="archive">
+    <choose>
+      <if type="thesis">
+        <group delimiter=" ">
+          <text variable="archive"/>
+          <text variable="archive_location" prefix="(" suffix=")"/>
+        </group>
+      </if>
+      <else>
+        <group delimiter=". ">
+          <text variable="archive_location" text-case="capitalize-first"/>
+          <text variable="archive"/>
+          <text variable="archive-place"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="issue-note-join-with-space">
+    <choose>
+      <if type="article-journal legal_case manuscript thesis" variable="publisher-place publisher" match="any">
+        <!--Chicago doesn't use publisher/place for Newspapers and we want the date delimited by a comma-->
+        <choose>
+          <if type="article-newspaper" match="none">
+            <choose>
+              <if type="article-journal" match="none">
+                <text macro="issue-note"/>
+              </if>
+              <else-if variable="issue volume" match="any">
+                <text macro="issue-note"/>
+              </else-if>
+            </choose>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="issue-note-join-with-comma">
+    <choose>
+      <if type="article-journal legal_case manuscript thesis" variable="publisher-place publisher" match="none">
+        <text macro="issue-note"/>
+      </if>
+      <else-if type="article-newspaper">
+        <text macro="issue-note"/>
+      </else-if>
+      <else-if type="article-journal">
+        <choose>
+          <if variable="volume issue" match="none">
+            <text macro="issue-note"/>
+          </if>
+        </choose>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="issue-note">
+    <choose>
+      <if type="legal_case" match="any">
+        <text macro="issued" prefix="(" suffix=")"/>
+      </if>
+      <else-if type="article-journal">
+        <choose>
+          <if variable="volume issue" match="any">
+            <text macro="issued" prefix="(" suffix=")"/>
+          </if>
+          <else>
+            <text macro="issued"/>
+          </else>
+        </choose>
+      </else-if>
+      <else-if type="article-newspaper">
+        <text macro="issued"/>
+      </else-if>
+      <else-if variable="publisher-place event-place publisher genre" match="any">
+        <group prefix="(" suffix=")" delimiter=", ">
+          <choose>
+            <if variable="title" match="none"/>
+            <else-if type="manuscript thesis speech" match="any">
+              <text variable="genre"/>
+            </else-if>
+          </choose>
+          <text macro="event-note"/>
+          <group delimiter="; ">
+            <text macro="originally-published"/>
+            <group delimiter=", ">
+              <text macro="reprint-note"/>
+              <text macro="publisher"/>
+            </group>
+          </group>
+          <text macro="issued"/>
+        </group>
+      </else-if>
+      <else>
+        <text macro="issued"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="issue-join-with-space">
+    <choose>
+      <if type="article-journal legal_case" match="any">
+        <choose>
+          <if variable="issue volume" match="any">
+            <text macro="issue"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="issue-join-with-period">
+    <choose>
+      <if type="article-journal legal_case" match="none">
+        <choose>
+          <if type="speech" variable="publisher publisher-place" match="any">
+            <text macro="issue"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="issue-join-with-comma">
+    <choose>
+      <if type="article-journal legal_case" match="none">
+        <choose>
+          <if type="speech" variable="publisher publisher-place" match="none">
+            <text macro="issue"/>
+          </if>
+        </choose>
+      </if>
+      <else-if variable="volume issue" match="none">
+        <text macro="issue"/>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="issue">
+    <choose>
+      <if type="legal_case" match="any">
+        <text macro="issued" prefix="(" suffix=")"/>
+      </if>
+      <else-if type="article-journal">
+        <choose>
+          <if variable="issue volume" match="any">
+            <text macro="issued" prefix="(" suffix=")"/>
+          </if>
+          <else>
+            <text macro="issued"/>
+          </else>
+        </choose>
+      </else-if>
+      <else-if type="speech">
+        <group delimiter=", ">
+          <group delimiter=" ">
+            <choose>
+              <if variable="title" match="none"/>
+              <else>
+                <text variable="genre" text-case="capitalize-first"/>
+              </else>
+            </choose>
+            <text macro="event"/>
+          </group>
+          <text variable="event-place"/>
+          <text macro="issued"/>
+        </group>
+      </else-if>
+      <!--Chicago doesn't use publisher/place for Newspapers -->
+      <else-if type="article-newspaper">
+        <text macro="issued"/>
+      </else-if>
+      <else-if variable="publisher-place publisher" match="any">
+        <group delimiter=", ">
+          <choose>
+            <if type="thesis">
+              <text variable="genre" text-case="capitalize-first"/>
+            </if>
+          </choose>
+          <group delimiter=". ">
+            <text macro="originally-published"/>
+            <group delimiter=", ">
+              <text macro="reprint"/>
+              <text macro="publisher"/>
+            </group>
+          </group>
+          <text macro="issued"/>
+        </group>
+      </else-if>
+      <else>
+        <text macro="issued"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="access-note">
+    <group delimiter=", ">
+      <choose>
+        <if type="graphic report" match="any">
+          <text macro="archive-note"/>
+        </if>
+        <else-if type="article-journal bill book chapter legal_case legislation motion_picture paper-conference" match="none">
+          <text macro="archive-note"/>
+        </else-if>
+      </choose>
+      <choose>
+        <if variable="issued" match="none">
+          <group delimiter=" ">
+            <text term="accessed"/>
+            <date variable="accessed" form="text"/>
+          </group>
+        </if>
+      </choose>
+      <choose>
+        <if type="legal_case" match="none">
+          <choose>
+            <if variable="DOI">
+              <text variable="DOI" prefix="doi:"/>
+            </if>
+            <else>
+              <text variable="URL"/>
+            </else>
+          </choose>
+        </if>
+      </choose>
+    </group>
+  </macro>
+  <macro name="access">
+    <group delimiter=". ">
+      <choose>
+        <if type="graphic report" match="any">
+          <text macro="archive"/>
+        </if>
+        <else-if type="article-journal bill book chapter legal_case legislation motion_picture paper-conference" match="none">
+          <text macro="archive"/>
+        </else-if>
+      </choose>
+      <choose>
+        <if variable="issued" match="none">
+          <group delimiter=" ">
+            <text term="accessed" text-case="capitalize-first"/>
+            <date variable="accessed" form="text"/>
+          </group>
+        </if>
+      </choose>
+      <choose>
+        <if type="legal_case" match="none">
+          <choose>
+            <if variable="DOI">
+              <text variable="DOI" prefix="doi:"/>
+            </if>
+            <else>
+              <text variable="URL"/>
+            </else>
+          </choose>
+        </if>
+      </choose>
+    </group>
+  </macro>
+  <macro name="case-locator-subsequent">
+    <choose>
+      <if type="legal_case">
+        <text macro="locators-note"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="case-issue-subsequent">
+    <choose>
+      <if type="legal_case">
+        <text macro="issue"/>
+      </if>
+    </choose>
+  </macro>
+  <citation et-al-min="4" et-al-use-first="1" disambiguate-add-names="true">
+    <layout suffix="." delimiter="; ">
+      <choose>
+        <if position="ibid-with-locator">
+          <group delimiter=", ">
+            <text term="ibid"/>
+            <text macro="point-locators-subsequent"/>
+          </group>
+        </if>
+        <else-if position="ibid">
+          <text term="ibid"/>
+        </else-if>
+        <else>
+          <group delimiter=", ">
+            <text macro="contributors-short"/>
+            <group delimiter=" ">
+              <group delimiter=", ">
+                <text macro="title-short"/>
+                <!--if title & author are the same: -->
+                <text macro="date-disambiguate"/>
+                <text macro="case-locator-subsequent"/>
+              </group>
+              <text macro="case-issue-subsequent"/>
+            </group>
+            <text macro="point-locators-subsequent"/>
+          </group>
+        </else>
+      </choose>
+    </layout>
+  </citation>
+  <bibliography hanging-indent="true" et-al-min="11" et-al-use-first="7" subsequent-author-substitute="&#8212;&#8212;&#8212;" entry-spacing="0">
+    <sort>
+      <key macro="contributors-sort"/>
+      <key variable="title"/>
+      <key variable="genre"/>
+      <key variable="issued"/>
+    </sort>
+    <layout suffix=".">
+      <group delimiter=". ">
+        <group delimiter=": ">
+          <group delimiter=", ">
+            <group delimiter=" ">
+              <group delimiter=". ">
+                <group delimiter=" ">
+                  <group delimiter=", ">
+                    <group delimiter=". ">
+                      <group delimiter=". ">
+                        <text macro="contributors"/>
+                        <text macro="title"/>
+                      </group>
+                      <text macro="description"/>
+                      <text macro="secondary-contributors"/>
+                      <group delimiter=", ">
+                        <text macro="container-title"/>
+                        <text macro="container-contributors"/>
+                      </group>
+                      <text macro="locators-join-with-period"/>
+                    </group>
+                    <text macro="locators-join-with-comma"/>
+                    <text macro="locators-chapter"/>
+                  </group>
+                  <text macro="locators-join-with-space"/>
+                </group>
+                <text macro="collection-title"/>
+                <text macro="issue-join-with-period"/>
+              </group>
+              <text macro="issue-join-with-space"/>
+            </group>
+            <text macro="issue-join-with-comma"/>
+            <text macro="locators-journal-join-with-comma"/>
+            <text macro="locators-newspaper"/>
+          </group>
+          <text macro="locators-journal-join-with-colon"/>
+        </group>
+        <text macro="access"/>
+      </group>
+      <text variable="note" display="block"/>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/chicago-author-date-with-original-date-and-status.csl b/test/command/chicago-author-date-with-original-date-and-status.csl
new file mode 100644
--- /dev/null
+++ b/test/command/chicago-author-date-with-original-date-and-status.csl
@@ -0,0 +1,575 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never" page-range-format="chicago">
+  <info>
+    <title>Chicago Manual of Style 16th edition (author-date)</title>
+    <id>http://www.zotero.org/styles/chicago-author-date</id>
+    <link href="http://www.zotero.org/styles/chicago-author-date" rel="self"/>
+    <link href="http://www.chicagomanualofstyle.org/tools_citationguide.html" rel="documentation"/>
+    <author>
+      <name>Julian Onions</name>
+      <email>julian.onions@gmail.com</email>
+    </author>
+    <contributor>
+      <name>Sebastian Karcher</name>
+    </contributor>
+    <contributor>
+      <name>Richard Karnesky</name>
+      <email>karnesky+zotero@gmail.com</email>
+      <uri>http://arc.nucapt.northwestern.edu/Richard_Karnesky</uri>
+    </contributor>
+    <contributor>
+      <name>Andrew Dunning</name>
+      <email>andrew.dunning@utoronto.ca</email>
+    </contributor>
+    <category citation-format="author-date"/>
+    <category field="generic-base"/>
+    <summary>The author-date variant of the Chicago style</summary>
+    <updated>2014-05-23T03:53:32+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="en">
+    <terms>
+      <term name="editor" form="verb-short">ed.</term>
+      <term name="container-author" form="verb">by</term>
+      <term name="translator" form="verb-short">trans.</term>
+      <term name="editortranslator" form="verb">
+        <single>edited and translated by</single>
+        <multiple>edited and translated by</multiple>
+      </term>
+      <term name="translator" form="short">trans.</term>
+    </terms>
+  </locale>
+  <macro name="secondary-contributors">
+    <choose>
+      <if type="chapter paper-conference" match="none">
+        <names variable="editor translator" delimiter=". ">
+          <label form="verb" text-case="capitalize-first" suffix=" "/>
+          <name and="text" delimiter=", "/>
+        </names>
+      </if>
+    </choose>
+  </macro>
+  <macro name="container-contributors">
+    <choose>
+      <if type="chapter paper-conference" match="any">
+        <group prefix=", " delimiter=", ">
+          <names variable="container-author" delimiter=", ">
+            <label form="verb" suffix=" "/>
+            <name and="text" delimiter=", "/>
+          </names>
+          <names variable="editor translator" delimiter=", ">
+            <label form="verb" suffix=" "/>
+            <name and="text" delimiter=", "/>
+          </names>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="editor">
+    <names variable="editor">
+      <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="short" prefix=", "/>
+    </names>
+  </macro>
+  <macro name="translator">
+    <names variable="translator">
+      <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="short" prefix=", "/>
+    </names>
+  </macro>
+  <macro name="recipient">
+    <choose>
+      <if type="personal_communication">
+        <choose>
+          <if variable="genre">
+            <text variable="genre" text-case="capitalize-first"/>
+          </if>
+          <else>
+            <text term="letter" text-case="capitalize-first"/>
+          </else>
+        </choose>
+      </if>
+    </choose>
+    <names variable="recipient" delimiter=", ">
+      <label form="verb" prefix=" " text-case="lowercase" suffix=" "/>
+      <name and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="contributors">
+    <group delimiter=". ">
+      <names variable="author">
+        <name and="text" name-as-sort-order="first" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+        <label form="short" prefix=", "/>
+        <substitute>
+          <names variable="editor"/>
+          <names variable="translator"/>
+          <text macro="title"/>
+        </substitute>
+      </names>
+      <text macro="recipient"/>
+    </group>
+  </macro>
+  <macro name="contributors-short">
+    <names variable="author">
+      <name form="short" and="text" delimiter=", " initialize-with=". "/>
+      <substitute>
+        <names variable="editor"/>
+        <names variable="translator"/>
+        <text macro="title"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="interviewer">
+    <names variable="interviewer" delimiter=", ">
+      <label form="verb" prefix=" " text-case="capitalize-first" suffix=" "/>
+      <name and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="archive">
+    <group delimiter=". ">
+      <text variable="archive_location" text-case="capitalize-first"/>
+      <text variable="archive"/>
+      <text variable="archive-place"/>
+    </group>
+  </macro>
+  <macro name="access">
+    <group delimiter=". ">
+      <choose>
+        <if type="graphic report" match="any">
+          <text macro="archive"/>
+        </if>
+        <else-if type="article-journal bill book chapter legal_case legislation motion_picture paper-conference" match="none">
+          <text macro="archive"/>
+        </else-if>
+      </choose>
+      <choose>
+        <if variable="issued" match="none">
+          <group delimiter=" ">
+            <text term="accessed" text-case="capitalize-first"/>
+            <date variable="accessed" delimiter=" ">
+              <date-part name="month"/>
+              <date-part name="day"/>
+            </date>
+          </group>
+        </if>
+      </choose>
+      <choose>
+        <if type="legal_case" match="none">
+          <choose>
+            <if variable="DOI">
+              <text variable="DOI" prefix="doi:"/>
+            </if>
+            <else>
+              <text variable="URL"/>
+            </else>
+          </choose>
+        </if>
+      </choose>
+    </group>
+  </macro>
+  <macro name="title">
+    <choose>
+      <if variable="title" match="none">
+        <choose>
+          <if type="personal_communication" match="none">
+            <text variable="genre" text-case="capitalize-first"/>
+          </if>
+        </choose>
+      </if>
+      <else-if type="bill book graphic legislation motion_picture report song" match="any">
+        <text variable="title" text-case="title" font-style="italic"/>
+        <group prefix=" (" suffix=")" delimiter=" ">
+          <text term="version"/>
+          <text variable="version"/>
+        </group>
+      </else-if>
+      <else-if variable="reviewed-author">
+        <group delimiter=", ">
+          <text variable="title" font-style="italic" prefix="Review of "/>
+          <names variable="reviewed-author">
+            <label form="verb-short" text-case="lowercase" suffix=" "/>
+            <name and="text" delimiter=", "/>
+          </names>
+        </group>
+      </else-if>
+      <else-if type="legal_case interview" match="any">
+        <text variable="title"/>
+      </else-if>
+      <else>
+        <text variable="title" text-case="title" quotes="true"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="edition">
+    <choose>
+      <if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+        <choose>
+          <if is-numeric="edition">
+            <group delimiter=" " prefix=". ">
+              <number variable="edition" form="ordinal"/>
+              <text term="edition" form="short" strip-periods="true"/>
+            </group>
+          </if>
+          <else>
+            <text variable="edition" prefix=". "/>
+          </else>
+        </choose>
+      </if>
+      <else-if type="chapter  paper-conference" match="any">
+        <choose>
+          <if is-numeric="edition">
+            <group delimiter=" " prefix=", ">
+              <number variable="edition" form="ordinal"/>
+              <text term="edition" form="short"/>
+            </group>
+          </if>
+          <else>
+            <text variable="edition" prefix=", "/>
+          </else>
+        </choose>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="locators">
+    <choose>
+      <if type="article-journal">
+        <choose>
+          <if variable="volume">
+            <text variable="volume" prefix=" "/>
+            <group prefix=" (" suffix=")">
+              <choose>
+                <if variable="issue">
+                  <text variable="issue"/>
+                </if>
+                <else>
+                  <date variable="issued">
+                    <date-part name="month"/>
+                  </date>
+                </else>
+              </choose>
+            </group>
+          </if>
+          <else-if variable="issue">
+            <group delimiter=" " prefix=", ">
+              <text term="issue" form="short"/>
+              <text variable="issue"/>
+              <date variable="issued" prefix="(" suffix=")">
+                <date-part name="month"/>
+              </date>
+            </group>
+          </else-if>
+          <else>
+            <date variable="issued" prefix=", ">
+              <date-part name="month"/>
+            </date>
+          </else>
+        </choose>
+      </if>
+      <else-if type="legal_case">
+        <text variable="volume" prefix=", "/>
+        <text variable="container-title" prefix=" "/>
+        <text variable="page" prefix=" "/>
+      </else-if>
+      <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+        <group prefix=". " delimiter=". ">
+          <group>
+            <text term="volume" form="short" text-case="capitalize-first" suffix=" "/>
+            <number variable="volume" form="numeric"/>
+          </group>
+          <group>
+            <number variable="number-of-volumes" form="numeric"/>
+            <text term="volume" form="short" prefix=" " plural="true"/>
+          </group>
+        </group>
+      </else-if>
+      <else-if type="chapter paper-conference" match="any">
+        <choose>
+          <if variable="page" match="none">
+            <group prefix=". ">
+              <text term="volume" form="short" text-case="capitalize-first" suffix=" "/>
+              <number variable="volume" form="numeric"/>
+            </group>
+          </if>
+        </choose>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="locators-chapter">
+    <choose>
+      <if type="chapter paper-conference" match="any">
+        <choose>
+          <if variable="page">
+            <group prefix=", ">
+              <text variable="volume" suffix=":"/>
+              <text variable="page"/>
+            </group>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators-article">
+    <choose>
+      <if type="article-newspaper">
+        <group prefix=", " delimiter=", ">
+          <group>
+            <text variable="edition" suffix=" "/>
+            <text term="edition" prefix=" "/>
+          </group>
+          <group>
+            <text term="section" form="short" suffix=" "/>
+            <text variable="section"/>
+          </group>
+        </group>
+      </if>
+      <else-if type="article-journal">
+        <choose>
+          <if variable="volume issue" match="any">
+            <text variable="page" prefix=": "/>
+          </if>
+          <else>
+            <text variable="page" prefix=", "/>
+          </else>
+        </choose>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="point-locators">
+    <choose>
+      <if variable="locator">
+        <choose>
+          <if locator="page" match="none">
+            <choose>
+              <if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+                <choose>
+                  <if variable="volume">
+                    <group>
+                      <text term="volume" form="short" suffix=" "/>
+                      <number variable="volume" form="numeric"/>
+                      <label variable="locator" form="short" prefix=", " suffix=" "/>
+                    </group>
+                  </if>
+                  <else>
+                    <label variable="locator" form="short" suffix=" "/>
+                  </else>
+                </choose>
+              </if>
+              <else>
+                <label variable="locator" form="short" suffix=" "/>
+              </else>
+            </choose>
+          </if>
+          <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+            <number variable="volume" form="numeric" suffix=":"/>
+          </else-if>
+        </choose>
+        <text variable="locator"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="container-prefix">
+    <text term="in" text-case="capitalize-first"/>
+  </macro>
+  <macro name="container-title">
+    <choose>
+      <if type="chapter paper-conference" match="any">
+        <text macro="container-prefix" suffix=" "/>
+      </if>
+    </choose>
+    <choose>
+      <if type="legal_case" match="none">
+        <text variable="container-title" text-case="title" font-style="italic"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="publisher">
+    <group delimiter=": ">
+      <text variable="publisher-place"/>
+      <text variable="publisher"/>
+    </group>
+  </macro>
+  <macro name="date-citation">
+    <choose>
+      <if variable="original-date">
+        <date variable="original-date" prefix="["  suffix="]">
+        <date-part name="year"/>
+      </date>
+      </if>
+    </choose>
+  <choose>
+    <if variable="issued">
+      <date variable="issued" prefix=" ">
+        <date-part name="year"/>
+      </date>
+    </if>
+    <else-if variable="status">
+      <text variable="status" prefix=", "/>
+    </else-if>
+    <else-if variable="accessed">
+      <date variable="accessed" prefix=" ">
+        <date-part name="year"/>
+      </date>
+    </else-if>
+    </choose>
+  </macro>
+  <macro name="date-bibliography">
+      <choose>
+        <if variable="original-date">
+          <date variable="original-date" prefix=" ("  suffix=") ">
+          <date-part name="year"/>
+        </date>
+        </if>
+      </choose>
+    <choose>
+      <if variable="issued">
+        <date variable="issued">
+          <date-part name="year"/>
+        </date>
+      </if>
+      <else-if variable="status">
+        <text variable="status" text-case="capitalize-first"/>
+      </else-if>
+      <else-if variable="accessed">
+        <date variable="accessed">
+          <date-part name="year"/>
+        </date>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="day-month">
+    <date variable="issued">
+      <date-part name="month"/>
+      <date-part name="day" prefix=" "/>
+    </date>
+  </macro>
+  <macro name="collection-title">
+    <choose>
+      <if match="none" type="article-journal">
+        <choose>
+          <if match="none" is-numeric="collection-number">
+            <group delimiter=", ">
+              <text variable="collection-title" text-case="title"/>
+              <text variable="collection-number"/>
+            </group>
+          </if>
+          <else>
+            <group delimiter=" ">
+              <text variable="collection-title" text-case="title"/>
+              <text variable="collection-number"/>
+            </group>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="collection-title-journal">
+    <choose>
+      <if type="article-journal">
+        <group delimiter=" ">
+          <text variable="collection-title"/>
+          <text variable="collection-number"/>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="event">
+    <group>
+      <text term="presented at" suffix=" "/>
+      <text variable="event"/>
+    </group>
+  </macro>
+  <macro name="description">
+    <choose>
+      <if type="interview">
+        <group delimiter=". ">
+          <text macro="interviewer"/>
+          <text variable="medium" text-case="capitalize-first"/>
+        </group>
+      </if>
+      <else>
+        <text variable="medium" text-case="capitalize-first" prefix=". "/>
+      </else>
+    </choose>
+    <choose>
+      <if variable="title" match="none"/>
+      <else-if type="thesis personal_communication speech" match="any"/>
+      <else>
+        <group delimiter=" " prefix=". ">
+          <text variable="genre" text-case="capitalize-first"/>
+          <choose>
+            <if type="report">
+              <text variable="number"/>
+            </if>
+          </choose>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="issue">
+    <choose>
+      <if type="legal_case">
+        <text variable="authority" prefix=". "/>
+      </if>
+      <else-if type="speech">
+        <group prefix=". " delimiter=", ">
+          <group delimiter=" ">
+            <text variable="genre" text-case="capitalize-first"/>
+            <text macro="event"/>
+          </group>
+          <text variable="event-place"/>
+          <text macro="day-month"/>
+        </group>
+      </else-if>
+      <else-if type="article-newspaper article-magazine personal_communication" match="any">
+        <text macro="day-month" prefix=", "/>
+      </else-if>
+      <else>
+        <group prefix=". " delimiter=", ">
+          <choose>
+            <if type="thesis">
+              <text variable="genre" text-case="capitalize-first"/>
+            </if>
+          </choose>
+          <text macro="publisher"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <citation et-al-min="4" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true" givenname-disambiguation-rule="primary-name">
+    <layout prefix="(" suffix=")" delimiter="; ">
+      <group delimiter=", ">
+        <group delimiter=" ">
+          <text macro="contributors-short"/>
+          <text macro="date-citation"/>
+        </group>
+        <text macro="point-locators"/>
+      </group>
+    </layout>
+  </citation>
+  <bibliography hanging-indent="true" et-al-min="11" et-al-use-first="7" subsequent-author-substitute="&#8212;&#8212;&#8212;" entry-spacing="0">
+    <sort>
+      <key macro="contributors"/>
+      <key variable="original-date"/>
+      <key variable="issued"/>
+    </sort>
+    <layout suffix=".">
+      <group delimiter=". ">
+        <text macro="contributors"/>
+        <text macro="date-bibliography" text-case="capitalize-first"/> 
+        <text macro="title"/>
+      </group>
+      <text macro="description"/>
+      <text macro="secondary-contributors" prefix=". "/>
+      <text macro="container-title" prefix=". "/>
+      <text macro="container-contributors"/>
+      <text macro="edition"/>
+      <text macro="locators-chapter"/>
+      <text macro="collection-title-journal" prefix=", " suffix=", "/>
+      <text macro="locators"/>
+      <text macro="collection-title" prefix=". "/>
+      <text macro="issue"/>
+      <text macro="locators-article"/>
+      <text macro="access" prefix=". "/>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/chicago-fullnote-bibliography.csl b/test/command/chicago-fullnote-bibliography.csl
new file mode 100644
--- /dev/null
+++ b/test/command/chicago-fullnote-bibliography.csl
@@ -0,0 +1,1430 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="note" version="1.0" demote-non-dropping-particle="display-and-sort" page-range-format="chicago">
+  <info>
+    <title>Chicago Manual of Style 17th edition (full note)</title>
+    <id>http://www.zotero.org/styles/chicago-fullnote-bibliography</id>
+    <link href="http://www.zotero.org/styles/chicago-fullnote-bibliography" rel="self"/>
+    <link href="http://www.chicagomanualofstyle.org/tools_citationguide.html" rel="documentation"/>
+    <author>
+      <name>Julian Onions</name>
+      <email>julian.onions@gmail.com</email>
+    </author>
+    <contributor>
+      <name>Simon Kornblith</name>
+      <email>simon@simonster.com</email>
+    </contributor>
+    <contributor>
+      <name>Elena Razlogova</name>
+      <email>elena.razlogova@gmail.com</email>
+    </contributor>
+    <contributor>
+      <name>Frank Bennett</name>
+      <email>biercenator@gmail.com</email>
+    </contributor>
+    <contributor>
+      <name>Andrew Dunning</name>
+      <email>andrew.dunning@utoronto.ca</email>
+    </contributor>
+    <contributor>
+      <name>Sebastian Karcher</name>
+    </contributor>
+    <category citation-format="note"/>
+    <category field="generic-base"/>
+    <summary>Chicago format with full notes and bibliography</summary>
+    <updated>2017-10-12T12:00:00+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="en">
+    <terms>
+      <term name="editor" form="verb-short">ed.</term>
+      <term name="translator" form="verb-short">trans.</term>
+      <term name="translator" form="short">trans.</term>
+      <term name="editortranslator" form="verb-short">ed. and trans.</term>
+      <term name="editortranslator" form="verb">Edited and translated by</term>
+      <term name="translator" form="short">trans.</term>
+    </terms>
+  </locale>
+  <macro name="editor-translator">
+    <group delimiter=", ">
+      <group delimiter=" ">
+        <choose>
+          <if variable="container-author reviewed-author" match="any">
+            <group>
+              <names variable="container-author reviewed-author">
+                <label form="verb-short" text-case="lowercase" suffix=" "/>
+                <name and="text" delimiter=", "/>
+              </names>
+            </group>
+          </if>
+        </choose>
+      </group>
+      <names variable="editor translator" delimiter=", ">
+        <label form="verb-short" text-case="lowercase" suffix=" "/>
+        <name and="text" delimiter=", "/>
+      </names>
+    </group>
+  </macro>
+  <macro name="secondary-contributors-note">
+    <choose>
+      <if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="none">
+        <text macro="editor-translator"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="container-contributors-note">
+    <choose>
+      <if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
+        <text macro="editor-translator"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="secondary-contributors">
+    <choose>
+      <if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="none">
+        <names variable="editor translator" delimiter=". ">
+          <label form="verb" text-case="capitalize-first" suffix=" "/>
+          <name and="text" delimiter=", "/>
+        </names>
+      </if>
+    </choose>
+  </macro>
+  <macro name="container-contributors">
+    <choose>
+      <if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
+        <group delimiter=", ">
+          <choose>
+            <if variable="author">
+              <choose>
+                <if variable="container-author" match="any">
+                  <names variable="container-author">
+                    <label form="verb-short" text-case="lowercase" suffix=" "/>
+                    <name and="text" delimiter=", "/>
+                  </names>
+                </if>
+              </choose>
+              <!--This includes page numers after the container author, e.g. for Introductions -->
+              <choose>
+                <if variable="container-author author" match="all">
+                  <group delimiter=". ">
+                    <text variable="page"/>
+                    <names variable="editor translator" delimiter=", ">
+                      <label form="verb" suffix=" "/>
+                      <name and="text" delimiter=", "/>
+                    </names>
+                  </group>
+                </if>
+                <else>
+                  <names variable="editor translator" delimiter=", ">
+                    <label form="verb" text-case="lowercase" suffix=" "/>
+                    <name and="text" delimiter=", "/>
+                  </names>
+                </else>
+              </choose>
+            </if>
+          </choose>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="recipient-note">
+    <names variable="recipient" delimiter=", ">
+      <label form="verb" text-case="lowercase" suffix=" "/>
+      <name and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="contributors-note">
+    <group delimiter=" ">
+      <names variable="author">
+        <name and="text" sort-separator=", " delimiter=", "/>
+        <label form="short" prefix=", "/>
+        <substitute>
+          <names variable="editor"/>
+          <names variable="translator"/>
+        </substitute>
+      </names>
+      <text macro="recipient-note"/>
+    </group>
+  </macro>
+  <macro name="editor">
+    <names variable="editor">
+      <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="short" prefix=", "/>
+    </names>
+  </macro>
+  <macro name="translator">
+    <names variable="translator">
+      <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="verb-short" prefix=", "/>
+    </names>
+  </macro>
+  <macro name="recipient">
+    <group delimiter=" ">
+      <choose>
+        <if type="personal_communication">
+          <choose>
+            <if variable="genre">
+              <text variable="genre" text-case="capitalize-first"/>
+            </if>
+            <else>
+              <text term="letter" text-case="capitalize-first"/>
+            </else>
+          </choose>
+        </if>
+      </choose>
+      <text macro="recipient-note"/>
+    </group>
+  </macro>
+  <macro name="contributors">
+    <group delimiter=". ">
+      <names variable="author">
+        <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+        <substitute>
+          <text macro="editor"/>
+          <text macro="translator"/>
+        </substitute>
+      </names>
+      <text macro="recipient"/>
+    </group>
+  </macro>
+  <macro name="recipient-short">
+    <names variable="recipient">
+      <label form="verb" text-case="lowercase" suffix=" "/>
+      <name form="short" and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="contributors-short">
+    <group delimiter=" ">
+      <names variable="author">
+        <name form="short" and="text" delimiter=", "/>
+        <substitute>
+          <names variable="editor"/>
+          <names variable="translator"/>
+        </substitute>
+      </names>
+      <text macro="recipient-short"/>
+    </group>
+  </macro>
+  <macro name="contributors-sort">
+    <names variable="author">
+      <name name-as-sort-order="all" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+      <substitute>
+        <names variable="editor"/>
+        <names variable="translator"/>
+        <text macro="title"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="interviewer-note">
+    <names variable="interviewer" delimiter=", ">
+      <label form="verb" text-case="lowercase" suffix=" "/>
+      <name and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="interviewer">
+    <names variable="interviewer" delimiter=", ">
+      <label form="verb" text-case="capitalize-first" suffix=" "/>
+      <name and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="title-note">
+    <choose>
+      <if variable="title" match="none">
+        <text variable="genre"/>
+      </if>
+      <else-if type="book graphic map motion_picture song" match="any">
+        <text variable="title" text-case="title" font-style="italic"/>
+        <group delimiter=" " prefix=", ">
+          <text term="version"/>
+          <text variable="version"/>
+        </group>
+      </else-if>
+      <else-if type="legal_case interview patent" match="any">
+        <text variable="title"/>
+      </else-if>
+      <else-if variable="reviewed-author">
+        <text variable="title" font-style="italic" prefix="review of "/>
+      </else-if>
+      <else>
+        <text variable="title" text-case="title" quotes="true"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="title">
+    <choose>
+      <if variable="title" match="none">
+        <choose>
+          <if type="personal_communication" match="none">
+            <text variable="genre" text-case="capitalize-first"/>
+          </if>
+        </choose>
+      </if>
+      <else-if type="book graphic motion_picture song" match="any">
+        <text variable="title" text-case="title" font-style="italic"/>
+        <group prefix=" (" suffix=")" delimiter=" ">
+          <text term="version"/>
+          <text variable="version"/>
+        </group>
+      </else-if>
+      <else-if variable="reviewed-author">
+        <group delimiter=", ">
+          <text variable="title" font-style="italic" prefix="Review of "/>
+          <names variable="reviewed-author">
+            <label form="verb-short" text-case="lowercase" suffix=" "/>
+            <name and="text" delimiter=", "/>
+          </names>
+        </group>
+      </else-if>
+      <else-if type="bill legislation legal_case interview patent" match="any">
+        <text variable="title"/>
+      </else-if>
+      <else>
+        <text variable="title" text-case="title" quotes="true"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="title-short">
+    <choose>
+      <if variable="title" match="none">
+        <choose>
+          <if type="interview">
+            <text term="interview"/>
+          </if>
+          <else-if type="manuscript speech" match="any">
+            <text variable="genre" form="short"/>
+          </else-if>
+          <else-if type="personal_communication">
+            <text macro="issued"/>
+          </else-if>
+        </choose>
+      </if>
+      <else-if type="book graphic motion_picture song" match="any">
+        <text variable="title" text-case="title" form="short" font-style="italic"/>
+      </else-if>
+      <else-if type="legal_case" variable="title-short" match="all">
+        <text variable="title" font-style="italic" form="short"/>
+      </else-if>
+      <else-if type="patent interview" match="any">
+        <text variable="title" form="short"/>
+      </else-if>
+      <else-if type="legal_case bill legislation" match="any">
+        <text variable="title"/>
+      </else-if>
+      <else>
+        <text variable="title" text-case="title" form="short" quotes="true"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="date-disambiguate">
+    <choose>
+      <if disambiguate="true">
+        <text macro="issued"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="description-note">
+    <group delimiter=", ">
+      <text macro="interviewer-note"/>
+      <text variable="medium"/>
+      <choose>
+        <if variable="title" match="none"/>
+        <else-if type="manuscript thesis speech" match="any"/>
+        <else-if type="patent">
+          <group delimiter=" ">
+            <text variable="authority"/>
+            <text variable="number"/>
+          </group>
+        </else-if>
+        <else>
+          <text variable="genre"/>
+        </else>
+      </choose>
+      <choose>
+        <if type="map">
+          <text variable="scale"/>
+        </if>
+        <else-if type="graphic">
+          <text variable="dimensions"/>
+        </else-if>
+      </choose>
+    </group>
+  </macro>
+  <macro name="description">
+    <group delimiter=", ">
+      <group delimiter=". ">
+        <text macro="interviewer"/>
+        <text variable="medium" text-case="capitalize-first"/>
+      </group>
+      <choose>
+        <if variable="title" match="none"/>
+        <else-if type="thesis speech" match="any"/>
+        <else-if type="patent">
+          <group delimiter=" ">
+            <text variable="authority"/>
+            <text variable="number"/>
+          </group>
+        </else-if>
+        <else>
+          <text variable="genre" text-case="capitalize-first"/>
+        </else>
+      </choose>
+      <choose>
+        <if type="map">
+          <text variable="scale"/>
+        </if>
+        <else-if type="graphic">
+          <text variable="dimensions"/>
+        </else-if>
+      </choose>
+    </group>
+  </macro>
+  <macro name="container-title-note">
+    <group delimiter=" ">
+      <choose>
+        <if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
+          <text term="in"/>
+        </if>
+      </choose>
+      <choose>
+        <if type="webpage">
+          <text variable="container-title"/>
+        </if>
+        <else-if type="post-weblog">
+          <text variable="container-title" text-case="title" font-style="italic" suffix=" (blog)"/>
+        </else-if>
+        <else-if type="bill legislation legal_case" match="none">
+          <text variable="container-title" text-case="title" font-style="italic"/>
+        </else-if>
+      </choose>
+    </group>
+  </macro>
+  <macro name="container-title">
+    <group delimiter=" ">
+      <choose>
+        <if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
+          <text term="in" text-case="capitalize-first"/>
+        </if>
+      </choose>
+      <choose>
+        <if type="webpage">
+          <text variable="container-title"/>
+        </if>
+        <else-if type="post-weblog">
+          <text variable="container-title" text-case="title" font-style="italic" suffix=" (blog)"/>
+        </else-if>
+        <else-if type="bill legislation legal_case" match="none">
+          <text variable="container-title" text-case="title" font-style="italic"/>
+        </else-if>
+      </choose>
+    </group>
+  </macro>
+  <macro name="collection-title">
+    <choose>
+      <if match="none" type="article-journal">
+        <choose>
+          <if match="none" is-numeric="collection-number">
+            <group delimiter=", ">
+              <text variable="collection-title" text-case="title"/>
+              <text variable="collection-number"/>
+            </group>
+          </if>
+          <else>
+            <group delimiter=" ">
+              <text variable="collection-title" text-case="title"/>
+              <text variable="collection-number"/>
+            </group>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="collection-title-journal">
+    <choose>
+      <if type="article-journal">
+        <group delimiter=" ">
+          <text variable="collection-title"/>
+          <text variable="collection-number"/>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="edition-note">
+    <choose>
+      <if type="book chapter graphic motion_picture paper-conference report song" match="any">
+        <choose>
+          <if is-numeric="edition">
+            <group delimiter=" ">
+              <number variable="edition" form="ordinal"/>
+              <text term="edition" form="short"/>
+            </group>
+          </if>
+          <else>
+            <text variable="edition"/>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="edition">
+    <choose>
+      <if type="book chapter graphic motion_picture paper-conference report song" match="any">
+        <choose>
+          <if is-numeric="edition">
+            <group delimiter=" ">
+              <number variable="edition" form="ordinal"/>
+              <text term="edition" form="short"/>
+            </group>
+          </if>
+          <else>
+            <text variable="edition" text-case="capitalize-first" suffix="."/>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators-note-join-with-space">
+    <choose>
+      <if type="article-journal" variable="volume" match="all">
+        <choose>
+          <if match="none" variable="collection-title">
+            <text macro="locators-note"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators-note-join-with-comma">
+    <choose>
+      <if type="article-journal" match="none">
+        <text macro="locators-note"/>
+      </if>
+      <else-if type="article-journal">
+        <choose>
+          <if variable="volume" match="none">
+            <text macro="locators-note"/>
+          </if>
+          <else-if match="any" variable="collection-title">
+            <text macro="locators-note"/>
+          </else-if>
+        </choose>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="locators-note">
+    <choose>
+      <if type="article-journal">
+        <group delimiter=", ">
+          <text macro="collection-title-journal"/>
+          <number variable="volume"/>
+          <group delimiter=" ">
+            <text term="issue" form="short"/>
+            <number variable="issue"/>
+          </group>
+        </group>
+      </if>
+      <else-if type="bill legislation legal_case" match="any">
+        <text macro="legal-cites"/>
+      </else-if>
+      <else-if type="book chapter graphic motion_picture paper-conference report song" match="any">
+        <group delimiter=", ">
+          <text macro="edition-note"/>
+          <group delimiter=" ">
+            <text term="volume" form="short"/>
+            <number variable="volume" form="numeric"/>
+          </group>
+          <choose>
+            <if variable="locator" match="none">
+              <group delimiter=" ">
+                <number variable="number-of-volumes" form="numeric"/>
+                <text term="volume" form="short" plural="true"/>
+              </group>
+            </if>
+          </choose>
+        </group>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="legal-cites">
+    <choose>
+      <if type="legal_case" match="any">
+        <group delimiter=" ">
+          <choose>
+            <if variable="container-title">
+              <text variable="volume"/>
+              <text variable="container-title"/>
+              <group delimiter=" ">
+                <!--change to label variable="section" as that becomes available -->
+                <text term="section" form="symbol"/>
+                <text variable="section"/>
+              </group>
+              <text variable="page"/>
+            </if>
+            <else>
+              <text variable="number" prefix="No. "/>
+            </else>
+          </choose>
+        </group>
+      </if>
+      <else-if type="bill legislation" match="any">
+        <group delimiter=", ">
+          <choose>
+            <if variable="number">
+              <!--There's a public law number-->
+              <text variable="number" prefix="Pub. L. No. "/>
+              <group delimiter=" ">
+                <!--change to label variable="section" as that becomes available -->
+                <text term="section" form="symbol"/>
+                <text variable="section"/>
+              </group>
+              <group delimiter=" ">
+                <text variable="volume"/>
+                <text variable="container-title"/>
+                <text variable="page-first"/>
+              </group>
+            </if>
+            <else>
+              <group delimiter=" ">
+                <text variable="volume"/>
+                <text variable="container-title"/>
+                <!--change to label variable="section" as that becomes available -->
+                <text term="section" form="symbol"/>
+                <text variable="section"/>
+              </group>
+            </else>
+          </choose>
+        </group>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="locators-join-with-space">
+    <choose>
+      <if type="article-journal" variable="volume" match="all">
+        <choose>
+          <if match="none" variable="collection-title">
+            <text macro="locators"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators-join-with-comma">
+    <choose>
+      <if type="bill chapter legislation legal_case paper-conference" match="any">
+        <text macro="locators"/>
+      </if>
+      <else-if type="article-journal">
+        <choose>
+          <if variable="volume" match="none">
+            <text macro="locators"/>
+          </if>
+          <else-if match="any" variable="collection-title">
+            <text macro="locators"/>
+          </else-if>
+        </choose>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="locators-join-with-period">
+    <choose>
+      <if type="bill legislation legal_case article-journal chapter paper-conference" match="none">
+        <text macro="locators"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators">
+    <choose>
+      <if type="article-journal">
+        <group delimiter=", ">
+          <text macro="collection-title-journal"/>
+          <number variable="volume"/>
+          <group delimiter=" ">
+            <text term="issue" form="short"/>
+            <number variable="issue"/>
+          </group>
+        </group>
+      </if>
+      <else-if type="bill legislation legal_case" match="any">
+        <text macro="legal-cites"/>
+      </else-if>
+      <else-if type="book graphic motion_picture report song" match="any">
+        <group delimiter=". ">
+          <text macro="edition"/>
+          <group delimiter=" ">
+            <text term="volume" form="short" text-case="capitalize-first"/>
+            <number variable="volume" form="numeric"/>
+          </group>
+          <group delimiter=" ">
+            <number variable="number-of-volumes" form="numeric"/>
+            <text term="volume" form="short" plural="true"/>
+          </group>
+        </group>
+      </else-if>
+      <else-if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
+        <group delimiter=". ">
+          <text macro="edition"/>
+          <choose>
+            <if variable="page" match="none">
+              <group delimiter=" ">
+                <text term="volume" form="short" text-case="capitalize-first"/>
+                <number variable="volume" form="numeric"/>
+              </group>
+            </if>
+          </choose>
+        </group>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="locators-newspaper">
+    <choose>
+      <if type="article-newspaper">
+        <group delimiter=", ">
+          <group delimiter=" ">
+            <number variable="edition"/>
+            <text term="edition"/>
+          </group>
+          <group delimiter=" ">
+            <text term="section" form="short"/>
+            <text variable="section"/>
+          </group>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="event-note">
+    <text variable="event"/>
+  </macro>
+  <macro name="event">
+    <choose>
+      <if variable="title">
+        <group delimiter=" ">
+          <text term="presented at"/>
+          <text variable="event"/>
+        </group>
+      </if>
+      <else>
+        <group delimiter=" ">
+          <text term="presented at" text-case="capitalize-first"/>
+          <text variable="event"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="originally-published">
+    <group delimiter=", ">
+      <group delimiter=": ">
+        <text variable="original-publisher-place"/>
+        <text variable="original-publisher"/>
+      </group>
+      <date variable="original-date" form="text" date-parts="year"/>
+    </group>
+  </macro>
+  <macro name="reprint-note">
+    <!--needs localization-->
+    <choose>
+      <if variable="original-date issued" match="all">
+        <choose>
+          <!--for whatever reason in notes, when we have both original and new publishers, reprint doesn't appear-->
+          <if variable="original-publisher original-publisher-place" match="none">
+            <text value="repr."/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="reprint">
+    <!--needs localization-->
+    <choose>
+      <if variable="original-date issued" match="all">
+        <text value="reprint" text-case="capitalize-first"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="publisher">
+    <choose>
+      <if type="thesis">
+        <text variable="publisher"/>
+      </if>
+      <else-if type="speech">
+        <text variable="event-place"/>
+      </else-if>
+      <else>
+        <group delimiter=": ">
+          <text variable="publisher-place"/>
+          <text variable="publisher"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="issued">
+    <choose>
+      <if variable="issued">
+        <choose>
+          <if type="legal_case">
+            <group delimiter=" ">
+              <text variable="authority"/>
+              <choose>
+                <if variable="container-title" match="any">
+                  <!--Only print year for cases published in reporters-->
+                  <date variable="issued" form="numeric" date-parts="year"/>
+                </if>
+                <else>
+                  <date variable="issued" form="text"/>
+                </else>
+              </choose>
+            </group>
+          </if>
+          <else-if type="book bill chapter  legislation motion_picture paper-conference song thesis" match="any">
+            <choose>
+              <if is-uncertain-date="issued">
+                <date variable="issued" form="numeric" date-parts="year" prefix="[" suffix="?]"/>
+              </if>
+              <else>
+                <date variable="issued" form="numeric" date-parts="year"/>
+              </else>
+            </choose>
+          </else-if>
+          <else-if type="patent">
+            <group delimiter=", ">
+              <group delimiter=" ">
+                <!--Needs Localization-->
+                <text value="filed"/>
+                <date variable="submitted" form="text"/>
+              </group>
+              <group delimiter=" ">
+                <choose>
+                  <if variable="issued submitted" match="all">
+                    <text term="and"/>
+                  </if>
+                </choose>
+                <!--Needs Localization-->
+                <text value="issued"/>
+                <date variable="issued" form="text"/>
+              </group>
+            </group>
+          </else-if>
+          <else>
+            <choose>
+              <if is-uncertain-date="issued">
+                <date variable="issued" form="text" prefix="[" suffix="?]"/>
+              </if>
+              <else>
+                <date variable="issued" form="text"/>
+              </else>
+            </choose>
+          </else>
+        </choose>
+      </if>
+      <else-if variable="status">
+        <text variable="status"/>
+      </else-if>
+      <else-if variable="accessed URL" match="all"/>
+      <else>
+        <text term="no date" form="short"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="point-locators-subsequent">
+    <choose>
+      <if type="legal_case" variable="locator" match="all">
+        <choose>
+          <if locator="page">
+            <group delimiter=":">
+              <number variable="volume"/>
+              <text variable="locator"/>
+            </group>
+          </if>
+          <else>
+            <group delimiter=" ">
+              <label variable="locator" form="short"/>
+              <text variable="locator"/>
+            </group>
+          </else>
+        </choose>
+      </if>
+      <else-if variable="locator">
+        <choose>
+          <if locator="page" match="none">
+            <group delimiter=" ">
+              <choose>
+                <if type="book graphic motion_picture report song" match="any">
+                  <choose>
+                    <if variable="volume">
+                      <group delimiter=", ">
+                        <group delimiter=" ">
+                          <text term="volume" form="short"/>
+                          <number variable="volume" form="numeric"/>
+                        </group>
+                        <label variable="locator" form="short"/>
+                      </group>
+                    </if>
+                    <else>
+                      <label variable="locator" form="short"/>
+                    </else>
+                  </choose>
+                </if>
+                <else>
+                  <label variable="locator" form="short"/>
+                </else>
+              </choose>
+              <text variable="locator"/>
+            </group>
+          </if>
+          <else-if type="book graphic motion_picture report song" match="any">
+            <group delimiter=":">
+              <number variable="volume" form="numeric"/>
+              <text variable="locator"/>
+            </group>
+          </else-if>
+          <else>
+            <text variable="locator"/>
+          </else>
+        </choose>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="point-locators-join-with-colon">
+    <choose>
+      <if type="article-journal">
+        <choose>
+          <if variable="locator page" match="any">
+            <choose>
+              <if variable="volume issue" match="any">
+                <text macro="point-locators"/>
+              </if>
+            </choose>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="point-locators-join-with-comma">
+    <choose>
+      <if type="article-journal" match="none">
+        <text macro="point-locators"/>
+      </if>
+      <else-if variable="volume issue" match="none">
+        <text macro="point-locators"/>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="point-locators">
+    <choose>
+      <if variable="locator" match="none">
+        <choose>
+          <if type="article-journal chapter paper-conference" match="any">
+            <text variable="page"/>
+          </if>
+        </choose>
+      </if>
+      <else-if type="article-journal">
+        <group delimiter=" ">
+          <choose>
+            <if locator="page" match="none">
+              <label variable="locator" form="short" suffix=" "/>
+            </if>
+          </choose>
+          <text variable="locator"/>
+        </group>
+      </else-if>
+      <else-if type="legal_case"/>
+      <else>
+        <group delimiter=" ">
+          <choose>
+            <if locator="page" match="none">
+              <label variable="locator" form="short"/>
+            </if>
+          </choose>
+          <text variable="locator"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="locators-chapter">
+    <choose>
+      <if type="chapter entry-dictionary entry-encyclopedia paper-conference" match="any">
+        <choose>
+          <if variable="author container-author" match="all"/>
+          <else>
+            <choose>
+              <if variable="page">
+                <number variable="volume" suffix=":"/>
+                <text variable="page"/>
+              </if>
+            </choose>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators-journal-join-with-colon">
+    <choose>
+      <if type="article-journal">
+        <choose>
+          <if variable="volume issue" match="any">
+            <text variable="page"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators-journal-join-with-comma">
+    <choose>
+      <if type="article-journal">
+        <choose>
+          <if variable="volume issue" match="none">
+            <text variable="page"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="archive-note">
+    <choose>
+      <if type="thesis">
+        <group delimiter=" ">
+          <text variable="archive"/>
+          <text variable="archive_location" prefix="(" suffix=")"/>
+        </group>
+      </if>
+      <else>
+        <group delimiter=", ">
+          <text variable="archive_location"/>
+          <text variable="archive"/>
+          <text variable="archive-place"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="archive">
+    <choose>
+      <if type="thesis">
+        <group delimiter=" ">
+          <text variable="archive"/>
+          <text variable="archive_location" prefix="(" suffix=")"/>
+        </group>
+      </if>
+      <else>
+        <group delimiter=". ">
+          <text variable="archive_location" text-case="capitalize-first"/>
+          <text variable="archive"/>
+          <text variable="archive-place"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="issue-note-join-with-space">
+    <choose>
+      <if type="article-journal bill legislation legal_case manuscript thesis" variable="publisher-place publisher" match="any">
+        <!--Chicago doesn't use publisher/place for Newspapers and we want the date delimited by a comma-->
+        <choose>
+          <if type="article-newspaper" match="none">
+            <choose>
+              <if type="article-journal" match="none">
+                <text macro="issue-note"/>
+              </if>
+              <else-if variable="issue volume" match="any">
+                <text macro="issue-note"/>
+              </else-if>
+            </choose>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="issue-note-join-with-comma">
+    <choose>
+      <if type="article-journal bill legislation legal_case manuscript thesis" variable="publisher-place publisher" match="none">
+        <text macro="issue-note"/>
+      </if>
+      <else-if type="article-newspaper">
+        <text macro="issue-note"/>
+      </else-if>
+      <else-if type="article-journal">
+        <choose>
+          <if variable="volume issue" match="none">
+            <text macro="issue-note"/>
+          </if>
+        </choose>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="issue-map-graphic">
+    <!--See CMoS 17th ed. 14.235 and 14.237-->
+    <choose>
+      <if type="graphic map" match="any">
+        <choose>
+          <if variable="publisher publisher-place" match="none">
+            <text macro="issued"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="issue-note">
+    <choose>
+      <if type="bill legislation legal_case" match="any">
+        <text macro="issued" prefix="(" suffix=")"/>
+      </if>
+      <else-if type="article-journal">
+        <choose>
+          <if variable="volume issue" match="any">
+            <text macro="issued" prefix="(" suffix=")"/>
+          </if>
+          <else>
+            <text macro="issued"/>
+          </else>
+        </choose>
+      </else-if>
+      <else-if type="article-newspaper">
+        <text macro="issued"/>
+      </else-if>
+      <else-if type="manuscript thesis speech" match="any">
+        <group delimiter=", " prefix="(" suffix=")">
+          <choose>
+            <if variable="title" match="any">
+              <text variable="genre"/>
+            </if>
+          </choose>
+          <text variable="publisher"/>
+          <text macro="issued"/>
+        </group>
+      </else-if>
+      <else-if variable="publisher-place event-place publisher" match="any">
+        <group prefix="(" suffix=")" delimiter=", ">
+          <text macro="event-note"/>
+          <group delimiter="; ">
+            <text macro="originally-published"/>
+            <group delimiter=", ">
+              <text macro="reprint-note"/>
+              <text macro="publisher"/>
+            </group>
+          </group>
+          <text macro="issued"/>
+        </group>
+      </else-if>
+      <else>
+        <text macro="issued"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="issue-join-with-space">
+    <choose>
+      <if type="article-journal" match="any">
+        <choose>
+          <if variable="issue volume" match="any">
+            <text macro="issue"/>
+          </if>
+        </choose>
+      </if>
+      <else-if type="bill legislation legal_case" match="any">
+        <text macro="issue"/>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="issue-join-with-period">
+    <choose>
+      <if type="article-journal bill legislation legal_case" match="none">
+        <choose>
+          <if type="speech" variable="publisher publisher-place" match="any">
+            <text macro="issue"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="issue-join-with-comma">
+    <choose>
+      <if type="bill legislation legal_case" match="none">
+        <choose>
+          <if type="article-journal" match="none">
+            <choose>
+              <if type="speech" variable="publisher publisher-place" match="none">
+                <text macro="issue"/>
+              </if>
+            </choose>
+          </if>
+          <else-if variable="volume issue" match="none">
+            <text macro="issue"/>
+          </else-if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="issue">
+    <choose>
+      <if type="bill legislation legal_case" match="any">
+        <text macro="issued" prefix="(" suffix=")"/>
+      </if>
+      <else-if type="article-journal">
+        <choose>
+          <if variable="issue volume" match="any">
+            <text macro="issued" prefix="(" suffix=")"/>
+          </if>
+          <else>
+            <text macro="issued"/>
+          </else>
+        </choose>
+      </else-if>
+      <else-if type="speech">
+        <group delimiter=", ">
+          <group delimiter=" ">
+            <choose>
+              <if variable="title" match="none"/>
+              <else>
+                <text variable="genre" text-case="capitalize-first"/>
+              </else>
+            </choose>
+            <text macro="event"/>
+          </group>
+          <text variable="event-place"/>
+          <text macro="issued"/>
+        </group>
+      </else-if>
+      <!--Chicago doesn't use publisher/place for Newspapers -->
+      <else-if type="article-newspaper">
+        <text macro="issued"/>
+      </else-if>
+      <else-if variable="publisher-place publisher" match="any">
+        <group delimiter=", ">
+          <choose>
+            <if type="thesis">
+              <text variable="genre" text-case="capitalize-first"/>
+            </if>
+          </choose>
+          <group delimiter=". ">
+            <text macro="originally-published"/>
+            <group delimiter=", ">
+              <text macro="reprint"/>
+              <text macro="publisher"/>
+            </group>
+          </group>
+          <text macro="issued"/>
+        </group>
+      </else-if>
+      <!--location for data for maps and artwork is different-->
+      <else-if type="graphic map" match="none">
+        <text macro="issued"/>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="access-note">
+    <group delimiter=", ">
+      <choose>
+        <if type="graphic report" match="any">
+          <text macro="archive-note"/>
+        </if>
+        <else-if type="article-journal bill book chapter legal_case legislation motion_picture paper-conference" match="none">
+          <text macro="archive-note"/>
+        </else-if>
+      </choose>
+      <choose>
+        <if variable="issued" match="none">
+          <group delimiter=" ">
+            <text term="accessed"/>
+            <date variable="accessed" form="text"/>
+          </group>
+        </if>
+      </choose>
+      <choose>
+        <if type="legal_case" match="none">
+          <choose>
+            <if variable="DOI">
+              <text variable="DOI" prefix="https://doi.org/"/>
+            </if>
+            <else>
+              <text variable="URL"/>
+            </else>
+          </choose>
+        </if>
+      </choose>
+    </group>
+  </macro>
+  <macro name="access">
+    <group delimiter=". ">
+      <choose>
+        <if type="graphic report" match="any">
+          <text macro="archive"/>
+        </if>
+        <else-if type="article-journal bill book chapter legal_case legislation motion_picture paper-conference" match="none">
+          <text macro="archive"/>
+        </else-if>
+      </choose>
+      <choose>
+        <if variable="issued" match="none">
+          <group delimiter=" ">
+            <text term="accessed" text-case="capitalize-first"/>
+            <date variable="accessed" form="text"/>
+          </group>
+        </if>
+      </choose>
+      <choose>
+        <if type="legal_case" match="none">
+          <choose>
+            <if variable="DOI">
+              <text variable="DOI" prefix="https://doi.org/"/>
+            </if>
+            <else>
+              <text variable="URL"/>
+            </else>
+          </choose>
+        </if>
+      </choose>
+    </group>
+  </macro>
+  <macro name="case-locator-subsequent">
+    <choose>
+      <if type="legal_case">
+        <group delimiter=" ">
+          <text variable="volume"/>
+          <text variable="container-title"/>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="case-pinpoint-subsequent">
+    <choose>
+      <if type="legal_case">
+        <group delimiter=" ">
+          <choose>
+            <if locator="page">
+              <text term="at"/>
+              <text variable="locator"/>
+            </if>
+            <else>
+              <label variable="locator"/>
+              <text variable="locator"/>
+            </else>
+          </choose>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <citation et-al-min="4" et-al-use-first="1" disambiguate-add-names="true">
+    <layout suffix="." delimiter="; ">
+      <choose>
+        <if position="ibid ibid-with-locator" match="any">
+          <group delimiter=", ">
+            <text macro="contributors-short"/>
+            <group delimiter=" ">
+              <group delimiter=", ">
+                <choose>
+                  <if variable="author editor translator" match="none">
+                    <text macro="title-short"/>
+                  </if>
+                </choose>
+                <text macro="case-locator-subsequent"/>
+              </group>
+              <text macro="case-pinpoint-subsequent"/>
+            </group>
+            <choose>
+              <if match="none" type="legal_case">
+                <text macro="point-locators-subsequent"/>
+              </if>
+            </choose>
+          </group>
+        </if>
+        <else-if position="subsequent">
+          <group delimiter=", ">
+            <text macro="contributors-short"/>
+            <group delimiter=" ">
+              <group delimiter=", ">
+                <text macro="title-short"/>
+                <!--if title & author are the same: -->
+                <text macro="date-disambiguate"/>
+                <text macro="case-locator-subsequent"/>
+              </group>
+              <text macro="case-pinpoint-subsequent"/>
+            </group>
+            <choose>
+              <if match="none" type="legal_case">
+                <text macro="point-locators-subsequent"/>
+              </if>
+            </choose>
+          </group>
+        </else-if>
+        <else>
+          <group delimiter=", ">
+            <group delimiter=": ">
+              <group delimiter=", ">
+                <group delimiter=" ">
+                  <group delimiter=", ">
+                    <group delimiter=" ">
+                      <group delimiter=", ">
+                        <group delimiter=", ">
+                          <text macro="contributors-note"/>
+                          <text macro="title-note"/>
+                          <text macro="issue-map-graphic"/>
+                        </group>
+                        <text macro="description-note"/>
+                        <text macro="secondary-contributors-note"/>
+                        <text macro="container-title-note"/>
+                        <text macro="container-contributors-note"/>
+                      </group>
+                      <text macro="locators-note-join-with-space"/>
+                    </group>
+                    <text macro="locators-note-join-with-comma"/>
+                    <text macro="collection-title"/>
+                    <text macro="issue-note-join-with-comma"/>
+                  </group>
+                  <text macro="issue-note-join-with-space"/>
+                </group>
+                <text macro="locators-newspaper"/>
+                <text macro="point-locators-join-with-comma"/>
+              </group>
+              <text macro="point-locators-join-with-colon"/>
+            </group>
+            <text macro="access-note"/>
+          </group>
+        </else>
+      </choose>
+    </layout>
+  </citation>
+  <bibliography hanging-indent="true" et-al-min="11" et-al-use-first="7" subsequent-author-substitute="&#8212;&#8212;&#8212;" entry-spacing="0">
+    <sort>
+      <key macro="contributors-sort"/>
+      <key variable="title"/>
+      <key variable="genre"/>
+      <key variable="issued"/>
+    </sort>
+    <layout suffix=".">
+      <group delimiter=". ">
+        <group delimiter=": ">
+          <group delimiter=", ">
+            <group delimiter=" ">
+              <group delimiter=". ">
+                <group delimiter=" ">
+                  <group delimiter=", ">
+                    <group delimiter=". ">
+                      <group delimiter=". ">
+                        <text macro="contributors"/>
+                        <text macro="title"/>
+                        <text macro="issue-map-graphic"/>
+                      </group>
+                      <text macro="description"/>
+                      <text macro="secondary-contributors"/>
+                      <group delimiter=", ">
+                        <text macro="container-title"/>
+                        <text macro="container-contributors"/>
+                      </group>
+                      <text macro="locators-join-with-period"/>
+                    </group>
+                    <text macro="locators-join-with-comma"/>
+                    <text macro="locators-chapter"/>
+                  </group>
+                  <text macro="locators-join-with-space"/>
+                </group>
+                <text macro="collection-title"/>
+                <text macro="issue-join-with-period"/>
+              </group>
+              <text macro="issue-join-with-space"/>
+            </group>
+            <text macro="issue-join-with-comma"/>
+            <text macro="locators-journal-join-with-comma"/>
+            <text macro="locators-newspaper"/>
+          </group>
+          <text macro="locators-journal-join-with-colon"/>
+        </group>
+        <text macro="access"/>
+      </group>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/chicago-note-bibliography.csl b/test/command/chicago-note-bibliography.csl
new file mode 100644
--- /dev/null
+++ b/test/command/chicago-note-bibliography.csl
@@ -0,0 +1,1005 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="note" version="1.0" demote-non-dropping-particle="sort-only">
+  <info>
+    <title>Chicago Manual of Style (note)</title>
+    <id>http://www.zotero.org/styles/chicago-note-bibliography</id>
+    <link href="http://www.zotero.org/styles/chicago-note-bibliography" rel="self"/>
+    <link href="http://www.chicagomanualofstyle.org/tools_citationguide.html" rel="documentation"/>
+    <author>
+      <name>Julian Onions</name>
+      <email>julian.onions@gmail.com</email>
+    </author>
+    <contributor>
+      <name>Simon Kornblith</name>
+      <email>simon@simonster.com</email>
+    </contributor>
+    <contributor>
+      <name>Elena Razlogova</name>
+      <email>elena.razlogova@gmail.com</email>
+    </contributor>
+    <contributor>
+      <name>Frank Bennett</name>
+      <email>biercenator@gmail.com</email>
+    </contributor>
+    <category citation-format="note"/>
+    <category field="generic-base"/>
+    <summary>Chicago format with short notes and bibliography</summary>
+    <updated>2012-10-25T21:15:26+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="en">
+    <terms>
+      <term name="editortranslator" form="verb-short">
+        <single>trans. and ed.</single>
+        <multiple>trans. and ed.</multiple>
+      </term>
+      <term name="editortranslator" form="verb">
+        <single> Translated and edited by</single>
+        <multiple> Translated and edited by</multiple>
+      </term>
+      <term name="editor" form="verb-short">ed.</term>
+      <term name="translator" form="verb-short">trans.</term>
+    </terms>
+  </locale>
+  <macro name="editor-translator">
+    <group delimiter=", ">
+      <choose>
+        <if variable="author">
+          <group delimiter=" ">
+            <choose>
+              <if variable="container-author">
+                <group>
+                  <names variable="container-author">
+                    <label form="verb-short" text-case="lowercase" suffix=" "/>
+                    <name and="text" delimiter=", "/>
+                  </names>
+                </group>
+              </if>
+            </choose>
+          </group>
+          <names variable="editor translator" delimiter=", ">
+            <label form="verb-short" text-case="lowercase" suffix=" "/>
+            <name and="text" delimiter=", "/>
+          </names>
+        </if>
+      </choose>
+    </group>
+  </macro>
+  <macro name="secondary-contributors-note">
+    <choose>
+      <if type="chapter paper-conference" match="none">
+        <text macro="editor-translator"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="container-contributors-note">
+    <choose>
+      <if type="chapter paper-conference" match="any">
+        <text macro="editor-translator"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="secondary-contributors">
+    <choose>
+      <if type="chapter paper-conference" match="none">
+        <group delimiter=". ">
+          <choose>
+            <if variable="author">
+              <names variable="editor translator" delimiter=". ">
+                <label form="verb" text-case="capitalize-first" suffix=" "/>
+                <name and="text" delimiter=", "/>
+              </names>
+            </if>
+          </choose>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="container-contributors">
+    <choose>
+      <if type="chapter paper-conference" match="any">
+        <group delimiter=", ">
+          <choose>
+            <if variable="author">
+              <choose>
+                <if variable="container-author">
+                  <names variable="container-author">
+                    <label form="verb-short" text-case="lowercase" suffix=" "/>
+                    <name and="text" delimiter=", "/>
+                  </names>
+                </if>
+              </choose>
+              <!--This includes page numers after the container author, e.g. for Introductions -->
+              <choose>
+                <if variable="container-author author" match="all">
+                  <group delimiter=". ">
+                    <text variable="page"/>
+                    <names variable="editor translator" delimiter=", ">
+                      <label form="verb" suffix=" "/>
+                      <name and="text" delimiter=", "/>
+                    </names>
+                  </group>
+                </if>
+                <else>
+                  <names variable="editor translator" delimiter=", ">
+                    <label form="verb" text-case="lowercase" suffix=" "/>
+                    <name and="text" delimiter=", "/>
+                  </names>
+                </else>
+              </choose>
+            </if>
+          </choose>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="recipient-note">
+    <names variable="recipient" delimiter=", ">
+      <label form="verb" text-case="lowercase" suffix=" "/>
+      <name and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="contributors-note">
+    <group delimiter=" ">
+      <names variable="author">
+        <name and="text" sort-separator=", " delimiter=", "/>
+        <label form="short" prefix=", "/>
+        <substitute>
+          <names variable="editor"/>
+          <names variable="translator"/>
+        </substitute>
+      </names>
+      <text macro="recipient-note"/>
+    </group>
+  </macro>
+  <macro name="editor">
+    <names variable="editor">
+      <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="short" prefix=", "/>
+    </names>
+  </macro>
+  <macro name="translator">
+    <names variable="translator">
+      <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="verb-short" prefix=", "/>
+    </names>
+  </macro>
+  <macro name="recipient">
+    <group delimiter=" ">
+      <choose>
+        <if type="personal_communication">
+          <choose>
+            <if variable="genre">
+              <text variable="genre" text-case="capitalize-first"/>
+            </if>
+            <else>
+              <text term="letter" text-case="capitalize-first"/>
+            </else>
+          </choose>
+        </if>
+      </choose>
+      <text macro="recipient-note"/>
+    </group>
+  </macro>
+  <macro name="contributors">
+    <group delimiter=". ">
+      <names variable="author">
+        <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+        <substitute>
+          <text macro="editor"/>
+          <text macro="translator"/>
+        </substitute>
+      </names>
+      <text macro="recipient"/>
+    </group>
+  </macro>
+  <macro name="recipient-short">
+    <names variable="recipient">
+      <label form="verb" text-case="lowercase" suffix=" "/>
+      <name form="short" and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="contributors-short">
+    <group delimiter=" ">
+      <names variable="author">
+        <name form="short" and="text" delimiter=", "/>
+        <substitute>
+          <names variable="editor"/>
+          <names variable="translator"/>
+        </substitute>
+      </names>
+      <text macro="recipient-short"/>
+    </group>
+  </macro>
+  <macro name="contributors-sort">
+    <names variable="author">
+      <name name-as-sort-order="all" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+      <substitute>
+        <names variable="editor"/>
+        <names variable="translator"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="interviewer-note">
+    <names variable="interviewer" delimiter=", ">
+      <label form="verb" text-case="lowercase" suffix=" "/>
+      <name and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="interviewer">
+    <names variable="interviewer" delimiter=", ">
+      <label form="verb" text-case="capitalize-first" suffix=" "/>
+      <name and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="title-note">
+    <choose>
+      <if variable="title" match="none">
+        <text variable="genre"/>
+      </if>
+      <else-if type="bill book graphic  legislation motion_picture report song" match="any">
+        <text variable="title" text-case="title" font-style="italic"/>
+        <text variable="version" prefix=" , version " suffix=""/>
+        <!--This isn't localized because we don't have a version term. While not ideal, it should work for many languages and is better than not including a term.-->
+      </else-if>
+      <else-if type="legal_case">
+        <text variable="title"/>
+      </else-if>
+      <else>
+        <text variable="title" text-case="title" quotes="true"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="title">
+    <choose>
+      <if variable="title" match="none">
+        <choose>
+          <if type="personal_communication" match="none">
+            <text variable="genre" text-case="capitalize-first"/>
+          </if>
+        </choose>
+      </if>
+      <else-if type="bill book graphic legislation motion_picture report song" match="any">
+        <text variable="title" text-case="title" font-style="italic"/>
+        <text variable="version" prefix=" (version " suffix=")"/>
+      </else-if>
+      <else-if type="legal_case">
+        <text variable="title"/>
+      </else-if>
+      <else>
+        <text variable="title" text-case="title" quotes="true"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="title-short">
+    <choose>
+      <if variable="title" match="none">
+        <choose>
+          <if type="interview">
+            <text term="interview" text-case="lowercase"/>
+          </if>
+          <else-if type="manuscript speech" match="any">
+            <text variable="genre" form="short"/>
+          </else-if>
+          <else-if type="personal_communication">
+            <text macro="issued"/>
+          </else-if>
+        </choose>
+      </if>
+      <else-if type="bill book graphic legislation motion_picture report song" match="any">
+        <text variable="title" text-case="title" form="short" font-style="italic"/>
+      </else-if>
+      <else-if type="legal_case">
+        <text variable="title"/>
+      </else-if>
+      <else>
+        <text variable="title" text-case="title" form="short" quotes="true"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="description-note">
+    <group delimiter=", ">
+      <text macro="interviewer-note"/>
+      <text variable="medium"/>
+      <choose>
+        <if variable="title" match="none"/>
+        <else-if type="thesis speech" match="any"/>
+        <else>
+          <text variable="genre"/>
+        </else>
+      </choose>
+    </group>
+  </macro>
+  <macro name="description">
+    <group delimiter=", ">
+      <group delimiter=". ">
+        <text macro="interviewer"/>
+        <text variable="medium" text-case="capitalize-first"/>
+      </group>
+      <choose>
+        <if variable="title" match="none"/>
+        <else-if type="thesis speech" match="any"/>
+        <else>
+          <text variable="genre" text-case="capitalize-first"/>
+        </else>
+      </choose>
+    </group>
+  </macro>
+  <macro name="container-title-note">
+    <group delimiter=" ">
+      <choose>
+        <if type="chapter paper-conference" match="any">
+          <text term="in" text-case="lowercase"/>
+        </if>
+      </choose>
+      <choose>
+        <if type="legal_case" match="none">
+          <text variable="container-title" text-case="title" font-style="italic"/>
+        </if>
+      </choose>
+    </group>
+  </macro>
+  <macro name="container-title">
+    <group delimiter=" ">
+      <choose>
+        <if type="chapter paper-conference" match="any">
+          <text term="in" text-case="capitalize-first"/>
+        </if>
+      </choose>
+      <choose>
+        <if type="legal_case" match="none">
+          <text variable="container-title" text-case="title" font-style="italic"/>
+        </if>
+      </choose>
+    </group>
+  </macro>
+  <macro name="collection-title">
+    <group delimiter=" ">
+      <text variable="collection-title" text-case="title"/>
+      <text variable="collection-number"/>
+    </group>
+  </macro>
+  <macro name="edition-note">
+    <choose>
+      <if type="bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="any">
+        <choose>
+          <if is-numeric="edition">
+            <group delimiter=" ">
+              <number variable="edition" form="ordinal"/>
+              <text term="edition" form="short"/>
+            </group>
+          </if>
+          <else>
+            <number variable="edition" suffix="."/>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="edition">
+    <choose>
+      <if type="bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="any">
+        <choose>
+          <if is-numeric="edition">
+            <group delimiter=" ">
+              <number variable="edition" form="ordinal"/>
+              <text term="edition" form="short"/>
+            </group>
+          </if>
+          <else>
+            <number variable="edition" text-case="capitalize-first" suffix="."/>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators-note-join-with-space">
+    <choose>
+      <if type="article-journal">
+        <text macro="locators-note"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators-note-join-with-comma">
+    <choose>
+      <if type="article-journal" match="none">
+        <text macro="locators-note"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators-note">
+    <choose>
+      <if type="article-journal">
+        <group delimiter=", ">
+          <number variable="volume"/>
+          <group delimiter=" ">
+            <text term="issue" form="short"/>
+            <number variable="issue"/>
+          </group>
+        </group>
+      </if>
+      <else-if type="legal_case">
+        <group delimiter=", ">
+          <group delimiter=" ">
+            <number variable="volume"/>
+            <text variable="container-title"/>
+            <text variable="page"/>
+          </group>
+          <text variable="locator"/>
+        </group>
+      </else-if>
+      <else-if type="bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="any">
+        <group delimiter=", ">
+          <group delimiter=" ">
+            <text term="volume" form="short"/>
+            <number variable="volume" form="numeric"/>
+          </group>
+          <choose>
+            <if variable="locator" match="none">
+              <group delimiter=" ">
+                <number variable="number-of-volumes" form="numeric"/>
+                <text term="volume" form="short" plural="true"/>
+              </group>
+            </if>
+          </choose>
+          <text macro="edition-note"/>
+        </group>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="locators-join-with-space">
+    <choose>
+      <if type="article-journal">
+        <text macro="locators"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators-join-with-comma">
+    <choose>
+      <if type="legal_case">
+        <text macro="locators"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators-join-with-period">
+    <choose>
+      <if type="legal_case article-journal" match="none">
+        <text macro="locators"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators">
+    <choose>
+      <if type="article-journal">
+        <group delimiter=", ">
+          <number variable="volume"/>
+          <group delimiter=" ">
+            <text term="issue" form="short"/>
+            <number variable="issue"/>
+          </group>
+        </group>
+      </if>
+      <else-if type="legal_case">
+        <group delimiter=" ">
+          <number variable="volume"/>
+          <text variable="container-title"/>
+          <text variable="page"/>
+        </group>
+      </else-if>
+      <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+        <group delimiter=". ">
+          <group delimiter=" ">
+            <text term="volume" form="short" text-case="capitalize-first"/>
+            <number variable="volume" form="numeric"/>
+          </group>
+          <group delimiter=" ">
+            <number variable="number-of-volumes" form="numeric"/>
+            <text term="volume" form="short" plural="true"/>
+          </group>
+          <text macro="edition"/>
+        </group>
+      </else-if>
+      <else-if type="chapter paper-conference" match="any">
+        <group delimiter=". ">
+          <choose>
+            <if variable="page" match="none">
+              <group delimiter=" ">
+                <text term="volume" form="short" text-case="capitalize-first"/>
+                <number variable="volume" form="numeric"/>
+              </group>
+            </if>
+          </choose>
+          <text macro="edition"/>
+        </group>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="locators-newspaper">
+    <choose>
+      <if type="article-newspaper">
+        <group delimiter=", ">
+          <group delimiter=" ">
+            <number variable="edition"/>
+            <text term="edition"/>
+          </group>
+          <group delimiter=" ">
+            <text term="section" form="short"/>
+            <text variable="section"/>
+          </group>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="event">
+    <group delimiter=" ">
+      <text term="presented at"/>
+      <text variable="event"/>
+    </group>
+  </macro>
+  <macro name="publisher">
+    <choose>
+      <if type="thesis">
+        <text variable="publisher"/>
+      </if>
+      <else>
+        <group delimiter=": ">
+          <text variable="publisher-place"/>
+          <text variable="publisher"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="issued">
+    <choose>
+      <if variable="issued">
+        <choose>
+          <if type="graphic report" match="any">
+            <date variable="issued">
+              <date-part name="month" suffix=" "/>
+              <date-part name="day" suffix=", "/>
+              <date-part name="year"/>
+            </date>
+          </if>
+          <else-if type="legal_case">
+            <group delimiter=" ">
+              <text variable="authority"/>
+              <date variable="issued">
+                <date-part name="year"/>
+              </date>
+            </group>
+          </else-if>
+          <else-if type="bill book chapter graphic legal_case legislation motion_picture paper-conference report song thesis" match="any">
+            <date variable="issued">
+              <date-part name="year"/>
+            </date>
+          </else-if>
+          <else>
+            <date variable="issued">
+              <date-part name="month" suffix=" "/>
+              <date-part name="day" suffix=", "/>
+              <date-part name="year"/>
+            </date>
+          </else>
+        </choose>
+      </if>
+      <else-if variable="accessed URL" match="all">
+      </else-if>
+      <else>
+        <text term="no date" form="short"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="point-locators-subsequent">
+    <choose>
+      <if variable="locator">
+        <choose>
+          <if locator="page" match="none">
+            <group delimiter=" ">
+              <choose>
+                <if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+                  <choose>
+                    <if variable="volume">
+                      <group delimiter=", ">
+                        <group delimiter=" ">
+                          <text term="volume" form="short" text-case="lowercase"/>
+                          <number variable="volume" form="numeric"/>
+                        </group>
+                        <label variable="locator" form="short"/>
+                      </group>
+                    </if>
+                    <else>
+                      <label variable="locator" form="short"/>
+                    </else>
+                  </choose>
+                </if>
+                <else>
+                  <label variable="locator" form="short"/>
+                </else>
+              </choose>
+              <text variable="locator"/>
+            </group>
+          </if>
+          <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+            <group delimiter=":">
+              <number variable="volume" form="numeric"/>
+              <text variable="locator"/>
+            </group>
+          </else-if>
+          <else>
+            <text variable="locator"/>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="point-locators-join-with-colon">
+    <choose>
+      <if type="article-journal">
+        <choose>
+          <if variable="locator page" match="any">
+            <text macro="point-locators"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="point-locators-join-with-comma">
+    <choose>
+      <if type="article-journal" match="none">
+        <text macro="point-locators"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="point-locators">
+    <choose>
+      <if variable="locator" match="none">
+        <choose>
+          <if type="article-journal chapter paper-conference" match="any">
+            <text variable="page"/>
+          </if>
+        </choose>
+      </if>
+      <else-if type="article-journal">
+        <group delimiter=" ">
+          <choose>
+            <if locator="page" match="none">
+              <label variable="locator" form="short" suffix=" "/>
+            </if>
+          </choose>
+          <text variable="locator"/>
+        </group>
+      </else-if>
+      <else-if type="legal_case"/>
+      <else>
+        <group delimiter=" ">
+          <choose>
+            <if locator="page" match="none">
+              <label variable="locator" form="short"/>
+            </if>
+          </choose>
+          <text variable="locator"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="locators-chapter">
+    <choose>
+      <if type="chapter paper-conference" match="any">
+        <choose>
+          <if variable="page">
+            <number variable="volume" suffix=":"/>
+            <text variable="page"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators-journal">
+    <choose>
+      <if type="article-journal">
+        <text variable="page"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="archive-note">
+    <choose>
+      <if type="thesis">
+        <group delimiter=" ">
+          <text variable="archive"/>
+          <text variable="archive_location" prefix="(" suffix=")"/>
+        </group>
+      </if>
+      <else>
+        <group delimiter=", ">
+          <text variable="archive_location"/>
+          <text variable="archive"/>
+          <text variable="archive-place"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="archive">
+    <choose>
+      <if type="thesis">
+        <group delimiter=" ">
+          <text variable="archive"/>
+          <text variable="archive_location" prefix="(" suffix=")"/>
+        </group>
+      </if>
+      <else>
+        <group delimiter=". ">
+          <text variable="archive_location" text-case="capitalize-first"/>
+          <text variable="archive"/>
+          <text variable="archive-place"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="issue-note-join-with-space">
+    <choose>
+      <if type="article-journal legal_case" variable="publisher-place publisher" match="any">
+        <text macro="issue-note"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="issue-note-join-with-comma">
+    <choose>
+      <if type="article-journal legal_case" variable="publisher-place publisher" match="none">
+        <text macro="issue-note"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="issue-note">
+    <choose>
+      <if type="article-journal legal_case" match="any">
+        <text macro="issued" prefix="(" suffix=")"/>
+      </if>
+      <else-if variable="publisher-place publisher" match="any">
+        <group prefix="(" suffix=")" delimiter=", ">
+          <group delimiter=" ">
+            <choose>
+              <if variable="title" match="none"/>
+              <else-if type="thesis speech" match="any">
+                <text variable="genre"/>
+              </else-if>
+            </choose>
+            <text macro="event"/>
+          </group>
+          <text macro="publisher"/>
+          <text macro="issued"/>
+        </group>
+      </else-if>
+      <else>
+        <text macro="issued"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="issue-join-with-space">
+    <choose>
+      <if type="article-journal legal_case">
+        <text macro="issue"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="issue-join-with-period">
+    <choose>
+      <if type="article-journal legal_case" match="none">
+        <choose>
+          <if type="speech" variable="publisher publisher-place" match="any">
+            <text macro="issue"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="issue-join-with-comma">
+    <choose>
+      <if type="article-journal legal_case" match="none">
+        <choose>
+          <if type="speech" variable="publisher publisher-place" match="none">
+            <text macro="issue"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="issue">
+    <choose>
+      <if type="article-journal legal_case" match="any">
+        <text macro="issued" prefix=" (" suffix=")"/>
+      </if>
+      <else-if type="speech">
+        <group delimiter=", ">
+          <group delimiter=" ">
+            <choose>
+              <if variable="title" match="none"/>
+              <else>
+                <text variable="genre" text-case="capitalize-first"/>
+              </else>
+            </choose>
+            <text macro="event"/>
+          </group>
+          <text variable="event-place"/>
+          <text macro="issued"/>
+        </group>
+      </else-if>
+      <else-if variable="publisher-place publisher" match="any">
+        <group delimiter=", ">
+          <choose>
+            <if type="thesis">
+              <text variable="genre" text-case="capitalize-first"/>
+            </if>
+          </choose>
+          <text macro="publisher"/>
+          <text macro="issued"/>
+        </group>
+      </else-if>
+      <else>
+        <text macro="issued"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="access-note">
+    <group delimiter=", ">
+      <choose>
+        <if type="graphic report" match="any">
+          <text macro="archive-note"/>
+        </if>
+        <else-if type="article-journal article-magazine article-newspaper bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="none">
+          <text macro="archive-note"/>
+        </else-if>
+      </choose>
+      <choose>
+        <if variable="issued" match="none">
+          <group delimiter=" ">
+            <text term="accessed"/>
+            <date variable="accessed">
+              <date-part name="month" suffix=" "/>
+              <date-part name="day" suffix=", "/>
+              <date-part name="year"/>
+            </date>
+          </group>
+        </if>
+      </choose>
+      <choose>
+        <if type="legal_case" match="none">
+          <choose>
+            <if variable="DOI">
+              <text variable="DOI" prefix="doi:"/>
+            </if>
+            <else>
+              <text variable="URL"/>
+            </else>
+          </choose>
+        </if>
+      </choose>
+    </group>
+  </macro>
+  <macro name="access">
+    <group delimiter=". ">
+      <choose>
+        <if type="graphic report" match="any">
+          <text macro="archive"/>
+        </if>
+        <else-if type="article-journal article-magazine article-newspaper bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="none">
+          <text macro="archive"/>
+        </else-if>
+      </choose>
+      <choose>
+        <if variable="issued" match="none">
+          <group delimiter=" ">
+            <text term="accessed" text-case="capitalize-first"/>
+            <date variable="accessed">
+              <date-part name="month" suffix=" "/>
+              <date-part name="day" suffix=", "/>
+              <date-part name="year"/>
+            </date>
+          </group>
+        </if>
+      </choose>
+      <choose>
+        <if type="legal_case" match="none">
+          <choose>
+            <if variable="DOI">
+              <text variable="DOI" prefix="doi:"/>
+            </if>
+            <else>
+              <text variable="URL"/>
+            </else>
+          </choose>
+        </if>
+      </choose>
+    </group>
+  </macro>
+  <macro name="case-locator-subsequent">
+    <choose>
+      <if type="legal_case">
+        <text macro="locators-note"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="case-issue-subsequent">
+    <choose>
+      <if type="legal_case">
+        <text macro="issue"/>
+      </if>
+    </choose>
+  </macro>
+  <citation et-al-min="4" et-al-use-first="1" disambiguate-add-names="true">
+    <layout suffix="." delimiter="; ">
+      <choose>
+        <if position="ibid-with-locator">
+          <group delimiter=", ">
+            <text term="ibid"/>
+            <text macro="point-locators-subsequent"/>
+          </group>
+        </if>
+        <else-if position="ibid">
+          <text term="ibid"/>
+        </else-if>
+        <else>
+          <group delimiter=", ">
+            <text macro="contributors-short"/>
+            <group delimiter=" ">
+              <group delimiter=", ">
+                <text macro="title-short"/>
+                <text macro="case-locator-subsequent"/>
+              </group>
+              <text macro="case-issue-subsequent"/>
+            </group>
+            <text macro="point-locators-subsequent"/>
+          </group>
+        </else>
+      </choose>
+    </layout>
+  </citation>
+  <bibliography hanging-indent="true" et-al-min="11" et-al-use-first="7" subsequent-author-substitute="&#8212;&#8212;&#8212;" entry-spacing="0">
+    <sort>
+      <key macro="contributors-sort"/>
+      <key variable="title"/>
+      <key variable="genre"/>
+      <key variable="issued"/>
+    </sort>
+    <layout suffix=".">
+      <group delimiter=". ">
+        <group delimiter=": ">
+          <group delimiter=", ">
+            <group delimiter=" ">
+              <group delimiter=". ">
+                <group delimiter=" ">
+                  <group delimiter=", ">
+                    <group delimiter=". ">
+                      <group delimiter=" ">
+                        <group delimiter=". ">
+                          <text macro="contributors"/>
+                          <text macro="title"/>
+                        </group>
+                        <text macro="description"/>
+                      </group>
+                      <text macro="secondary-contributors"/>
+                      <group delimiter=", ">
+                        <text macro="container-title"/>
+                        <text macro="container-contributors"/>
+                        <text macro="locators-chapter"/>
+                      </group>
+                      <text macro="locators-join-with-period"/>
+                    </group>
+                    <text macro="locators-join-with-comma"/>
+                  </group>
+                  <text macro="locators-join-with-space"/>
+                </group>
+                <text macro="collection-title"/>
+                <text macro="issue-join-with-period"/>
+              </group>
+              <text macro="issue-join-with-space"/>
+            </group>
+            <text macro="issue-join-with-comma"/>
+            <text macro="locators-newspaper"/>
+          </group>
+          <text macro="locators-journal"/>
+        </group>
+        <text macro="access"/>
+      </group>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/chinese-gb7714-2005-numeric.csl b/test/command/chinese-gb7714-2005-numeric.csl
new file mode 100644
--- /dev/null
+++ b/test/command/chinese-gb7714-2005-numeric.csl
@@ -0,0 +1,213 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="zh-CN">
+  <info>
+    <title>Chinese Std GB/T 7714-2005 (numeric, Chinese)</title>
+    <id>http://www.zotero.org/styles/chinese-gb7714-2005-numeric</id>
+    <link href="http://www.zotero.org/styles/chinese-gb7714-2005-numeric" rel="self"/>
+    <link href="http://gradschool.ustc.edu.cn/ylb/material/xw/wdxz/19.pdf" rel="documentation"/>
+    <author>
+      <name>heromyth</name>
+      <email>zxpmyth@yahoo.com.cn</email>
+    </author>
+    <category citation-format="numeric"/>
+    <category field="engineering"/>
+    <category field="generic-base"/>
+    <category field="science"/>
+    <summary>This style just partly implemented what the Chinese GB/T 7714-2005 requires.</summary>
+    <updated>2012-10-11T09:38:41+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <macro name="author">
+    <names variable="author">
+      <name initialize-with=" " name-as-sort-order="all" sort-separator=" " delimiter=", " delimiter-precedes-last="always">
+        <name-part name="family" text-case="uppercase"/>
+      </name>
+    </names>
+  </macro>
+  <macro name="recipient">
+    <names variable="recipient">
+      <name name-as-sort-order="all" sort-separator=" " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="short" prefix=", " text-case="lowercase"/>
+    </names>
+  </macro>
+  <macro name="interviewer">
+    <names variable="interviewer">
+      <name name-as-sort-order="all" sort-separator=" " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="short" prefix=", " text-case="lowercase"/>
+    </names>
+  </macro>
+  <macro name="composer">
+    <names variable="composer">
+      <name name-as-sort-order="all" sort-separator=" " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="short" prefix=", " text-case="lowercase"/>
+    </names>
+  </macro>
+  <macro name="original-author">
+    <names variable="original-author">
+      <name name-as-sort-order="all" sort-separator=" " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="short" prefix=", " text-case="lowercase"/>
+    </names>
+  </macro>
+  <macro name="title">
+    <text variable="title"/>
+  </macro>
+  <macro name="titleField">
+    <choose>
+      <if type="report">
+        <text macro="title" suffix="[R]. "/>
+      </if>
+      <else-if type="thesis">
+        <text macro="title" suffix="[D]. "/>
+      </else-if>
+      <else-if type="bill legislation" match="any">
+        <text variable="number" suffix=", "/>
+        <text macro="title" suffix="[S]"/>
+      </else-if>
+      <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+        <text macro="title" suffix="[M]. "/>
+      </else-if>
+      <else-if type="paper-conference">
+        <text macro="title" suffix="[C]//"/>
+      </else-if>
+      <else-if type="chapter paper-conference" match="any">
+        <text macro="title" suffix="[G]//"/>
+      </else-if>
+      <else-if type="webpage">
+        <text macro="title" suffix="[EB/OL]. "/>
+      </else-if>
+      <else-if type="patent">
+        <text macro="title"/>
+        <text variable="number" prefix=": 中国, " suffix="[P].  "/>
+      </else-if>
+      <else>
+        <text macro="title" suffix="[J]. "/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="secondaryAuthor">
+    <names variable="editor">
+      <name initialize-with=" " name-as-sort-order="all" sort-separator=" " delimiter=", " delimiter-precedes-last="always">
+        <name-part name="family" text-case="uppercase"/>
+      </name>
+    </names>
+    <names variable="translator">
+      <name name-as-sort-order="all" sort-separator=" " delimiter=", " delimiter-precedes-last="always" suffix=", 译"/>
+    </names>
+  </macro>
+  <macro name="publisher">
+    <choose>
+      <if type="chapter paper-conference" match="any">
+        <text variable="container-title" suffix=". "/>
+      </if>
+      <else-if type="report">
+        <text variable="collection-title" suffix=", "/>
+        <text variable="number" suffix=", "/>
+      </else-if>
+      <else-if type="bill legislation" match="any">
+        <text variable="container-title" prefix=". "/>
+      </else-if>
+      <else>
+        <text variable="container-title" suffix=", "/>
+      </else>
+    </choose>
+    <!--
+
+<text variable="event" suffix="event "/>
+<text variable="event-place" suffix="event-place "/>
+<text variable="original-title" suffix="original-title"/>
+
+ -->
+    <text variable="publisher-place" suffix=": "/>
+    <group delimiter=", ">
+      <text variable="publisher"/>
+      <choose>
+        <if type="webpage" variable="container-title" match="all">
+          <date variable="issued" suffix=". ">
+            <date-part name="year"/>
+            <date-part name="month" form="numeric-leading-zeros" prefix="-"/>
+            <date-part name="day" form="numeric-leading-zeros" prefix="-"/>
+          </date>
+        </if>
+        <else-if type="webpage"/>
+        <else-if type="patent">
+          <date variable="issued">
+            <date-part name="year"/>
+            <date-part name="month" form="numeric-leading-zeros" prefix="-"/>
+            <date-part name="day" form="numeric-leading-zeros" prefix="-"/>
+          </date>
+        </else-if>
+        <else-if variable="publisher">
+          <date variable="issued">
+            <date-part name="year"/>
+          </date>
+        </else-if>
+        <else-if type="bill legislation" match="any"/>
+        <else>
+          <date variable="issued">
+            <date-part name="year"/>
+          </date>
+        </else>
+      </choose>
+    </group>
+    <text variable="volume" prefix=", "/>
+    <text variable="issue" prefix="(" suffix=")"/>
+  </macro>
+  <macro name="pageField">
+    <text variable="page"/>
+  </macro>
+  <macro name="referenceDate">
+    <choose>
+      <if type="webpage">
+        <date variable="issued" prefix="(" suffix=")">
+          <date-part name="year"/>
+          <date-part name="month" form="numeric-leading-zeros" prefix="-"/>
+          <date-part name="day" form="numeric-leading-zeros" prefix="-"/>
+        </date>
+        <date variable="accessed" prefix="[" suffix="]">
+          <date-part name="year"/>
+          <date-part name="month" form="numeric-leading-zeros" prefix="-"/>
+          <date-part name="day" form="numeric-leading-zeros" prefix="-"/>
+        </date>
+      </if>
+    </choose>
+  </macro>
+  <macro name="access">
+    <choose>
+      <if variable="DOI">
+        <text variable="DOI" prefix="doi:"/>
+      </if>
+      <else-if variable="URL">
+        <text variable="URL"/>
+      </else-if>
+    </choose>
+  </macro>
+  <citation collapse="citation-number">
+    <sort>
+      <key variable="citation-number" sort="ascending"/>
+    </sort>
+    <layout vertical-align="sup" prefix="[" suffix="]" delimiter=",">
+      <text variable="citation-number"/>
+    </layout>
+  </citation>
+  <bibliography et-al-min="4" et-al-use-first="3" second-field-align="flush" entry-spacing="0">
+    <layout suffix=".">
+      <text variable="citation-number" prefix="[" suffix="]"/>
+      <text macro="author" suffix=". "/>
+      <text macro="titleField"/>
+      <text macro="secondaryAuthor" suffix=". "/>
+      <text variable="edition" prefix="第" suffix="版. "/>
+      <text macro="publisher"/>
+      <text macro="pageField" prefix=": "/>
+      <text macro="referenceDate"/>
+      <choose>
+        <if type="webpage" match="any">
+          <text macro="access" prefix=". "/>
+        </if>
+      </choose>
+      <text macro="recipient"/>
+      <text macro="interviewer"/>
+      <text macro="composer"/>
+      <text macro="original-author"/>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/cite-in-inline-note.md b/test/command/cite-in-inline-note.md
--- a/test/command/cite-in-inline-note.md
+++ b/test/command/cite-in-inline-note.md
@@ -2,5 +2,5 @@
 % pandoc -t native
 foo^[bar [@doe]]
 ^D
-[Para [Str "foo",Note [Para [Str "bar",Space,Cite [Citation {citationId = "doe", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [Str "[@doe]"]]]]]
+[Para [Str "foo",Note [Para [Str "bar",Space,Cite [Citation {citationId = "doe", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 1, citationHash = 0}] [Str "[@doe]"]]]]]
 ```
diff --git a/test/command/citeproc-17.md b/test/command/citeproc-17.md
new file mode 100644
--- /dev/null
+++ b/test/command/citeproc-17.md
@@ -0,0 +1,17 @@
+```
+% pandoc -t csljson
+---
+references:
+- id: foo
+  type: book
+  title: "Hi & Low"
+...
+^D
+[
+  {
+    "id": "foo",
+    "title": "Hi & Low",
+    "type": "book"
+  }
+]
+```
diff --git a/test/command/citeproc-7a.md b/test/command/citeproc-7a.md
new file mode 100644
--- /dev/null
+++ b/test/command/citeproc-7a.md
@@ -0,0 +1,42 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: command/chicago-fullnote-bibliography.csl
+references:
+  - id: test
+    title: Test
+    author:
+      family: Doe
+      given: John
+---
+
+Test [@test, 12].
+
+Test [@test, 12].
+
+Test.^[asdfasdf]
+
+Test [@test, 12].
+^D
+Test.[^1]
+
+Test.[^2]
+
+Test.[^3]
+
+Test.[^4]
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-test .csl-entry}
+Doe, John. "Test," n.d.
+:::
+:::
+
+[^1]: John Doe, "Test," n.d., 12.
+
+[^2]: Doe, 12.
+
+[^3]: asdfasdf
+
+[^4]: Doe, "Test," 12.
+```
diff --git a/test/command/citeproc-7b.md b/test/command/citeproc-7b.md
new file mode 100644
--- /dev/null
+++ b/test/command/citeproc-7b.md
@@ -0,0 +1,36 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: command/bioethics.csl
+references:
+  - id: test
+    title: Test
+    author:
+      family: Doe
+      given: John
+---
+
+Irrelevant.^[note]
+
+Test [@test, 12].
+
+Test.^[asdfasdf]
+
+Test [@test, 12].
+^D
+Irrelevant.[^1]
+
+Test.[^2]
+
+Test.[^3]
+
+Test.[^4]
+
+[^1]: note
+
+[^2]: J. Doe. ***Test***: 12.
+
+[^3]: asdfasdf
+
+[^4]: Doe (cited n. 2) : 12.
+```
diff --git a/test/command/din-1505-2.csl b/test/command/din-1505-2.csl
new file mode 100644
--- /dev/null
+++ b/test/command/din-1505-2.csl
@@ -0,0 +1,406 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="de-DE">
+  <info>
+    <title>DIN 1505-2 (author-date, German)</title>
+    <id>http://www.zotero.org/styles/din-1505-2</id>
+    <link href="http://www.zotero.org/styles/din-1505-2" rel="self"/>
+    <link href="http://www.bui.haw-hamburg.de/fileadmin/redaktion/diplom/Lorenzen__litverz.pdf" rel="documentation"/>
+    <link href="http://bibliothek.fh-potsdam.de/fileadmin/fhp_bib/dokumente/Schulungen/wissenschaftliches_Arbeiten/Zitieren_Lorenzen.pdf" rel="documentation"/>
+    <link href="http://www.uni-muenster.de/imperia/md/content/fachbereich_physik/didaktik_physik/materialien/materialschlichting/zitierregeln.pdf" rel="documentation"/>
+    <link href="http://forums.zotero.org/discussion/1857" rel="documentation"/>
+    <author>
+      <name>Sven Rothe</name>
+      <email>mmoole@googlemail.com</email>
+    </author>
+    <contributor>
+      <name>Julian Onions</name>
+      <email>julian.onions@gmail.com</email>
+    </contributor>
+    <category citation-format="author-date"/>
+    <category field="generic-base"/>
+    <summary>Style following DIN 1505-2, for other media types on additional standards 
+      Hinweise zur Benutzung: 
+      * Zitieren von Gesetzen: 
+        - hier müssen manuell §, Abs und S. zur Seitenangabe beim Zitieren eingetragen werden 
+        - im Kurzbeleg wird der Kurztitel verwendet, dafür keine Autoren eintragen! 
+        - als Jahresangabe wird 'Datum des Inkrafttretens' herangezogen, Verwenden nur bei Verweis auf nicht z.Z. gültige Gesetze, z.B. (idF. v. 12.12.1972) 
+       * Zitieren von Normen und Standards - nicht vollständig nach DIN 1505
+        - Nutzen Sie den Typ 'Bericht' - als Abhilfe, da es keinen Typ 'Standard' gibt.
+        - als Autor die Kurzbezeichnung inkl. Nummer und Jahr eingeben (z.B. VDI 2222-1997), Vorname leer, Jahr leer
+        - als Titel den ausführlichen Titel bei Bedarf (z.B. VDI Richtlinie 2222 Blatt 1 - Konstruktionsmethodik - Methodisches Entwickeln von Lösungsprinzipien)</summary>
+    <!--    This is just a beginning to try to have a DIN 1505 citation style,
+            Feel free to send me any comments, suggestions etc...
+            todo:
+            * basic media types (book, journal article, etc..)
+            * more media types (according DINxxx) audio video etc...
+            * fine tuning
+            * correcting errors
+            known bugs, help appreciated
+            * Abbreviations (Mitarb.) & (Hrsg. der Reihe) are missing (contributor, seriesEditor labels)
+            * "contributor" is not valid as a name variable , nevertheless it works but doesnt validate!
+            * author etc. first names should not be abbreviated
+            * reviewed author seems to be not available as variable (newspaper article)
+            * thesis type does notoffer a PLACE or FACULTY as variable!
+            how to show the place if it is not included in the University title!?!?
+            * thesis type: publisher (university), genre (type) dont seem to get through!?
+    -->
+    <!-- useful things:
+      non breaking space: &#160;
+      narrow no break space: uni202F / &#8239; - but this is not supported widely!
+      em dash: &#8212;
+      space:  &#032;
+      tab: &#009;
+
+    -->
+    <updated>2012-09-27T22:06:38+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="de">
+    <terms>
+      <term name="anonymous" form="short">o.&#160;A.</term>
+      <term name="no date" form="short">o.&#160;J.</term>
+      <term name="collection-editor" form="short">Hrsg.</term>
+      <term name="retrieved">abgerufen am</term>
+      <term name="composer" form="short">Komp.</term>
+      <term name="composer" form="long">Komponist</term>
+    </terms>
+  </locale>
+  <macro name="author">
+    <names variable="author" delimiter=" ; ">
+      <name name-as-sort-order="all" sort-separator=", " delimiter=" ; " delimiter-precedes-last="always" font-variant="small-caps"/>
+      <label form="short" prefix=" (" suffix=")"/>
+    </names>
+  </macro>
+  <macro name="author-container">
+    <names variable="container-author" delimiter=" ; ">
+      <name name-as-sort-order="all" sort-separator=", " initialize-with=". " delimiter=" ; " delimiter-precedes-last="always" font-variant="small-caps"/>
+      <label form="short" prefix=" (" suffix=")"/>
+    </names>
+  </macro>
+  <macro name="editor">
+    <names variable="editor" delimiter=" ; ">
+      <name name-as-sort-order="all" sort-separator=", " initialize-with=". " delimiter=" ; " delimiter-precedes-last="always" font-variant="small-caps"/>
+      <label form="short" prefix=" (" suffix=")"/>
+      <!-- needed: Label should appear as suffix to EVERY name...!-->
+    </names>
+  </macro>
+  <macro name="editor-collection">
+    <names variable="collection-editor" delimiter=" ; ">
+      <name name-as-sort-order="all" sort-separator=", " initialize-with=". " delimiter=" ; " delimiter-precedes-last="always" font-variant="small-caps"/>
+      <label form="short" prefix=" (" suffix=")"/>
+      <!-- needed: Label should appear as suffix to EVERY name...!-->
+    </names>
+  </macro>
+  <macro name="composer">
+    <names variable="composer" delimiter=" ; ">
+      <name name-as-sort-order="all" sort-separator=", " delimiter=" ; " delimiter-precedes-last="always" font-variant="small-caps"/>
+      <label form="long" prefix=" (" suffix=")"/>
+      <!-- needed: Label should appear as suffix to EVERY name...!-->
+    </names>
+  </macro>
+  <!--  <macro name="contributor">
+    <names variable=" " delimiter=" ; ">
+    <name name-as-sort-order="all" sort-separator=", " initialize-with=". " delimiter=" ; "
+    delimiter-precedes-last="always" font-variant="small-caps"/>
+    <label form="short" prefix=" (" suffix=")"/>
+    </names>
+    </macro>-->
+  <macro name="translator">
+    <names variable="translator" delimiter=" ; ">
+      <name name-as-sort-order="all" sort-separator=", " initialize-with=". " delimiter=" ; " delimiter-precedes-last="always" font-variant="small-caps"/>
+      <label form="short" prefix=" (" suffix=")"/>
+      <!-- needed: Label should appear as suffix to EVERY name...!-->
+    </names>
+  </macro>
+  <macro name="recipient">
+    <names variable="recipient" delimiter=" ; ">
+      <name name-as-sort-order="all" sort-separator=", " initialize-with=". " delimiter=" ; " delimiter-precedes-last="always" font-variant="small-caps"/>
+      <!--<label form="long" prefix=" (" suffix=")"/>-->
+      <!-- needed: Label should appear as suffix to EVERY name...!-->
+    </names>
+  </macro>
+  <macro name="author-short">
+    <names variable="author">
+      <name form="short" and="symbol" delimiter=", " initialize-with=". " delimiter-precedes-last="never" font-variant="small-caps"/>
+      <et-al font-variant="normal"/>
+      <substitute>
+        <names variable="editor" font-variant="small-caps"/>
+        <names variable="translator" font-variant="small-caps"/>
+        <choose>
+          <if type="bill book graphic legal_case  motion_picture report song" match="any">
+            <text variable="title" form="short" font-style="italic"/>
+          </if>
+          <else-if type="bill legal_case legislation" match="any">
+            <text variable="title" form="short" font-style="normal"/>
+          </else-if>
+          <else>
+            <text variable="title" form="short" quotes="true"/>
+          </else>
+        </choose>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="access">
+    <group>
+      <text term="retrieved" suffix=" "/>
+      <date variable="accessed">
+        <date-part name="year" form="long" suffix="-"/>
+        <date-part name="month" form="numeric-leading-zeros" suffix="-"/>
+        <date-part name="day" form="numeric-leading-zeros"/>
+      </date>
+      <!--<date variable="accessed" form="numeric" date-parts="year-month-day"/> // dd.mm.yyy -->
+    </group>
+  </macro>
+  <macro name="title">
+    <choose>
+      <if type="bill legislation" match="any">
+        <group delimiter=" &#8212; ">
+          <text variable="title-short" font-style="normal"/>
+          <text variable="title"/>
+        </group>
+      </if>
+      <else-if type="book graphic legal_case motion_picture report song" match="any">
+        <text variable="title" font-style="italic"/>
+      </else-if>
+      <else>
+        <text variable="title"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="genre">
+    <choose>
+      <if type="report thesis manuscript map" match="any">
+        <group>
+          <text variable="genre"/>
+          <!--<text term="number" form="short" suffix=" "/>-->
+          <text variable="number" prefix=" Nr. "/>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="volumes">
+    <group delimiter=" ">
+      <text term="volume" form="short" plural="false"/>
+      <number variable="volume" form="numeric"/>
+      <number variable="number-of-volumes" form="numeric" prefix="v. "/>
+    </group>
+  </macro>
+  <macro name="edition">
+    <group>
+      <number variable="edition" form="numeric" suffix=". "/>
+      <text term="edition" form="short" plural="false"/>
+    </group>
+  </macro>
+  <macro name="pages">
+    <choose>
+      <if type="chapter paper-conference article-journal" match="any">
+        <label variable="page" form="short" suffix="&#160;"/>
+        <text variable="page"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="dimensions">
+    <group>
+      <text variable="dimensions"/>
+    </group>
+  </macro>
+  <macro name="medium">
+    <group>
+      <text variable="medium"/>
+    </group>
+  </macro>
+  <macro name="scale">
+    <group>
+      <text term="scale"/>
+      <text prefix=" " variable="scale"/>
+    </group>
+  </macro>
+  <macro name="recipient-show">
+    <choose>
+      <if type="personal_communication">
+        <choose>
+          <if variable="genre">
+            <text variable="genre" text-case="capitalize-first"/>
+          </if>
+          <else>
+            <text term="letter" text-case="capitalize-first"/>
+          </else>
+        </choose>
+      </if>
+    </choose>
+    <text macro="recipient" prefix=", "/>
+  </macro>
+  <macro name="cite-year">
+    <group>
+      <choose>
+        <if type="bill legislation" match="any">
+          <date variable="issued" prefix=" (" suffix=")">
+            <date-part name="year" prefix="idF. v. "/>
+          </date>
+        </if>
+        <else>
+          <date variable="issued" prefix=", ">
+            <date-part name="year"/>
+          </date>
+          <text variable="year-suffix"/>
+        </else>
+      </choose>
+    </group>
+  </macro>
+  <macro name="bibliography-year">
+    <date variable="issued" form="numeric" date-parts="year"/>
+    <text variable="year-suffix"/>
+  </macro>
+  <macro name="locator">
+    <group>
+      <choose>
+        <if type="bill legislation" match="any">
+          <text variable="locator" prefix=" "/>
+        </if>
+        <else>
+          <label variable="locator" form="short" prefix=", "/>
+          <text variable="locator" prefix=" "/>
+        </else>
+      </choose>
+    </group>
+  </macro>
+  <citation et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="false" disambiguate-add-givenname="false" collapse="year">
+    <sort>
+      <key macro="author"/>
+      <key variable="issued"/>
+    </sort>
+    <layout prefix="(" suffix=")" delimiter="; ">
+      <group>
+        <text macro="author-short"/>
+        <text macro="cite-year"/>
+        <text macro="locator"/>
+      </group>
+    </layout>
+  </citation>
+  <bibliography hanging-indent="true" et-al-min="9" et-al-use-first="8">
+    <sort>
+      <key macro="author"/>
+      <key variable="issued"/>
+      <key variable="title"/>
+    </sort>
+    <layout>
+      <group delimiter=" ; " suffix=":">
+        <text macro="author"/>
+        <choose>
+          <if type="bill book graphic legal_case legislation manuscript map motion_picture report song thesis webpage" match="any">
+            <!-- except type="chapter article " etc.... -->
+            <text macro="editor"/>
+            <text macro="editor-collection"/>
+            <text macro="composer"/>
+          </if>
+        </choose>
+        <!-- <text macro="contributor"/> -->
+        <text macro="translator"/>
+      </group>
+      <choose>
+        <!-- Tabelle 1 aus litverz.ps -->
+        <if type="bill book broadcast graphic legal_case legislation manuscript map motion_picture report song" match="any">
+          <text prefix=" " macro="title"/>
+          <text prefix=", " variable="collection-title" font-style="italic"/>
+          <!--Reihe-->
+          <text prefix=" (" macro="genre" suffix=")"/>
+          <text prefix=". " macro="volumes"/>
+          <text prefix=". " macro="edition"/>
+          <text prefix=". " macro="medium"/>
+          <text prefix=". " macro="dimensions"/>
+          <text prefix=". " variable="publisher-place"/>
+          <text prefix="&#160;: " variable="publisher"/>
+          <text macro="bibliography-year" prefix=", "/>
+          <!-- " (1. Gesamttitel mit Zählung)"
+            " (2. Gesamttitel mit Zählung)" -->
+          <text prefix=" &#8211;&#160;" macro="scale"/>
+          <text prefix=". &#8212;&#160;" variable="note"/>
+          <text prefix=" &#8212;&#160;ISBN&#160;" variable="ISBN"/>
+        </if>
+        <!-- Tabelle 3 aus litverz.ps -->
+        <else-if type="chapter paper-conference" match="any">
+          <text prefix=" " macro="title" suffix="."/>
+          <text prefix=". " term="in" text-case="capitalize-all" suffix=": "/>
+          <!-- verfahre nach Tabelle 1... -->
+          <group delimiter=" ; " suffix=": ">
+            <text macro="author-container"/>
+            <text macro="editor"/>
+            <text macro="editor-collection"/>
+          </group>
+          <text variable="container-title" font-style="italic"/>
+          <text prefix=", " variable="collection-title" font-style="italic"/>
+          <!-- Reihe -->
+          <text prefix=". " macro="volumes"/>
+          <!-- <text prefix=" : " variable="title of volumes"/> what is this? -->
+          <text prefix=". " macro="edition"/>
+          <text prefix=". " variable="publisher-place"/>
+          <text prefix="&#160;: " variable="publisher"/>
+          <text macro="bibliography-year" prefix=", "/>
+          <!-- " (1. Gesamttitel mit Zählung)"
+            " (2. Gesamttitel mit Zählung)" -->
+          <text prefix=". &#8212;&#160;" variable="note"/>
+          <text prefix=" &#8212;&#160;ISBN&#160;" variable="ISBN"/>
+          <text prefix=", " macro="pages"/>
+        </else-if>
+        <!-- Tabelle 5 aus litverz.ps - Hochschulschriften
+          (Diplomarbeiten, Dissertationen, Master-A., unverö. Studienarbeiten -->
+        <else-if type="thesis" match="any">
+          <text prefix=" " macro="title" font-style="italic"/>
+          <text prefix=". " macro="edition"/>
+          <text prefix=". " variable="publisher-place"/>
+          <text prefix=", " variable="publisher" form="long"/>
+          <!-- <text prefix=", " variable="faculty"/> -->
+          <text prefix=", " macro="genre"/>
+          <text macro="bibliography-year" prefix=", "/>
+          <text prefix=". &#8212;&#160;" variable="note"/>
+        </else-if>
+        <else-if type="webpage post post-weblog" match="any">
+          <text prefix=" " macro="title" suffix=". " font-style="italic"/>
+          <text prefix="URL " variable="URL"/>
+          <text prefix=". - " macro="access"/>
+          <text prefix=". &#8212;&#160;" variable="container-title"/>
+          <text prefix=". &#8212;&#160;" variable="note"/>
+        </else-if>
+        <!-- Tabelle 2 aus litverz.ps UND -->
+        <!-- Tabelle 4 aus litverz.ps - Schriften von Tagungen, Konferenzen, Symposien, ...-->
+        <else-if type="article article-journal article-magazine article-newspaper" match="any">
+          <text prefix=" " variable="title"/>
+          <!-- " : Zusatz zum Sachtitel"
+            ". Angabe des Teils"
+            " (Gesamttitelangabe)" -->
+          <group>
+            <text prefix=". " term="in" text-case="capitalize-first" suffix=": "/>
+            <text macro="editor" suffix=" "/>
+            <text variable="container-title" font-style="italic"/>
+            <text prefix=", " variable="collection-title" font-style="italic" suffix="."/>
+            <!--", unterreihe der zeitschrift/zeitung" -->
+          </group>
+          <text prefix=" " macro="volumes"/>
+          <text prefix=". " variable="publisher-place"/>
+          <text prefix=", " variable="publisher" form="long"/>
+          <text macro="bibliography-year" prefix=" (" suffix=")"/>
+          <text prefix=", Nr.&#160;" variable="issue"/>
+          <text prefix=", " macro="pages"/>
+          <text prefix=". &#8212;&#160;" variable="note"/>
+          <text prefix=" &#8212;&#160;ISBN&#160;" variable="ISBN"/>
+        </else-if>
+        <!-- keiner der oben genannten fälle -->
+        <else>
+          <group suffix=".">
+            <text prefix=" " macro="title"/>
+            <text prefix=", " macro="editor"/>
+            <text prefix=". " macro="recipient-show"/>
+          </group>
+          <group prefix=" " suffix=".">
+            <text variable="container-title" font-style="italic"/>
+            <group prefix=", ">
+              <text variable="volume" font-style="italic"/>
+              <text variable="issue" prefix="(" suffix=")"/>
+            </group>
+            <text prefix=", " macro="pages"/>
+          </group>
+        </else>
+      </choose>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/harvard-university-of-kent.csl b/test/command/harvard-university-of-kent.csl
new file mode 100644
--- /dev/null
+++ b/test/command/harvard-university-of-kent.csl
@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-GB">
+  <info>
+    <title>University of Kent - Harvard</title>
+    <id>http://www.zotero.org/styles/harvard-university-of-kent</id>
+    <link href="http://www.zotero.org/styles/harvard-university-of-kent" rel="self"/>
+    <link href="http://www.zotero.org/styles/harvard-cardiff-university-biosi" rel="template"/>
+    <link href="http://www.kent.ac.uk/ai/Harvard-Style-Guide-July-2014.pdf" rel="documentation"/>
+    <author>
+      <name>Sebastian Karcher</name>
+    </author>
+    <category citation-format="author-date"/>
+    <category field="generic-base"/>
+    <summary>The Harvard author-date style - adapted for the University of Kent</summary>
+    <updated>2012-09-27T22:06:38+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <macro name="editor">
+    <names variable="editor" delimiter=", ">
+      <name name-as-sort-order="all" and="text" sort-separator=", " initialize-with=". " delimiter=", " delimiter-precedes-last="never"/>
+      <label form="short" prefix=" "/>
+    </names>
+  </macro>
+  <macro name="author">
+    <names variable="author">
+      <name name-as-sort-order="all" and="text" sort-separator=", " initialize-with="." delimiter-precedes-last="never" delimiter=", "/>
+      <label form="short" prefix=" "/>
+      <et-al font-style="italic"/>
+      <substitute>
+        <names variable="editor"/>
+        <text macro="title-substitute"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="author-short">
+    <names variable="author">
+      <name form="short" and="text" delimiter=", " delimiter-precedes-last="never" initialize-with=". "/>
+      <et-al font-style="italic"/>
+      <substitute>
+        <names variable="editor"/>
+        <text macro="title-substitute"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="access">
+    <choose>
+      <if variable="URL">
+        <group delimiter=" ">
+          <group delimiter=": ">
+            <text term="available at" text-case="capitalize-first"/>
+            <text variable="URL"/>
+          </group>
+          <group prefix="[" suffix="]" delimiter=": ">
+            <text term="accessed" text-case="capitalize-first"/>
+            <date variable="accessed">
+              <date-part name="day" suffix=" "/>
+              <date-part name="month" suffix=" "/>
+              <date-part name="year"/>
+            </date>
+          </group>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="title">
+    <choose>
+      <if type="bill book graphic legal_case legislation motion_picture report song thesis webpage" match="any">
+        <text variable="title" font-style="italic" text-case="title"/>
+      </if>
+      <else>
+        <text variable="title"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="title-substitute">
+    <choose>
+      <if type="bill book graphic legal_case legislation motion_picture report song thesis webpage" match="any">
+        <text variable="title" font-style="italic" text-case="title"/>
+      </if>
+      <else-if type="broadcast">
+        <choose>
+          <if variable="container-title">
+            <text variable="title"/>
+          </if>
+          <else>
+            <text variable="title" font-style="italic"/>
+          </else>
+        </choose>
+      </else-if>
+      <else>
+        <text variable="title"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="publisher">
+    <choose>
+      <if type="thesis">
+        <text variable="publisher"/>
+      </if>
+      <else-if type="graphic">
+        <text variable="archive"/>
+      </else-if>
+      <else>
+        <group delimiter=": ">
+          <text variable="publisher-place"/>
+          <text variable="publisher"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="year-date">
+    <choose>
+      <if variable="issued">
+        <date variable="issued">
+          <date-part name="year"/>
+        </date>
+      </if>
+      <else>
+        <text term="no date" form="short"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="edition">
+    <choose>
+      <if is-numeric="edition">
+        <group delimiter=" ">
+          <number variable="edition" form="ordinal"/>
+          <text term="edition" form="short"/>
+        </group>
+      </if>
+      <else>
+        <text variable="edition" suffix="."/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="online">
+    <choose>
+      <if variable="medium">
+        <text variable="medium" prefix="[" suffix="]"/>
+      </if>
+      <else-if variable="URL">
+        <text term="online" text-case="capitalize-first" prefix="[" suffix="]"/>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="broadcast-info">
+    <choose>
+      <if type="broadcast">
+        <group delimiter=". ">
+          <text variable="container-title" font-style="italic"/>
+          <text variable="number"/>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="pages">
+    <group>
+      <label variable="page" form="short" suffix=" "/>
+      <text variable="page"/>
+    </group>
+  </macro>
+  <citation et-al-min="4" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true">
+    <layout prefix="(" suffix=")" delimiter="; ">
+      <group delimiter=", ">
+        <group delimiter=" ">
+          <text macro="author-short"/>
+          <text macro="year-date"/>
+        </group>
+        <group>
+          <label variable="locator" form="short"/>
+          <text variable="locator"/>
+        </group>
+      </group>
+    </layout>
+  </citation>
+  <bibliography et-al-min="4" et-al-use-first="1" hanging-indent="true">
+    <sort>
+      <key macro="author"/>
+      <key variable="title"/>
+    </sort>
+    <layout suffix=".">
+      <text macro="author"/>
+      <date variable="issued" prefix=" (" suffix=").">
+        <date-part name="year"/>
+      </date>
+      <choose>
+        <if type="book broadcast graphic legal_case motion_picture report song" match="any">
+          <group prefix=" " delimiter=". " suffix=".">
+            <text macro="title"/>
+            <text macro="broadcast-info"/>
+            <text macro="online"/>
+            <group delimiter=" ">
+              <text term="volume" form="short" text-case="capitalize-first"/>
+              <text variable="volume"/>
+            </group>
+            <text macro="edition"/>
+            <text macro="editor"/>
+            <text variable="collection-title"/>
+            <text variable="collection-number" prefix="Number "/>
+            <text macro="publisher"/>
+            <text variable="dimensions"/>
+          </group>
+        </if>
+        <else-if type="chapter paper-conference" match="any">
+          <text macro="title" prefix=" " suffix="."/>
+          <group prefix=" " delimiter=" ">
+            <text term="in" text-case="capitalize-first" suffix=":"/>
+            <text macro="editor"/>
+            <text variable="container-title" font-style="italic" suffix="." text-case="title"/>
+            <text macro="edition"/>
+            <group suffix="." delimiter=", ">
+              <text macro="publisher"/>
+              <text macro="pages"/>
+            </group>
+          </group>
+        </else-if>
+        <else-if type="thesis">
+          <group prefix=" " delimiter=". " suffix=".">
+            <text macro="title"/>
+            <group delimiter=", ">
+              <text variable="genre"/>
+              <text macro="publisher"/>
+            </group>
+          </group>
+        </else-if>
+        <else-if type="webpage">
+          <group prefix=" " suffix=".">
+            <group delimiter=" " suffix=".">
+              <text macro="title"/>
+              <text macro="online"/>
+            </group>
+            <text macro="edition"/>
+          </group>
+        </else-if>
+        <else>
+          <group suffix=".">
+            <text macro="title" prefix=" "/>
+            <text macro="editor" prefix=" "/>
+          </group>
+          <group prefix=" " suffix=".">
+            <group delimiter=" ">
+              <text variable="container-title" font-style="italic"/>
+              <text macro="online"/>
+            </group>
+            <text variable="volume" font-weight="bold" prefix=" "/>
+            <text variable="page" prefix=":"/>
+          </group>
+        </else>
+      </choose>
+      <text prefix=". " macro="access" suffix="."/>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/ieee.csl b/test/command/ieee.csl
new file mode 100644
--- /dev/null
+++ b/test/command/ieee.csl
@@ -0,0 +1,339 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only">
+  <info>
+    <title>IEEE</title>
+    <id>http://www.zotero.org/styles/ieee</id>
+    <link href="http://www.zotero.org/styles/ieee" rel="self"/>
+    <link href="http://www.ieee.org/documents/style_manual.pdf" rel="documentation"/>
+    <link href="http://www.ieee.org/documents/auinfo07.pdf" rel="documentation"/>
+    <author>
+      <name>Michael Berkowitz</name>
+      <email>mberkowi@gmu.edu</email>
+    </author>
+    <contributor>
+      <name>Julian Onions</name>
+      <email>julian.onions@gmail.com</email>
+    </contributor>
+    <contributor>
+      <name>Rintze Zelle</name>
+      <uri>http://twitter.com/rintzezelle</uri>
+    </contributor>
+    <contributor>
+      <name>Stephen Frank</name>
+      <uri>http://www.zotero.org/sfrank</uri>
+    </contributor>
+    <contributor>
+      <name>Sebastian Karcher</name>
+    </contributor>
+    <category citation-format="numeric"/>
+    <category field="engineering"/>
+    <category field="generic-base"/>
+    <updated>2013-12-17T18:04:02+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="en">
+    <terms>
+      <term name="chapter" form="short">ch.</term>
+      <term name="presented at">presented at the</term>
+      <term name="available at">available</term>
+    </terms>
+  </locale>
+  <!-- Macros -->
+  <macro name="edition">
+    <choose>
+      <if type="bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="any">
+        <choose>
+          <if is-numeric="edition">
+            <group delimiter=" ">
+              <number variable="edition" form="ordinal"/>
+              <text term="edition" form="short"/>
+            </group>
+          </if>
+          <else>
+            <text variable="edition" text-case="capitalize-first" suffix="."/>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="issued">
+    <choose>
+      <if type="article-journal report" match="any">
+        <date variable="issued">
+          <date-part name="month" form="short" suffix=" "/>
+          <date-part name="year" form="long"/>
+        </date>
+      </if>
+      <else-if type=" bill book chapter graphic legal_case legislation motion_picture paper-conference song thesis" match="any">
+        <date variable="issued">
+          <date-part name="year" form="long"/>
+        </date>
+      </else-if>
+      <else>
+        <date variable="issued">
+          <date-part name="day" form="numeric-leading-zeros" suffix="-"/>
+          <date-part name="month" form="short" suffix="-" strip-periods="true"/>
+          <date-part name="year" form="long"/>
+        </date>
+      </else>
+    </choose>
+  </macro>
+  <macro name="author">
+    <names variable="author">
+      <name initialize-with=". " delimiter=", " and="text"/>
+      <label form="short" prefix=", " text-case="capitalize-first"/>
+      <substitute>
+        <names variable="editor"/>
+        <names variable="translator"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="editor">
+    <names variable="editor">
+      <name initialize-with=". " delimiter=", " and="text"/>
+      <label form="short" prefix=", " text-case="capitalize-first"/>
+    </names>
+  </macro>
+  <macro name="locators">
+    <group delimiter=", ">
+      <text macro="edition"/>
+      <group delimiter=" ">
+        <text term="volume" form="short"/>
+        <number variable="volume" form="numeric"/>
+      </group>
+      <group delimiter=" ">
+        <number variable="number-of-volumes" form="numeric"/>
+        <text term="volume" form="short" plural="true"/>
+      </group>
+      <group delimiter=" ">
+        <text term="issue" form="short"/>
+        <number variable="issue" form="numeric"/>
+      </group>
+    </group>
+  </macro>
+  <macro name="title">
+    <choose>
+      <if type="bill book graphic legal_case legislation motion_picture song" match="any">
+        <text variable="title" font-style="italic"/>
+      </if>
+      <else>
+        <text variable="title" quotes="true"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="publisher">
+    <choose>
+      <if type=" bill book chapter graphic legal_case legislation motion_picture paper-conference song" match="any">
+        <group delimiter=": ">
+          <text variable="publisher-place"/>
+          <text variable="publisher"/>
+        </group>
+      </if>
+      <else>
+        <group delimiter=", ">
+          <text variable="publisher"/>
+          <text variable="publisher-place"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="event">
+    <choose>
+      <if type="paper-conference speech" match="any">
+        <choose>
+          <!-- Published Conference Paper -->
+          <if variable="container-title">
+            <group delimiter=", ">
+              <group delimiter=" ">
+                <text term="in"/>
+                <text variable="container-title" font-style="italic"/>
+              </group>
+              <text variable="event-place"/>
+            </group>
+          </if>
+          <!-- Unpublished Conference Paper -->
+          <else>
+            <group delimiter=", ">
+              <group delimiter=" ">
+                <text term="presented at"/>
+                <text variable="event"/>
+              </group>
+              <text variable="event-place"/>
+            </group>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="access">
+    <choose>
+      <if type="webpage">
+        <choose>
+          <if variable="URL">
+            <group delimiter=". ">
+              <text term="online" prefix="[" suffix="]" text-case="capitalize-first"/>
+              <group delimiter=": ">
+                <text term="available at" text-case="capitalize-first"/>
+                <text variable="URL"/>
+              </group>
+              <group prefix="[" suffix="]" delimiter=": ">
+                <text term="accessed" text-case="capitalize-first"/>
+                <date variable="accessed">
+                  <date-part name="day" form="numeric-leading-zeros" suffix="-"/>
+                  <date-part name="month" form="short" suffix="-" strip-periods="true"/>
+                  <date-part name="year" form="long"/>
+                </date>
+              </group>
+            </group>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="page">
+    <group>
+      <label variable="page" form="short" suffix=" "/>
+      <text variable="page"/>
+    </group>
+  </macro>
+  <macro name="citation-locator">
+    <group delimiter=" ">
+      <choose>
+        <if locator="page">
+          <label variable="locator" form="short"/>
+        </if>
+        <else>
+          <label variable="locator" form="short" text-case="capitalize-first"/>
+        </else>
+      </choose>
+      <text variable="locator"/>
+    </group>
+  </macro>
+  <!-- Citation -->
+  <citation collapse="citation-number">
+    <sort>
+      <key variable="citation-number"/>
+    </sort>
+    <layout delimiter=", ">
+      <group prefix="[" suffix="]" delimiter=", ">
+        <text variable="citation-number"/>
+        <text macro="citation-locator"/>
+      </group>
+    </layout>
+  </citation>
+  <!-- Bibliography -->
+  <bibliography entry-spacing="0" second-field-align="flush">
+    <layout suffix=".">
+      <!-- Citation Number -->
+      <text variable="citation-number" prefix="[" suffix="]"/>
+      <!-- Author(s) -->
+      <text macro="author" suffix=", "/>
+      <!-- Rest of Citation -->
+      <choose>
+        <!-- Specific Formats -->
+        <if type="article-journal">
+          <group delimiter=", ">
+            <text macro="title"/>
+            <text variable="container-title" font-style="italic" form="short"/>
+            <text macro="locators"/>
+            <text macro="page"/>
+            <text macro="issued"/>
+          </group>
+        </if>
+        <else-if type="paper-conference speech" match="any">
+          <group delimiter=", ">
+            <text macro="title"/>
+            <text macro="event"/>
+            <text macro="issued"/>
+            <text macro="locators"/>
+            <text macro="page"/>
+          </group>
+        </else-if>
+        <else-if type="report">
+          <group delimiter=", ">
+            <text macro="title"/>
+            <text macro="publisher"/>
+            <group delimiter=" ">
+              <text variable="genre"/>
+              <text variable="number"/>
+            </group>
+            <text macro="issued"/>
+          </group>
+        </else-if>
+        <else-if type="thesis">
+          <group delimiter=", ">
+            <text macro="title"/>
+            <text variable="genre"/>
+            <text macro="publisher"/>
+            <text macro="issued"/>
+          </group>
+        </else-if>
+        <else-if type="webpage post-weblog" match="any">
+          <group delimiter=", " suffix=". ">
+            <text macro="title"/>
+            <text variable="container-title" font-style="italic"/>
+            <text macro="issued"/>
+          </group>
+          <text macro="access"/>
+        </else-if>
+        <else-if type="patent">
+          <group delimiter=", ">
+            <text macro="title"/>
+            <text variable="number"/>
+            <text macro="issued"/>
+          </group>
+        </else-if>
+        <!-- Generic/Fallback Formats -->
+        <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+          <group delimiter=", " suffix=". ">
+            <text macro="title"/>
+            <text macro="locators"/>
+          </group>
+          <group delimiter=", ">
+            <text macro="publisher"/>
+            <text macro="issued"/>
+            <text macro="page"/>
+          </group>
+        </else-if>
+        <else-if type="article-magazine article-newspaper broadcast interview manuscript map patent personal_communication song speech thesis webpage" match="any">
+          <group delimiter=", ">
+            <text macro="title"/>
+            <text variable="container-title" font-style="italic"/>
+            <text macro="locators"/>
+            <text macro="publisher"/>
+            <text macro="page"/>
+            <text macro="issued"/>
+          </group>
+        </else-if>
+        <else-if type="chapter paper-conference" match="any">
+          <group delimiter=", " suffix=", ">
+            <text macro="title"/>
+            <group delimiter=" ">
+              <text term="in"/>
+              <text variable="container-title" font-style="italic"/>
+            </group>
+            <text macro="locators"/>
+          </group>
+          <text macro="editor" suffix=" "/>
+          <group delimiter=", ">
+            <text macro="publisher"/>
+            <text macro="issued"/>
+            <text macro="page"/>
+          </group>
+        </else-if>
+        <else>
+          <group delimiter=", " suffix=". ">
+            <text macro="title"/>
+            <text variable="container-title" font-style="italic"/>
+            <text macro="locators"/>
+          </group>
+          <group delimiter=", ">
+            <text macro="publisher"/>
+            <text macro="page"/>
+            <text macro="issued"/>
+          </group>
+        </else>
+      </choose>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/issue160.csl b/test/command/issue160.csl
new file mode 100644
--- /dev/null
+++ b/test/command/issue160.csl
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" default-locale="en-US">
+  <info>
+    <title>Issue 160 Test Style</title>
+    <id>issue-160-test</id>
+    <category citation-format="label"/>
+    <updated>2017-02-04T19:31:46+0000</updated>
+  </info>
+  <citation>
+    <layout prefix="[" suffix="]" delimiter=",">
+      <text variable="citation-label"/>
+    </layout>
+  </citation>
+  <bibliography>
+    <layout>
+      <text variable="citation-label" prefix="[" suffix="] "/>
+      <group delimiter=". " suffix=".">
+        <names variable="author">
+          <name delimiter=", " delimiter-precedes-last="always"/>
+        </names>
+        <text variable="title"/>
+        <date variable="issued">
+          <date-part name="year"/>
+        </date>
+      </group>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/issue437.csl b/test/command/issue437.csl
new file mode 100644
--- /dev/null
+++ b/test/command/issue437.csl
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="note" default-locale="en-US" version="1.0">
+  <info>
+    <title>Minimal style to reproduce bug</title>
+    <id>http://www.example.org/styles/minimal-test-style</id>
+    <author>
+      <name>Nicolas Chachereau</name>
+      <email>nicolas@nchachereau.ch</email>
+    </author>
+    <updated>2020-01-27T14:27:45+01:00</updated>
+  </info>
+  <citation>
+    <layout>
+      <group delimiter=", ">
+        <names variable="author"/>
+        <text variable="title"/>
+        <text variable="publisher-place"/>
+        <date variable="issued" form="numeric" date-parts="year"/>
+        <group delimiter="&#160;">
+          <number variable="number-of-pages"/>
+          <label variable="number-of-pages"/>
+        </group>
+      </group>
+    </layout>
+  </citation>
+</style>
diff --git a/test/command/issue58.csl b/test/command/issue58.csl
new file mode 100644
--- /dev/null
+++ b/test/command/issue58.csl
@@ -0,0 +1,553 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never" page-range-format="chicago">
+  <info>
+    <title>Chicago Manual of Style 16th edition (author-date) modif 2014-06-30</title>
+    <id></id>
+    <link href="" rel="self"/>
+    <link href="http://www.chicagomanualofstyle.org/tools_citationguide.html" rel="documentation"/>
+    <author>
+      <name>Julian Onions</name>
+      <email>julian.onions@gmail.com</email>
+    </author>
+    <contributor>
+      <name>Sebastian Karcher</name>
+    </contributor>
+    <contributor>
+      <name>Richard Karnesky</name>
+      <email>karnesky+zotero@gmail.com</email>
+      <uri>http://arc.nucapt.northwestern.edu/Richard_Karnesky</uri>
+    </contributor>
+    <contributor>
+      <name>Andrew Dunning</name>
+      <email>andrew.dunning@utoronto.ca</email>
+    </contributor>
+    <category citation-format="author-date"/>
+    <category field="generic-base"/>
+    <summary>The author-date variant of the Chicago style</summary>
+    <updated>2014-05-23T03:53:32+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="en">
+    <terms>
+      <term name="editor" form="verb-short">ed.</term>
+      <term name="container-author" form="verb">by</term>
+      <term name="translator" form="verb-short">trans.</term>
+      <term name="editortranslator" form="verb">
+        <single>edited and translated by</single>
+        <multiple>edited and translated by</multiple>
+      </term>
+      <term name="translator" form="short">trans.</term>
+    </terms>
+  </locale>
+  <macro name="secondary-contributors">
+    <choose>
+      <if type="chapter paper-conference" match="none">
+        <names variable="editor translator" delimiter=". ">
+          <label form="verb" text-case="capitalize-first" suffix=" "/>
+          <name and="text" delimiter=", "/>
+        </names>
+      </if>
+    </choose>
+  </macro>
+  <macro name="container-contributors">
+    <choose>
+      <if type="chapter paper-conference" match="any">
+        <group prefix=", " delimiter=", ">
+          <names variable="container-author" delimiter=", ">
+            <label form="verb" suffix=" "/>
+            <name and="text" delimiter=", "/>
+          </names>
+          <names variable="editor translator" delimiter=", ">
+            <label form="verb" suffix=" "/>
+            <name and="text" delimiter=", "/>
+          </names>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="editor">
+    <names variable="editor">
+      <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="short" prefix=", "/>
+    </names>
+  </macro>
+  <macro name="translator">
+    <names variable="translator">
+      <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="short" prefix=", "/>
+    </names>
+  </macro>
+  <macro name="recipient">
+    <choose>
+      <if type="personal_communication">
+        <choose>
+          <if variable="genre">
+            <text variable="genre" text-case="capitalize-first"/>
+          </if>
+          <else>
+            <text term="letter" text-case="capitalize-first"/>
+          </else>
+        </choose>
+      </if>
+    </choose>
+    <names variable="recipient" delimiter=", ">
+      <label form="verb" prefix=" " text-case="lowercase" suffix=" "/>
+      <name and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="noauthor-container-title">
+    <choose>
+      <if variable="container-title">
+        <choose>
+          <if type="article-journal article-magazine article-newspaper" match="any">
+            <text macro="container-title"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="contributors">
+    <group delimiter=". ">
+      <names variable="author">
+        <name and="text" name-as-sort-order="first" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+        <label form="short" prefix=", "/>
+        <substitute>
+          <names variable="editor"/>
+          <names variable="translator"/>
+          <text macro="noauthor-container-title"/>
+          <text macro="title"/>
+        </substitute>
+      </names>
+      <text macro="recipient"/>
+    </group>
+  </macro>
+  <macro name="contributors-short">
+    <names variable="author">
+      <name form="short" and="text" delimiter=", " initialize-with=". "/>
+      <substitute>
+        <names variable="editor"/>
+        <names variable="translator"/>
+        <text macro="noauthor-container-title"/>
+        <text macro="title"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="interviewer">
+    <names variable="interviewer" delimiter=", ">
+      <label form="verb" prefix=" " text-case="capitalize-first" suffix=" "/>
+      <name and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="archive">
+    <group delimiter=". ">
+      <text variable="archive_location" text-case="capitalize-first"/>
+      <text variable="archive"/>
+      <text variable="archive-place"/>
+    </group>
+  </macro>
+  <macro name="access">
+    <group delimiter=". ">
+      <choose>
+        <if type="graphic report" match="any">
+          <text macro="archive"/>
+        </if>
+        <else-if type="article-journal bill book chapter legal_case legislation motion_picture paper-conference" match="none">
+          <text macro="archive"/>
+        </else-if>
+      </choose>
+      <choose>
+        <if variable="issued" match="none">
+          <group delimiter=" ">
+            <text term="accessed" text-case="capitalize-first"/>
+            <date variable="accessed" delimiter=" ">
+              <date-part name="month"/>
+              <date-part name="day"/>
+            </date>
+          </group>
+        </if>
+      </choose>
+      <choose>
+        <if type="legal_case" match="none">
+          <choose>
+            <if variable="DOI">
+              <text variable="DOI" prefix="doi:"/>
+            </if>
+            <else>
+              <text variable="URL"/>
+            </else>
+          </choose>
+        </if>
+      </choose>
+    </group>
+  </macro>
+  <macro name="title">
+    <choose>
+      <if variable="title" match="none">
+        <choose>
+          <if type="personal_communication" match="none">
+            <text variable="genre" text-case="capitalize-first"/>
+          </if>
+        </choose>
+      </if>
+      <else-if type="bill book graphic legislation motion_picture report song" match="any">
+        <text variable="title" text-case="title" font-style="italic"/>
+        <group prefix=" (" suffix=")" delimiter=" ">
+          <text term="version"/>
+          <text variable="version"/>
+        </group>
+      </else-if>
+      <else-if variable="reviewed-author">
+        <group delimiter=", ">
+          <text variable="title" font-style="italic" prefix="Review of "/>
+          <names variable="reviewed-author">
+            <label form="verb-short" text-case="lowercase" suffix=" "/>
+            <name and="text" delimiter=", "/>
+          </names>
+        </group>
+      </else-if>
+      <else-if type="legal_case interview" match="any">
+        <text variable="title"/>
+      </else-if>
+      <else>
+        <text variable="title" text-case="title" quotes="true"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="edition">
+    <choose>
+      <if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+        <choose>
+          <if is-numeric="edition">
+            <group delimiter=" " prefix=". ">
+              <number variable="edition" form="ordinal"/>
+              <text term="edition" form="short" strip-periods="true"/>
+            </group>
+          </if>
+          <else>
+            <text variable="edition" prefix=". "/>
+          </else>
+        </choose>
+      </if>
+      <else-if type="chapter  paper-conference" match="any">
+        <choose>
+          <if is-numeric="edition">
+            <group delimiter=" " prefix=", ">
+              <number variable="edition" form="ordinal"/>
+              <text term="edition" form="short"/>
+            </group>
+          </if>
+          <else>
+            <text variable="edition" prefix=", "/>
+          </else>
+        </choose>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="locators">
+    <choose>
+      <if type="article-journal">
+        <choose>
+          <if variable="volume">
+            <text variable="volume" prefix=" "/>
+            <group prefix=" (" suffix=")">
+              <choose>
+                <if variable="issue">
+                  <text variable="issue"/>
+                </if>
+                <else>
+                  <date variable="issued">
+                    <date-part name="month"/>
+                  </date>
+                </else>
+              </choose>
+            </group>
+          </if>
+          <else-if variable="issue">
+            <group delimiter=" " prefix=", ">
+              <text term="issue" form="short"/>
+              <text variable="issue"/>
+              <date variable="issued" prefix="(" suffix=")">
+                <date-part name="month"/>
+              </date>
+            </group>
+          </else-if>
+          <else>
+            <date variable="issued" prefix=", ">
+              <date-part name="month"/>
+            </date>
+          </else>
+        </choose>
+      </if>
+      <else-if type="legal_case">
+        <text variable="volume" prefix=", "/>
+        <text variable="container-title" prefix=" "/>
+        <text variable="page" prefix=" "/>
+      </else-if>
+      <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+        <group prefix=". " delimiter=". ">
+          <group>
+            <text term="volume" form="short" text-case="capitalize-first" suffix=" "/>
+            <number variable="volume" form="numeric"/>
+          </group>
+          <group>
+            <number variable="number-of-volumes" form="numeric"/>
+            <text term="volume" form="short" prefix=" " plural="true"/>
+          </group>
+        </group>
+      </else-if>
+      <else-if type="chapter paper-conference" match="any">
+        <choose>
+          <if variable="page" match="none">
+            <group prefix=". ">
+              <text term="volume" form="short" text-case="capitalize-first" suffix=" "/>
+              <number variable="volume" form="numeric"/>
+            </group>
+          </if>
+        </choose>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="locators-chapter">
+    <choose>
+      <if type="chapter paper-conference" match="any">
+        <choose>
+          <if variable="page">
+            <group prefix=", ">
+              <text variable="volume" suffix=":"/>
+              <text variable="page"/>
+            </group>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locators-article">
+    <choose>
+      <if type="article-newspaper">
+        <group prefix=", " delimiter=", ">
+          <group>
+            <text variable="edition" suffix=" "/>
+            <text term="edition" prefix=" "/>
+          </group>
+          <group>
+            <text term="section" form="short" suffix=" "/>
+            <text variable="section"/>
+          </group>
+        </group>
+      </if>
+      <else-if type="article-journal">
+        <choose>
+          <if variable="volume issue" match="any">
+            <text variable="page" prefix=": "/>
+          </if>
+          <else>
+            <text variable="page" prefix=", "/>
+          </else>
+        </choose>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="point-locators">
+    <choose>
+      <if variable="locator">
+        <choose>
+          <if locator="page" match="none">
+            <choose>
+              <if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+                <choose>
+                  <if variable="volume">
+                    <group>
+                      <text term="volume" form="short" suffix=" "/>
+                      <number variable="volume" form="numeric"/>
+                      <label variable="locator" form="short" prefix=", " suffix=" "/>
+                    </group>
+                  </if>
+                  <else>
+                    <label variable="locator" form="short" suffix=" "/>
+                  </else>
+                </choose>
+              </if>
+              <else>
+                <label variable="locator" form="short" suffix=" "/>
+              </else>
+            </choose>
+          </if>
+          <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+            <number variable="volume" form="numeric" suffix=":"/>
+          </else-if>
+        </choose>
+        <text variable="locator"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="container-prefix">
+    <text term="in" text-case="capitalize-first"/>
+  </macro>
+  <macro name="container-title">
+    <choose>
+      <if type="chapter paper-conference" match="any">
+        <text macro="container-prefix" suffix=" "/>
+      </if>
+    </choose>
+    <choose>
+      <if type="legal_case" match="none">
+        <text variable="container-title" text-case="title" font-style="italic"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="publisher">
+    <group delimiter=": ">
+      <text variable="publisher-place"/>
+      <text variable="publisher"/>
+    </group>
+  </macro>
+  <macro name="date">
+    <choose>
+      <if variable="issued">
+        <date variable="issued">
+          <date-part name="year"/>
+        </date>
+      </if>
+      <else-if variable="accessed">
+        <date variable="accessed">
+          <date-part name="year"/>
+        </date>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="day-month">
+    <date variable="issued">
+      <date-part name="month"/>
+      <date-part name="day" prefix=" "/>
+    </date>
+  </macro>
+  <macro name="collection-title">
+    <choose>
+      <if match="none" type="article-journal">
+        <choose>
+          <if match="none" is-numeric="collection-number">
+            <group delimiter=", ">
+              <text variable="collection-title" text-case="title"/>
+              <text variable="collection-number"/>
+            </group>
+          </if>
+          <else>
+            <group delimiter=" ">
+              <text variable="collection-title" text-case="title"/>
+              <text variable="collection-number"/>
+            </group>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="collection-title-journal">
+    <choose>
+      <if type="article-journal">
+        <group delimiter=" ">
+          <text variable="collection-title"/>
+          <text variable="collection-number"/>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="event">
+    <group>
+      <text term="presented at" suffix=" "/>
+      <text variable="event"/>
+    </group>
+  </macro>
+  <macro name="description">
+    <choose>
+      <if type="interview">
+        <group delimiter=". ">
+          <text macro="interviewer"/>
+          <text variable="medium" text-case="capitalize-first"/>
+        </group>
+      </if>
+      <else>
+        <text variable="medium" text-case="capitalize-first" prefix=". "/>
+      </else>
+    </choose>
+    <choose>
+      <if variable="title" match="none"/>
+      <else-if type="thesis personal_communication speech" match="any"/>
+      <else>
+        <group delimiter=" " prefix=". ">
+          <text variable="genre" text-case="capitalize-first"/>
+          <choose>
+            <if type="report">
+              <text variable="number"/>
+            </if>
+          </choose>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="issue">
+    <choose>
+      <if type="legal_case">
+        <text variable="authority" prefix=". "/>
+      </if>
+      <else-if type="speech">
+        <group prefix=". " delimiter=", ">
+          <group delimiter=" ">
+            <text variable="genre" text-case="capitalize-first"/>
+            <text macro="event"/>
+          </group>
+          <text variable="event-place"/>
+          <text macro="day-month"/>
+        </group>
+      </else-if>
+      <else-if type="article-newspaper article-magazine personal_communication" match="any">
+        <text macro="day-month" prefix=", "/>
+      </else-if>
+      <else>
+        <group prefix=". " delimiter=", ">
+          <choose>
+            <if type="thesis">
+              <text variable="genre" text-case="capitalize-first"/>
+            </if>
+          </choose>
+          <text macro="publisher"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <citation et-al-min="4" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true" givenname-disambiguation-rule="primary-name">
+    <layout prefix="(" suffix=")" delimiter="; ">
+      <group delimiter=", ">
+        <group delimiter=" ">
+          <text macro="contributors-short"/>
+          <text macro="date"/>
+        </group>
+        <text macro="point-locators"/>
+      </group>
+    </layout>
+  </citation>
+  <bibliography hanging-indent="true" et-al-min="11" et-al-use-first="7" subsequent-author-substitute="&#8212;&#8212;&#8212;" entry-spacing="0">
+    <sort>
+      <key macro="contributors"/>
+      <key variable="issued"/>
+    </sort>
+    <layout suffix=".">
+      <group delimiter=". ">
+        <text macro="contributors"/>
+        <text macro="date"/>
+        <text macro="title"/>
+      </group>
+      <text macro="description"/>
+      <text macro="secondary-contributors" prefix=". "/>
+      <text macro="container-title" prefix=". "/>
+      <text macro="container-contributors"/>
+      <text macro="edition"/>
+      <text macro="locators-chapter"/>
+      <text macro="collection-title-journal" prefix=", " suffix=", "/>
+      <text macro="locators"/>
+      <text macro="collection-title" prefix=". "/>
+      <text macro="issue"/>
+      <text macro="locators-article"/>
+      <text macro="access" prefix=". "/>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/jats.csl b/test/command/jats.csl
new file mode 100644
--- /dev/null
+++ b/test/command/jats.csl
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" default-locale="en-US">
+  <info>
+    <title>Journal Article Tag Suite</title>
+    <title-short>JATS</title-short>
+    <id>http://www.zotero.org/styles/journal-article-tag-suite</id>
+    <link href="https://github.com/MartinPaulEve/JATS-CSL/blob/master/jats.csl" rel="self"/>
+    <link rel="documentation" href="http://jats.nlm.nih.gov/archiving/tag-library/1.0/index.html"/>
+    <author>
+      <name>Martin Paul Eve</name>
+      <email>martin@martineve.com</email>
+    </author>
+    <category citation-format="numeric"/>
+    <category field="medicine"/>
+    <category field="biology"/>
+    <summary>Use this style to generate bibliographic data in Journal Article Tagging Suite (JATS) 1.0 XML format</summary>
+    <updated>2014-06-21T17:41:26+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Originally by Martin Fenner.</rights>
+  </info>
+  <locale xml:lang="en">
+    <terms>
+        <term name="et-al">{{jats}}&lt;etal/&gt;{{/jats}}</term>
+    </terms>
+  </locale>
+  <macro name="citation-number">
+    <text variable="citation-number" prefix="{{jats}}id=&quot;ref-{{/jats}}" suffix="{{jats}}&quot;&gt;{{/jats}}"/>
+  </macro>
+  <macro name="author">
+    <names variable="author">
+        <name prefix="{{jats}}&lt;name&gt;{{/jats}}" suffix="{{jats}}&lt;/name&gt;{{/jats}}" name-as-sort-order="all" sort-separator="">
+            <name-part name="family" text-case="capitalize-first" prefix="{{jats}}&lt;surname&gt;{{/jats}}" suffix="{{jats}}&lt;/surname&gt;{{/jats}}"/>
+            <name-part name="given" text-case="capitalize-first" prefix="{{jats}}&lt;given-names&gt;{{/jats}}" suffix="{{jats}}&lt;/given-names&gt;{{/jats}}"/>
+      </name>
+      <substitute>
+        <names variable="editor"/>
+      </substitute>
+    </names>
+  </macro>
+
+  <macro name="editor">
+    <names variable="editor" prefix="{{jats}}&lt;person-group person-group-type=&quot;editor&quot;&gt;{{/jats}}" suffix="{{jats}}&lt;/person-group&gt;{{/jats}}">
+      <name prefix="{{jats}}&lt;name&gt;{{/jats}}" suffix="{{jats}}&lt;/name&gt;{{/jats}}" name-as-sort-order="all" sort-separator="">
+        <name-part name="family" text-case="capitalize-first" prefix="{{jats}}&lt;surname&gt;{{/jats}}" suffix="{{jats}}&lt;/surname&gt;{{/jats}}"/>
+        <name-part name="given" text-case="capitalize-first" prefix="{{jats}}&lt;given-names&gt;{{/jats}}" suffix="{{jats}}&lt;/given-names&gt;{{/jats}}"/>
+      </name>
+      <substitute>
+        <names variable="editor"/>
+      </substitute>
+    </names>
+  </macro>
+
+  <macro name="editor">
+    <group delimiter=": ">
+      <names variable="editor">
+        <name prefix="{{jats}}&lt;name&gt;{{/jats}}" suffix="{{jats}}&lt;/name&gt;{{/jats}}" name-as-sort-order="all" sort-separator="">
+          <name-part name="family" text-case="capitalize-first" prefix="{{jats}}&lt;surname&gt;{{/jats}}" suffix="{{jats}}&lt;/surname&gt;{{/jats}}"/>
+          <name-part name="given" text-case="capitalize-first" prefix="{{jats}}&lt;given-names&gt;{{/jats}}" suffix="{{jats}}&lt;given-names&gt;{{/jats}}"/>
+        </name>
+      </names>
+    </group>
+  </macro>
+  <macro name="title">
+    <choose>
+      <if type="book" match="any">
+        <group prefix="{{jats}}&lt;source&gt;{{/jats}}" suffix="{{jats}}&lt;/source&gt;{{/jats}}">
+	        <text variable="title"/>
+				</group>			
+			</if>
+      <else>
+        <group prefix="{{jats}}&lt;article-title&gt;{{/jats}}" suffix="{{jats}}&lt;/article-title&gt;{{/jats}}">
+	        <text variable="title"/>
+				</group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="container-title">
+    <text variable="container-title" form="short" prefix="{{jats}}&lt;source&gt;{{/jats}}" suffix="{{jats}}&lt;/source&gt;{{/jats}}"/>
+  </macro>
+  <macro name="publisher">
+    <text variable="publisher" prefix="{{jats}}&lt;publisher-name&gt;{{/jats}}" suffix="{{jats}}&lt;/publisher-name&gt;{{/jats}}"/>
+    <text variable="publisher-place" prefix="{{jats}}&lt;publisher-loc&gt;{{/jats}}" suffix="{{jats}}&lt;/publisher-loc&gt;{{/jats}}"/>
+  </macro>
+  <macro name="link">
+    <choose>
+      <if match="any" variable="DOI">
+        <group prefix="{{jats}}&lt;pub-id pub-id-type=&quot;doi&quot;&gt;{{/jats}}" suffix="{{jats}}&lt;/pub-id&gt;{{/jats}}">
+          <text variable="DOI"/>
+        </group>
+      </if>
+    </choose>
+    <choose>
+      <if match="any" variable="PMID">
+        <group prefix="{{jats}}&lt;ext-link ext-link-type=&quot;pmid&quot; {{/jats}}" suffix="{{jats}}&lt;/ext-link&gt;{{/jats}}">
+          <text variable="PMID" prefix="{{jats}}xlink:href=&quot;http://www.ncbi.nlm.nih.gov/pubmed/{{/jats}}" suffix="{{jats}}&quot; xlink:type=&quot;simple&quot;&gt;{{/jats}}"/>
+          <text variable="PMID"/>
+        </group>
+      </if>
+    </choose>
+    <choose>
+      <if variable="URL" match="any">
+        <group prefix="{{jats}}&lt;ext-link ext-link-type=&quot;uri&quot; {{/jats}}" suffix="{{jats}}&lt;/ext-link&gt;{{/jats}}">
+          <text variable="URL" prefix="{{jats}}xlink:href=&quot;{{/jats}}" suffix="{{jats}}&quot; xlink:type=&quot;simple&quot;&gt;{{/jats}}"/>
+          <text variable="URL"/>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="date">
+    <choose>
+      <if type="article-journal article-magazine article-newspaper report patent book" match="any">
+        <group prefix="{{jats}}&lt;date&gt;{{/jats}}" suffix="{{jats}}&lt;/date&gt;{{/jats}}">
+          <date variable="issued">
+            <date-part name="day" form="numeric-leading-zeros" prefix="{{jats}}&lt;day&gt;{{/jats}}" suffix="{{jats}}&lt;/day&gt;{{/jats}}"/>
+            <date-part name="month" form="numeric-leading-zeros" prefix="{{jats}}&lt;month&gt;{{/jats}}" suffix="{{jats}}&lt;/month&gt;{{/jats}}"/>
+            <date-part name="year" prefix="{{jats}}&lt;year&gt;{{/jats}}" suffix="{{jats}}&lt;/year&gt;{{/jats}}"/>
+          </date>
+        </group>
+      </if>
+      <else>
+        <group prefix="{{jats}}&lt;date-in-citation content-type=&quot;access-date&quot;{{/jats}}" suffix="{{jats}}&lt;/date-in-citation&gt;{{/jats}}">
+          <date variable="accessed" prefix="{{jats}} iso-8601-date=&quot;{{/jats}}" suffix="{{jats}}&quot;&gt;{{/jats}}">
+            <date-part name="year"/>
+            <date-part name="month" form="numeric-leading-zeros" prefix="{{jats}}-{{/jats}}"/>
+            <date-part name="day" form="numeric-leading-zeros" prefix="{{jats}}-{{/jats}}"/>
+          </date>
+          <date variable="accessed">
+            <date-part name="day" prefix="{{jats}}&lt;day&gt;{{/jats}}" suffix="{{jats}}&lt;/day&gt;{{/jats}}"/>
+            <date-part name="month" form="numeric-leading-zeros" prefix="{{jats}}&lt;month&gt;{{/jats}}" suffix="{{jats}}&lt;/month&gt;{{/jats}}"/>
+            <date-part name="year" prefix="{{jats}}&lt;year&gt;{{/jats}}" suffix="{{jats}}&lt;/year&gt;{{/jats}}"/>
+          </date>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="location">
+    <choose>
+      <if type="article-journal article-magazine" match="any">
+        <text variable="volume" prefix="{{jats}}&lt;volume&gt;{{/jats}}" suffix="{{jats}}&lt;/volume&gt;{{/jats}}"/>
+        <text variable="issue" prefix="{{jats}}&lt;issue&gt;{{/jats}}" suffix="{{jats}}&lt;/issue&gt;{{/jats}}"/>
+      </if>
+    </choose>
+    <choose>
+      <if type="article-journal article-magazine article-newspaper chapter" match="any">
+        <text variable="page-first" prefix="{{jats}}&lt;fpage&gt;{{/jats}}" suffix="{{jats}}&lt;/fpage&gt;{{/jats}}"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="publication-type">
+    <group prefix="{{jats}} publication-type=&quot;{{/jats}}" suffix="{{jats}}&quot;&gt;{{/jats}}">
+      <choose>
+        <if type="article-journal article-magazine article-newspaper" match="any">
+          <text value="journal"/>
+        </if>
+        <else-if type="book" match="any">
+          <text value="book"/>
+        </else-if>
+        <else-if type="chapter" match="any">
+          <text value="bookchapter"/>
+        </else-if>
+        <else-if type="dataset" match="any">
+          <text value="dataset"/>
+        </else-if>
+        <else-if type="patent" match="any">
+          <text value="patent"/>
+        </else-if>
+        <else-if type="report" match="any">
+          <text value="report"/>
+        </else-if>
+        <else-if type="review" match="any">
+          <text value="review"/>
+        </else-if>
+        <else>
+          <text value="standard"/>
+        </else>
+      </choose>
+    </group>
+  </macro>
+  <citation collapse="citation-number">
+    <sort>
+      <key variable="citation-number"/>
+    </sort>
+    <layout delimiter=",">
+      <group prefix="{{jats}}&lt;xref ref-type=&quot;bibr&quot; rid=&quot;{{/jats}}" suffix="{{jats}}&lt;/xref&gt;{{/jats}}">
+        <text variable="citation-number" prefix="{{jats}}ref-{{/jats}}" suffix="{{jats}}&quot;&gt;{{/jats}}"/>
+        <text variable="citation-number"/>
+      </group>
+    </layout>
+  </citation>
+  <bibliography sort-separator="">
+    <layout>
+      <group prefix="{{jats}}&lt;ref {{/jats}}" suffix="{{jats}}&lt;/ref&gt;{{/jats}}">
+        <text macro="citation-number"/>
+        <group prefix="{{jats}}&lt;element-citation{{/jats}}" suffix="{{jats}}&lt;/element-citation&gt;{{/jats}}">
+          <text macro="publication-type"/>
+          <text macro="author" prefix="{{jats}}&lt;person-group person-group-type=&quot;author&quot;&gt;{{/jats}}" suffix="{{jats}}&lt;/person-group&gt;{{/jats}}"/>
+          <text macro="title" />
+          <text macro="container-title"/>
+          <text macro="editor"/>
+          <text macro="publisher"/>
+          <text macro="date"/>
+          <text macro="location"/>
+          <text macro="link"/>
+        </group>
+      </group>
+    </layout>
+  </bibliography>
+</style>
+
diff --git a/test/command/le-tapuscrit-note.csl b/test/command/le-tapuscrit-note.csl
new file mode 100644
--- /dev/null
+++ b/test/command/le-tapuscrit-note.csl
@@ -0,0 +1,496 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="note" default-locale="fr-FR" version="1.0" page-range-format="expanded">
+  <info>
+    <title>Le tapuscrit (École des hautes études en sciences sociales) (note, French)</title>
+    <title-short>Tapuscrit-EHESS</title-short>
+    <id>http://www.zotero.org/styles/le-tapuscrit-note</id>
+    <link href="http://www.zotero.org/styles/le-tapuscrit-note" rel="self"/>
+    <link href="http://www.editions.ehess.fr/ouvrages/ouvrage/le-tapuscrit/" rel="documentation"/>
+    <author>
+      <name>Franziska Heimburger</name>
+      <email>zotero@franziska.fr</email>
+    </author>
+    <category citation-format="note"/>
+    <category field="social_science"/>
+    <category field="generic-base"/>
+    <updated>2018-07-12T11:20:37+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="fr">
+    <terms>
+      <term name="ordinal-01">ère</term>
+      <term name="ordinal-02">e</term>
+      <term name="ordinal-03">e</term>
+      <term name="ordinal-04">e</term>
+      <term name="cited">op.&#160;cit.</term>
+      <term name="page" form="short">p.</term>
+      <term name="editor" form="short">
+        <single>ed.</single>
+        <multiple>eds.</multiple>
+      </term>
+      <term name="in">dans</term>
+    </terms>
+  </locale>
+  <macro name="author">
+    <choose>
+      <if variable="author">
+        <names variable="author">
+          <name form="long" and="text" delimiter-precedes-last="never" sort-separator=" "/>
+        </names>
+      </if>
+      <else-if variable="editor">
+        <names variable="editor">
+          <name form="long" and="text" delimiter-precedes-last="never" sort-separator=" "/>
+          <label form="short" prefix="&#160;(" suffix=".)"/>
+        </names>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="author-bib">
+    <choose>
+      <if variable="author">
+        <names variable="author">
+          <name name-as-sort-order="all" form="long" and="text" delimiter-precedes-last="never" sort-separator=" ">
+            <name-part name="family" font-variant="small-caps"/>
+          </name>
+        </names>
+      </if>
+      <else-if variable="editor">
+        <names variable="editor">
+          <name name-as-sort-order="all" form="long" and="text" delimiter-precedes-last="never" sort-separator=" ">
+            <name-part name="family" font-variant="small-caps"/>
+          </name>
+          <label form="short" prefix="&#160;(" suffix=".)"/>
+        </names>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="author-ibid">
+    <choose>
+      <if variable="author">
+        <names variable="author">
+          <name and="text" initialize="true" initialize-with="." delimiter-precedes-last="never" sort-separator=" " font-style="normal"/>
+        </names>
+      </if>
+      <else-if variable="editor">
+        <names variable="editor">
+          <name form="long" and="text" delimiter-precedes-last="never" sort-separator=" "/>
+          <label form="short" prefix="&#160;(" suffix=".)"/>
+        </names>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="editor">
+    <names variable="editor">
+      <name form="long" and="text" delimiter-precedes-last="never" sort-separator=" "/>
+      <label form="short" prefix="&#160;(" suffix=".)"/>
+    </names>
+  </macro>
+  <macro name="translator">
+    <names variable="translator">
+      <name form="long" and="text" delimiter-precedes-last="never" sort-separator=" " prefix=" traduit par "/>
+    </names>
+  </macro>
+  <macro name="title">
+    <choose>
+      <if type="bill book graphic legal_case motion_picture report song" match="any">
+        <text variable="title" text-case="capitalize-first" font-style="italic"/>
+      </if>
+      <else-if type="article-journal article-newspaper article-magazine" match="any">
+        <group delimiter=", ">
+          <text variable="title" text-case="capitalize-first" quotes="true"/>
+          <text variable="container-title" font-style="italic"/>
+        </group>
+      </else-if>
+      <else-if type="thesis" match="any">
+        <group delimiter="">
+          <text variable="title" text-case="capitalize-first" font-style="italic" suffix=","/>
+          <text variable="genre" suffix=", " prefix=" "/>
+          <text variable="publisher"/>
+        </group>
+      </else-if>
+      <else-if type="manuscript" match="any">
+        <group delimiter=",">
+          <text variable="title" text-case="capitalize-first" font-style="italic"/>
+          <text variable="genre" prefix=" [" suffix="]"/>
+        </group>
+      </else-if>
+      <else-if type="chapter entry-dictionary entry-encyclopedia" match="any">
+        <group delimiter="">
+          <text variable="title" text-case="capitalize-first" quotes="true"/>
+          <text value="dans" suffix=" " prefix=" "/>
+          <text macro="editor" suffix=", "/>
+          <text variable="container-title" text-case="capitalize-first" font-style="italic"/>
+        </group>
+      </else-if>
+      <else-if type="webpage post-weblog" match="any">
+        <group delimiter="">
+          <text variable="title" text-case="capitalize-first" font-style="italic" suffix=", "/>
+          <text variable="URL"/>
+          <group prefix=" , ">
+            <date variable="issued">
+              <date-part name="day" suffix=" "/>
+              <date-part name="month" suffix=" "/>
+              <date-part name="year"/>
+            </date>
+          </group>
+        </group>
+      </else-if>
+      <else>
+        <text variable="title" quotes="true"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="pub-place">
+    <choose>
+      <if type="bill book chapter entry-dictionary entry-encyclopedia thesis graphic legal_case manuscript motion_picture paper-conference report song" match="any">
+        <choose>
+          <if variable="publisher-place" match="any">
+            <text variable="publisher-place"/>
+          </if>
+          <else>
+            <text value="s.l."/>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="publisher">
+    <choose>
+      <if type="bill book chapter entry-dictionary entry-encyclopedia graphic legal_case motion_picture paper-conference report song" match="any">
+        <text variable="publisher"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="yearpage">
+    <choose>
+      <if type="bill book graphic legal_case motion_picture paper-conference manuscript report song thesis" match="any">
+        <group delimiter=", ">
+          <date variable="issued">
+            <date-part name="year"/>
+          </date>
+          <group>
+            <text term="volume" form="short" suffix="."/>
+            <text variable="number-of-volumes" prefix=". " suffix="/"/>
+            <text variable="volume"/>
+          </group>
+          <choose>
+            <if variable="locator" match="any">
+              <group delimiter="&#8239;">
+                <label variable="locator" form="short"/>
+                <text variable="locator"/>
+              </group>
+            </if>
+            <else-if variable="locator" match="none">
+              <text variable="number-of-pages" suffix="&#160;p"/>
+            </else-if>
+          </choose>
+        </group>
+      </if>
+      <else-if type="chapter entry-dictionary entry-encyclopedia" match="any">
+        <group delimiter=" ">
+          <date variable="issued">
+            <date-part name="year" suffix=", "/>
+          </date>
+          <group>
+            <text term="volume" form="short" suffix="."/>
+            <text variable="number-of-volumes" prefix=". " suffix="/"/>
+            <text variable="volume" suffix=","/>
+          </group>
+          <choose>
+            <if variable="locator" match="any">
+              <group delimiter="&#8239;">
+                <label variable="locator" form="short"/>
+                <text variable="locator"/>
+              </group>
+            </if>
+            <else-if variable="locator" match="none">
+              <label variable="page" form="short"/>
+              <text variable="page"/>
+            </else-if>
+          </choose>
+        </group>
+      </else-if>
+      <else-if type="article-journal" match="any">
+        <group delimiter=" " font-style="normal">
+          <choose>
+            <if variable="locator" match="any">
+              <group delimiter="&#8239;">
+                <label variable="locator" form="short"/>
+                <text variable="locator"/>
+              </group>
+            </if>
+            <else-if variable="locator" match="none">
+              <label variable="page" form="short"/>
+              <text variable="page"/>
+            </else-if>
+          </choose>
+        </group>
+      </else-if>
+      <else-if type="article-newspaper article-magazine" match="any">
+        <date variable="issued">
+          <date-part name="day" suffix=" "/>
+          <date-part name="month" form="short" suffix=" "/>
+          <date-part name="year"/>
+        </date>
+        <group delimiter=" " font-style="normal">
+          <label variable="page" form="short"/>
+          <text variable="page"/>
+        </group>
+        <group delimiter=" " font-style="normal">
+          <choose>
+            <if variable="locator" match="any">
+              <group delimiter="&#8239;">
+                <label variable="locator" form="short"/>
+                <text variable="locator"/>
+              </group>
+            </if>
+            <else-if variable="locator" match="none">
+              <label variable="page" form="short"/>
+            </else-if>
+          </choose>
+        </group>
+      </else-if>
+      <else-if type="webpage post-weblog" match="any">
+        <group delimiter=" " prefix="(" suffix=")">
+          <text value="consulté le" suffix=" " prefix=" "/>
+          <date variable="accessed" form="text">
+            <date-part name="day"/>
+            <date-part name="month"/>
+            <date-part name="year"/>
+          </date>
+        </group>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="yearpage-bib">
+    <choose>
+      <if type="bill book graphic legal_case motion_picture paper-conference report song thesis" match="any">
+        <group delimiter=", ">
+          <group delimiter=", ">
+            <date variable="issued">
+              <date-part name="year"/>
+            </date>
+            <group>
+              <text term="volume" form="short" suffix="."/>
+              <text variable="number-of-volumes" prefix=". " suffix="/"/>
+              <text variable="volume"/>
+            </group>
+            <text variable="number-of-pages" suffix="&#160;p"/>
+          </group>
+          <group>
+            <label variable="locator" form="short"/>
+            <text variable="locator"/>
+          </group>
+        </group>
+      </if>
+      <else-if type="chapter entry-dictionary entry-encyclopedia" match="any">
+        <group delimiter=", ">
+          <date variable="issued">
+            <date-part name="year"/>
+          </date>
+          <group>
+            <text term="volume" form="short" suffix="."/>
+            <text variable="number-of-volumes" prefix=". " suffix="/"/>
+            <text variable="volume"/>
+          </group>
+          <group>
+            <label variable="page" form="short"/>
+            <text variable="page" prefix="&#160;"/>
+          </group>
+        </group>
+      </else-if>
+      <else-if type="article-journal chapter" match="any">
+        <group delimiter=" ">
+          <label variable="page" form="short"/>
+          <text variable="page"/>
+        </group>
+      </else-if>
+      <else-if type="article-newspaper article-magazine" match="any">
+        <group delimiter=" ">
+          <date variable="issued">
+            <date-part name="day" suffix=" "/>
+            <date-part name="month" form="short" suffix=" "/>
+            <date-part name="year"/>
+          </date>
+          <label variable="page" form="short"/>
+          <text variable="page"/>
+        </group>
+      </else-if>
+      <else-if type="manuscript">
+        <group delimiter="" font-style="normal">
+          <choose>
+            <if variable="issued">
+              <date variable="issued">
+                <date-part name="day" suffix=" "/>
+                <date-part name="month" suffix=" "/>
+                <date-part name="year"/>
+              </date>
+            </if>
+            <else>
+              <text value="s. d."/>
+            </else>
+          </choose>
+        </group>
+      </else-if>
+      <else-if type="webpage post-weblog" match="any">
+        <group delimiter=" ">
+          <text value="consulté le" suffix=" " prefix=" "/>
+          <date variable="accessed" form="text">
+            <date-part name="day"/>
+            <date-part name="month"/>
+            <date-part name="year"/>
+          </date>
+        </group>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="edition">
+    <choose>
+      <if type="bill book graphic legal_case motion_picture report song chapter paper-conference" match="any">
+        <choose>
+          <if is-numeric="edition">
+            <group delimiter=" ">
+              <number variable="edition" form="ordinal"/>
+              <text term="edition" form="short"/>
+            </group>
+          </if>
+          <else>
+            <text variable="edition" text-case="capitalize-first" suffix="."/>
+          </else>
+        </choose>
+      </if>
+      <else-if type="article-journal article-magazine" match="any">
+        <group delimiter="">
+          <choose>
+            <if variable="issued">
+              <date variable="issued">
+                <date-part name="day" suffix=" "/>
+                <date-part name="month" suffix=" "/>
+                <date-part name="year"/>
+              </date>
+              <text macro="volume" prefix=", "/>
+            </if>
+            <else>
+              <text macro="volume" text-case="capitalize-first"/>
+            </else>
+          </choose>
+        </group>
+      </else-if>
+    </choose>
+    <text macro="issue" prefix=", "/>
+  </macro>
+  <macro name="volume">
+    <choose>
+      <if is-numeric="volume">
+        <text term="volume" form="short" suffix=".&#160;"/>
+        <text variable="volume"/>
+      </if>
+      <else>
+        <text variable="volume"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="issue">
+    <choose>
+      <if is-numeric="issue">
+        <text term="issue" form="short" suffix="&#160;"/>
+        <text variable="issue"/>
+      </if>
+      <else>
+        <text variable="issue"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="collection">
+    <text variable="collection-title" quotes="true" prefix=" (coll.&#160;" suffix=")"/>
+  </macro>
+  <citation et-al-min="4" et-al-use-first="1">
+    <layout suffix="." delimiter="&#160;; ">
+      <choose>
+        <if position="ibid-with-locator">
+          <group delimiter=", ">
+            <text term="ibid" text-case="capitalize-first" font-style="italic" suffix="."/>
+            <text variable="locator" prefix="p.&#160;"/>
+          </group>
+        </if>
+        <else-if position="ibid">
+          <text term="ibid" text-case="capitalize-first" font-style="italic"/>
+        </else-if>
+        <else-if position="subsequent">
+          <group delimiter=", ">
+            <text macro="author-ibid"/>
+            <choose>
+              <if type="bill book graphic legal_case motion_picture report song thesis manuscript" match="any">
+                <text variable="title" form="short" font-style="italic"/>
+                <text term="cited" font-style="italic" suffix="."/>
+              </if>
+              <else>
+                <text variable="title" text-case="capitalize-first" form="short" quotes="true"/>
+                <text value="art cit"/>
+              </else>
+            </choose>
+            <text variable="locator" prefix="p.&#160;"/>
+          </group>
+        </else-if>
+        <else>
+          <choose>
+            <if type="manuscript">
+              <group delimiter=", ">
+                <text variable="archive"/>
+                <text variable="archive_location"/>
+                <text variable="call-number"/>
+                <text macro="title"/>
+                <text macro="yearpage-bib"/>
+              </group>
+            </if>
+            <else-if type="bill chapter article-journal article-newspaper interview book graphic legal_case motion_picture paper-conference report song thesis webpage post-weblog article-magazine" match="any">
+              <group delimiter=", ">
+                <text macro="author"/>
+                <text macro="title"/>
+                <text macro="translator"/>
+                <text macro="edition"/>
+                <text macro="pub-place"/>
+                <text macro="publisher"/>
+                <text macro="yearpage"/>
+              </group>
+            </else-if>
+          </choose>
+        </else>
+      </choose>
+    </layout>
+  </citation>
+  <bibliography>
+    <sort>
+      <key macro="author" names-min="3" names-use-first="3"/>
+      <key variable="issued" sort="descending"/>
+    </sort>
+    <layout suffix=".">
+      <choose>
+        <if type="manuscript">
+          <group delimiter=", ">
+            <text variable="archive"/>
+            <text variable="archive_location"/>
+            <text variable="call-number"/>
+            <text macro="title"/>
+            <text macro="yearpage-bib"/>
+          </group>
+        </if>
+        <else-if type="bill chapter article-journal article-newspaper interview book graphic legal_case motion_picture paper-conference report song thesis webpage post-weblog article-magazine" match="any">
+          <group delimiter=", ">
+            <text macro="author-bib"/>
+            <text macro="title"/>
+            <text macro="translator"/>
+            <text macro="edition"/>
+            <text macro="pub-place"/>
+            <group delimiter=" ">
+              <text macro="publisher"/>
+              <text macro="collection"/>
+            </group>
+            <text macro="yearpage-bib"/>
+          </group>
+        </else-if>
+      </choose>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/lists-inside-definition.md b/test/command/lists-inside-definition.md
new file mode 100644
--- /dev/null
+++ b/test/command/lists-inside-definition.md
@@ -0,0 +1,67 @@
+This inserts an empty `\item[]` when a list occurs at the
+beginning of a definition list definition; otherwise the list
+may start on the line with the label, which looks terrible.
+See https://tex.stackexchange.com/questions/192480/force-itemize-inside-description-onto-a-new-line
+
+```
+% pandoc -t latex
+Definition
+:   1. list
+    2. list
+^D
+\begin{description}
+\item[Definition]
+\begin{enumerate}
+\def\labelenumi{\arabic{enumi}.}
+\tightlist
+\item[]
+\item
+  list
+\item
+  list
+\end{enumerate}
+\end{description}
+```
+
+```
+% pandoc -t latex
+Definition
+:   Foo
+
+    1. list
+    2. list
+^D
+\begin{description}
+\item[Definition]
+Foo
+
+\begin{enumerate}
+\def\labelenumi{\arabic{enumi}.}
+\tightlist
+\item
+  list
+\item
+  list
+\end{enumerate}
+\end{description}
+```
+
+```
+% pandoc -t latex
+Definition
+:   - list
+    - list
+^D
+\begin{description}
+\item[Definition]
+\begin{itemize}
+\tightlist
+\item[]
+\item
+  list
+\item
+  list
+\end{itemize}
+\end{description}
+```
+
diff --git a/test/command/locators.csl b/test/command/locators.csl
new file mode 100644
--- /dev/null
+++ b/test/command/locators.csl
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="note" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-GB">
+  <info>
+    <title>A CSL to test locator parsing in pandoc-citeproc</title>
+    <title-short>test-locators</title-short>
+    <id>https://example.com/test-locators</id>
+    <link href="https://forums.zotero.org/discussion/4841/new-australian-legal-citation-style/?Focus=20831#Comment_20831" rel="documentation"/>
+    <category citation-format="note"/>
+  </info>
+
+  <locale>
+    <terms>
+      <term name="section" form="short">
+        <single>s</single>
+        <multiple>ss</multiple>
+      </term>
+    </terms>
+  </locale>
+
+  <macro name="locator">
+    <choose>
+      <if locator="section">
+        <!-- s or ss -->
+        <group delimiter=" " prefix=" ">
+          <label variable="locator" form="short" />
+          <text variable="locator" prefix="{" suffix="}" />
+        </group>
+      </if>
+      <else>
+        <text variable="locator" prefix=" {" suffix="}" />
+      </else>
+    </choose>
+  </macro>
+
+  <macro name="title">
+      <text variable="title" suffix=" "/>
+  </macro>
+
+  <citation>
+    <layout prefix="" suffix="." delimiter="; ">
+      <choose>
+        <if position="ibid-with-locator">
+          <text value="ibid-with-locator"/>
+          <text macro="locator"/>
+        </if>
+        <else-if position="ibid">
+          <text value="ibid"/>
+        </else-if>
+        <else-if position="subsequent">
+          <text value="subsequent"/>
+          <text macro="locator"/>
+        </else-if>
+        <else>
+          <text macro="title" />
+          <text macro="locator" />
+        </else>
+      </choose>
+    </layout>
+  </citation>
+  <bibliography>
+    <sort>
+      <key variable="issued"/>
+    </sort>
+    <layout>
+      <text variable="title" />
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/modern-humanities-research-association.csl b/test/command/modern-humanities-research-association.csl
new file mode 100644
--- /dev/null
+++ b/test/command/modern-humanities-research-association.csl
@@ -0,0 +1,445 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="note" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-GB">
+  <info>
+    <title>Modern Humanities Research Association (note with bibliography)</title>
+    <id>http://www.zotero.org/styles/modern-humanities-research-association</id>
+    <link href="http://www.zotero.org/styles/modern-humanities-research-association" rel="self"/>
+    <link href="http://www.mhra.org.uk/Publications/Books/StyleGuide/download.shtml" rel="documentation"/>
+    <author>
+      <name>Rintze Zelle</name>
+      <uri>http://twitter.com/rintzezelle</uri>
+    </author>
+    <contributor>
+      <name>Sebastian Karcher</name>
+    </contributor>
+    <category citation-format="note"/>
+    <category field="generic-base"/>
+    <summary>MHRA format with full notes and bibliography</summary>
+    <updated>2013-04-16T04:40:01+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="en">
+    <terms>
+      <term name="et-al">and others</term>
+      <term name="editor" form="verb-short">ed. by</term>
+      <term name="edition" form="short">edn</term>
+      <term name="translator" form="verb-short">trans. by</term>
+    </terms>
+  </locale>
+  <macro name="author">
+    <group delimiter=". ">
+      <names variable="author">
+        <name name-as-sort-order="first" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="always"/>
+        <label form="short" prefix=", " suffix="."/>
+        <substitute>
+          <names variable="editor"/>
+          <names variable="translator"/>
+          <text macro="title-note"/>
+        </substitute>
+      </names>
+      <text macro="recipient"/>
+    </group>
+  </macro>
+  <macro name="recipient">
+    <group delimiter=" ">
+      <choose>
+        <if type="personal_communication">
+          <choose>
+            <if variable="genre">
+              <text variable="genre" text-case="capitalize-first"/>
+            </if>
+            <else>
+              <text term="letter" text-case="capitalize-first"/>
+            </else>
+          </choose>
+        </if>
+      </choose>
+      <text macro="recipient-note"/>
+    </group>
+  </macro>
+  <macro name="contributors-note">
+    <names variable="author">
+      <name and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="never"/>
+      <label form="short" prefix=", "/>
+      <substitute>
+        <names variable="editor"/>
+        <names variable="translator"/>
+        <text macro="title-note"/>
+      </substitute>
+    </names>
+    <text macro="recipient-note"/>
+  </macro>
+  <macro name="title-note">
+    <choose>
+      <if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+        <text variable="title" font-style="italic" text-case="title"/>
+      </if>
+      <else>
+        <text variable="title" quotes="true" text-case="title"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="disambiguate">
+    <choose>
+      <if disambiguate="true">
+        <choose>
+          <if variable="title" match="none">
+            <text macro="issued"/>
+          </if>
+          <else-if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+            <text variable="title" font-style="italic" text-case="title" form="short"/>
+          </else-if>
+          <else>
+            <text variable="title" quotes="true" text-case="title" form="short"/>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="title-sort-substitute">
+    <choose>
+      <if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+        <text variable="title" font-style="italic" text-case="title" form="short"/>
+      </if>
+      <else>
+        <text variable="title" quotes="true" text-case="title" form="short"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="editor-translator">
+    <group delimiter=", ">
+      <choose>
+        <if variable="author">
+          <group delimiter=" ">
+            <choose>
+              <if variable="container-author">
+                <group>
+                  <names variable="container-author">
+                    <label form="verb-short" text-case="lowercase" suffix=" "/>
+                    <name and="text" delimiter=", "/>
+                  </names>
+                </group>
+              </if>
+            </choose>
+          </group>
+          <names variable="editor translator" delimiter=", ">
+            <label form="verb-short" text-case="lowercase" suffix=" "/>
+            <name and="text" delimiter=", "/>
+          </names>
+        </if>
+      </choose>
+    </group>
+  </macro>
+  <macro name="collection-title">
+    <text variable="collection-title" text-case="title"/>
+    <text variable="collection-number" prefix=", "/>
+  </macro>
+  <macro name="locators-note">
+    <choose>
+      <if type="article-journal">
+        <text variable="volume"/>
+      </if>
+      <else-if type="bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="any">
+        <group delimiter=", ">
+          <text macro="edition-note"/>
+          <group>
+            <number variable="number-of-volumes" form="numeric"/>
+            <text term="volume" form="short" prefix=" " plural="true"/>
+          </group>
+        </group>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="volume">
+    <choose>
+      <if type="article-journal">
+        <text variable="volume"/>
+      </if>
+      <else-if type="bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="any">
+        <group delimiter=", ">
+          <text macro="edition-note"/>
+          <group>
+            <number variable="number-of-volumes" form="numeric"/>
+            <text term="volume" form="short" prefix=" " plural="true"/>
+          </group>
+        </group>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="issue-note">
+    <choose>
+      <if type="article-journal">
+        <choose>
+          <if variable="volume">
+            <text macro="issued" prefix=" (" suffix=")"/>
+          </if>
+          <else>
+            <text macro="issued" prefix=", "/>
+          </else>
+        </choose>
+      </if>
+      <else-if variable="publisher-place publisher" match="any">
+        <group prefix=" (" suffix=")" delimiter=", ">
+          <group delimiter=" ">
+            <choose>
+              <if variable="title" match="none"/>
+              <else-if type="thesis speech" match="any">
+                <text variable="genre" prefix="unpublished "/>
+              </else-if>
+            </choose>
+            <text macro="event"/>
+          </group>
+          <text macro="publisher"/>
+          <text macro="issued"/>
+        </group>
+      </else-if>
+      <else>
+        <text macro="issued" prefix=", "/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="locators-specific-note">
+    <choose>
+      <if type="bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="any">
+        <choose>
+          <if is-numeric="volume">
+            <number variable="volume" form="roman" font-variant="small-caps"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="container-title-note">
+    <choose>
+      <if type="chapter paper-conference" match="any">
+        <text term="in" text-case="lowercase" suffix=" "/>
+      </if>
+    </choose>
+    <text variable="container-title" font-style="italic"/>
+  </macro>
+  <macro name="edition-note">
+    <choose>
+      <if type="bill book chapter graphic legal_case legislation motion_picture paper-conference report song" match="any">
+        <choose>
+          <if is-numeric="edition">
+            <group delimiter=" ">
+              <number variable="edition" form="ordinal"/>
+              <text term="edition" form="short"/>
+            </group>
+          </if>
+          <else>
+            <text variable="edition"/>
+          </else>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="editor-note">
+    <names variable="editor">
+      <name and="text" sort-separator=", " delimiter=", "/>
+      <label form="short" prefix=", " suffix="."/>
+    </names>
+  </macro>
+  <macro name="translator-note">
+    <names variable="translator">
+      <name and="text" sort-separator=", " delimiter=", "/>
+      <label form="verb-short" prefix=", " suffix="."/>
+    </names>
+  </macro>
+  <macro name="recipient-note">
+    <names variable="recipient" delimiter=", ">
+      <label form="verb" prefix=" " text-case="lowercase" suffix=" "/>
+      <name and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="recipient-short">
+    <names variable="recipient">
+      <label form="verb" prefix=" " text-case="lowercase" suffix=" "/>
+      <name form="short" and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="contributors-short">
+    <names variable="author">
+      <name form="short" and="text" sort-separator=", " delimiter=", " delimiter-precedes-last="never"/>
+      <substitute>
+        <names variable="editor"/>
+        <names variable="translator"/>
+        <text macro="title-sort-substitute"/>
+      </substitute>
+    </names>
+    <text macro="recipient-short"/>
+  </macro>
+  <macro name="interviewer-note">
+    <names variable="interviewer" delimiter=", ">
+      <label form="verb" prefix=" " text-case="lowercase" suffix=" "/>
+      <name and="text" delimiter=", "/>
+    </names>
+  </macro>
+  <macro name="locators-newspaper">
+    <choose>
+      <if type="article-newspaper">
+        <group delimiter=", ">
+          <group>
+            <text variable="edition" suffix=" "/>
+            <text term="edition" prefix=" "/>
+          </group>
+          <group>
+            <text term="section" suffix=" "/>
+            <text variable="section"/>
+          </group>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="event">
+    <group>
+      <text term="presented at" suffix=" "/>
+      <text variable="event"/>
+    </group>
+  </macro>
+  <macro name="publisher">
+    <group delimiter=": ">
+      <text variable="publisher-place"/>
+      <text variable="publisher"/>
+    </group>
+  </macro>
+  <macro name="issued">
+    <choose>
+      <if type="graphic report article-newspaper article-magazine personal_communication" match="any">
+        <date variable="issued">
+          <date-part name="day" suffix=" "/>
+          <date-part name="month" suffix=" "/>
+          <date-part name="year"/>
+        </date>
+      </if>
+      <else>
+        <date variable="issued">
+          <date-part name="year"/>
+        </date>
+      </else>
+    </choose>
+  </macro>
+  <macro name="pages">
+    <choose>
+      <if type="article-journal">
+        <text variable="page" prefix=", "/>
+      </if>
+      <else>
+        <choose>
+          <if variable="volume">
+            <text variable="page" prefix=", "/>
+          </if>
+          <else>
+            <label variable="page" form="short" prefix=", " suffix=" "/>
+            <text variable="page"/>
+          </else>
+        </choose>
+      </else>
+    </choose>
+  </macro>
+  <macro name="point-locators">
+    <text macro="pages"/>
+    <choose>
+      <if variable="page">
+        <group prefix=" (" suffix=")">
+          <label variable="locator" form="short" suffix=" "/>
+          <text variable="locator"/>
+        </group>
+      </if>
+      <else>
+        <label variable="locator" form="short" prefix=", " suffix=" "/>
+        <text variable="locator"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="point-locators-subsequent">
+    <label variable="locator" form="short" prefix=", " suffix=" "/>
+    <text variable="locator"/>
+  </macro>
+  <macro name="archive-note">
+    <group delimiter=", ">
+      <text variable="archive_location"/>
+      <text variable="archive"/>
+      <text variable="archive-place"/>
+    </group>
+  </macro>
+  <macro name="access-note">
+    <group delimiter=", ">
+      <choose>
+        <if type="article-journal bill chapter legal_case legislation paper-conference" match="none">
+          <text macro="archive-note" prefix=", "/>
+        </if>
+      </choose>
+    </group>
+    <choose>
+      <if variable="DOI">
+        <text variable="DOI" prefix=" &lt;doi:" suffix="&gt;"/>
+      </if>
+      <else>
+        <choose>
+          <if variable="URL">
+            <text variable="URL" prefix=" &lt;" suffix="&gt;"/>
+            <group prefix=" [" suffix="]">
+              <text term="accessed" text-case="lowercase"/>
+              <date variable="accessed">
+                <date-part name="day" prefix=" "/>
+                <date-part name="month" prefix=" "/>
+                <date-part name="year" prefix=" "/>
+              </date>
+            </group>
+          </if>
+        </choose>
+      </else>
+    </choose>
+  </macro>
+  <citation et-al-min="4" et-al-use-first="1" disambiguate-add-names="true" disambiguate-add-givenname="true">
+    <layout prefix="" suffix="." delimiter="; ">
+      <choose>
+        <if position="subsequent">
+          <group delimiter=", ">
+            <text macro="contributors-short"/>
+            <text macro="disambiguate"/>
+            <text macro="locators-specific-note"/>
+          </group>
+          <text macro="point-locators-subsequent"/>
+        </if>
+        <else>
+          <group delimiter=", ">
+            <text macro="contributors-note"/>
+            <text macro="title-note"/>
+            <text macro="container-title-note"/>
+            <text macro="editor-translator"/>
+            <text macro="collection-title"/>
+            <text macro="locators-note"/>
+          </group>
+          <text macro="issue-note"/>
+          <text macro="locators-specific-note" prefix=", "/>
+          <text macro="locators-newspaper" prefix=", "/>
+          <text macro="point-locators"/>
+          <text macro="access-note"/>
+        </else>
+      </choose>
+    </layout>
+  </citation>
+  <bibliography hanging-indent="true" et-al-min="7" et-al-use-first="6" subsequent-author-substitute="---">
+    <sort>
+      <key macro="author"/>
+      <key variable="title"/>
+    </sort>
+    <layout>
+      <group delimiter=", ">
+        <text macro="author"/>
+        <text macro="title-note"/>
+        <text macro="container-title-note"/>
+        <text macro="editor-translator"/>
+        <text macro="collection-title"/>
+        <text macro="volume"/>
+      </group>
+      <text macro="issue-note"/>
+      <text macro="locators-specific-note" prefix=", "/>
+      <text macro="locators-newspaper" prefix=", "/>
+      <text macro="pages"/>
+      <text macro="access-note"/>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/oscola.csl b/test/command/oscola.csl
new file mode 100644
--- /dev/null
+++ b/test/command/oscola.csl
@@ -0,0 +1,680 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="note" version="1.0" demote-non-dropping-particle="never" default-locale="en-GB">
+  <info>
+    <title>OSCOLA (Oxford University Standard for Citation of Legal Authorities)</title>
+    <title-short>OSCOLA</title-short>
+    <id>http://www.zotero.org/styles/oscola</id>
+    <link href="http://www.zotero.org/styles/oscola" rel="self"/>
+    <link href="http://www.zotero.org/styles/australian-guide-to-legal-citation" rel="template"/>
+    <link href="http://www.law.ox.ac.uk/publications/oscola.php" rel="documentation"/>
+    <author>
+      <name>Sebastian Karcher</name>
+    </author>
+    <category citation-format="note"/>
+    <category field="law"/>
+    <summary>The OSCOLA Standards. For a Zotero Group showing data-entry in Zotero see: https://www.zotero.org/groups/oscola_samples/items/order/itemType</summary>
+    <updated>2013-11-15T01:14:57+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale>
+    <terms>
+      <term name="chapter" form="short">
+        <single>ch.</single>
+        <multiple>chs.</multiple>
+      </term>
+      <term name="section" form="short">
+        <single>s</single>
+        <multiple>ss</multiple>
+      </term>
+      <term name="paragraph" form="short">
+        <single>para</single>
+        <multiple>paras</multiple>
+      </term>
+      <term name="translator" form="short">
+        <single>tr.</single>
+        <multiple>trs.</multiple>
+      </term>
+      <term name="edition" form="short">edn.</term>
+      <term name="et-al">and others</term>
+    </terms>
+  </locale>
+  <!--Authors and Persons-->
+  <macro name="author-note">
+    <!--for bills & hearing this should start with jurisdiction once available-->
+    <choose>
+      <if type="interview">
+        <group delimiter=", ">
+          <names variable="interviewer">
+            <name delimiter-precedes-last="never" and="text" delimiter=", " initialize="false" initialize-with=""/>
+          </names>
+          <names variable="author" prefix="Interview with ">
+            <name delimiter-precedes-last="never" and="text" delimiter=", " initialize="false" initialize-with=""/>
+          </names>
+        </group>
+      </if>
+      <else-if type="personal_communication">
+        <group delimiter=" ">
+          <group delimiter=" from ">
+            <text variable="genre"/>
+            <names variable="author">
+              <name delimiter-precedes-last="never" and="text" delimiter=", " initialize="false" initialize-with=""/>
+            </names>
+          </group>
+          <names variable="recipient" prefix="to ">
+            <name delimiter-precedes-last="never" and="text" delimiter=", " initialize="false" initialize-with=""/>
+          </names>
+        </group>
+      </else-if>
+      <else-if type="broadcast">
+        <text variable="publisher"/>
+      </else-if>
+      <else-if type="legal_case legislation" match="any"/>
+      <else>
+        <names variable="author">
+          <name delimiter-precedes-last="never" and="text" delimiter=", " initialize="false" initialize-with=""/>
+          <label form="short" prefix=" (" suffix=")" strip-periods="true"/>
+          <substitute>
+            <names variable="editor"/>
+            <names variable="translator"/>
+            <text macro="title"/>
+          </substitute>
+        </names>
+      </else>
+    </choose>
+  </macro>
+  <macro name="author-short">
+    <choose>
+      <if type="interview">
+        <group delimiter=", ">
+          <names variable="interviewer">
+            <name delimiter-precedes-last="never" and="text" form="short" delimiter=", " initialize="false" initialize-with=""/>
+          </names>
+          <names variable="author" prefix="Interview with ">
+            <name delimiter-precedes-last="never" and="text" form="short" delimiter=", " initialize="false" initialize-with=""/>
+          </names>
+        </group>
+      </if>
+      <else-if type="personal_communication">
+        <group delimiter=" ">
+          <group delimiter=" from ">
+            <text variable="genre"/>
+            <names variable="author">
+              <name delimiter-precedes-last="never" and="text" delimiter=", " form="short" initialize="false" initialize-with=""/>
+            </names>
+          </group>
+          <names variable="recipient" prefix="to ">
+            <name delimiter-precedes-last="never" and="text" delimiter=", " initialize="false" form="short" initialize-with=""/>
+          </names>
+        </group>
+      </else-if>
+      <else-if type="broadcast">
+        <text variable="publisher"/>
+      </else-if>
+      <else>
+        <names variable="author">
+          <name delimiter-precedes-last="never" and="text" delimiter=", " initialize="false" initialize-with="" form="short"/>
+          <substitute>
+            <names variable="editor"/>
+            <names variable="translator"/>
+            <text macro="title"/>
+          </substitute>
+        </names>
+      </else>
+    </choose>
+  </macro>
+  <macro name="author">
+    <!--for bills & hearing this should start with jurisdiction once available-->
+    <choose>
+      <if type="interview">
+        <group delimiter=", ">
+          <names variable="interviewer">
+            <name delimiter-precedes-last="never" and="text" delimiter=", " initialize-with="" name-as-sort-order="all" sort-separator=" "/>
+          </names>
+          <names variable="author" prefix="Interview with ">
+            <name delimiter-precedes-last="never" and="text" delimiter=", " initialize="false" initialize-with=""/>
+          </names>
+        </group>
+      </if>
+      <else-if type="personal_communication">
+        <group delimiter=" ">
+          <group delimiter=", ">
+            <names variable="author">
+              <name delimiter-precedes-last="never" and="text" delimiter=", " initialize-with="" name-as-sort-order="all" sort-separator=" "/>
+            </names>
+            <text variable="genre"/>
+          </group>
+          <names variable="recipient" prefix="to ">
+            <name delimiter-precedes-last="never" and="text" delimiter=", " initialize="false" initialize-with=""/>
+          </names>
+        </group>
+      </else-if>
+      <else-if type="broadcast">
+        <text variable="publisher"/>
+      </else-if>
+      <else-if type="legal_case legislation" match="any"/>
+      <else>
+        <names variable="author">
+          <name delimiter-precedes-last="never" and="text" delimiter=", " name-as-sort-order="all" initialize-with="" sort-separator=" "/>
+          <label form="short" prefix=" (" suffix=")" strip-periods="true"/>
+          <substitute>
+            <names variable="editor"/>
+            <names variable="translator"/>
+            <text macro="title"/>
+          </substitute>
+        </names>
+      </else>
+    </choose>
+  </macro>
+  <macro name="editor">
+    <choose>
+      <if type="chapter paper-conference entry-encyclopedia" match="none">
+        <names variable="editor translator container-author" delimiter=", ">
+          <name delimiter-precedes-last="never" and="text" delimiter=", " initialize="false" initialize-with=""/>
+          <label form="short" prefix=" " strip-periods="true"/>
+        </names>
+      </if>
+    </choose>
+  </macro>
+  <macro name="editor-chapter">
+    <group>
+      <text term="in" suffix=" "/>
+      <names variable="editor translator container-author" delimiter=", ">
+        <name delimiter-precedes-last="never" and="text" delimiter=", " initialize="false" initialize-with=""/>
+        <label form="short" prefix=" (" suffix=")" strip-periods="true"/>
+      </names>
+    </group>
+  </macro>
+  <!-- Titles -->
+  <macro name="title">
+    <choose>
+      <if type="book motion_picture treaty" match="any">
+        <text variable="title" font-style="italic" text-case="title"/>
+      </if>
+      <else-if type="bill legislation" match="any">
+        <text variable="title"/>
+      </else-if>
+      <else-if type="legal_case">
+        <text variable="title" font-style="italic" strip-periods="true"/>
+      </else-if>
+      <else>
+        <text variable="title" quotes="true" text-case="title"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="title-short">
+    <choose>
+      <if type="book motion_picture treaty" match="any">
+        <text variable="title" font-style="italic" text-case="title" form="short"/>
+      </if>
+      <else-if type="bill legislation" match="any">
+        <text variable="title" form="short"/>
+      </else-if>
+      <else-if type="legal_case">
+        <choose>
+          <if variable="title-short">
+            <text variable="title-short" font-style="italic"/>
+          </if>
+          <else>
+            <text variable="title" font-style="italic"/>
+          </else>
+        </choose>
+      </else-if>
+      <else>
+        <text variable="title" quotes="true" text-case="title" form="short"/>
+      </else>
+    </choose>
+  </macro>
+  <!--Dates-->
+  <macro name="issued-year">
+    <date variable="issued" form="text" date-parts="year"/>
+  </macro>
+  <macro name="issued-full">
+    <date variable="issued" form="text"/>
+  </macro>
+  <macro name="date-parenthesis">
+    <choose>
+      <if type="legal_case article-journal article-magazine" match="any">
+        <choose>
+          <if variable="number authority" match="all">
+            <text macro="issued-year" prefix="[" suffix="]"/>
+          </if>
+          <else-if variable="volume">
+            <text macro="issued-year" prefix="(" suffix=")"/>
+          </else-if>
+          <else-if variable="container-title volume number" match="any">
+            <!--no year in square brackets for unreported case w/o medium neutral citation-->
+            <text macro="issued-year" prefix="[" suffix="]"/>
+          </else-if>
+        </choose>
+      </if>
+      <else-if type="legislation bill" match="any">
+        <text macro="issued-year"/>
+      </else-if>
+    </choose>
+  </macro>
+  <!--publication info -->
+  <macro name="publisher">
+    <choose>
+      <if type="book chapter broadcast personal_communication manuscript paper-conference article-newspaper report legislation motion_picture speech interview thesis entry-encyclopedia webpage post-weblog" match="any">
+        <group delimiter=" ">
+          <group prefix="(" suffix=")" delimiter=", ">
+            <choose>
+              <if type="article-newspaper">
+                <text variable="publisher-place" strip-periods="true"/>
+                <date variable="issued" form="text"/>
+              </if>
+              <else-if type="broadcast personal_communication treaty" match="any">
+                <date variable="issued" form="text"/>
+              </else-if>
+              <else-if type="legislation bill" match="any">
+                <!--this should be jurisdiction we use code instead-->
+                <text variable="container-title" strip-periods="true"/>
+              </else-if>
+              <else>
+                <!--this won't work in Zotero yet, but does no harm -->
+                <names variable="director">
+                  <label form="verb" text-case="capitalize-first" suffix=" "/>
+                  <name delimiter-precedes-last="never" and="text" delimiter=", " initialize="false" initialize-with=""/>
+                </names>
+                <text macro="editor"/>
+                <choose>
+                  <!--if none of these, this we don't want edition either. Might be Loose-Leaf-->
+                  <if variable="publisher issued genre container-title" match="any">
+                    <text macro="edition"/>
+                  </if>
+                </choose>
+                <choose>
+                  <if type="speech">
+                    <text variable="event"/>
+                    <text variable="event-place"/>
+                    <text macro="issued-full"/>
+                  </if>
+                  <else-if type="thesis" match="any">
+                    <text variable="genre" strip-periods="true"/>
+                    <group delimiter=" ">
+                      <text variable="publisher" strip-periods="true"/>
+                      <text macro="issued-year"/>
+                    </group>
+                  </else-if>
+                  <else-if type="webpage post-weblog" match="any">
+                    <text variable="container-title" font-style="italic"/>
+                    <text macro="issued-full"/>
+                  </else-if>
+                  <else-if type="interview" match="any">
+                    <text macro="issued-full"/>
+                  </else-if>
+                  <else>
+                    <group delimiter=" ">
+                      <text variable="publisher" strip-periods="true"/>
+                      <text macro="issued-year"/>
+                    </group>
+                  </else>
+                </choose>
+              </else>
+            </choose>
+          </group>
+          <choose>
+            <if type="report interview manuscript" match="any">
+              <group delimiter=" ">
+                <text variable="genre" strip-periods="true"/>
+                <text variable="number"/>
+              </group>
+            </if>
+          </choose>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="looseleaf-note">
+    <choose>
+      <if type="book">
+        <choose>
+          <if variable="publisher issued" match="none">
+            <choose>
+              <if variable="locator">
+                <group delimiter=" ">
+                  <label variable="locator" form="short" strip-periods="true"/>
+                  <text variable="locator"/>
+                  <text variable="edition" prefix="(" suffix=")"/>
+                </group>
+              </if>
+            </choose>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="volume-book">
+    <choose>
+      <if type="book chapter report" match="any">
+        <group delimiter=" ">
+          <label variable="volume" form="short" strip-periods="true"/>
+          <text variable="volume"/>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="edition">
+    <choose>
+      <if is-numeric="edition">
+        <group delimiter=" ">
+          <number variable="edition" form="ordinal"/>
+          <label variable="edition" form="short" strip-periods="true"/>
+        </group>
+      </if>
+      <else>
+        <text variable="edition" strip-periods="true"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="book-container">
+    <choose>
+      <if type="chapter paper-conference entry-encyclopedia" match="any">
+        <group>
+          <text macro="editor-chapter" prefix=" "/>
+          <text variable="container-title" font-style="italic" prefix=", "/>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="broadcast-container">
+    <choose>
+      <if type="broadcast" match="any">
+        <text variable="container-title" font-style="italic"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="bill-number">
+    <choose>
+      <if type="bill">
+        <text variable="number" prefix="[" suffix="]"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="article-case-info">
+    <choose>
+      <if type="article-journal article-magazine article-newspaper legal_case" match="any">
+        <group delimiter=", ">
+          <!--Assume that only cases with a Medium Neutral Citation have a docket number -->
+          <choose>
+            <if variable="authority number" match="all">
+              <group delimiter=" ">
+                <text variable="authority" form="short" strip-periods="true"/>
+                <text variable="number"/>
+              </group>
+            </if>
+          </choose>
+          <group delimiter=" ">
+            <text variable="volume"/>
+            <choose>
+              <if type="legal_case">
+                <choose>
+                  <if variable="container-title">
+                    <text variable="container-title" form="short" strip-periods="true"/>
+                  </if>
+                </choose>
+              </if>
+              <else-if type="article-magazine article-newspaper" match="any">
+                <text variable="container-title" font-style="italic"/>
+              </else-if>
+              <else>
+                <text variable="container-title"/>
+              </else>
+            </choose>
+          </group>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="page-first">
+    <choose>
+      <if type="chapter report paper-conference" match="none">
+        <text variable="page-first"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="court">
+    <choose>
+      <if type="legal_case">
+        <choose>
+          <if variable="number" match="none">
+            <text variable="authority" prefix="(" suffix=")" strip-periods="true"/>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="locator-basic">
+    <group delimiter=" ">
+      <choose>
+        <if locator="page" match="none">
+          <label variable="locator" form="short" strip-periods="true"/>
+        </if>
+      </choose>
+      <text variable="locator"/>
+    </group>
+  </macro>
+  <macro name="locator-space">
+    <choose>
+      <if type="legal_case">
+        <choose>
+          <if locator="paragraph">
+            <text variable="locator" prefix="[" suffix="]"/>
+          </if>
+          <else-if variable="number container-title volume page" match="all"/>
+          <else-if variable="authority">
+            <text variable="locator"/>
+          </else-if>
+        </choose>
+      </if>
+      <else-if type="legislation book article-journal article-magazine" match="none">
+        <text macro="locator-basic"/>
+      </else-if>
+      <else-if type="book">
+        <choose>
+          <if variable="issued publisher" match="any">
+            <text macro="locator-basic"/>
+          </if>
+        </choose>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="locator-comma">
+    <choose>
+      <if type="legal_case">
+        <choose>
+          <if locator="paragraph" match="none">
+            <choose>
+              <if variable="authority" match="none">
+                <text variable="locator"/>
+              </if>
+              <else-if variable="number container-title volume page" match="all">
+                <text variable="locator"/>
+              </else-if>
+            </choose>
+          </if>
+        </choose>
+      </if>
+      <else-if type="legislation article-journal article-magazine" match="any">
+        <text macro="locator-basic"/>
+      </else-if>
+    </choose>
+  </macro>
+  <!--Others -->
+  <macro name="treaty-catchall">
+    <choose>
+      <if type="treaty">
+        <text variable="genre"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="URL">
+    <choose>
+      <if type="legal_case legislation bill" match="none">
+        <choose>
+          <if variable="URL">
+            <group delimiter=" ">
+              <text variable="URL" prefix="&lt;" suffix="&gt;"/>
+              <group delimiter=" ">
+                <text term="accessed"/>
+                <date variable="accessed" form="text"/>
+              </group>
+            </group>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="author-count">
+    <names variable="author">
+      <name form="count"/>
+      <substitute>
+        <names variable="editor"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="sort-type">
+    <!--This should just sort secondary sources first. I'm leaving the rest from AGLC for simplicity-->
+    <choose>
+      <if type="book chapter paper-conference article-magazine article-newspaper article-journal manuscript report speech entry-encyclopedia" match="any">
+        <text value="1"/>
+      </if>
+      <else-if type="legal_case">
+        <text value="2"/>
+        <text variable="title"/>
+      </else-if>
+      <else-if type="bill legislation" match="any">
+        <text value="3"/>
+        <choose>
+          <if type="legislation">
+            <text variable="title"/>
+          </if>
+        </choose>
+      </else-if>
+      <else-if type="treaty">
+        <text value="4"/>
+      </else-if>
+      <else>
+        <text value="1"/>
+      </else>
+    </choose>
+  </macro>
+  <citation et-al-min="4" et-al-use-first="1">
+    <layout suffix="." delimiter="; ">
+      <choose>
+        <if position="ibid-with-locator">
+          <group delimiter=" ">
+            <text term="ibid" strip-periods="true" text-case="lowercase"/>
+            <text variable="locator"/>
+          </group>
+        </if>
+        <else-if position="ibid">
+          <text term="ibid" strip-periods="true" text-case="lowercase"/>
+        </else-if>
+        <else-if position="subsequent">
+          <choose>
+            <if type="legal_case bill legislation treaty" match="any">
+              <!--don't use short form and above note for legal citations -->
+              <group delimiter=" ">
+                <text macro="author-note"/>
+                <text macro="title-short"/>
+                <text macro="looseleaf-note"/>
+                <text variable="first-reference-note-number" prefix="(n " suffix=")"/>
+                <text macro="locator-space"/>
+              </group>
+            </if>
+            <else>
+              <group delimiter=" ">
+                <group delimiter=", ">
+                  <text macro="author-short"/>
+                  <choose>
+                    <if disambiguate="true">
+                      <text macro="title-short"/>
+                    </if>
+                  </choose>
+                </group>
+                <text variable="first-reference-note-number" prefix="(n " suffix=")"/>
+                <text macro="locator-basic"/>
+              </group>
+            </else>
+          </choose>
+        </else-if>
+        <else>
+          <!--general whole citation -->
+          <group delimiter=" ">
+            <group delimiter=", ">
+              <group delimiter=" ">
+                <group delimiter=", ">
+                  <text macro="author-note"/>
+                  <group>
+                    <text macro="title"/>
+                    <text macro="book-container"/>
+                  </group>
+                  <text macro="broadcast-container"/>
+                  <text macro="volume-book"/>
+                  <text macro="looseleaf-note"/>
+                </group>
+                <group delimiter=" ">
+                  <text macro="date-parenthesis"/>
+                  <text macro="bill-number"/>
+                  <text macro="article-case-info"/>
+                  <text macro="publisher"/>
+                </group>
+              </group>
+              <text macro="treaty-catchall"/>
+            </group>
+            <group delimiter=", ">
+              <group delimiter=" ">
+                <text macro="page-first"/>
+                <text macro="court"/>
+                <text macro="locator-space"/>
+              </group>
+              <text macro="locator-comma"/>
+            </group>
+            <text macro="URL"/>
+          </group>
+        </else>
+      </choose>
+    </layout>
+  </citation>
+  <bibliography et-al-min="4" et-al-use-first="1" subsequent-author-substitute="&#8212;&#8212;">
+    <sort>
+      <key macro="sort-type"/>
+      <key macro="author" names-min="1" names-use-first="1"/>
+      <key macro="author-count" names-min="2" names-use-first="2"/>
+      <key macro="author"/>
+      <key variable="issued"/>
+      <key variable="title"/>
+    </sort>
+    <layout>
+      <group delimiter=" ">
+        <group delimiter=", ">
+          <group delimiter=" ">
+            <group delimiter=", ">
+              <text macro="author"/>
+              <group>
+                <text macro="title"/>
+                <text macro="book-container"/>
+              </group>
+              <text macro="broadcast-container"/>
+              <text macro="volume-book"/>
+              <text macro="looseleaf-note"/>
+            </group>
+            <group delimiter=" ">
+              <text macro="date-parenthesis"/>
+              <text macro="bill-number"/>
+              <text macro="article-case-info"/>
+              <text macro="publisher"/>
+            </group>
+          </group>
+          <text macro="treaty-catchall"/>
+        </group>
+        <group delimiter=" ">
+          <text macro="page-first"/>
+          <text macro="court"/>
+        </group>
+        <text macro="URL"/>
+      </group>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/pandoc-citeproc-118.md b/test/command/pandoc-citeproc-118.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-118.md
@@ -0,0 +1,28 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- director:
+    family: Hitchcock
+    given: Alfred
+  id: nbn
+  issued:
+    year: 1959
+  language: 'en-US'
+  publisher: 'Metro-Goldwyn-Mayer'
+  publisher-place: USA
+  title: North by Northwest
+  type: motion_picture
+---
+
+[@nbn] is a spy thriller film.
+^D
+(Hitchcock 1959) is a spy thriller film.
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-nbn .csl-entry}
+Hitchcock, Alfred, dir. 1959. *North by Northwest*. USA:
+Metro-Goldwyn-Mayer.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-119.md b/test/command/pandoc-citeproc-119.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-119.md
@@ -0,0 +1,39 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+bibliography: 'command/biblatex-examples.bib'
+csl: command/apa.csl
+---
+
+@averroes/bland; @averroes/hannes; @averroes/hercz
+
+References {#references .unnumbered}
+==========
+^D
+Averroes (1982); Averroes (1892); Averroes (1869)
+
+References {#references .unnumbered}
+==========
+
+::: {#refs .references .csl-bib-body .hanging-indent line-spacing="2"}
+::: {#ref-averroes/hercz .csl-entry}
+Averroes. (1869). *Drei Abhandlungen über die Conjunction des separaten
+Intellects mit dem Menschen: Von Averroes (Vater und Sohn), aus dem
+Arabischen übersetzt von Samuel Ibn Tibbon*. (J. Hercz, Ed. & Trans.).
+Berlin: S. Hermann.
+:::
+
+::: {#ref-averroes/hannes .csl-entry}
+Averroes. (1892). *Des Averroës Abhandlung: "Über die Möglichkeit der
+Conjunktion" oder "Über den materiellen Intellekt"*. (L. Hannes, Ed. &
+Trans.). Halle an der Saale: C. A. Kaemmerer.
+:::
+
+::: {#ref-averroes/bland .csl-entry}
+Averroes. (1982). *The epistle on the possibility of conjunction with
+the active intellect by Ibn Rushd with the commentary of Moses Narboni*.
+(K. P. Bland, Ed. & Trans.). New York: Jewish Theological Seminary of
+America.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-13.md b/test/command/pandoc-citeproc-13.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-13.md
@@ -0,0 +1,29 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: 'command/chicago-note-bibliography.csl'
+references:
+- author:
+    family: Author
+    given:
+    - Ann
+  container-title: Journal
+  id: item1
+  issued:
+  - year: 2011
+  title: Title
+  type: 'article-newspaper'
+---
+
+Foo [@item1].
+^D
+Foo.[^1]
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-item1 .csl-entry}
+Author, Ann. "Title." *Journal*, 2011.
+:::
+:::
+
+[^1]: Author, "Title."
+```
diff --git a/test/command/pandoc-citeproc-136.md b/test/command/pandoc-citeproc-136.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-136.md
@@ -0,0 +1,23 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- id: stanze
+  type: book
+  issued:
+  - year: 1547
+  title: Stanze in lode della donna brutta
+  publisher-place: Florence
+  language: it-IT
+...
+
+@stanze is an anoynymous work.
+^D
+*Stanze in lode della donna brutta* (1547) is an anoynymous work.
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-stanze .csl-entry}
+*Stanze in lode della donna brutta*. 1547. Florence.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-14.md b/test/command/pandoc-citeproc-14.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-14.md
@@ -0,0 +1,78 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- author:
+    family: Pelikan
+    given: Jaroslav
+  container-title: 'The Christian tradition: A history of the
+    development of doctrine'
+  id: CTv1c2
+  issued:
+  - year: 1971
+  language: 'en-US'
+  page: '34-56'
+  publisher: University of Chicago Press
+  publisher-place: Chicago
+  title: Chapter two
+  type: chapter
+  volume: 1
+  volume-title: 'The emergence of the Catholic tradition (100--600)'
+- author:
+    family: Pelikan
+    given: Jaroslav
+  container-title: 'The Christian tradition: A history of the
+    development of doctrine'
+  id: CTv1
+  issued:
+  - year: 1971
+  language: 'en-US'
+  publisher: University of Chicago Press
+  publisher-place: Chicago
+  title: 'The emergence of the Catholic tradition (100--600)'
+  type: book
+  volume: 1
+- author:
+    family: Pelikan
+    given: Jaroslav
+  id: CT
+  issued:
+  - year: 1971
+  language: 'en-US'
+  publisher: University of Chicago Press
+  publisher-place: Chicago
+  title: 'The Christian tradition: A history of the development of
+    doctrine'
+  type: book
+---
+
+Foo [@CT, 1:12]. Bar [@CTv1, 12]. Baz [@CTv1c2, 12].
+
+References {#references .unnumbered}
+==========
+^D
+Foo (Pelikan 1971b, 1:12). Bar (Pelikan 1971c, 1:12). Baz (Pelikan
+1971a, 12).
+
+References {#references .unnumbered}
+==========
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-CTv1c2 .csl-entry}
+Pelikan, Jaroslav. 1971a. "Chapter Two." In *The Christian Tradition: A
+History of the Development of Doctrine*, 1:34--56. Chicago: University
+of Chicago Press.
+:::
+
+::: {#ref-CT .csl-entry}
+---------. 1971b. *The Christian Tradition: A History of the Development
+of Doctrine*. Chicago: University of Chicago Press.
+:::
+
+::: {#ref-CTv1 .csl-entry}
+---------. 1971c. *The Emergence of the Catholic Tradition (100--600)*.
+*The Christian Tradition: A History of the Development of Doctrine*.
+Vol. 1. Chicago: University of Chicago Press.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-152.md b/test/command/pandoc-citeproc-152.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-152.md
@@ -0,0 +1,65 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: command/apa.csl
+references:
+- URL: 'http://geekfeminism.wikia.com/wiki/Geek_Feminism'
+  accessed:
+    day: 10
+    month: 4
+    year: 2013
+  container-title: Geek Feminism
+  custom2: ok.mm
+  id: Feminism2013gf
+  issued:
+    day: 10
+    month: 4
+    year: 2013
+  keyword: gender
+  title: Geek Feminism
+  type: webpage
+- URL: 'http://geekfeminism.wikia.com/wiki/Category:Communities'
+  accessed:
+    day: 19
+    month: 10
+    year: 2011
+  container-title: Geek Feminism
+  custom2: gender.mm
+  id: Feminism2011ces
+  issued:
+    day: 14
+    month: 8
+    year: 2011
+  keyword: gender
+  title: Communities
+  type: 'entry-encyclopedia'
+---
+
+Test
+====
+
+I have two citations [@Feminism2013gf; @Feminism2011ces].
+
+References
+==========
+^D
+Test
+====
+
+I have two citations ("Communities," 2011; "Geek Feminism," 2013).
+
+References {#references .unnumbered}
+==========
+
+::: {#refs .references .csl-bib-body .hanging-indent line-spacing="2"}
+::: {#ref-Feminism2011ces .csl-entry}
+Communities. (2011, August 14). In *Geek Feminism*. Retrieved from
+<http://geekfeminism.wikia.com/wiki/Category:Communities>
+:::
+
+::: {#ref-Feminism2013gf .csl-entry}
+Geek Feminism. (2013, April 10). *Geek Feminism*. Retrieved April 10,
+2013, from <http://geekfeminism.wikia.com/wiki/Geek_Feminism>
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-160.md b/test/command/pandoc-citeproc-160.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-160.md
@@ -0,0 +1,46 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: command/issue160.csl
+references:
+- author:
+  - family: Doe
+    given: Jane
+  citation-label: Jane11
+  id: item1
+  issued:
+    year: 2011
+  title: A book
+  type: book
+---
+
+No citation-label
+-----------------
+
+Foo [@item1].
+
+Expected
+--------
+
+> Foo \[Jane11\].
+>
+> \[Jane11\] Jane Doe. A book. 2011.
+^D
+No citation-label
+-----------------
+
+Foo \[Jane11\].
+
+Expected
+--------
+
+> Foo \[Jane11\].
+>
+> \[Jane11\] Jane Doe. A book. 2011.
+
+::: {#refs .references .csl-bib-body}
+::: {#ref-item1 .csl-entry}
+\[Jane11\] Jane Doe. A book. 2011.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-175.md b/test/command/pandoc-citeproc-175.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-175.md
@@ -0,0 +1,45 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- author:
+  - family: Doe
+    given: Jane
+  container-title: A magazine
+  id: item1
+  issued:
+  - month: 1
+    year: 2011
+  - month: 2
+    year: 2011
+  page: '33-44'
+  title: A title
+  type: 'article-magazine'
+---
+
+Missing en-dash between months
+------------------------------
+
+Foo [@item1].
+
+Expected
+--------
+
+> Doe, Jane. 2011. "A Title." *A Magazine*, January--February.
+^D
+Missing en-dash between months
+------------------------------
+
+Foo (Doe 2011).
+
+Expected
+--------
+
+> Doe, Jane. 2011. "A Title." *A Magazine*, January--February.
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-item1 .csl-entry}
+Doe, Jane. 2011. "A Title." *A Magazine*, January--February 2011.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-197.md b/test/command/pandoc-citeproc-197.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-197.md
@@ -0,0 +1,31 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: 'command/chicago-fullnote-bibliography.csl'
+nocite: '@test'
+references:
+- editor:
+  - family: Abelard
+    given: Peter
+  id: test
+  issued:
+    date-parts:
+    - - 1989
+  publisher: Clarendon Press
+  publisher-place: Oxford
+  title: Test
+  type: book
+---
+
+This is a test [@test].
+^D
+This is a test.[^1]
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-test .csl-entry}
+Abelard, Peter, ed. *Test*. Oxford: Clarendon Press, 1989.
+:::
+:::
+
+[^1]: Peter Abelard, ed., *Test* (Oxford: Clarendon Press, 1989).
+```
diff --git a/test/command/pandoc-citeproc-213.md b/test/command/pandoc-citeproc-213.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-213.md
@@ -0,0 +1,34 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: 'command/harvard-university-of-kent.csl'
+references:
+- author:
+  - family: Doe
+    given: Ann
+  collection-title: The collection title
+  dimensions: 789 pp.
+  id: doe1
+  issued:
+  - year: 1999
+  publisher: The publisher
+  title: Title
+  type: book
+---
+
+Foo [@doe1].
+
+References {#references .unnumbered}
+==========
+^D
+Foo (Doe 1999).
+
+References {#references .unnumbered}
+==========
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-doe1 .csl-entry}
+Doe, A. (1999). *Title*. The collection title. The publisher. 789 pp.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-25.md b/test/command/pandoc-citeproc-25.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-25.md
@@ -0,0 +1,31 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- author:
+  - family: Author
+    given: Al
+  id: item1
+  issued:
+    date-parts:
+    - - 1998
+  title: 'foo bar baz: bazbaz foo'
+  type: 'article-journal'
+---
+
+Foo [@item1].
+
+References {#references .unnumbered}
+==========
+^D
+Foo (Author 1998).
+
+References {#references .unnumbered}
+==========
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-item1 .csl-entry}
+Author, Al. 1998. "Foo Bar Baz: Bazbaz Foo."
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-250.md b/test/command/pandoc-citeproc-250.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-250.md
@@ -0,0 +1,21 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+link-citations: true
+references:
+- author:
+    family: Doe
+  id: doe
+  title: Title
+---
+
+[@doe]
+^D
+([Doe, n.d.](#ref-doe))
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-doe .csl-entry}
+Doe. n.d. "Title."
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-27.md b/test/command/pandoc-citeproc-27.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-27.md
@@ -0,0 +1,39 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: command/science.csl
+references:
+- author:
+  - family: AuthorOne
+    given: Joe
+  - family: AuthorTwo
+    given: Jill
+  container-title: Some Journal
+  id: AuthorOne2014
+  issue: X
+  issued:
+    date-parts:
+    - - 2014
+  page: 'XXXX-YYYY'
+  title: Sample Title
+  type: 'article-journal'
+  volume: XX
+---
+
+Minimal example
+===============
+
+Here is some text that needs a citation [@AuthorOne2014].
+^D
+Minimal example
+===============
+
+Here is some text that needs a citation (*1*).
+
+::: {#refs .references .csl-bib-body}
+::: {#ref-AuthorOne2014 .csl-entry}
+[1. ]{.csl-left-margin}[J. AuthorOne, J. AuthorTwo, *Some Journal*, in
+press.]{.csl-right-inline}
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-292.md b/test/command/pandoc-citeproc-292.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-292.md
@@ -0,0 +1,43 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: 'command/sage-harvard.csl'
+references:
+- author:
+    family: Doe
+  id: doe
+  issued:
+    year: 2007
+  type: article
+- author:
+    family: Zoe
+  id: zoe
+  issued:
+  - year: 2009
+  type: article
+- author:
+    family: Roe
+  id: roe
+  issued:
+  - year: 2007
+  type: article
+---
+
+[@zoe; @roe; see for comparison @doe, p. 3]
+^D
+(Roe, 2007; Zoe, 2009; see for comparison Doe, 2007: 3)
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-doe .csl-entry}
+Doe (2007).
+:::
+
+::: {#ref-roe .csl-entry}
+Roe (2007).
+:::
+
+::: {#ref-zoe .csl-entry}
+Zoe (2009).
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-301.md b/test/command/pandoc-citeproc-301.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-301.md
@@ -0,0 +1,25 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- id: test
+  title: Essays presented to N.R. Ker (On Art)
+- id: test2
+  title: '*Test:* An experiment: An abridgement'
+---
+
+@test; @test2
+^D
+"Essays Presented to N.R. Ker (On Art)" (n.d.); "*Test:* An Experiment:
+An Abridgement" (n.d.)
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-test .csl-entry}
+"Essays Presented to N.R. Ker (On Art)." n.d.
+:::
+
+::: {#ref-test2 .csl-entry}
+"*Test:* An Experiment: An Abridgement." n.d.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-307.md b/test/command/pandoc-citeproc-307.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-307.md
@@ -0,0 +1,31 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+lang: 'fr-FR'
+references:
+- author:
+  - family: Bazin
+    given: André
+  container-title: Cahiers du cinéma
+  id: bazin_cybernetique_1954
+  issue: 36
+  issued:
+    date-parts:
+    - - 1954
+      - 6
+  page: '22-27'
+  title: 'La Cybernétique d''André Cayatte'
+  type: 'article-journal'
+---
+
+Bonjour[@bazin_cybernetique_1954] !
+^D
+Bonjour(Bazin 1954) !
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-bazin_cybernetique_1954 .csl-entry}
+Bazin, André. 1954. « La Cybernétique d'André Cayatte ». *Cahiers du
+cinéma*, nᵒ 36 (juin): 22‑27.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-31.md b/test/command/pandoc-citeproc-31.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-31.md
@@ -0,0 +1,48 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: command/oscola.csl
+references:
+- DOI: 10.1086/504343
+  author:
+  - family: Olson
+    given: Hope A.
+  container-title: Library Quarterly
+  id: item1
+  issue: 1
+  issued:
+    date-parts:
+    - - 2006
+  page: '19-35'
+  title: 'Codes, costs, and critiques: The organization of information
+    in *Library Quarterly*, 1931--2004'
+  title-short: 'Codes, costs, and critiques'
+  type: 'article-magazine'
+  volume: 76
+- id: item2
+  title: Second title
+---
+
+Foo [@item1]. Bar [@item2]. Baz [@item1].
+^D
+Foo.[^1] Bar.[^2] Baz.[^3]
+
+::: {#refs .references .csl-bib-body}
+::: {#ref-item1 .csl-entry}
+Olson HA, 'Codes, Costs, and Critiques: The Organization of Information
+in *Library Quarterly*, 1931--2004' (2006) 76 *Library Quarterly* 19
+:::
+
+::: {#ref-item2 .csl-entry}
+'Second Title'
+:::
+:::
+
+[^1]: Hope A Olson, 'Codes, Costs, and Critiques: The Organization of
+    Information in *Library Quarterly*, 1931--2004' (2006) 76 *Library
+    Quarterly* 19.
+
+[^2]: 'Second Title'.
+
+[^3]: Olson (n 1).
+```
diff --git a/test/command/pandoc-citeproc-312.md b/test/command/pandoc-citeproc-312.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-312.md
@@ -0,0 +1,171 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: command/apa.csl
+nocite: '@*'
+references:
+- author:
+  - literal: NN
+  id: Y
+  issued:
+  - year: 1950
+  title: 'Date: Year'
+  title-short: Date
+  type: webpage
+- author:
+  - literal: NN
+  id: Y/Y
+  issued:
+  - year: 1951
+  - year: 1952
+  title: 'Date range: Year'
+  title-short: Date range
+  type: webpage
+- author:
+  - literal: NN
+  id: YM
+  issued:
+  - month: 1
+    year: 1953
+  title: 'Date: Year+month'
+  title-short: Date
+  type: webpage
+- author:
+  - literal: NN
+  id: YM/YM
+  issued:
+  - month: 1
+    year: 1954
+  - month: 2
+    year: 1955
+  title: 'Date range: Year+month'
+  title-short: Date range
+  type: webpage
+- author:
+  - literal: NN
+  id: YM/YM_same
+  issued:
+  - month: 1
+    year: 1956
+  - month: 2
+    year: 1956
+  title: 'Date range: Year+month, same year'
+  title-short: Date range
+  type: webpage
+- author:
+  - literal: NN
+  id: YMD
+  issued:
+  - day: 15
+    month: 1
+    year: 1958
+  title: 'Date: Year+month+day'
+  title-short: Date
+  type: webpage
+- author:
+  - literal: NN
+  id: YMD/YMD
+  issued:
+  - day: 15
+    month: 1
+    year: 1959
+  - day: 16
+    month: 2
+    year: 1960
+  title: 'Date range: Year+month+day'
+  title-short: Date range
+  type: webpage
+- author:
+  - literal: NN
+  id: YMD/YMD_same
+  issued:
+  - day: 15
+    month: 1
+    year: 1961
+  - day: 16
+    month: 1
+    year: 1962
+  title: 'Date range: Year+month+day, same month'
+  title-short: Date range
+  type: webpage
+- author:
+  - literal: NN
+  id: YS
+  issued:
+  - season: 3
+    year: 1963
+  title: 'Date: Year+season'
+  title-short: Date
+  type: webpage
+- author:
+  - literal: NN
+  id: YS/YS
+  issued:
+  - season: 1
+    year: 1964
+  - season: 4
+    year: 1965
+  title: 'Date range: Year+season'
+  title-short: Date range
+  type: webpage
+- author:
+  - literal: NN
+  id: YS/YS_same
+  issued:
+  - season: 2
+    year: 1966
+  - season: 4
+    year: 1966
+  title: 'Date range: Year+season, same year'
+  title-short: Date range
+  type: webpage
+---
+
+^D
+::: {#refs .references .csl-bib-body .hanging-indent line-spacing="2"}
+::: {#ref-Y .csl-entry}
+NN. (1950). Date: Year.
+:::
+
+::: {#ref-Y/Y .csl-entry}
+NN. (1951--1952). Date range: Year.
+:::
+
+::: {#ref-YM .csl-entry}
+NN. (1953, January). Date: Year+month.
+:::
+
+::: {#ref-YM/YM .csl-entry}
+NN. (1954--1955, January--February). Date range: Year+month.
+:::
+
+::: {#ref-YM/YM_same .csl-entry}
+NN. (1956, January--February). Date range: Year+month, same year.
+:::
+
+::: {#ref-YMD .csl-entry}
+NN. (1958, January 15). Date: Year+month+day.
+:::
+
+::: {#ref-YMD/YMD .csl-entry}
+NN. (1959--1960, January 15--February 16). Date range: Year+month+day.
+:::
+
+::: {#ref-YMD/YMD_same .csl-entry}
+NN. (1961--1962, January 15--16). Date range: Year+month+day, same
+month.
+:::
+
+::: {#ref-YS .csl-entry}
+NN. (1963, Autumn). Date: Year+season.
+:::
+
+::: {#ref-YS/YS .csl-entry}
+NN. (1964--1965, Spring--Winter). Date range: Year+season.
+:::
+
+::: {#ref-YS/YS_same .csl-entry}
+NN. (1966, Summer--Winter). Date range: Year+season, same year.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-320.md b/test/command/pandoc-citeproc-320.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-320.md
@@ -0,0 +1,254 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: command/apa.csl
+references:
+- author:
+  - family: Benjamin
+    given: A. S.
+  id: itemA1
+- author:
+  - family: Yaakov
+    given: D.
+    non-dropping-particle: ben
+  id: itemA2
+- author:
+  - family: Brown
+    given: J. R.
+  id: itemA3
+- author:
+  - family: Browning
+    given: A. R.
+  id: itemA4
+- author:
+  - family: Girard
+    given: 'J.-B.'
+  id: itemA5
+- author:
+  - family: 'Girard-Perregaux'
+    given: A. S.
+  id: itemA6
+- author:
+  - family: Ibn Abdulaziz
+    given: T.
+  id: itemA7
+- author:
+  - family: Ibn Nidal
+    given: A. K. M.
+  id: itemA8
+- author:
+  - family: López
+    given: M. E.
+  id: itemA9
+- author:
+  - family: López de Molina
+    given: G.
+  id: itemA10
+- author:
+  - family: Singh
+    given: Y.
+  id: itemA11
+- author:
+  - family: Singh Siddhu
+    given: N.
+  id: itemA12
+- author:
+  - family: Villafuerte
+    given: S. A.
+  id: itemA13
+- author:
+  - family: 'Villa-Lobos'
+    given: J.
+  id: itemA14
+- author:
+  - family: Macalister
+    given: Donald
+  id: itemB1
+- author:
+  - family: MacAlister
+    given: Paul
+  id: itemB2
+- author:
+  - family: Macauley
+    given: Catharine
+  id: itemB3
+- author:
+  - family: Macmillan
+    given: Harold
+  id: itemB4
+- author:
+  - family: Madison
+    given: James
+  id: itemB5
+- author:
+  - family: McAllister
+    given: Ward
+  id: itemB6
+- author:
+  - family: McAuley
+    given: Catherine
+  id: itemB7
+- author:
+  - family: McMillan
+    given: Edwin M.
+  id: itemB8
+- author:
+  - family: 'Sainte-Beuve'
+    given: 'Charles-Augustin'
+  id: itemC1
+- author:
+  - family: 'Saint-Gaudens'
+    given: Augustus
+  id: itemC2
+- author:
+  - family: 'Saint-Saëns'
+    given: Camille
+  id: itemC3
+- author:
+  - dropping-particle: de
+    family: San Martin
+    given: José
+  id: itemC4
+- author:
+  - family: St. Denis
+    given: Ruth
+  id: itemC5
+- author:
+  - family: St. Laurent
+    given: Louis Stephen
+  id: itemC6
+---
+
+Foo
+[@itemA1; @itemA2; @itemA3; @itemA4; @itemA5; @itemA6; @itemA7; @itemA8; @itemA9; @itemA10; @itemA11; @itemA12; @itemA13; @itemA14].
+
+Foo
+[@itemB1; @itemB2; @itemB3; @itemB4; @itemB5; @itemB6; @itemB7; @itemB8].
+
+Foo [@itemC1; @itemC2; @itemC3; @itemC4; @itemC5; @itemC6].
+^D
+Foo (ben Yaakov, n.d.; Benjamin, n.d.; Brown, n.d.; Browning, n.d.;
+Girard, n.d.; Girard-Perregaux, n.d.; Ibn Abdulaziz, n.d.; Ibn Nidal,
+n.d.; López de Molina, n.d.; López, n.d.; Singh Siddhu, n.d.; Singh,
+n.d.; Villafuerte, n.d.; Villa-Lobos, n.d.).
+
+Foo (Macalister, n.d.; MacAlister, n.d.; Macauley, n.d.; Macmillan,
+n.d.; Madison, n.d.; McAllister, n.d.; McAuley, n.d.; McMillan, n.d.).
+
+Foo (Sainte-Beuve, n.d.; Saint-Gaudens, n.d.; Saint-Saëns, n.d.; San
+Martin, n.d.; St. Denis, n.d.; St. Laurent, n.d.).
+
+::: {#refs .references .csl-bib-body .hanging-indent line-spacing="2"}
+::: {#ref-itemA2 .csl-entry}
+ben Yaakov, D. (n.d.).
+:::
+
+::: {#ref-itemA1 .csl-entry}
+Benjamin, A. S. (n.d.).
+:::
+
+::: {#ref-itemA3 .csl-entry}
+Brown, J. R. (n.d.).
+:::
+
+::: {#ref-itemA4 .csl-entry}
+Browning, A. R. (n.d.).
+:::
+
+::: {#ref-itemA5 .csl-entry}
+Girard, J.-B. (n.d.).
+:::
+
+::: {#ref-itemA6 .csl-entry}
+Girard-Perregaux, A. S. (n.d.).
+:::
+
+::: {#ref-itemA7 .csl-entry}
+Ibn Abdulaziz, T. (n.d.).
+:::
+
+::: {#ref-itemA8 .csl-entry}
+Ibn Nidal, A. K. M. (n.d.).
+:::
+
+::: {#ref-itemA10 .csl-entry}
+López de Molina, G. (n.d.).
+:::
+
+::: {#ref-itemA9 .csl-entry}
+López, M. E. (n.d.).
+:::
+
+::: {#ref-itemB1 .csl-entry}
+Macalister, D. (n.d.).
+:::
+
+::: {#ref-itemB2 .csl-entry}
+MacAlister, P. (n.d.).
+:::
+
+::: {#ref-itemB3 .csl-entry}
+Macauley, C. (n.d.).
+:::
+
+::: {#ref-itemB4 .csl-entry}
+Macmillan, H. (n.d.).
+:::
+
+::: {#ref-itemB5 .csl-entry}
+Madison, J. (n.d.).
+:::
+
+::: {#ref-itemB6 .csl-entry}
+McAllister, W. (n.d.).
+:::
+
+::: {#ref-itemB7 .csl-entry}
+McAuley, C. (n.d.).
+:::
+
+::: {#ref-itemB8 .csl-entry}
+McMillan, E. M. (n.d.).
+:::
+
+::: {#ref-itemC1 .csl-entry}
+Sainte-Beuve, C.-A. (n.d.).
+:::
+
+::: {#ref-itemC2 .csl-entry}
+Saint-Gaudens, A. (n.d.).
+:::
+
+::: {#ref-itemC3 .csl-entry}
+Saint-Saëns, C. (n.d.).
+:::
+
+::: {#ref-itemC4 .csl-entry}
+San Martin, J. de. (n.d.).
+:::
+
+::: {#ref-itemA12 .csl-entry}
+Singh Siddhu, N. (n.d.).
+:::
+
+::: {#ref-itemA11 .csl-entry}
+Singh, Y. (n.d.).
+:::
+
+::: {#ref-itemC5 .csl-entry}
+St. Denis, R. (n.d.).
+:::
+
+::: {#ref-itemC6 .csl-entry}
+St. Laurent, L. S. (n.d.).
+:::
+
+::: {#ref-itemA13 .csl-entry}
+Villafuerte, S. A. (n.d.).
+:::
+
+::: {#ref-itemA14 .csl-entry}
+Villa-Lobos, J. (n.d.).
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-320a.md b/test/command/pandoc-citeproc-320a.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-320a.md
@@ -0,0 +1,87 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- author:
+  - family: ʾUdhrī
+    given: Jamīl
+    non-dropping-particle: 'al-'
+    note: ayn
+  id: item1
+- author:
+  - family: ʿUdhrī
+    given: Jamīl
+    non-dropping-particle: 'al-'
+    note: hamza
+  id: item2
+- author:
+  - family: '\''Udhrī'
+    given: Jamīl
+    non-dropping-particle: 'al-'
+    note: straight apostrophe
+  id: item3
+- author:
+  - family: '‘Udhrī'
+    given: Jamīl
+    non-dropping-particle: 'al-'
+    note: inverted apostrophe = opening single curly quote (for ayn)
+  id: item4
+- author:
+  - family: '’Udhrī'
+    given: Jamīl
+    non-dropping-particle: 'al-'
+    note: apostrophe = closing single curly quote (for hamza)
+  id: item5
+- author:
+  - family: Uch
+    given: Ann
+  id: item6
+- author:
+  - family: Uebel
+    given: Joe
+  id: item7
+- author:
+  - family: Zzz
+    given: Zoe
+  id: item8
+---
+
+Foo [@item1; @item2; @item3; @item4; @item5; @item6; @item7; @item8].
+^D
+Foo (al-ʾUdhrī, n.d.; al-ʿUdhrī, n.d.; al-\'Udhrī, n.d.; al-'Udhrī,
+n.d.; al-'Udhrī, n.d.; Uch, n.d.; Uebel, n.d.; Zzz, n.d.).
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-item6 .csl-entry}
+Uch, Ann. n.d.
+:::
+
+::: {#ref-item1 .csl-entry}
+ʾUdhrī, Jamīl al-. n.d.
+:::
+
+::: {#ref-item2 .csl-entry}
+ʿUdhrī, Jamīl al-. n.d.
+:::
+
+::: {#ref-item3 .csl-entry}
+\'Udhrī, Jamīl al-. n.d.
+:::
+
+::: {#ref-item4 .csl-entry}
+'Udhrī, Jamīl al-. n.d.
+:::
+
+::: {#ref-item5 .csl-entry}
+'Udhrī, Jamīl al-. n.d.
+:::
+
+::: {#ref-item7 .csl-entry}
+Uebel, Joe. n.d.
+:::
+
+::: {#ref-item8 .csl-entry}
+Zzz, Zoe. n.d.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-322.md b/test/command/pandoc-citeproc-322.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-322.md
@@ -0,0 +1,35 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: command/annales.csl
+references:
+- author:
+  - family: Timmory
+    given: François
+  container-title: 'L''Écran français'
+  id: timmory\_\_justice_1950
+  issue: 272
+  issued:
+  - day: 25
+    month: 9
+    year: 1950
+  language: 'fr-FR'
+  page: 12
+  title: '*Justice est faite* : soyons justes'
+  type: 'article-journal'
+---
+
+Foo[@timmory__justice_1950].
+^D
+Foo.[^1]
+
+::: {#refs .references .csl-bib-body}
+::: {#ref-timmory__justice_1950 .csl-entry}
+François [Timmory]{.smallcaps}, « *Justice est faite* : soyons justes »,
+*L'Écran français*, 1950, nᵒ 272, p. 12.
+:::
+:::
+
+[^1]: François [Timmory]{.smallcaps}, « *Justice est faite* : soyons
+    justes », *L'Écran français*, 1950, nᵒ 272, p. 12.
+```
diff --git a/test/command/pandoc-citeproc-325.md b/test/command/pandoc-citeproc-325.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-325.md
@@ -0,0 +1,30 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- author:
+  - family: Smith
+    given: John
+  id: item1
+  type: book
+- author:
+  - family: Smith
+    given: John
+  id: item2
+  type: book
+---
+
+[@item1; @item2]
+^D
+(Smith, n.d.a, n.d.b)
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-item1 .csl-entry}
+Smith, John. n.d.a.
+:::
+
+::: {#ref-item2 .csl-entry}
+---------. n.d.b.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-327.md b/test/command/pandoc-citeproc-327.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-327.md
@@ -0,0 +1,51 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: 'command/chinese-gb7714-2005-numeric.csl'
+references:
+- ISSN: '1003-1111'
+  URL: 'http://kns.cnki.net/kns/detail/detail.aspx?QueryID=4&CurRec=4&recid=&FileName=CHAN201706006&DbName=CJFDLAST2018&DbCode=CJFQ&yx=Y&pr=&URLID=21.1110.S.20171129.1725.006'
+  abstract: '为了解辽东湾海域底栖动物次级生产力水平和时空分布特点,根据2007年的4月和10月辽东湾海域大型底栖动物调查数据,运用Brey经验公式计算大型底栖动物次级生产力和P/B值,并结合海洋生物指数方法对辽东湾海域进行生境适宜性评价。分析结果表明,该海域大型底栖动物年平均次级生产力为5.59g/(m\~2·年),年平均P/B值为3.16,辽东湾大型底栖动物次级生产力空间分布呈现出自沿岸向中部递增的趋势,P/B值空间分布与底栖动物次级生产力相反,呈现出自沿岸向中部递减的趋势,群落组成中以个体小、生活史短、代谢快的底栖动物为主。'
+  accessed:
+  - day: 27
+    month: 3
+    year: 2018
+  author:
+  - family: 李
+    given: 轶平
+  - family: 于
+    given: 旭光
+  - family: 孙
+    given: 明
+  - family: 郭
+    given: 栋
+  - family: 段
+    given: 妍
+  - family: 董
+    given: 婧
+  container-title: 水产科学
+  id: LiLiaoDongWanHaiYuDiQiDongWuCiJiShengChanLiYanJiuJiShengJingGuaYiXingPingJie2017
+  issue: 06
+  issued:
+  - year: 2017
+  keyword: '次级生产力,大型底栖动物,海洋生物指数方法,AMBI,macrozoobenthos,P/B
+    value,P/B值,secondary productivity'
+  language: 中文;
+  page: '728-734'
+  title: 辽东湾海域底栖动物次级生产力研究及生境适宜性评价
+  type: 'article-journal'
+---
+
+I referenced something here
+[@LiLiaoDongWanHaiYuDiQiDongWuCiJiShengChanLiYanJiuJiShengJingGuaYiXingPingJie2017]
+^D
+I referenced something here^\[1\]^
+
+::: {#refs .references .csl-bib-body}
+::: {#ref-LiLiaoDongWanHaiYuDiQiDongWuCiJiShengChanLiYanJiuJiShengJingGuaYiXingPingJie2017 .csl-entry}
+[\[1\] ]{.csl-left-margin}[李轶平, 于旭光, 孙明, 等.
+辽东湾海域底栖动物次级生产力研究及生境适宜性评价\[J\]. 水产科学,
+2017(06): 728--734.]{.csl-right-inline}
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-338.md b/test/command/pandoc-citeproc-338.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-338.md
@@ -0,0 +1,35 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: 'command/din-1505-2.csl'
+lang: de
+nocite: '@*'
+pagetitle: Citation
+references:
+- ISBN: '978-3-642-32078-1'
+  author:
+  - family: Wolfinger
+    given: Christine
+  edition: '11., vollst. überarb. Aufl.'
+  id: 'item-1'
+  issued:
+  - year: 2013
+  keyword: UNIX; LINUX
+  number-of-pages: 'XVIII, 529 S. : Ill., graph. Darst.'
+  publisher: Springer Vieweg
+  publisher-place: 'Berlin \[u.a.\]'
+  title: 'Keine Angst vor Linux, Unix: ein Lehrbuch für Linux- und
+    Unix-Anwender'
+  type: book
+---
+
+^D
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-item-1 .csl-entry}
+[Wolfinger, Christine]{.smallcaps}: *Keine Angst vor Linux, Unix: ein
+Lehrbuch für Linux- und Unix-Anwender*. 11., vollst. überarb. Aufl.
+Aufl. Berlin \[u.a.\] : Springer Vieweg, 2013
+--- ISBN [978-3-642-32078-1](https://worldcat.org/isbn/978-3-642-32078-1)
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-351.md b/test/command/pandoc-citeproc-351.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-351.md
@@ -0,0 +1,27 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: 'command/zeitschrift-fur-kunstgeschichte.csl'
+references:
+- editor:
+  - family: Nietzsche
+    given: Friedrich
+  id: Nie72
+  issued:
+  - year: 1872
+  title: Die geburt
+  type: book
+---
+
+@Nie72
+^D
+Friedrich Nietzsche (ed.)[^1]
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-Nie72 .csl-entry}
+Nietzsche, Friedrich (ed.), *Die geburt*, 1872.
+:::
+:::
+
+[^1]: *Die geburt*, 1872.
+```
diff --git a/test/command/pandoc-citeproc-356.md b/test/command/pandoc-citeproc-356.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-356.md
@@ -0,0 +1,25 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- author:
+  - family: Alice
+  id: foo
+  issued:
+  - year: 2042
+  other-ids:
+  - bar
+  - doz
+  type: book
+---
+
+[@bar]
+^D
+(Alice 2042)
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-foo .csl-entry}
+Alice. 2042.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-360.md b/test/command/pandoc-citeproc-360.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-360.md
@@ -0,0 +1,35 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: 'command/chicago-fullnote-bibliography.csl'
+references:
+- author:
+  - family: 'L''Estrange'
+    given: Michael
+  - family: Merchant
+    given: Stephen
+  id: lestrange2017
+  issued:
+  - day: 18
+    month: 7
+    year: 2017
+  language: 'en-US'
+  title: 2017 Independent Intelligence Review
+  title-short: Independent Intelligence Review
+  type: report
+---
+
+[@lestrange2017]
+^D
+[^1]
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-lestrange2017 .csl-entry}
+L'Estrange, Michael, and Stephen Merchant. "2017 Independent
+Intelligence Review," July 18, 2017.
+:::
+:::
+
+[^1]: Michael L'Estrange and Stephen Merchant, "2017 Independent
+    Intelligence Review," July 18, 2017.
+```
diff --git a/test/command/pandoc-citeproc-361.md b/test/command/pandoc-citeproc-361.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-361.md
@@ -0,0 +1,80 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: command/locators.csl
+references:
+- id: citekey
+  title: Title
+  type: 'article-journal'
+- id: other
+  title: Other
+  type: 'article-journal'
+suppress-bibliography: true
+---
+
+Content[@citekey]
+
+Content[@citekey, 1]
+
+Content[@citekey, 2]
+
+Content[@citekey, 2]
+
+Content[@citekey 2]
+
+Content[@citekey, p. 2]
+
+Content[@citekey p. 2]
+
+Content[@citekey]
+
+Content[@other]
+
+Content[@citekey, 3]
+
+Content[@citekey, 3]
+^D
+Content[^1]
+
+Content[^2]
+
+Content[^3]
+
+Content[^4]
+
+Content[^5]
+
+Content[^6]
+
+Content[^7]
+
+Content[^8]
+
+Content[^9]
+
+Content[^10]
+
+Content[^11]
+
+[^1]: Title.
+
+[^2]: Ibid-with-locator {1}.
+
+[^3]: Ibid-with-locator {2}.
+
+[^4]: Ibid.
+
+[^5]: Ibid.
+
+[^6]: Ibid.
+
+[^7]: Ibid.
+
+[^8]: Subsequent.
+
+[^9]: Other.
+
+[^10]: Subsequent {3}.
+
+[^11]: Ibid.
+```
diff --git a/test/command/pandoc-citeproc-365.md b/test/command/pandoc-citeproc-365.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-365.md
@@ -0,0 +1,39 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: 'command/le-tapuscrit-note.csl'
+references:
+- ISBN: '978-2-912573-52-0'
+  author:
+  - family: Le Gras
+    given: Gwénaëlle
+  call-number: 'Tolbiac - Rez de Jardin - Littérature et art - Magasin -
+    2010-82178'
+  collection-title: 'Jeux d''acteurs'
+  id: legras_michel_2010
+  issued:
+  - year: 2010
+  language: fre
+  number-of-pages: 128
+  publisher: Scope
+  publisher-place: Paris
+  source: 'BnF Catalogue général (http://catalogue.bnf.fr)'
+  title: 'Michel Simon : l''art de la disgrâce'
+  title-short: Michel Simon
+  type: book
+---
+
+Foo [@legras_michel_2010].
+^D
+Foo.[^1]
+
+::: {#refs .references .csl-bib-body}
+::: {#ref-legras_michel_2010 .csl-entry}
+[Le Gras]{.smallcaps} Gwénaëlle, *Michel Simon : l'art de la disgrâce*,
+Paris, Scope (coll. « Jeux d'acteurs »), 2010, 128 p.
+:::
+:::
+
+[^1]: Gwénaëlle Le Gras, *Michel Simon : l'art de la disgrâce*, Paris,
+    Scope, 2010, 128 p.
+```
diff --git a/test/command/pandoc-citeproc-371.md b/test/command/pandoc-citeproc-371.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-371.md
@@ -0,0 +1,41 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- author:
+  - family: Doe
+    given: Jane
+  id: item1
+  status: in press
+  title: Title one
+  type: book
+- author:
+  - family: Doe
+    given: Jane
+  id: item2
+  issued:
+  - year: 2018
+  title: Title two
+  type: book
+---
+
+Foo [@item2; @item1].
+
+References {#references .unnumbered}
+==========
+^D
+Foo (Doe 2018, in press).
+
+References {#references .unnumbered}
+==========
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-item2 .csl-entry}
+Doe, Jane. 2018. *Title Two*.
+:::
+
+::: {#ref-item1 .csl-entry}
+---------. In press. *Title One*.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-38.md b/test/command/pandoc-citeproc-38.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-38.md
@@ -0,0 +1,29 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- author:
+  - family: Doe
+    given: Ann
+  - family: Doe
+    given: Ben
+  - family: Roe
+    given: Ron
+  id: a
+  issued:
+    date-parts:
+    - - 2007
+  title: Title
+  type: 'article-journal'
+---
+
+@a
+^D
+Doe, Doe, and Roe (2007)
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-a .csl-entry}
+Doe, Ann, Ben Doe, and Ron Roe. 2007. "Title."
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-386.md b/test/command/pandoc-citeproc-386.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-386.md
@@ -0,0 +1,35 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: 'command/advanced-optical-materials.csl'
+references:
+- DOI: 10.1038/lsa.2012.20
+  ISSN: '2047-7538'
+  author:
+  - family: Ding
+    given: K.
+  - family: Ning
+    given: C. Z.
+  container-title: Light Sci. Appl.
+  id: ding_metallic_2012
+  issue: 7
+  issued:
+  - month: 7
+    year: 2012
+  page: 'e20-e20'
+  title: 'Metallic subwavelength-cavity semiconductor nanolasers'
+  type: 'article-journal'
+  volume: 1
+---
+
+@ding_metallic_2012
+^D
+^\[1\]^
+
+::: {#refs .references .csl-bib-body line-spacing="2"}
+::: {#ref-ding_metallic_2012 .csl-entry}
+[\[1\] ]{.csl-left-margin}[K. Ding, C. Z. Ning, *Light Sci. Appl.*
+**2012**, *1*, e20.]{.csl-right-inline}
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-392.md b/test/command/pandoc-citeproc-392.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-392.md
@@ -0,0 +1,29 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: command/vancouver.csl
+references:
+- author:
+  - family: James
+    given: M.R.C.E.L.
+  id: james
+- author:
+  - family: MacFarlane
+    given: J. G.
+  id: macfarlane
+---
+
+@james; @macfarlane
+^D
+(1); (2)
+
+::: {#refs .references .csl-bib-body}
+::: {#ref-james .csl-entry}
+[1. ]{.csl-left-margin}[James MRCEL. ]{.csl-right-inline}
+:::
+
+::: {#ref-macfarlane .csl-entry}
+[2. ]{.csl-left-margin}[MacFarlane JG. ]{.csl-right-inline}
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-399.md b/test/command/pandoc-citeproc-399.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-399.md
@@ -0,0 +1,45 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: command/style399.csl
+references:
+- author:
+  - family: One
+  id: one
+- author:
+  - family: Two
+  id: two
+- author:
+  - family: Three
+  id: three
+- author:
+  - family: Four
+  id: four
+- author:
+  - family: Five
+  id: five
+- author:
+  - family: Six
+  id: six
+- author:
+  - family: Seven
+  id: seven
+- author:
+  - family: Eight
+  id: eight
+- author:
+  - family: Nine
+  id: nine
+- author:
+  - family: Ten
+  id: ten
+- author:
+  - family: Eleven
+  id: eleven
+---
+
+Inline citation
+[@one; @two; @three; @four; @five; @six; @seven; @eight; @nine; @ten; @eleven].
+^D
+Inline citation \[1,2,3,4,5,6,7,8,9,10,11\].
+```
diff --git a/test/command/pandoc-citeproc-401.md b/test/command/pandoc-citeproc-401.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-401.md
@@ -0,0 +1,59 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- id: haslanger2012SocialConstructionDebunking
+  type: chapter
+  author:
+  - family: Haslanger
+    given: Sally
+  issued:
+  - year: 2012
+  original-date:
+  - year: 2003
+  title: 'Social Construction: The ‘Debunking’ Project'
+  title-short: Social Construction
+  container-title: 'Resisting Reality: Social Construction and Social Critique'
+  publisher: Oxford University Press
+  publisher-place: Oxford
+  event-place: Oxford
+  page: 113–138
+  ISBN: 978-0-19-989262-4
+
+- id: haslanger2012FeminismMetaphysicsNegotiating
+  type: chapter
+  author:
+  - family: Haslanger
+    given: Sally
+  issued:
+  - year: 2012
+  original-date:
+  - year: 2000
+  title: 'Feminism in Metaphysics: Negotiating the Natural'
+  container-title: 'Resisting Reality: Social Construction and Social Critique'
+  publisher: Oxford University Press
+  publisher-place: Oxford
+  event-place: Oxford
+  page: 139–157
+  ISBN: 978-0-19-989262-4
+  language: en
+...
+
+Haslanger [-@haslanger2012SocialConstructionDebunking; @haslanger2012FeminismMetaphysicsNegotiating] says...
+^D
+Haslanger (\[2003\] 2012, \[2000\] 2012) says...
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-haslanger2012FeminismMetaphysicsNegotiating .csl-entry}
+Haslanger, Sally. (2000) 2012. "Feminism in Metaphysics: Negotiating the
+Natural." In *Resisting Reality: Social Construction and Social
+Critique*, 139--57. Oxford: Oxford University Press.
+:::
+
+::: {#ref-haslanger2012SocialConstructionDebunking .csl-entry}
+---------. (2003) 2012. "Social Construction: The 'Debunking' Project."
+In *Resisting Reality: Social Construction and Social Critique*,
+113--38. Oxford: Oxford University Press.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-408.md b/test/command/pandoc-citeproc-408.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-408.md
@@ -0,0 +1,39 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- id: smith1
+  type: article-journal
+  author:
+  - family: Smith
+    given: Mary
+  issued:
+  - year: 2019
+  title: Foo
+
+- id: smithsmith
+  type: article-journal
+  author:
+  - family: Smith
+    given: Mary
+  - family: Smith
+    given: John
+  issued:
+  - year: 2019
+  title: Foo bar
+...
+
+[@smithsmith; @smith1]
+^D
+(Smith and Smith 2019; Smith 2019)
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-smith1 .csl-entry}
+Smith, Mary. 2019. "Foo."
+:::
+
+::: {#ref-smithsmith .csl-entry}
+Smith, Mary, and John Smith. 2019. "Foo Bar."
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-416.md b/test/command/pandoc-citeproc-416.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-416.md
@@ -0,0 +1,61 @@
+```
+% pandoc --citeproc -t markdown-citations
+Blah blah [@item1; @item2; @item3].
+
+# References {-}
+
+---
+title: The Title
+references:
+- id: item1
+  type: article-newspaper
+  author:
+  - family: Doe
+    given: J.
+  issued:
+  - year: 2010
+    month: 12
+    day: 13
+  title: The title
+- id: item2
+  type: article-newspaper
+  author:
+  - family: Doe
+    given: J.
+  issued:
+  - year: 2007
+    month: 12
+    day: 12
+  - year: 2007
+    month: 12
+    day: 13
+  title: The title
+- id: item3
+  type: article-newspaper
+  author:
+  - family: Doe
+    given: J.
+  issued:
+  - year: 2008
+  title: The title
+...
+^D
+Blah blah (Doe 2010, 2007, 2008).
+
+References {#references .unnumbered}
+==========
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-item2 .csl-entry}
+Doe, J. 2007. "The Title," December 12--13, 2007.
+:::
+
+::: {#ref-item3 .csl-entry}
+---------. 2008. "The Title," 2008.
+:::
+
+::: {#ref-item1 .csl-entry}
+---------. 2010. "The Title," December 13, 2010.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-437.md b/test/command/pandoc-citeproc-437.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-437.md
@@ -0,0 +1,23 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: command/issue437.csl
+references:
+- author:
+  - family: Smith
+    given: John
+  id: hirt2009
+  issued:
+  - year: 2009
+  publisher: Publishing House
+  publisher-place: Lausanne
+  title: Some Book
+  type: book
+---
+
+> Here is a quote. [@hirt2009]
+^D
+> Here is a quote.[^1]
+
+[^1]: John Smith, Some Book, Lausanne, 2009
+```
diff --git a/test/command/pandoc-citeproc-47.md b/test/command/pandoc-citeproc-47.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-47.md
@@ -0,0 +1,113 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- author:
+  - family: Doe
+    given: A.
+  id: doe
+  issued:
+    date-parts:
+    - - 2000
+  title: Title
+  type: book
+- author:
+  - family: Doe
+    given: A.
+  - family: Poe
+    given: A.
+  id: doepoe
+  issued:
+    date-parts:
+    - - 2000
+  title: Title
+  type: book
+- editor:
+  - family: Doe
+    given: A.
+  id: 'doe-ed'
+  issued:
+    date-parts:
+    - - 2000
+  title: Title
+  type: book
+- author:
+  - family: Doe
+    given: A.
+  - family: Loe
+    given: A.
+  - family: Toe
+    given: A.
+  id: doeloetoe
+  issued:
+    date-parts:
+    - - 2000
+  title: Title
+  type: book
+---
+
+Foo [@doe]. Bar [@doepoe]. Foo [@doe-ed]. Bar [@doeloetoe].
+
+Expected output:
+
+> Doe, A. 2000a. Title.
+>
+> ---------, ed. 2000b. Title.
+>
+> Doe, A., A. Loe, and A. Toe. 2000. Title.
+>
+> Doe, A., and A. Poe. 2000. Title.
+
+(See CMoS, 16e, 15.16, "Single author versus several authors---reference
+list order": "Successive entries by two or more authors in which only
+the first author's name is the same are alphabetized according to the
+coauthors' last names (regardless of how many coauthors there are)." and
+15.18, "The 3-em dash with edited, translated, or compiled works": "The
+chronological order is maintained, regardless of the added abbreviation.
+\[ed., trans., comp., or whatever\]"
+
+References {#references .unnumbered}
+==========
+^D
+Foo (Doe 2000a). Bar (Doe and Poe 2000). Foo (Doe 2000b). Bar (Doe, Loe,
+and Toe 2000).
+
+Expected output:
+
+> Doe, A. 2000a. Title.
+>
+> ---------, ed. 2000b. Title.
+>
+> Doe, A., A. Loe, and A. Toe. 2000. Title.
+>
+> Doe, A., and A. Poe. 2000. Title.
+
+(See CMoS, 16e, 15.16, "Single author versus several authors---reference
+list order": "Successive entries by two or more authors in which only
+the first author's name is the same are alphabetized according to the
+coauthors' last names (regardless of how many coauthors there are)." and
+15.18, "The 3-em dash with edited, translated, or compiled works": "The
+chronological order is maintained, regardless of the added abbreviation.
+\[ed., trans., comp., or whatever\]"
+
+References {#references .unnumbered}
+==========
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-doe .csl-entry}
+Doe, A. 2000a. *Title*.
+:::
+
+::: {#ref-doe-ed .csl-entry}
+---------, ed. 2000b. *Title*.
+:::
+
+::: {#ref-doeloetoe .csl-entry}
+Doe, A., A. Loe, and A. Toe. 2000. *Title*.
+:::
+
+::: {#ref-doepoe .csl-entry}
+Doe, A., and A. Poe. 2000. *Title*.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-51.md b/test/command/pandoc-citeproc-51.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-51.md
@@ -0,0 +1,45 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- author:
+  - family: Doe
+    given: John
+  container-title: Journal of Something
+  id: item1
+  issued:
+    date-parts:
+    - - 1987
+    - - 1988
+  page: '12-34'
+  title: The title
+  type: 'article-journal'
+  volume: 3
+- author:
+  - family: Roe
+    given: Ron
+  container-title: Journal of Something
+  id: item2
+  issued:
+    date-parts:
+    - - 1987
+  page: '12-34'
+  title: The title
+  type: 'article-journal'
+  volume: 4
+---
+
+@item1; @item2
+^D
+Doe (1987--1988); Roe (1987)
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-item1 .csl-entry}
+Doe, John. 1987--1988. "The Title." *Journal of Something* 3: 12--34.
+:::
+
+::: {#ref-item2 .csl-entry}
+Roe, Ron. 1987. "The Title." *Journal of Something* 4: 12--34.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-53.md b/test/command/pandoc-citeproc-53.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-53.md
@@ -0,0 +1,54 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: command/archeologie-medievale.csl
+references:
+- title: Work A
+  id: a
+  issued:
+    date-parts:
+    - - 2000
+  author:
+  - given: John
+    family: Doe
+  type: book
+- title: Work B
+  id: b
+  issued:
+    date-parts:
+    - - 1990
+  author:
+  - given: Jane
+    family: Roe
+  type: book
+---
+@a @a @b @b @a @a @b @b
+^D
+Doe[^1] Doe[^2] Roe[^3] Roe[^4] Doe[^5] Doe[^6] Roe[^7] Roe[^8]
+
+::: {#refs .references .csl-bib-body}
+::: {#ref-a .csl-entry}
+[[Doe J.]{.smallcaps} ]{.csl-block}[2000, *Work A*,.]{.csl-left-margin}
+:::
+
+::: {#ref-b .csl-entry}
+[[Roe J.]{.smallcaps} ]{.csl-block}[1990, *Work B*,.]{.csl-left-margin}
+:::
+:::
+
+[^1]: 2000
+
+[^2]: *Ibid.*
+
+[^3]: 1990
+
+[^4]: *Ibid.*
+
+[^5]: 2000
+
+[^6]: *Ibid.*
+
+[^7]: 1990
+
+[^8]: *Ibid.*
+```
diff --git a/test/command/pandoc-citeproc-57.md b/test/command/pandoc-citeproc-57.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-57.md
@@ -0,0 +1,38 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: 'command/chicago-author-date-with-original-date-and-status.csl'
+references:
+- author:
+  - family: Faraday
+    given: Carry
+  container-title: Seven Trips beyond the Asteroid Belt
+  editor:
+  - family: Oring
+    given: James
+  id: 'Faraday-forthcoming'
+  publisher: Launch Press
+  publisher-place: 'Cape Canaveral, FL'
+  status: forthcoming
+  title: Protean photography
+  type: chapter
+---
+
+[@Faraday-forthcoming]
+
+References
+==========
+^D
+(Faraday, forthcoming)
+
+References {#references .unnumbered}
+==========
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-Faraday-forthcoming .csl-entry}
+Faraday, Carry. Forthcoming. "Protean Photography." In *Seven Trips
+Beyond the Asteroid Belt*, edited by James Oring. Cape Canaveral, FL:
+Launch Press.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-58.md b/test/command/pandoc-citeproc-58.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-58.md
@@ -0,0 +1,33 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: command/issue58.csl
+references:
+- id: stanze
+  issued:
+    date-parts:
+    - - 1547
+  language: 'it-IT'
+  publisher-place: Florence
+  title: Stanze in lode della donna brutta
+  type: book
+---
+
+In this item, the title replaces the (unknown) author (see 14.79)
+[@stanze, p. 12].
+
+References
+==========
+^D
+In this item, the title replaces the (unknown) author (see 14.79)
+(*Stanze in lode della donna brutta* 1547, 12).
+
+References {#references .unnumbered}
+==========
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-stanze .csl-entry}
+*Stanze in lode della donna brutta*. 1547. Florence.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-61.md b/test/command/pandoc-citeproc-61.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-61.md
@@ -0,0 +1,79 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: 'command/modern-humanities-research-association.csl'
+references:
+- author:
+  - family: Doe
+    given: John
+  id: doe
+  issued:
+    date-parts:
+    - - 1985
+  publisher: Publisher
+  title: Title
+  type: book
+- author:
+  - family: Roe
+    given: Rob
+  id: roe
+  issued:
+    date-parts:
+    - - 1985
+  publisher: Publisher
+  title: Title
+  type: book
+---
+
+Text
+====
+
+Foo [@doe, VIII, 89]
+
+Foo [@roe, III, 89]
+
+Foo [@doe, LVIII, 89]
+
+Foo [@roe, MVIII, 89]
+
+Foo [@doe, CL, 89]
+
+References
+==========
+^D
+Text
+====
+
+Foo[^1]
+
+Foo[^2]
+
+Foo[^3]
+
+Foo[^4]
+
+Foo[^5]
+
+References {#references .unnumbered}
+==========
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-doe .csl-entry}
+Doe, John, *Title* (Publisher, 1985)
+:::
+
+::: {#ref-roe .csl-entry}
+Roe, Rob, *Title* (Publisher, 1985)
+:::
+:::
+
+[^1]: John Doe, *Title* (Publisher, 1985), VIII, 89.
+
+[^2]: Rob Roe, *Title* (Publisher, 1985), III, 89.
+
+[^3]: Doe, LVIII, 89.
+
+[^4]: Roe, MVIII, 89.
+
+[^5]: Doe, CL, 89.
+```
diff --git a/test/command/pandoc-citeproc-64.md b/test/command/pandoc-citeproc-64.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-64.md
@@ -0,0 +1,24 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+bibliography:
+- command/biblio.bib
+nocite: '[@*]'
+---
+
+^D
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-item1 .csl-entry}
+Doe, John. 2005. *First Book*. Cambridge: Cambridge University Press.
+:::
+
+::: {#ref-item2 .csl-entry}
+---------. 2006. "Article." *Journal of Generic Studies* 6: 33--34.
+:::
+
+::: {#ref-пункт3 .csl-entry}
+Doe, John, and Jenny Roe. 2007. "Why Water Is Wet." In *Third Book*,
+edited by Sam Smith. Oxford: Oxford University Press.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-65.md b/test/command/pandoc-citeproc-65.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-65.md
@@ -0,0 +1,38 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- ISBN: 3406493556
+  author:
+  - family: Stotz
+    given: Peter
+  call-number: 'PA25 PA2616 .H24 Abt. 2, T. 5, Bd. 2, etc'
+  collection-number: 2.5
+  collection-title: Handbuch der Altertumswissenschaft
+  event-place: Munich
+  first-reference-note-number: 1
+  id: 'stotz:1996handbuch'
+  issued:
+    literal: 1996_2004
+  language: German
+  number-of-volumes: 5
+  publisher: Beck
+  publisher-place: Munich
+  source: Library of Congress ISBN
+  title: Handbuch zur lateinischen Sprache des Mittelalters
+  title-short: Handbuch
+  type: book
+---
+
+[@stotz:1996handbuch]
+^D
+(Stotz 1996--2004)
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-stotz:1996handbuch .csl-entry}
+Stotz, Peter. 1996--2004. *Handbuch zur lateinischen Sprache des
+Mittelalters*. 5 vols. Handbuch der Altertumswissenschaft 2.5. Munich:
+Beck.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-68.md b/test/command/pandoc-citeproc-68.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-68.md
@@ -0,0 +1,56 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: 'command/chicago-fullnote-bibliography.csl'
+references:
+- ISBN: 0888441088
+  author:
+  - family: Goering
+    given: Joseph
+  call-number: BV4009 .W55 1992
+  collection-number: 108
+  collection-title: Studies and Texts
+  event-place: Toronto
+  first-reference-note-number: 1
+  id: 'goering:1992william'
+  issued:
+    date-parts:
+    - - 1992
+  publisher: Pontifical Institute of Mediaeval Studies
+  publisher-place: Toronto
+  source: toroprod.library.utoronto.ca Library Catalog
+  title: 'William de Montibus (c. 1140--1213): The Schools and the
+    Literature of Pastoral Care'
+  title-short: William de Montibus
+  type: book
+---
+
+\... a prose commentary [the text of fol. 9r is printed in
+@goering:1992william, pp. 501--3]. \... a collection of verses with a
+formal prose commentary [excerpts from this text were previously printed
+in @goering:1992william, p. 508--14; it was also briefly described in
+@goering:1992william, pp. 141--42] \... and finally a note starting with
+a citation [@goering:1992william, pp. 141-42].
+^D
+\... a prose commentary.[^1] \... a collection of verses with a formal
+prose commentary[^2] \... and finally a note starting with a
+citation.[^3]
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-goering:1992william .csl-entry}
+Goering, Joseph. *William de Montibus (c. 1140--1213): The Schools and
+the Literature of Pastoral Care*. Studies and Texts 108. Toronto:
+Pontifical Institute of Mediaeval Studies, 1992.
+:::
+:::
+
+[^1]: The text of fol. 9r is printed in Joseph Goering, *William de
+    Montibus (c. 1140--1213): The Schools and the Literature of Pastoral
+    Care*, Studies and Texts 108 (Toronto: Pontifical Institute of
+    Mediaeval Studies, 1992), 501--3.
+
+[^2]: Excerpts from this text were previously printed in Goering,
+    508--14; it was also briefly described in Goering, 141--42.
+
+[^3]: Goering, *William de Montibus*, 141--42.
+```
diff --git a/test/command/pandoc-citeproc-7.md b/test/command/pandoc-citeproc-7.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-7.md
@@ -0,0 +1,31 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- author:
+    family: Author
+    given:
+    - Ann
+  container-title: Journal
+  id: item1
+  issued:
+  - day: 24
+    month: 9
+    year: 2011
+  - day: 26
+    month: 9
+    year: 2011
+  title: Title
+  type: 'article-magazine'
+---
+
+@item1
+^D
+Author (2011)
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-item1 .csl-entry}
+Author, Ann. 2011. "Title." *Journal*, September 24--26, 2011.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-70.md b/test/command/pandoc-citeproc-70.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-70.md
@@ -0,0 +1,73 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- ISBN: 9782503531465
+  author:
+  - family: 'Dinkova-Bruun'
+    given: Greti
+  call-number: CB351 .F564 2009
+  collection-number: 50
+  collection-title: Textes et études du moyen âge
+  container-title: 'Florilegium mediaevale: Études offertes à Jacqueline
+    Hamesse à l''occasion de son éméritat'
+  editor:
+  - family: Meirinhos
+    given: José Francisco
+  - family: Weijers
+    given: Olga
+  event-place: 'Louvain-la-Neuve'
+  first-reference-note-number: 1
+  id: 'bruun:2009samuel'
+  issued:
+    date-parts:
+    - - 2009
+  language: French
+  page: '155--174'
+  publisher: 'Fédération Internationale des Instituts d''Études
+    Médiévales'
+  publisher-place: 'Louvain-la-Neuve'
+  source: Library of Congress ISBN
+  title: 'Samuel Presbyter and the Glosses to His Versification of Psalm
+    1: An Anti-Church Invective?'
+  title-short: Samuel Presbyter
+  type: chapter
+- ISSN: '0362-1529'
+  author:
+  - family: Thorndike
+    given: Lynn
+  container-title: Traditio
+  first-reference-note-number: 1
+  id: 'thorndike:1955unde'
+  issued:
+    date-parts:
+    - - 1955
+  language: Latin
+  note: 'ArticleType: research-article / Full publication date: 1955 /
+    Copyright © 1955 Fordham University'
+  page: '163--193'
+  source: JSTOR
+  title: Unde versus
+  type: 'article-journal'
+  volume: 11
+---
+
+[@thorndike:1955unde; @bruun:2009samuel]
+^D
+(Thorndike 1955; Dinkova-Bruun 2009)
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-bruun:2009samuel .csl-entry}
+Dinkova-Bruun, Greti. 2009. "Samuel Presbyter and the Glosses to His
+Versification of Psalm 1: An Anti-Church Invective?" In *Florilegium
+mediaevale: Études offertes à Jacqueline Hamesse à l'occasion de son
+éméritat*, edited by José Francisco Meirinhos and Olga Weijers, 155--74.
+Textes et études du moyen âge 50. Louvain-la-Neuve: Fédération
+Internationale des Instituts d'Études Médiévales.
+:::
+
+::: {#ref-thorndike:1955unde .csl-entry}
+Thorndike, Lynn. 1955. "Unde versus." *Traditio* 11: 163--93.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-75.md b/test/command/pandoc-citeproc-75.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-75.md
@@ -0,0 +1,67 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: command/apa.csl
+references:
+- author:
+  - family: Doe
+    given: John
+  id: test
+  issued:
+    date-parts:
+    - - 2006
+  title: Test
+  type: 'article-journal'
+  volume: 81
+---
+
+[@test, p. 6]
+
+[@test, chap. 6]
+
+[@test, n. 6]
+
+[@test, pp. 34-36, 38-39]
+
+[@test, sec. 3]
+
+[@test, p.3]
+
+[@test, 33-35, 38-39]
+
+[@test, 14]
+
+[@test bk. VI]
+
+[@test, no. 6]
+
+[@test, nos. 6 and 7]
+^D
+(Doe, 2006, p. 6)
+
+(Doe, 2006, Chapter 6)
+
+(Doe, 2006, n. 6)
+
+(Doe, 2006, pp. 34--36, 38--39)
+
+(Doe, 2006, sec. 3)
+
+(Doe, 2006, p. 3)
+
+(Doe, 2006, pp. 33--35, 38--39)
+
+(Doe, 2006, p. 14)
+
+(Doe, 2006, bk. VI)
+
+(Doe, 2006, no. 6)
+
+(Doe, 2006, no. 6 and 7)
+
+::: {#refs .references .csl-bib-body .hanging-indent line-spacing="2"}
+::: {#ref-test .csl-entry}
+Doe, J. (2006). Test, *81*.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-76.md b/test/command/pandoc-citeproc-76.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-76.md
@@ -0,0 +1,64 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- author:
+  - family: Author
+    given: Al
+  id: item1
+  issued:
+    date-parts:
+    - - 1998
+  title: 'foo bar baz: bazbaz bar foo'
+  type: 'article-journal'
+- author:
+  - family: Author
+    given: Al
+  id: item2
+  issued:
+    date-parts:
+    - - 1998
+  title: 'foo bar baz: the bazbaz bar foo'
+  type: 'article-journal'
+- author:
+  - family: Author
+    given: Al
+  id: item3
+  issued:
+    date-parts:
+    - - 1998
+  title: 'foo bar baz: a bazbaz bar foo'
+  type: 'article-journal'
+- author:
+  - family: Author
+    given: Al
+  id: item4
+  issued:
+    date-parts:
+    - - 1998
+  title: 'foo bar baz: an abazbaz bar foo'
+  type: 'article-journal'
+---
+
+@item1, @item2, @item3, @item4
+^D
+Author (1998c), Author (1998d), Author (1998a), Author (1998b)
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-item3 .csl-entry}
+Author, Al. 1998a. "Foo Bar Baz: A Bazbaz Bar Foo."
+:::
+
+::: {#ref-item4 .csl-entry}
+---------. 1998b. "Foo Bar Baz: An Abazbaz Bar Foo."
+:::
+
+::: {#ref-item1 .csl-entry}
+---------. 1998c. "Foo Bar Baz: Bazbaz Bar Foo."
+:::
+
+::: {#ref-item2 .csl-entry}
+---------. 1998d. "Foo Bar Baz: The Bazbaz Bar Foo."
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-77.md b/test/command/pandoc-citeproc-77.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-77.md
@@ -0,0 +1,67 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: 'command/chicago-fullnote-bibliography.csl'
+references:
+- author:
+  - family: Doe
+    given: 'John, III'
+    parse-names: true
+  id: item1
+  type: book
+- author:
+  - family: van Gogh
+    given: Vincent
+    parse-names: true
+  id: item2
+  type: book
+- author:
+  - family: Humboldt
+    given: Alexander von
+    parse-names: true
+  id: item3
+  type: book
+- author:
+  - family: Bennett
+    given: 'Frank G.,! Jr.'
+    parse-names: true
+  id: item4
+  type: book
+- author:
+  - family: Dumboldt
+    given: 'Ezekiel, III'
+    parse-names: true
+  id: item5
+  type: book
+---
+
+[@item1; @item2; @item3; @item4; @item5]
+^D
+[^1]
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-item4 .csl-entry}
+Bennett, Frank G., Jr., n.d.
+:::
+
+::: {#ref-item1 .csl-entry}
+Doe, John, III, n.d.
+:::
+
+::: {#ref-item5 .csl-entry}
+Dumboldt, Ezekiel, III, n.d.
+:::
+
+::: {#ref-item2 .csl-entry}
+Gogh, Vincent van, n.d.
+:::
+
+::: {#ref-item3 .csl-entry}
+Humboldt, Alexander von, n.d.
+:::
+:::
+
+[^1]: John Doe III, n.d.; Vincent van Gogh, n.d.; Alexander von
+    Humboldt, n.d.; Frank G. Bennett, Jr., n.d.; Ezekiel Dumboldt III,
+    n.d.
+```
diff --git a/test/command/pandoc-citeproc-82.md b/test/command/pandoc-citeproc-82.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-82.md
@@ -0,0 +1,40 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: 'command/chicago-annotated-bibliography.csl'
+references:
+- URL: 'https://www.worldcat.org/'
+  accessed:
+    date-parts:
+    - - 2014
+      - 9
+      - 19
+  author:
+  - literal: OCLC
+  first-reference-note-number: 1
+  id: OCLC_i1099
+  title: WorldCat
+  type: webpage
+---
+
+Title
+=====
+
+Some text.[^1]
+
+[^1]: Comment regarding text, supported by citation [@OCLC_i1099]
+^D
+Title
+=====
+
+Some text.[^1]
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-OCLC_i1099 .csl-entry}
+OCLC. "WorldCat." Accessed September 19, 2014.
+<https://www.worldcat.org/>.
+:::
+:::
+
+[^1]: Comment regarding text, supported by citation (OCLC, "WorldCat.")
+```
diff --git a/test/command/pandoc-citeproc-87.md b/test/command/pandoc-citeproc-87.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-87.md
@@ -0,0 +1,157 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- URL: 'http://www.example.com'
+  author:
+  - family: Doe
+    given: John
+  container-title: The Web Site
+  id: item1
+  issued:
+    date-parts:
+    - - 2006
+      - 10
+      - 26
+  title: Title
+  type: webpage
+- URL: 'http://www.example.com'
+  author:
+  - family: Doe
+    given: John
+  container-title: The Web Site
+  id: item2
+  issued:
+    date-parts:
+    - - 2006
+      - 10
+      - 26
+    - - 2006
+      - 11
+      - 27
+  title: Title
+  type: webpage
+- URL: 'http://www.example.com'
+  author:
+  - family: Doe
+    given: John
+  container-title: The Web Site
+  id: item2a
+  issued:
+    date-parts:
+    - - 2006
+      - 10
+    - - 2006
+      - 11
+  title: Title
+  type: webpage
+- URL: 'http://www.example.com'
+  author:
+  - family: Doe
+    given: John
+  container-title: The Web Site
+  id: item2b
+  issued:
+    date-parts:
+    - - 2006
+      - 12
+      - 31
+    - - 2007
+      - 1
+      - 1
+  title: Title
+  type: webpage
+- URL: 'http://www.example.com'
+  author:
+  - family: Doe
+    given: John
+  container-title: The Newspaper
+  id: item3
+  issued:
+    date-parts:
+    - - 2006
+      - 10
+      - 26
+    - - 2006
+      - 11
+      - 27
+  title: Title
+  type: 'article-newspaper'
+- URL: 'http://www.example.com'
+  author:
+  - family: Doe
+    given: John
+  container-title: The Newspaper
+  id: item3b
+  issued:
+    date-parts:
+    - - 2006
+      - 10
+    - - 2006
+      - 11
+  title: Title
+  type: 'article-newspaper'
+---
+
+@item1 -- webpage, date
+
+@item2 -- webpage, date range
+
+@item2a -- webpage, date range YM
+
+@item2b -- webpage, date range across years
+
+@item3 -- article-newspaper
+
+@item3b -- article-newspaper YM
+
+References
+==========
+^D
+Doe (2006c) -- webpage, date
+
+Doe (2006d) -- webpage, date range
+
+Doe (2006a) -- webpage, date range YM
+
+Doe (2006--2007) -- webpage, date range across years
+
+Doe (2006e) -- article-newspaper
+
+Doe (2006b) -- article-newspaper YM
+
+References {#references .unnumbered}
+==========
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-item2a .csl-entry}
+Doe, John. 2006a. "Title." The Web Site. October--November 2006.
+<http://www.example.com>.
+:::
+
+::: {#ref-item3b .csl-entry}
+---------. 2006b. "Title." *The Newspaper*, October--November 2006.
+<http://www.example.com>.
+:::
+
+::: {#ref-item1 .csl-entry}
+---------. 2006c. "Title." The Web Site. October 26, 2006.
+<http://www.example.com>.
+:::
+
+::: {#ref-item2 .csl-entry}
+---------. 2006d. "Title." The Web Site. October 26--November 27, 2006.
+<http://www.example.com>.
+:::
+
+::: {#ref-item3 .csl-entry}
+---------. 2006e. "Title." *The Newspaper*, October 26--November 27,
+2006. <http://www.example.com>.
+:::
+
+::: {#ref-item2b .csl-entry}
+---------. 2006--2007. "Title." The Web Site. December 31, 2006--January
+1, 2007. <http://www.example.com>.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-chicago-author-date.md b/test/command/pandoc-citeproc-chicago-author-date.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-chicago-author-date.md
@@ -0,0 +1,111 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+bibliography: command/biblio.bib
+link-citations: true
+---
+
+Pandoc with citeproc-hs
+=======================
+
+[@nonexistent]
+
+@nonexistent
+
+@item1 says blah.
+
+@item1 [p. 30] says blah.
+
+@item1 [p. 30, with suffix] says blah.
+
+@item1 [-@item2 p. 30; see also @пункт3] says blah.
+
+In a note.[^1]
+
+A citation group [see @item1 chap. 3; also @пункт3 p. 34-35].
+
+Another one [see @item1 p. 34-35].
+
+And another one in a note.[^2]
+
+Citation with a suffix and locator [@item1 pp. 33, 35-37, and nowhere
+else].
+
+Citation with suffix only [@item1 and nowhere else].
+
+Now some modifiers.[^3]
+
+With some markup [*see* @item1 p. **32**].
+
+References {#references .unnumbered}
+==========
+
+[^1]: @пункт3 [p. 12] and a citation without locators [@пункт3].
+
+[^2]: Some citations [see @item1 chap. 3; @пункт3; @item2].
+
+[^3]: Like a citation without author: [-@item1], and now Doe with a
+    locator [-@item2 p. 44].
+^D
+[WARNING] Citeproc: citation nonexistent not found
+Pandoc with citeproc-hs
+=======================
+
+([**nonexistent?**](#ref-nonexistent))
+
+([**nonexistent?**](#ref-nonexistent))
+
+[Doe](#ref-item1) ([2005](#ref-item1)) says blah.
+
+[Doe](#ref-item1) ([2005, 30](#ref-item1)) says blah.
+
+[Doe](#ref-item1) ([2005, 30](#ref-item1), with suffix) says blah.
+
+[Doe](#ref-item1) ([2005](#ref-item1), [2006, 30](#ref-item2); see also
+[Doe and Roe 2007](#ref-пункт3)) says blah.
+
+In a note.[^1]
+
+A citation group (see [Doe 2005, chap. 3](#ref-item1); also [Doe and Roe
+2007, 34--35](#ref-пункт3)).
+
+Another one (see [Doe 2005, 34--35](#ref-item1)).
+
+And another one in a note.[^2]
+
+Citation with a suffix and locator ([Doe 2005, 33, 35--37](#ref-item1),
+and nowhere else).
+
+Citation with suffix only ([Doe 2005](#ref-item1) and nowhere else).
+
+Now some modifiers.[^3]
+
+With some markup (*see* [Doe 2005, 32](#ref-item1)).
+
+References {#references .unnumbered}
+==========
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-item1 .csl-entry}
+Doe, John. 2005. *First Book*. Cambridge: Cambridge University Press.
+:::
+
+::: {#ref-item2 .csl-entry}
+---------. 2006. "Article." *Journal of Generic Studies* 6: 33--34.
+:::
+
+::: {#ref-пункт3 .csl-entry}
+Doe, John, and Jenny Roe. 2007. "Why Water Is Wet." In *Third Book*,
+edited by Sam Smith. Oxford: Oxford University Press.
+:::
+:::
+
+[^1]: [Doe and Roe](#ref-пункт3) ([2007, 12](#ref-пункт3)) and a
+    citation without locators ([Doe and Roe 2007](#ref-пункт3)).
+
+[^2]: Some citations (see [Doe 2005, chap. 3](#ref-item1); [Doe and Roe
+    2007](#ref-пункт3); [Doe 2006](#ref-item2)).
+
+[^3]: Like a citation without author: ([2005](#ref-item1)), and now Doe
+    with a locator ([2006, 44](#ref-item2)).
+```
diff --git a/test/command/pandoc-citeproc-chicago-fullnote-bibliography.md b/test/command/pandoc-citeproc-chicago-fullnote-bibliography.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-chicago-fullnote-bibliography.md
@@ -0,0 +1,139 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+bibliography: command/biblio.bib
+csl: 'command/chicago-fullnote-bibliography.csl'
+link-citations: true
+---
+
+Pandoc with citeproc-hs
+=======================
+
+[@nonexistent]
+
+@nonexistent
+
+@item1 says blah.
+
+@item1 [p. 30] says blah.
+
+@item1 [p. 30, with suffix] says blah.
+
+@item1 [-@item2 p. 30; see also @пункт3] says blah.
+
+In a note.[^1]
+
+A citation group [see @item1 chap. 3; also @пункт3 p. 34-35].
+
+Another one [see @item1 p. 34-35].
+
+And another one in a note.[^2]
+
+Citation with a suffix and locator [@item1 pp. 33, 35-37, and nowhere
+else].
+
+Citation with suffix only [@item1 and nowhere else].
+
+Now some modifiers.[^3]
+
+With some markup [*see* @item1 p. **32**].
+
+References {#references .unnumbered}
+==========
+
+[^1]: @пункт3 [p. 12] and a citation without locators [@пункт3].
+
+[^2]: Some citations [see @item1 chap. 3; @пункт3; @item2].
+
+[^3]: Like a citation without author: [-@item1], and again
+    [-@item1], and now Doe with a locator [-@item2 p. 44].
+^D
+[WARNING] Citeproc: citation nonexistent not found
+Pandoc with citeproc-hs
+=======================
+
+[^1]
+
+[^2]
+
+[John Doe](#ref-item1)[^3] says blah.
+
+[Doe](#ref-item1)[^4] says blah.
+
+[Doe](#ref-item1)[^5] says blah.
+
+[Doe](#ref-item1)[^6] says blah.
+
+In a note.[^7]
+
+A citation group.[^8]
+
+Another one.[^9]
+
+And another one in a note.[^10]
+
+Citation with a suffix and locator.[^11]
+
+Citation with suffix only.[^12]
+
+Now some modifiers.[^13]
+
+With some markup.[^14]
+
+References {#references .unnumbered}
+==========
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-item2 .csl-entry}
+Doe, John. "Article." *Journal of Generic Studies* 6 (2006): 33--34.
+:::
+
+::: {#ref-item1 .csl-entry}
+---------. *First Book*. Cambridge: Cambridge University Press, 2005.
+:::
+
+::: {#ref-пункт3 .csl-entry}
+Doe, John, and Jenny Roe. "Why Water Is Wet." In *Third Book*, edited by
+Sam Smith. Oxford: Oxford University Press, 2007.
+:::
+:::
+
+[^1]: [**Nonexistent?**](#ref-nonexistent)
+
+[^2]: [**Nonexistent?**](#ref-nonexistent)
+
+[^3]: [*First Book* (Cambridge: Cambridge University Press,
+    2005)](#ref-item1).
+
+[^4]: [30](#ref-item1).
+
+[^5]: [30](#ref-item1), with suffix.
+
+[^6]: [*First Book*, 2005](#ref-item1); ["Article," *Journal of Generic
+    Studies* 6 (2006): 30](#ref-item2); see also [John Doe and Jenny
+    Roe, "Why Water Is Wet," in *Third Book*, ed. Sam Smith (Oxford:
+    Oxford University Press, 2007)](#ref-пункт3).
+
+[^7]: [Doe and Roe](#ref-пункт3) (["Why Water Is Wet," 12](#ref-пункт3))
+    and a citation without locators ([Doe and Roe, "Why Water Is
+    Wet"](#ref-пункт3)).
+
+[^8]: See [Doe, *First Book*, 2005, chap. 3](#ref-item1); also [Doe and
+    Roe, "Why Water Is Wet," 34--35](#ref-пункт3).
+
+[^9]: See [Doe, *First Book*, 2005, 34--35](#ref-item1).
+
+[^10]: Some citations (See [Doe, chap. 3](#ref-item1); [Doe and Roe,
+    "Why Water Is Wet"](#ref-пункт3); [Doe, "Article,"
+    2006](#ref-item2)).
+
+[^11]: [Doe, *First Book*, 2005, 33, 35--37](#ref-item1), and nowhere
+    else.
+
+[^12]: [Doe, *First Book*, 2005](#ref-item1) and nowhere else.
+
+[^13]: Like a citation without author: (), and again (), and now Doe
+    with a locator (["Article," 2006, 44](#ref-item2)).
+
+[^14]: *See* [Doe, *First Book*, 2005, 32](#ref-item1).
+```
diff --git a/test/command/pandoc-citeproc-ieee.md b/test/command/pandoc-citeproc-ieee.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-ieee.md
@@ -0,0 +1,115 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+bibliography: command/biblio.bib
+csl: command/ieee.csl
+link-citations: true
+---
+
+Pandoc with citeproc-hs
+=======================
+
+[@nonexistent]
+
+@nonexistent
+
+@item1 says blah.
+
+@item1 [p. 30] says blah.
+
+@item1 [p. 30, with suffix] says blah.
+
+@item1 [-@item2 p. 30; see also @пункт3] says blah.
+
+In a note.[^1]
+
+A citation group [see @item1 chap. 3; also @пункт3 p. 34-35].
+
+Another one [see @item1 p. 34-35].
+
+And another one in a note.[^2]
+
+Citation with a suffix and locator [@item1 pp. 33, 35-37, and nowhere
+else].
+
+Citation with suffix only [@item1 and nowhere else].
+
+Now some modifiers.[^3]
+
+With some markup [*see* @item1 p. **32**].
+
+References {#references .unnumbered}
+==========
+
+[^1]: @пункт3 [p. 12] and a citation without locators [@пункт3].
+
+[^2]: Some citations [see @item1 chap. 3; @пункт3; @item2].
+
+[^3]: Like a citation without author: [-@item1], and now Doe with a
+    locator [-@item2 p. 44].
+^D
+[WARNING] Citeproc: citation nonexistent not found
+Pandoc with citeproc-hs
+=======================
+
+[**nonexistent?**](#ref-nonexistent)
+
+[**nonexistent?**](#ref-nonexistent)
+
+[\[1\]](#ref-item1) says blah.
+
+[\[1, p. 30\]](#ref-item1) says blah.
+
+[\[1, p. 30\]](#ref-item1), with suffix says blah.
+
+[\[1\]](#ref-item1), [\[2, p. 30\]](#ref-item2), see also
+[\[3\]](#ref-пункт3) says blah.
+
+In a note.[^1]
+
+A citation group see [\[1, Ch. 3\]](#ref-item1), also [\[3, pp.
+34--35\]](#ref-пункт3).
+
+Another one see [\[1, pp. 34--35\]](#ref-item1).
+
+And another one in a note.[^2]
+
+Citation with a suffix and locator [\[1, pp. 33, 35--37\]](#ref-item1),
+and nowhere else.
+
+Citation with suffix only [\[1\]](#ref-item1) and nowhere else.
+
+Now some modifiers.[^3]
+
+With some markup *see* [\[1, p. 32\]](#ref-item1).
+
+References {#references .unnumbered}
+==========
+
+::: {#refs .references .csl-bib-body}
+::: {#ref-item1 .csl-entry}
+[\[1\] ]{.csl-left-margin}[J. Doe, *First book*. Cambridge: Cambridge
+University Press, 2005.]{.csl-right-inline}
+:::
+
+::: {#ref-item2 .csl-entry}
+[\[2\] ]{.csl-left-margin}[J. Doe, "Article," *Journal of Generic
+Studies*, vol. 6, pp. 33--34, 2006.]{.csl-right-inline}
+:::
+
+::: {#ref-пункт3 .csl-entry}
+[\[3\] ]{.csl-left-margin}[J. Doe and J. Roe, "Why water is wet," in
+*Third book*, S. Smith, Ed. Oxford: Oxford University Press,
+2007.]{.csl-right-inline}
+:::
+:::
+
+[^1]: [\[3, p. 12\]](#ref-пункт3) and a citation without locators
+    [\[3\]](#ref-пункт3).
+
+[^2]: Some citations see [\[1, Ch. 3\]](#ref-item1),
+    [\[2\]](#ref-item2), [\[3\]](#ref-пункт3).
+
+[^3]: Like a citation without author: [\[1\]](#ref-item1), and now Doe
+    with a locator [\[2, p. 44\]](#ref-item2).
+```
diff --git a/test/command/pandoc-citeproc-locators-delimited.md b/test/command/pandoc-citeproc-locators-delimited.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-locators-delimited.md
@@ -0,0 +1,127 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: command/locators.csl
+references:
+- id: citekey
+  title: Title
+  type: 'article-journal'
+suppress-bibliography: true
+---
+
+See <https://github.com/jgm/pandoc-citeproc/pull/362>.
+
+Standard page range[@citekey {35-89, 102}]
+
+Alphanumeric[@citekey {abcdefg1234}]
+
+Kitchen sink[@citekey, {123(4)a-8(\[a\]12.398{8})}]
+
+Empty braces inside[@citekey, {{}}]
+
+Label specified[@citekey {p. a}]
+
+Should it work outside? No. [@citekey, p. {(a)}]
+
+Empty locator [@citekey, {}]
+
+Empty locator to force suffix[@citekey {} 123-35 numbers are suffix]
+
+Suffix generally [@citekey {123-35} numbers not, but text is suffix]
+
+With preceding comma[@citekey, {p. VI}]
+
+No commas before label[@citekey, {, p. (p. is not recognised)}]
+
+Trim white space[@citekey, { p. 9 }]
+
+Without delimiters[@citekey, suffix]
+
+With rendering label[@citekey {ss IV div 4 s 128L(7)(a)(i)-(iv), 129(5),
+130(b)}]
+
+The text is apparently NOT verbatim; it is lightly processed as page
+numbers. [@citekey {no comma, no label, no nothing}]
+
+AGLC-style page \[para\] [@citekey {584 \[78\]}]
+
+Unbalanced curly { breaks the parse[@citekey {p. suffix{suffix}suffix]
+
+Unbalanced curly } ends early[@citekey {green}suffix}suffix]
+^D
+See <https://github.com/jgm/pandoc-citeproc/pull/362>.
+
+Standard page range[^1]
+
+Alphanumeric[^2]
+
+Kitchen sink[^3]
+
+Empty braces inside[^4]
+
+Label specified[^5]
+
+Should it work outside? No.[^6]
+
+Empty locator[^7]
+
+Empty locator to force suffix[^8]
+
+Suffix generally[^9]
+
+With preceding comma[^10]
+
+No commas before label[^11]
+
+Trim white space[^12]
+
+Without delimiters[^13]
+
+With rendering label[^14]
+
+The text is apparently NOT verbatim; it is lightly processed as page
+numbers.[^15]
+
+AGLC-style page \[para\][^16]
+
+Unbalanced curly { breaks the parse[^17]
+
+Unbalanced curly } ends early[^18]
+
+[^1]: Title {35--89, 102}.
+
+[^2]: Ibid-with-locator {abcdefg1234}.
+
+[^3]: Ibid-with-locator {123(4)a--8(\[a\]12.398{8})}.
+
+[^4]: Ibid-with-locator {{}}.
+
+[^5]: Ibid-with-locator {a}.
+
+[^6]: Subsequent, p. {(a)}.
+
+[^7]: Ibid-with-locator.
+
+[^8]: Ibid 123-35 numbers are suffix.
+
+[^9]: Ibid-with-locator {123--35} numbers not, but text is suffix.
+
+[^10]: Ibid-with-locator {VI}.
+
+[^11]: Ibid-with-locator {, p. (p. is not recognised)}.
+
+[^12]: Ibid-with-locator {9}.
+
+[^13]: Subsequent, suffix.
+
+[^14]: Ibid-with-locator ss {IV div 4 s 128L(7)(a)(i)--(iv), 129(5),
+    130(b)}.
+
+[^15]: Ibid-with-locator {no comma, no label, no nothing}.
+
+[^16]: Ibid-with-locator {584 \[78\]}.
+
+[^17]: Subsequent {p. suffix{suffix}suffix.
+
+[^18]: Ibid-with-locator {green}suffix}suffix.
+```
diff --git a/test/command/pandoc-citeproc-locators-integrated.md b/test/command/pandoc-citeproc-locators-integrated.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-locators-integrated.md
@@ -0,0 +1,159 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: command/locators.csl
+references:
+- id: citekey
+  title: Title
+  type: 'article-journal'
+suppress-bibliography: true
+---
+
+See <https://github.com/jgm/pandoc-citeproc/pull/362>.
+
+[@citekey, 89, and suffix]
+
+[@citekey, 89, perfect Ibid with suffix]
+
+[@citekey, 123-79, and suffix]
+
+[@citekey, xi, will be entirely suffix]
+
+[@citekey, p. xi, gives you a (page) locator xi]
+
+[@citekey, pp. VII, 89, gives you a (pages) locator VII, 89]
+
+[@citekey, p. VI, VII, VIII-IX, explicit romans]
+
+[@citekey \[89\]]
+
+[@citekey, p. \[89\]]
+
+[@citekey and nothing else].
+
+[@citekey, 123(4)\[5\]6, and suffix]
+
+[@citekey, 3(a), 4.4.8, \[7.6\], 7A(2)(a)(i)-(iv)]
+
+[@citekey, 4B.2a.i(3.4), and suffix]
+
+[@citekey, IV.2A, and suffix]
+
+[@citekey, \[28\], and suffix]
+
+[@citekey, \[39-52\], and suffix]
+
+[@citekey, \[39\]-\[52\], and suffix]
+
+[@citekey, s 123(4)(a)(iv), and suffix]
+
+[@citekey, ss 123(4)-(6), and suffix]
+
+[@citekey, \[13\], and suffix]
+
+[@citekey, p.3, and suffix]
+
+[@citekey, (13 entirely suffix]
+
+[@citekey, p.a entirely suffix]
+
+[@citekey, s (a) entirely suffix]
+^D
+See <https://github.com/jgm/pandoc-citeproc/pull/362>.
+
+[^1]
+
+[^2]
+
+[^3]
+
+[^4]
+
+[^5]
+
+[^6]
+
+[^7]
+
+[^8]
+
+[^9]
+
+.[^10]
+
+[^11]
+
+[^12]
+
+[^13]
+
+[^14]
+
+[^15]
+
+[^16]
+
+[^17]
+
+[^18]
+
+[^19]
+
+[^20]
+
+[^21]
+
+[^22]
+
+[^23]
+
+[^24]
+
+[^1]: Title {89}, and suffix.
+
+[^2]: Ibid, perfect Ibid with suffix.
+
+[^3]: Ibid-with-locator {123--79}, and suffix.
+
+[^4]: Subsequent, xi, will be entirely suffix.
+
+[^5]: Ibid-with-locator {xi}, gives you a (page) locator xi.
+
+[^6]: Ibid-with-locator {VII, 89}, gives you a (pages) locator VII, 89.
+
+[^7]: Ibid-with-locator {VI, VII, VIII--IX}, explicit romans.
+
+[^8]: Ibid-with-locator {\[89\]}.
+
+[^9]: Ibid.
+
+[^10]: Subsequent and nothing else.
+
+[^11]: Ibid-with-locator {123(4)\[5\]6}, and suffix.
+
+[^12]: Ibid-with-locator {3(a), 4.4.8, \[7.6\], 7A(2)(a)(i)--(iv)}.
+
+[^13]: Ibid-with-locator {4B.2a.i(3.4)}, and suffix.
+
+[^14]: Ibid-with-locator {IV.2A}, and suffix.
+
+[^15]: Ibid-with-locator {\[28\]}, and suffix.
+
+[^16]: Ibid-with-locator {\[39--52\]}, and suffix.
+
+[^17]: Ibid-with-locator {\[39\]--\[52\]}, and suffix.
+
+[^18]: Ibid-with-locator s {123(4)(a)(iv)}, and suffix.
+
+[^19]: Ibid-with-locator ss {123(4)--(6)}, and suffix.
+
+[^20]: Ibid-with-locator {\[13\]}, and suffix.
+
+[^21]: Ibid-with-locator {3}, and suffix.
+
+[^22]: Subsequent, (13 entirely suffix.
+
+[^23]: Ibid, p.a entirely suffix.
+
+[^24]: Ibid, s (a) entirely suffix.
+```
diff --git a/test/command/pandoc-citeproc-move-period-inside-quote.md b/test/command/pandoc-citeproc-move-period-inside-quote.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-move-period-inside-quote.md
@@ -0,0 +1,52 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: 'command/chicago-fullnote-bibliography.csl'
+references:
+- DOI: 10.1038/171737a0
+  URL: 'http://www.nature.com/nature/journal/v171/n4356/abs/171737a0.html'
+  accessed:
+    day: 17
+    month: 6
+    year: 2008
+  author:
+  - family: Watson
+    given: J. D.
+  - family: Crick
+    given: F. H. C.
+  container-title: Nature
+  custom4: custom4
+  id: WatsonCrick1953
+  issue: 4356
+  issued:
+    date-parts:
+    - - 1953
+      - 4
+      - 25
+  language: 'en-US'
+  note: this is a note
+  original-date:
+    year: 1951
+  page: '737-738'
+  title: 'Molecular structure of nucleic acids: a structure for
+    deoxyribose nucleic acid'
+  title-short: Molecular structure of nucleic acids
+  type: 'article-journal'
+  volume: 171
+suppress-bibliography: true
+---
+
+Here is a "test citation" [@WatsonCrick1953].
+
+Here is a test citation [@WatsonCrick1953].
+^D
+Here is a "test citation."[^1]
+
+Here is a test citation.[^2]
+
+[^1]: J. D. Watson and F. H. C. Crick, "Molecular Structure of Nucleic
+    Acids: A Structure for Deoxyribose Nucleic Acid," *Nature* 171, no.
+    4356 (April 25, 1953): 737--38, <https://doi.org/10.1038/171737a0>.
+
+[^2]: Watson and Crick.
+```
diff --git a/test/command/pandoc-citeproc-no-author.md b/test/command/pandoc-citeproc-no-author.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-no-author.md
@@ -0,0 +1,73 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- container-title: Magazine
+  id: item1
+  issued:
+    year: 2012
+  title: Title A
+  type: 'article-magazine'
+- container-title: Magazine
+  id: item2
+  issued:
+    year: 2012
+  title: Title B
+  type: 'article-magazine'
+- container-title: Magazine
+  id: item3
+  issued:
+    year: 2012
+  title: Title C
+  type: 'article-magazine'
+- container-title: Magazine
+  id: item4
+  issued:
+    year: 2012
+  title: Title D
+  type: 'article-magazine'
+- container-title: Newspaper
+  id: item5
+  issued:
+    year: 2012
+  title: Title E
+  type: 'article-magazine'
+- container-title: Newspaper
+  id: item6
+  issued:
+    year: 2012
+  title: Title F
+  type: 'article-magazine'
+---
+
+@item1 [p. 3], @item2, @item3, @item4, @item5, @item6
+^D
+*Magazine* (2012a, 3), *Magazine* (2012b), *Magazine* (2012c),
+*Magazine* (2012d), *Newspaper* (2012a), *Newspaper* (2012b)
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-item1 .csl-entry}
+*Magazine*. 2012a. "Title A," 2012.
+:::
+
+::: {#ref-item2 .csl-entry}
+---------. 2012b. "Title B," 2012.
+:::
+
+::: {#ref-item3 .csl-entry}
+---------. 2012c. "Title C," 2012.
+:::
+
+::: {#ref-item4 .csl-entry}
+---------. 2012d. "Title D," 2012.
+:::
+
+::: {#ref-item5 .csl-entry}
+*Newspaper*. 2012a. "Title E," 2012.
+:::
+
+::: {#ref-item6 .csl-entry}
+---------. 2012b. "Title F," 2012.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-number-of-volumes.md b/test/command/pandoc-citeproc-number-of-volumes.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-number-of-volumes.md
@@ -0,0 +1,29 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+references:
+- author:
+    family: Author
+    given:
+    - Al
+  id: item1
+  issued:
+    year: 2013
+  language: 'en-US'
+  number-of-volumes: 2
+  publisher: Publisher
+  publisher-place: Location
+  title: Title
+  type: book
+---
+
+@item1
+^D
+Author (2013)
+
+::: {#refs .references .csl-bib-body .hanging-indent}
+::: {#ref-item1 .csl-entry}
+Author, Al. 2013. *Title*. 2 vols. Location: Publisher.
+:::
+:::
+```
diff --git a/test/command/pandoc-citeproc-page-range.md b/test/command/pandoc-citeproc-page-range.md
new file mode 100644
--- /dev/null
+++ b/test/command/pandoc-citeproc-page-range.md
@@ -0,0 +1,32 @@
+```
+% pandoc --citeproc -t markdown-citations
+---
+csl: 'command/chicago-fullnote-bibliography.csl'
+references:
+- URL: 'https://johnmacfarlane.net/vagueness.pdf'
+  id: test1
+- URL: 'https://pandoc.org'
+  id: test2
+- URL: 'https://johnmacfarlane.net'
+  id: test3
+suppress-bibliography: true
+---
+
+Test 1 [@test1, pp. 93--101].
+
+Test 2 [@test2, pp. 93--101].
+
+Test 3 [@test3, pp. 93-101].
+^D
+Test 1.[^1]
+
+Test 2.[^2]
+
+Test 3.[^3]
+
+[^1]: N.d., 93--101, <https://johnmacfarlane.net/vagueness.pdf>.
+
+[^2]: N.d., 93--101, <https://pandoc.org>.
+
+[^3]: N.d., 93--101, <https://johnmacfarlane.net>.
+```
diff --git a/test/command/sage-harvard.csl b/test/command/sage-harvard.csl
new file mode 100644
--- /dev/null
+++ b/test/command/sage-harvard.csl
@@ -0,0 +1,202 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never" default-locale="en-GB">
+  <info>
+    <title>SAGE - Harvard</title>
+    <id>http://www.zotero.org/styles/sage-harvard</id>
+    <link href="http://www.zotero.org/styles/sage-harvard" rel="self"/>
+    <link href="http://www.zotero.org/styles/the-open-university-harvard" rel="template"/>
+    <link href="http://www.uk.sagepub.com/repository/binaries/pdf/SAGE_Harvard_reference_style.pdf" rel="documentation"/>
+    <author>
+      <name>Joseph Reagle</name>
+    </author>
+    <category citation-format="author-date"/>
+    <category field="generic-base"/>
+    <summary>The SAGE Harvard author-date style</summary>
+    <updated>2012-09-27T22:06:38+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="en-GB">
+    <terms>
+      <term name="editor" form="short">
+        <single>ed.</single>
+        <multiple>eds</multiple>
+      </term>
+    </terms>
+  </locale>
+  <macro name="editor">
+    <names variable="editor" delimiter=", ">
+      <name and="text" initialize-with="" delimiter=", " sort-separator=" " name-as-sort-order="all"/>
+      <label form="short" prefix=" (" suffix=")"/>
+    </names>
+  </macro>
+  <macro name="author">
+    <names variable="author">
+      <name initialize-with="" name-as-sort-order="all" and="text" sort-separator=" " delimiter=", " delimiter-precedes-last="never" form="long"/>
+      <label form="short" prefix=" (" suffix=")"/>
+      <substitute>
+        <names variable="editor"/>
+        <names variable="translator"/>
+        <text variable="container-title" font-style="italic"/>
+        <text macro="title"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="author-count">
+    <names variable="author">
+      <name form="count"/>
+      <substitute>
+        <names variable="editor"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="author-short">
+    <names variable="author">
+      <name form="short" and="text" delimiter=", " delimiter-precedes-last="never" initialize-with=""/>
+      <substitute>
+        <names variable="editor"/>
+        <names variable="translator"/>
+        <text variable="container-title" font-style="italic"/>
+        <text macro="title"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="access">
+    <choose>
+      <if variable="URL">
+        <text value="Available from: "/>
+        <text variable="URL"/>
+        <group prefix=" (" delimiter=" " suffix=")">
+          <text term="accessed"/>
+          <date variable="accessed">
+            <date-part name="day" suffix=" "/>
+            <date-part name="month" suffix=" "/>
+            <date-part name="year"/>
+          </date>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="title">
+    <choose>
+      <if type="bill book graphic legal_case motion_picture report song" match="any">
+        <text variable="title" font-style="italic"/>
+      </if>
+      <else>
+        <text variable="title"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="publisher">
+    <group delimiter=": ">
+      <text variable="publisher-place"/>
+      <text variable="publisher"/>
+    </group>
+  </macro>
+  <macro name="year-date">
+    <choose>
+      <if variable="issued">
+        <date variable="issued">
+          <date-part name="year"/>
+        </date>
+      </if>
+      <else>
+        <text term="no date" form="short"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="locator">
+    <choose>
+      <if type="article-journal">
+        <text variable="volume"/>
+        <text variable="issue" prefix="(" suffix=")"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="published-date">
+    <choose>
+      <if type="article-newspaper">
+        <date variable="issued">
+          <date-part name="day" form="ordinal" suffix=" "/>
+          <date-part name="month" form="long"/>
+        </date>
+      </if>
+    </choose>
+  </macro>
+  <macro name="pages">
+    <choose>
+      <if type="chapter paper-conference" match="any">
+        <group delimiter=" " prefix=", ">
+          <label variable="page" form="short" suffix=" "/>
+          <text variable="page"/>
+        </group>
+      </if>
+      <else-if type="article-journal">
+        <text variable="page" prefix=": "/>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="edition">
+    <choose>
+      <if is-numeric="edition">
+        <group delimiter=" ">
+          <number variable="edition" form="ordinal"/>
+          <text term="edition" form="short"/>
+        </group>
+      </if>
+      <else>
+        <text variable="edition" suffix="."/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="container-prefix">
+    <choose>
+      <if type="chapter paper-conference" match="any">
+        <text term="in" text-case="capitalize-first" suffix=": "/>
+      </if>
+    </choose>
+  </macro>
+  <citation et-al-min="3" et-al-use-first="1" disambiguate-add-year-suffix="true" disambiguate-add-names="true" disambiguate-add-givenname="true" collapse="year">
+    <sort>
+      <key macro="author-short"/>
+      <key macro="year-date"/>
+    </sort>
+    <layout prefix="(" suffix=")" delimiter="; ">
+      <group delimiter=": ">
+        <group delimiter=", ">
+          <text macro="author-short"/>
+          <text macro="year-date"/>
+        </group>
+        <text variable="locator"/>
+      </group>
+    </layout>
+  </citation>
+  <bibliography hanging-indent="true" et-al-min="4" et-al-use-first="3">
+    <sort>
+      <key macro="author" names-min="1" names-use-first="1"/>
+      <key macro="author-count" names-min="3" names-use-first="3"/>
+      <key macro="author" names-min="3" names-use-first="1"/>
+      <key macro="year-date"/>
+      <key variable="title"/>
+    </sort>
+    <layout suffix=".">
+      <group delimiter=" ">
+        <text macro="author"/>
+        <text macro="year-date" prefix="(" suffix=")"/>
+        <text macro="title" suffix="."/>
+        <text macro="edition"/>
+        <text macro="container-prefix"/>
+        <group delimiter=", ">
+          <text macro="editor"/>
+          <text variable="container-title" font-style="italic"/>
+          <text variable="collection-title"/>
+          <text variable="genre"/>
+          <text macro="publisher"/>
+          <text macro="published-date"/>
+        </group>
+        <text macro="locator"/>
+      </group>
+      <text macro="pages"/>
+      <text macro="access" prefix=". "/>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/science.csl b/test/command/science.csl
new file mode 100644
--- /dev/null
+++ b/test/command/science.csl
@@ -0,0 +1,245 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="en-US">
+  <info>
+    <title>Science</title>
+    <id>http://www.zotero.org/styles/science</id>
+    <link href="http://www.zotero.org/styles/science" rel="self"/>
+    <link href="http://www.sciencemag.org/about/authors/prep/res/refs.dtl" rel="documentation"/>
+    <author>
+      <name>Julian Onions</name>
+      <email>julian.onions@gmail.com</email>
+    </author>
+    <contributor>
+      <name>Sebastian Karcher</name>
+    </contributor>
+    <contributor>
+      <name>Greg Barendt</name>
+    </contributor>
+    <category citation-format="numeric"/>
+    <category field="science"/>
+    <issn>0036-8075</issn>
+    <eissn>1095-9203</eissn>
+    <summary>The Science journal style.</summary>
+    <updated>2014-06-18T08:06:38+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <macro name="editor">
+    <names variable="editor" delimiter=", ">
+      <name initialize-with=". " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="short" prefix=", " text-case="capitalize-first"/>
+    </names>
+  </macro>
+  <macro name="author">
+    <names variable="author">
+      <name sort-separator=", " initialize-with=". " delimiter=", " delimiter-precedes-last="always"/>
+      <label form="short" prefix=", " text-case="capitalize-first"/>
+      <et-al font-style="italic"/>
+      <substitute>
+        <names variable="editor"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="access">
+    <choose>
+      <if variable="page" match="none">
+        <text macro="access-value"/>
+      </if>
+      <else-if is-numeric="page" match="none">
+        <text macro="access-value"/>
+      </else-if>
+    </choose>
+  </macro>
+  <macro name="access-value">
+    <choose>
+      <if variable="DOI">
+        <text variable="DOI" prefix=", doi:"/>
+      </if>
+      <else>
+        <group prefix=" (" suffix=")">
+          <text value="available at "/>
+          <text variable="URL"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="title">
+    <choose>
+      <if type="bill book graphic legal_case legislation motion_picture report song" match="any">
+        <text variable="title" font-style="italic"/>
+      </if>
+      <else>
+        <text variable="title"/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="article-details">
+    <group delimiter=", ">
+      <group delimiter=". ">
+        <text macro="title"/>
+        <text form="short" variable="container-title" font-style="italic"/>
+        <text variable="volume" font-weight="bold"/>
+      </group>
+      <text variable="page"/>
+    </group>
+    <text macro="issued" prefix=" (" suffix=")"/>
+    <text macro="access"/>
+  </macro>
+  <macro name="publisher">
+    <group delimiter=", ">
+      <text variable="publisher"/>
+      <text variable="publisher-place"/>
+    </group>
+  </macro>
+  <macro name="volume">
+    <text variable="volume" prefix="vol. "/>
+  </macro>
+  <macro name="pages">
+    <label variable="page" form="short" suffix=" "/>
+    <text variable="page" form="short"/>
+  </macro>
+  <macro name="issued">
+    <date variable="issued" delimiter=" ">
+      <date-part name="year"/>
+    </date>
+  </macro>
+  <macro name="edition">
+    <choose>
+      <if is-numeric="edition">
+        <group delimiter=" ">
+          <text term="edition" form="short"/>
+          <number variable="edition" form="numeric"/>
+        </group>
+      </if>
+      <else>
+        <text variable="edition" suffix="."/>
+      </else>
+    </choose>
+  </macro>
+  <citation collapse="citation-number">
+    <sort>
+      <key variable="citation-number"/>
+    </sort>
+    <layout prefix="(" suffix=")" delimiter=", ">
+      <text variable="citation-number" font-style="italic"/>
+    </layout>
+  </citation>
+  <bibliography et-al-min="6" et-al-use-first="1" second-field-align="flush">
+    <layout suffix=".">
+      <text variable="citation-number" suffix=". "/>
+      <group delimiter=", ">
+        <text macro="author"/>
+        <choose>
+          <if type="thesis">
+            <group delimiter=" ">
+              <group delimiter=", ">
+                <group>
+                  <!-- Always print, even if no university given -->
+                  <text value="thesis"/>
+                </group>
+                <text macro="publisher"/>
+              </group>
+              <text macro="issued" prefix="(" suffix=")"/>
+            </group>
+          </if>
+          <else-if type="bill book graphic legal_case legislation motion_picture song chapter paper-conference" match="any">
+            <group delimiter=" ">
+              <choose>
+                <if type="chapter paper-conference" match="any">
+                  <group delimiter=", ">
+                    <group delimiter=" ">
+                      <text term="in"/>
+                      <text variable="container-title" font-style="italic"/>
+                    </group>
+                    <text macro="editor"/>
+                  </group>
+                </if>
+                <else>
+                  <text macro="title"/>
+                </else>
+              </choose>
+              <group prefix="(" suffix=")" delimiter="; ">
+                <group delimiter=", ">
+                  <text macro="publisher"/>
+                  <text macro="edition"/>
+                  <text macro="issued"/>
+                </group>
+                <text variable="URL"/>
+              </group>
+            </group>
+            <group delimiter=" of ">
+              <group>
+                <label variable="volume" form="short" suffix=" "/>
+                <number variable="volume"/>
+              </group>
+              <text variable="collection-title" font-style="italic"/>
+            </group>
+            <choose>
+              <if type="chapter paper-conference" match="any">
+                <text macro="pages"/>
+              </if>
+            </choose>
+          </else-if>
+          <else-if type="article-journal">
+            <choose>
+              <if variable="page">
+                <choose>
+                  <if is-numeric="page" match="none">
+                    <group>
+                      <group delimiter=", ">
+                        <text variable="container-title" form="short" font-style="italic"/>
+                        <group>
+                          <text term="in press"/>
+                        </group>
+                      </group>
+                      <text macro="access"/>
+                    </group>
+                  </if>
+                  <else>
+                    <text macro="article-details"/>
+                  </else>
+                </choose>
+              </if>
+              <else>
+                <text macro="article-details"/>
+              </else>
+            </choose>
+          </else-if>
+          <else-if type="report">
+            <group>
+              <group delimiter=", ">
+                <text variable="title" quotes="true"/>
+                <text variable="collection-title" font-style="italic"/>
+              </group>
+              <group prefix=" (" suffix=")" delimiter=", ">
+                <group delimiter=" ">
+                  <text variable="genre" form="short"/>
+                  <number variable="number"/>
+                </group>
+                <text variable="publisher"/>
+                <text variable="publisher-place"/>
+                <text macro="issued"/>
+              </group>
+            </group>
+            <text macro="pages"/>
+            <text macro="access"/>
+          </else-if>
+          <else>
+            <group>
+              <group delimiter=", ">
+                <text macro="editor"/>
+                <group delimiter=". ">
+                  <text macro="title"/>
+                  <text form="short" variable="container-title" font-style="italic"/>
+                  <text variable="volume" font-weight="bold"/>
+                </group>
+              </group>
+              <text macro="issued" prefix=" (" suffix=")"/>
+            </group>
+            <text macro="pages"/>
+            <text macro="access"/>
+          </else>
+        </choose>
+      </group>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/style399.csl b/test/command/style399.csl
new file mode 100644
--- /dev/null
+++ b/test/command/style399.csl
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="never" default-locale="en-US">
+  <citation>
+    <sort>
+      <key variable="citation-number"/>
+    </sort>
+    <layout prefix="[" suffix="]" delimiter=",">
+      <text variable="citation-number"/>
+    </layout>
+  </citation>
+</style>
+
diff --git a/test/command/table-with-cell-align.md b/test/command/table-with-cell-align.md
new file mode 100644
--- /dev/null
+++ b/test/command/table-with-cell-align.md
@@ -0,0 +1,82 @@
+```
+% pandoc -f docbook -t native --quiet
+<informaltable frame="all" rowsep="1" colsep="1">
+<tgroup cols="16">
+<tbody>
+<row>
+<entry align="center" valign="top"><simpara>1</simpara></entry>
+<entry align="left" valign="top"><simpara>2</simpara></entry>
+<entry align="right" valign="top"><simpara>3</simpara></entry>
+<entry align="justify" valign="top"><simpara>4</simpara></entry>
+</row>
+</tbody>
+</tgroup>
+</informaltable>
+^D
+[Table ("",[],[]) (Caption Nothing
+ [])
+ [(AlignDefault,ColWidthDefault)
+ ,(AlignDefault,ColWidthDefault)
+ ,(AlignDefault,ColWidthDefault)
+ ,(AlignDefault,ColWidthDefault)]
+ (TableHead ("",[],[])
+ [])
+ [(TableBody ("",[],[]) (RowHeadColumns 0)
+  []
+  [Row ("",[],[])
+   [Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)
+    [Para [Str "1"]]
+   ,Cell ("",[],[]) AlignLeft (RowSpan 1) (ColSpan 1)
+    [Para [Str "2"]]
+   ,Cell ("",[],[]) AlignRight (RowSpan 1) (ColSpan 1)
+    [Para [Str "3"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+    [Para [Str "4"]]]])]
+ (TableFoot ("",[],[])
+ [])]
+```
+```
+% pandoc -f native -t opendocument --quiet
+[Table ("",[],[]) (Caption Nothing
+ [])
+ [(AlignDefault,ColWidthDefault)
+ ,(AlignDefault,ColWidthDefault)
+ ,(AlignDefault,ColWidthDefault)
+ ,(AlignDefault,ColWidthDefault)]
+ (TableHead ("",[],[])
+ [])
+ [(TableBody ("",[],[]) (RowHeadColumns 0)
+  []
+  [Row ("",[],[])
+   [Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)
+    [Para [Str "1"]]
+   ,Cell ("",[],[]) AlignLeft (RowSpan 1) (ColSpan 1)
+    [Para [Str "2"]]
+   ,Cell ("",[],[]) AlignRight (RowSpan 1) (ColSpan 1)
+    [Para [Str "3"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+    [Para [Str "4"]]]])]
+ (TableFoot ("",[],[])
+ [])]
+^D
+<table:table table:name="Table1" table:style-name="Table1">
+  <table:table-column table:style-name="Table1.A" />
+  <table:table-column table:style-name="Table1.B" />
+  <table:table-column table:style-name="Table1.C" />
+  <table:table-column table:style-name="Table1.D" />
+  <table:table-row>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="P1">1</text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="Table_20_Contents">2</text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="P2">3</text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="Table_20_Contents">4</text:p>
+    </table:table-cell>
+  </table:table-row>
+</table:table>
+```
diff --git a/test/command/table-with-column-span.md b/test/command/table-with-column-span.md
new file mode 100644
--- /dev/null
+++ b/test/command/table-with-column-span.md
@@ -0,0 +1,276 @@
+```
+% pandoc -f docbook -t native --quiet
+<informaltable frame="all" rowsep="1" colsep="1">
+<tgroup cols="16">
+<colspec colname="col_1" colwidth="6.25*"/>
+<colspec colname="col_2" colwidth="6.25*"/>
+<colspec colname="col_3" colwidth="6.25*"/>
+<colspec colname="col_4" colwidth="6.25*"/>
+<colspec colname="col_5" colwidth="6.25*"/>
+<colspec colname="col_6" colwidth="6.25*"/>
+<colspec colname="col_7" colwidth="6.25*"/>
+<colspec colname="col_8" colwidth="6.25*"/>
+<colspec colname="col_9" colwidth="6.25*"/>
+<colspec colname="col_10" colwidth="6.25*"/>
+<colspec colname="col_11" colwidth="6.25*"/>
+<colspec colname="col_12" colwidth="6.25*"/>
+<colspec colname="col_13" colwidth="6.25*"/>
+<colspec colname="col_14" colwidth="6.25*"/>
+<colspec colname="col_15" colwidth="6.25*"/>
+<colspec colname="col_16" colwidth="6.25*"/>
+<tbody>
+<row>
+<entry align="center" valign="top" namest="col_1" nameend="col_8"><simpara><emphasis role="strong">Octet no. 1</emphasis></simpara></entry>
+<entry align="center" valign="top" namest="col_2" nameend="col_9"><simpara><emphasis role="strong">Octet no. 2</emphasis></simpara></entry>
+</row>
+<row>
+<entry align="center" valign="top"><simpara>16</simpara></entry>
+<entry align="center" valign="top"><simpara>15</simpara></entry>
+<entry align="center" valign="top"><simpara>14</simpara></entry>
+<entry align="center" valign="top"><simpara>13</simpara></entry>
+<entry align="center" valign="top"><simpara>12</simpara></entry>
+<entry align="center" valign="top"><simpara>11</simpara></entry>
+<entry align="center" valign="top"><simpara>10</simpara></entry>
+<entry align="center" valign="top"><simpara>9</simpara></entry>
+<entry align="center" valign="top"><simpara>8</simpara></entry>
+<entry align="center" valign="top"><simpara>7</simpara></entry>
+<entry align="center" valign="top"><simpara>6</simpara></entry>
+<entry align="center" valign="top"><simpara>5</simpara></entry>
+<entry align="center" valign="top"><simpara>4</simpara></entry>
+<entry align="center" valign="top"><simpara>3</simpara></entry>
+<entry align="center" valign="top"><simpara>2</simpara></entry>
+<entry align="center" valign="top"><simpara>1</simpara></entry>
+</row>
+<row>
+<entry align="center" valign="top" namest="col_1" nameend="col_8"><simpara>Code A</simpara></entry>
+<entry align="center" valign="top" namest="col_2" nameend="col_9"><simpara>Code B</simpara></entry>
+</row>
+</tbody>
+</tgroup>
+</informaltable>
+^D
+[Table ("",[],[]) (Caption Nothing
+ [])
+ [(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)]
+ (TableHead ("",[],[])
+ [])
+ [(TableBody ("",[],[]) (RowHeadColumns 0)
+  []
+  [Row ("",[],[])
+   [Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 8)
+    [Para [Strong [Str "Octet",Space,Str "no.",Space,Str "1"]]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 8)
+    [Para [Strong [Str "Octet",Space,Str "no.",Space,Str "2"]]]]
+  ,Row ("",[],[])
+   [Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)
+    [Para [Str "16"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)
+    [Para [Str "15"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)
+    [Para [Str "14"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)
+    [Para [Str "13"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)
+    [Para [Str "12"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)
+    [Para [Str "11"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)
+    [Para [Str "10"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)
+    [Para [Str "9"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)
+    [Para [Str "8"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)
+    [Para [Str "7"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)
+    [Para [Str "6"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)
+    [Para [Str "5"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)
+    [Para [Str "4"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)
+    [Para [Str "3"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)
+    [Para [Str "2"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1)
+    [Para [Str "1"]]]
+  ,Row ("",[],[])
+   [Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 8)
+    [Para [Str "Code",Space,Str "A"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 8)
+    [Para [Str "Code",Space,Str "B"]]]])]
+ (TableFoot ("",[],[])
+ [])]
+```
+```
+% pandoc -f native -t opendocument --quiet
+[Table ("",[],[]) (Caption Nothing
+ [])
+ [(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)
+ ,(AlignDefault,ColWidth 6.25e-2)]
+ (TableHead ("",[],[])
+ [])
+ [(TableBody ("",[],[]) (RowHeadColumns 0)
+  []
+  [Row ("",[],[])
+   [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 8)
+    [Para [Strong [Str "Octet",Space,Str "no.",Space,Str "1"]]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 8)
+    [Para [Strong [Str "Octet",Space,Str "no.",Space,Str "2"]]]]
+  ,Row ("",[],[])
+   [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+    [Para [Str "16"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+    [Para [Str "15"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+    [Para [Str "14"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+    [Para [Str "13"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+    [Para [Str "12"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+    [Para [Str "11"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+    [Para [Str "10"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+    [Para [Str "9"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+    [Para [Str "8"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+    [Para [Str "7"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+    [Para [Str "6"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+    [Para [Str "5"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+    [Para [Str "4"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+    [Para [Str "3"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+    [Para [Str "2"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1)
+    [Para [Str "1"]]]
+  ,Row ("",[],[])
+   [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 8)
+    [Para [Str "Code",Space,Str "A"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 8)
+    [Para [Str "Code",Space,Str "B"]]]])]
+ (TableFoot ("",[],[])
+ [])]
+^D
+<table:table table:name="Table1" table:style-name="Table1">
+  <table:table-column table:style-name="Table1.A" />
+  <table:table-column table:style-name="Table1.B" />
+  <table:table-column table:style-name="Table1.C" />
+  <table:table-column table:style-name="Table1.D" />
+  <table:table-column table:style-name="Table1.E" />
+  <table:table-column table:style-name="Table1.F" />
+  <table:table-column table:style-name="Table1.G" />
+  <table:table-column table:style-name="Table1.H" />
+  <table:table-column table:style-name="Table1.I" />
+  <table:table-column table:style-name="Table1.J" />
+  <table:table-column table:style-name="Table1.K" />
+  <table:table-column table:style-name="Table1.L" />
+  <table:table-column table:style-name="Table1.M" />
+  <table:table-column table:style-name="Table1.N" />
+  <table:table-column table:style-name="Table1.O" />
+  <table:table-column table:style-name="Table1.P" />
+  <table:table-row>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string" table:number-columns-spanned="8">
+      <text:p text:style-name="Table_20_Contents"><text:span text:style-name="T1">Octet
+      no. 1</text:span></text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string" table:number-columns-spanned="8">
+      <text:p text:style-name="Table_20_Contents"><text:span text:style-name="T1">Octet
+      no. 2</text:span></text:p>
+    </table:table-cell>
+  </table:table-row>
+  <table:table-row>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="Table_20_Contents">16</text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="Table_20_Contents">15</text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="Table_20_Contents">14</text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="Table_20_Contents">13</text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="Table_20_Contents">12</text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="Table_20_Contents">11</text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="Table_20_Contents">10</text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="Table_20_Contents">9</text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="Table_20_Contents">8</text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="Table_20_Contents">7</text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="Table_20_Contents">6</text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="Table_20_Contents">5</text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="Table_20_Contents">4</text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="Table_20_Contents">3</text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="Table_20_Contents">2</text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string">
+      <text:p text:style-name="Table_20_Contents">1</text:p>
+    </table:table-cell>
+  </table:table-row>
+  <table:table-row>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string" table:number-columns-spanned="8">
+      <text:p text:style-name="Table_20_Contents">Code A</text:p>
+    </table:table-cell>
+    <table:table-cell table:style-name="TableRowCell" office:value-type="string" table:number-columns-spanned="8">
+      <text:p text:style-name="Table_20_Contents">Code B</text:p>
+    </table:table-cell>
+  </table:table-row>
+</table:table>
+```
diff --git a/test/command/vancouver.csl b/test/command/vancouver.csl
new file mode 100644
--- /dev/null
+++ b/test/command/vancouver.csl
@@ -0,0 +1,351 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" page-range-format="minimal">
+  <info>
+    <title>Vancouver</title>
+    <id>http://www.zotero.org/styles/vancouver</id>
+    <link href="http://www.zotero.org/styles/vancouver" rel="self"/>
+    <link href="http://www.nlm.nih.gov/bsd/uniform_requirements.html" rel="documentation"/>
+    <author>
+      <name>Michael Berkowitz</name>
+      <email>mberkowi@gmu.edu</email>
+    </author>
+    <contributor>
+      <name>Sean Takats</name>
+      <email>stakats@gmu.edu</email>
+    </contributor>
+    <contributor>
+      <name>Sebastian Karcher</name>
+    </contributor>
+    <category citation-format="numeric"/>
+    <category field="medicine"/>
+    <summary>Vancouver style as outlined by International Committee of Medical Journal Editors Uniform Requirements for Manuscripts Submitted to Biomedical Journals: Sample References</summary>
+    <updated>2014-09-06T16:03:01+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="en">
+    <date form="text" delimiter=" ">
+      <date-part name="year"/>
+      <date-part name="month" form="short" strip-periods="true"/>
+      <date-part name="day"/>
+    </date>
+    <terms>
+      <term name="collection-editor" form="long">
+        <single>editor</single>
+        <multiple>editors</multiple>
+      </term>
+      <term name="presented at">presented at</term>
+      <term name="available at">available from</term>
+      <term name="section" form="short">sect.</term>
+    </terms>
+  </locale>
+  <locale xml:lang="fr">
+    <date form="text" delimiter=" ">
+      <date-part name="day"/>
+      <date-part name="month" form="short" strip-periods="true"/>
+      <date-part name="year"/>
+    </date>
+  </locale>
+  <macro name="author">
+    <names variable="author">
+      <name sort-separator=" " initialize-with="" name-as-sort-order="all" delimiter=", " delimiter-precedes-last="always"/>
+      <label form="long" prefix=", "/>
+      <substitute>
+        <names variable="editor"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="editor">
+    <names variable="editor" suffix=".">
+      <name sort-separator=" " initialize-with="" name-as-sort-order="all" delimiter=", " delimiter-precedes-last="always"/>
+      <label form="long" prefix=", "/>
+    </names>
+  </macro>
+  <macro name="chapter-marker">
+    <choose>
+      <if type="chapter paper-conference entry-dictionary entry-encyclopedia" match="any">
+        <text term="in" text-case="capitalize-first"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="publisher">
+    <choose>
+      <!--discard publisher info for articles-->
+      <if type="article-journal article-magazine article-newspaper" match="none">
+        <group delimiter=": " suffix=";">
+          <choose>
+            <if type="thesis">
+              <text variable="publisher-place" prefix="[" suffix="]"/>
+            </if>
+            <else-if type="speech"/>
+            <else>
+              <text variable="publisher-place"/>
+            </else>
+          </choose>
+          <text variable="publisher"/>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="access">
+    <choose>
+      <if variable="URL">
+        <group delimiter=": ">
+          <text term="available at" text-case="capitalize-first"/>
+          <text variable="URL"/>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="accessed-date">
+    <choose>
+      <if variable="URL">
+        <group prefix="[" suffix="]" delimiter=" ">
+          <text term="cited" text-case="lowercase"/>
+          <date variable="accessed" form="text"/>
+        </group>
+      </if>
+    </choose>
+  </macro>
+  <macro name="container-title">
+    <choose>
+      <if type="article-journal article-magazine chapter paper-conference article-newspaper review review-book entry-dictionary entry-encyclopedia" match="any">
+        <group suffix="." delimiter=" ">
+          <choose>
+            <if type="article-journal review review-book" match="any">
+              <text variable="container-title" form="short" strip-periods="true"/>
+            </if>
+            <else>
+              <text variable="container-title" strip-periods="true"/>
+            </else>
+          </choose>
+          <choose>
+            <if variable="URL">
+              <text term="internet" prefix="[" suffix="]" text-case="capitalize-first"/>
+            </if>
+          </choose>
+        </group>
+        <text macro="edition" prefix=" "/>
+      </if>
+      <!--add event-name and event-place once they become available-->
+      <else-if type="bill legislation" match="any">
+        <group delimiter=", ">
+          <group delimiter=". ">
+            <text variable="container-title"/>
+            <group delimiter=" ">
+              <text term="section" form="short" text-case="capitalize-first"/>
+              <text variable="section"/>
+            </group>
+          </group>
+          <text variable="number"/>
+        </group>
+      </else-if>
+      <else-if type="speech">
+        <group delimiter=": " suffix=";">
+          <group delimiter=" ">
+            <text variable="genre" text-case="capitalize-first"/>
+            <text term="presented at"/>
+          </group>
+          <text variable="event"/>
+        </group>
+      </else-if>
+      <else>
+        <group delimiter=", " suffix=".">
+          <choose>
+            <if variable="collection-title" match="none">
+              <group delimiter=" ">
+                <label variable="volume" form="short" text-case="capitalize-first"/>
+                <text variable="volume"/>
+              </group>
+            </if>
+          </choose>
+          <text variable="container-title"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="title">
+    <text variable="title"/>
+    <choose>
+      <if type="article-journal article-magazine chapter paper-conference article-newspaper review review-book entry-dictionary entry-encyclopedia" match="none">
+        <choose>
+          <if variable="URL">
+            <text term="internet" prefix=" [" suffix="]" text-case="capitalize-first"/>
+          </if>
+        </choose>
+        <text macro="edition" prefix=". "/>
+      </if>
+    </choose>
+    <choose>
+      <if type="thesis">
+        <text variable="genre" prefix=" [" suffix="]"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="edition">
+    <choose>
+      <if is-numeric="edition">
+        <group delimiter=" ">
+          <number variable="edition" form="ordinal"/>
+          <text term="edition" form="short"/>
+        </group>
+      </if>
+      <else>
+        <text variable="edition" suffix="."/>
+      </else>
+    </choose>
+  </macro>
+  <macro name="date">
+    <choose>
+      <if type="article-journal article-magazine article-newspaper review review-book" match="any">
+        <group suffix=";" delimiter=" ">
+          <date variable="issued" form="text"/>
+          <text macro="accessed-date"/>
+        </group>
+      </if>
+      <else-if type="bill legislation" match="any">
+        <group delimiter=", ">
+          <date variable="issued" delimiter=" ">
+            <date-part name="month" form="short" strip-periods="true"/>
+            <date-part name="day"/>
+          </date>
+          <date variable="issued">
+            <date-part name="year"/>
+          </date>
+        </group>
+      </else-if>
+      <else-if type="report">
+        <date variable="issued" delimiter=" ">
+          <date-part name="year"/>
+          <date-part name="month" form="short" strip-periods="true"/>
+        </date>
+        <text macro="accessed-date" prefix=" "/>
+      </else-if>
+      <else-if type="patent">
+        <group suffix=".">
+          <group delimiter=", ">
+            <text variable="number"/>
+            <date variable="issued">
+              <date-part name="year"/>
+            </date>
+          </group>
+          <text macro="accessed-date" prefix=" "/>
+        </group>
+      </else-if>
+      <else-if type="speech">
+        <group delimiter="; ">
+          <group delimiter=" ">
+            <date variable="issued" delimiter=" ">
+              <date-part name="year"/>
+              <date-part name="month" form="short" strip-periods="true"/>
+              <date-part name="day"/>
+            </date>
+            <text macro="accessed-date"/>
+          </group>
+          <text variable="event-place"/>
+        </group>
+      </else-if>
+      <else>
+        <group suffix=".">
+          <date variable="issued">
+            <date-part name="year"/>
+          </date>
+          <text macro="accessed-date" prefix=" "/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="pages">
+    <choose>
+      <if type="article-journal article-magazine article-newspaper review review-book" match="any">
+        <text variable="page" prefix=":"/>
+      </if>
+      <else-if type="book" match="any">
+        <text variable="number-of-pages" prefix=" "/>
+        <choose>
+          <if is-numeric="number-of-pages">
+            <label variable="number-of-pages" form="short" prefix=" " plural="never"/>
+          </if>
+        </choose>
+      </else-if>
+      <else>
+        <group prefix=" " delimiter=" ">
+          <label variable="page" form="short" plural="never"/>
+          <text variable="page"/>
+        </group>
+      </else>
+    </choose>
+  </macro>
+  <macro name="journal-location">
+    <choose>
+      <if type="article-journal article-magazine review review-book" match="any">
+        <text variable="volume"/>
+        <text variable="issue" prefix="(" suffix=")"/>
+      </if>
+    </choose>
+  </macro>
+  <macro name="collection-details">
+    <choose>
+      <if type="article-journal article-magazine article-newspaper review review-book" match="none">
+        <choose>
+          <if variable="collection-title">
+            <group delimiter=" " prefix="(" suffix=")">
+              <names variable="collection-editor" suffix=".">
+                <name sort-separator=" " initialize-with="" name-as-sort-order="all" delimiter=", " delimiter-precedes-last="always"/>
+                <label form="long" prefix=", "/>
+              </names>
+              <group delimiter="; ">
+                <text variable="collection-title"/>
+                <group delimiter=" ">
+                  <label variable="volume" form="short"/>
+                  <text variable="volume"/>
+                </group>
+              </group>
+            </group>
+          </if>
+        </choose>
+      </if>
+    </choose>
+  </macro>
+  <macro name="report-details">
+    <choose>
+      <if type="report">
+        <text variable="number" prefix="Report No.: "/>
+      </if>
+    </choose>
+  </macro>
+  <citation collapse="citation-number">
+    <sort>
+      <key variable="citation-number"/>
+    </sort>
+    <layout prefix="(" suffix=")" delimiter=",">
+      <text variable="citation-number"/>
+    </layout>
+  </citation>
+  <bibliography et-al-min="7" et-al-use-first="6" second-field-align="flush">
+    <layout>
+      <text variable="citation-number" suffix=". "/>
+      <group delimiter=". " suffix=". ">
+        <text macro="author"/>
+        <text macro="title"/>
+      </group>
+      <group delimiter=" " suffix=". ">
+        <group delimiter=": ">
+          <text macro="chapter-marker"/>
+          <group delimiter=" ">
+            <text macro="editor"/>
+            <text macro="container-title"/>
+          </group>
+        </group>
+        <text macro="publisher"/>
+        <group>
+          <text macro="date"/>
+          <text macro="journal-location"/>
+          <text macro="pages"/>
+        </group>
+      </group>
+      <text macro="collection-details" suffix=". "/>
+      <text macro="report-details" suffix=". "/>
+      <text macro="access"/>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/command/zeitschrift-fur-kunstgeschichte.csl b/test/command/zeitschrift-fur-kunstgeschichte.csl
new file mode 100644
--- /dev/null
+++ b/test/command/zeitschrift-fur-kunstgeschichte.csl
@@ -0,0 +1,346 @@
+<?xml version="1.0" encoding="utf-8"?>
+<style xmlns="http://purl.org/net/xbiblio/csl" class="note" version="1.0" demote-non-dropping-particle="sort-only">
+  <info>
+    <title>Zeitschrift für Kunstgeschichte</title>
+    <title-short>ZfK</title-short>
+    <id>http://www.zotero.org/styles/zeitschrift-fur-kunstgeschichte</id>
+    <link href="http://www.zotero.org/styles/zeitschrift-fur-kunstgeschichte" rel="self"/>
+    <link href="http://www.zotero.org/styles/kritische-ausgabe" rel="template"/>
+    <link href="http://www.uni-bielefeld.de/geschichte/abteilung/arbeitsbereiche/bildwissenschaft/zfk/documents/Sylesheet-(ger)-Zeitschrift-fur-Kunstgeschichte.pdf" rel="documentation"/>
+    <link href="https://github.com/citation-style-language/styles/pull/1861" rel="documentation"/>
+    <author>
+      <name>Philipp Zumstein</name>
+      <uri>https://github.com/zuphilip/</uri>
+    </author>
+    <contributor>
+      <name>Anna Simon</name>
+      <email>simonanna@gmx.net</email>
+    </contributor>
+    <category citation-format="note"/>
+    <category field="humanities"/>
+    <category field="history"/>
+    <issn>0044-2992</issn>
+    <summary>From the editors: "Die Herausgeber werden im Falle von Editionen, Lexika und Ausstellungskatalogen dem Titel nachgestellt [use encyclopedia articles with or without container-title for that]. Bei gewöhnlichen Sammelbänden werden die Herausgeber dem Titel vorangestellt [use book for that]." Multilingual style; the information for exhibition catalogues should be entered in the field collection-title; locators may use the word "here" or "hier" in front of the page refering to which must be entered individually (the style outputs the locator as it is entered w/o any label or additional text).</summary>
+    <updated>2016-02-03T17:41:02+00:00</updated>
+    <rights license="http://creativecommons.org/licenses/by-sa/3.0/">This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License</rights>
+  </info>
+  <locale xml:lang="de">
+    <terms>
+      <term name="note">wie Anm.</term>
+      <term name="et-al">et al.</term>
+      <term name="editor" form="short">Hg.</term>
+      <term name="editortranslator" form="verb-short">hg. und übers. von</term>
+      <term name="accessed">letzter Zugriff am</term>
+    </terms>
+  </locale>
+  <locale xml:lang="en">
+    <terms>
+      <term name="note">as note</term>
+      <term name="editortranslator" form="verb-short">ed. and trans. by</term>
+    </terms>
+  </locale>
+  <macro name="author-short">
+    <names variable="author">
+      <name form="short" delimiter="/" and="text" delimiter-precedes-et-al="never"/>
+      <substitute>
+        <choose>
+          <if type="entry-encyclopedia" match="none">
+            <names variable="editor"/>
+          </if>
+        </choose>
+        <text variable="title" form="short"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="author">
+    <names variable="author" delimiter=", ">
+      <name and="text" delimiter-precedes-et-al="never" delimiter-precedes-last="never"/>
+      <label form="short" prefix=" (" suffix=")"/>
+      <substitute>
+        <choose>
+          <if type="entry-encyclopedia" match="none">
+            <names variable="editor"/>
+          </if>
+        </choose>
+        <text variable="title"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="author-bibliography">
+    <names variable="author" delimiter=", ">
+      <name and="text" delimiter-precedes-et-al="never" delimiter-precedes-last="never" name-as-sort-order="first"/>
+      <label form="short" prefix=" (" suffix=")"/>
+      <substitute>
+        <choose>
+          <if type="entry-encyclopedia" match="none">
+            <names variable="editor"/>
+          </if>
+        </choose>
+        <text variable="title"/>
+      </substitute>
+    </names>
+  </macro>
+  <macro name="editor">
+    <names variable="editor translator" delimiter=", ">
+      <name and="text" delimiter-precedes-et-al="never" delimiter-precedes-last="never"/>
+      <label form="short" prefix=" (" suffix=")"/>
+    </names>
+  </macro>
+  <macro name="editor-encyclopedia">
+    <names variable="editor translator" delimiter=", ">
+      <label form="verb-short" suffix=" "/>
+      <name and="text" delimiter-precedes-et-al="never" delimiter-precedes-last="never"/>
+    </names>
+  </macro>
+  <macro name="volume">
+    <choose>
+      <if type="article-journal">
+        <text variable="volume" prefix=" "/>
+        <text variable="issue" prefix="/"/>
+      </if>
+      <else>
+        <choose>
+          <if variable="volume">
+            <group delimiter=" ">
+              <number variable="volume" form="long-ordinal" text-case="capitalize-first"/>
+              <text term="volume" form="short" text-case="capitalize-first"/>
+            </group>
+          </if>
+          <else>
+            <group>
+              <number variable="number-of-volumes" form="numeric"/>
+              <text term="volume" form="short" prefix=" " plural="true"/>
+            </group>
+          </else>
+        </choose>
+      </else>
+    </choose>
+  </macro>
+  <macro name="year-date">
+    <date variable="issued" date-parts="year" form="numeric"/>
+  </macro>
+  <macro name="collection-with-number">
+    <group delimiter=", " prefix="(" suffix=")">
+      <text variable="collection-title"/>
+      <text variable="collection-number"/>
+    </group>
+  </macro>
+  <macro name="translator">
+    <names variable="editor translator" delimiter=", ">
+      <label form="verb-short"/>
+      <name prefix=" " and="text" delimiter-precedes-et-al="never" delimiter-precedes-last="never"/>
+    </names>
+  </macro>
+  <citation et-al-min="3" et-al-use-first="1" disambiguate-add-names="true">
+    <layout delimiter="; " suffix=".">
+      <choose>
+        <if position="ibid-with-locator">
+          <group delimiter=", ">
+            <text term="ibid"/>
+            <text variable="locator" prefix=" "/>
+          </group>
+        </if>
+        <else-if position="ibid">
+          <text term="ibid"/>
+        </else-if>
+        <else-if position="subsequent">
+          <group delimiter=", ">
+            <group delimiter=" ">
+              <text macro="author-short"/>
+              <text macro="year-date"/>
+              <group delimiter=" " prefix="(" suffix=")">
+                <text term="note"/>
+                <text variable="first-reference-note-number"/>
+              </group>
+            </group>
+            <text variable="locator"/>
+          </group>
+        </else-if>
+        <else>
+          <group delimiter=", ">
+            <text macro="author"/>
+            <choose>
+              <if match="any" variable="container-title">
+                <text variable="title"/>
+                <group delimiter=" ">
+                  <text term="in" suffix=": "/>
+                  <choose>
+                    <if type="entry-encyclopedia" match="any">
+                      <group delimiter=", ">
+                        <group delimiter=" ">
+                          <text variable="container-title" font-style="italic"/>
+                          <text macro="collection-with-number"/>
+                          <text macro="volume"/>
+                        </group>
+                        <text macro="editor-encyclopedia"/>
+                      </group>
+                    </if>
+                    <else>
+                      <text macro="editor" suffix=","/>
+                      <text variable="container-title" font-style="italic"/>
+                      <text macro="collection-with-number"/>
+                      <text macro="volume"/>
+                    </else>
+                  </choose>
+                </group>
+              </if>
+              <else>
+                <choose>
+                  <if type="entry-encyclopedia" match="any">
+                    <group delimiter=" ">
+                      <text variable="title" font-style="italic"/>
+                      <text macro="collection-with-number"/>
+                    </group>
+                    <text macro="editor-encyclopedia"/>
+                  </if>
+                  <else-if match="any" variable="translator">
+                    <choose>
+                      <if match="none" variable="author">
+                        <names variable="editor">
+                          <name and="text" delimiter-precedes-et-al="never" delimiter-precedes-last="never"/>
+                          <label form="short" prefix=" (" suffix=")"/>
+                        </names>
+                      </if>
+                    </choose>
+                    <group delimiter=" ">
+                      <text variable="title" font-style="italic" suffix=","/>
+                      <text macro="collection-with-number"/>
+                    </group>
+                  </else-if>
+                  <else>
+                    <choose>
+                      <if match="none" variable="author">
+                        <names variable="editor">
+                          <name and="text" delimiter-precedes-et-al="never" delimiter-precedes-last="never"/>
+                          <label form="short" prefix=" (" suffix=")"/>
+                        </names>
+                      </if>
+                    </choose>
+                    <group delimiter=" ">
+                      <group delimiter=", ">
+                        <text variable="title" font-style="italic"/>
+                        <text macro="translator"/>
+                      </group>
+                      <text macro="collection-with-number"/>
+                    </group>
+                  </else>
+                </choose>
+              </else>
+            </choose>
+            <choose>
+              <if type="thesis">
+                <text variable="publisher" prefix="Diss., "/>
+              </if>
+            </choose>
+            <group delimiter=" ">
+              <text variable="publisher-place"/>
+              <group>
+                <text variable="edition" vertical-align="sup"/>
+                <text macro="year-date"/>
+              </group>
+            </group>
+            <text variable="page" prefix=" "/>
+            <text variable="locator" prefix=" "/>
+          </group>
+        </else>
+      </choose>
+      <choose>
+        <if variable="URL" match="any">
+          <group>
+            <text variable="URL" prefix=", "/>
+            <text term="accessed" prefix=" ("/>
+            <date variable="accessed" prefix=" " delimiter="." suffix=")">
+              <date-part name="day"/>
+              <date-part name="month" form="numeric"/>
+              <date-part name="year"/>
+            </date>
+          </group>
+        </if>
+      </choose>
+    </layout>
+  </citation>
+  <bibliography et-al-min="3" et-al-use-first="1" subsequent-author-substitute="&#8212;&#8212;&#8212;" entry-spacing="0" hanging-indent="true">
+    <sort>
+      <key macro="author-bibliography"/>
+      <key macro="year-date"/>
+      <key variable="title"/>
+    </sort>
+    <layout suffix=".">
+      <group delimiter=", ">
+        <text macro="author-bibliography"/>
+        <choose>
+          <if match="any" variable="container-title">
+            <text variable="title"/>
+            <group delimiter=" ">
+              <text term="in" suffix=": "/>
+              <choose>
+                <if type="entry-encyclopedia" match="any">
+                  <group delimiter=", ">
+                    <group delimiter=" ">
+                      <text variable="container-title" font-style="italic"/>
+                      <text macro="collection-with-number"/>
+                      <text macro="volume"/>
+                    </group>
+                    <text macro="editor-encyclopedia"/>
+                  </group>
+                </if>
+                <else>
+                  <text macro="editor" suffix=","/>
+                  <text variable="container-title" font-style="italic"/>
+                  <text macro="collection-with-number"/>
+                  <text macro="volume"/>
+                </else>
+              </choose>
+            </group>
+          </if>
+          <else>
+            <choose>
+              <if type="entry-encyclopedia" match="any">
+                <group delimiter=" ">
+                  <text variable="title" font-style="italic"/>
+                  <text macro="collection-with-number"/>
+                </group>
+                <text macro="editor-encyclopedia"/>
+              </if>
+              <else>
+                <group delimiter=" ">
+                  <group delimiter=", ">
+                    <text variable="title" font-style="italic"/>
+                    <text macro="editor"/>
+                  </group>
+                  <text macro="collection-with-number"/>
+                </group>
+              </else>
+            </choose>
+          </else>
+        </choose>
+        <choose>
+          <if type="thesis">
+            <text variable="publisher" prefix="Diss., "/>
+          </if>
+        </choose>
+        <group delimiter=" ">
+          <text variable="publisher-place"/>
+          <group>
+            <text variable="edition" vertical-align="sup"/>
+            <text macro="year-date"/>
+          </group>
+        </group>
+        <text variable="page" prefix=" "/>
+      </group>
+      <choose>
+        <if variable="URL" match="any">
+          <group>
+            <text variable="URL" prefix=", "/>
+            <text term="accessed" prefix=" ("/>
+            <date variable="accessed" prefix=" " delimiter="." suffix=")">
+              <date-part name="day"/>
+              <date-part name="month" form="numeric"/>
+              <date-part name="year"/>
+            </date>
+          </group>
+        </if>
+      </choose>
+    </layout>
+  </bibliography>
+</style>
diff --git a/test/docx/golden/lists_multiple_initial.docx b/test/docx/golden/lists_multiple_initial.docx
new file mode 100644
Binary files /dev/null and b/test/docx/golden/lists_multiple_initial.docx differ
diff --git a/test/docx/golden/tables.docx b/test/docx/golden/tables.docx
Binary files a/test/docx/golden/tables.docx and b/test/docx/golden/tables.docx differ
diff --git a/test/docx/golden/track_changes_scrubbed_metadata.docx b/test/docx/golden/track_changes_scrubbed_metadata.docx
new file mode 100644
Binary files /dev/null and b/test/docx/golden/track_changes_scrubbed_metadata.docx differ
diff --git a/test/docx/lists_multiple_initial.native b/test/docx/lists_multiple_initial.native
new file mode 100644
--- /dev/null
+++ b/test/docx/lists_multiple_initial.native
@@ -0,0 +1,8 @@
+[OrderedList (1,Decimal,Period)
+ [[OrderedList (1,LowerAlpha,TwoParens)
+   [[Para [Str "foo"]]
+   ,[Para [Str "bar"]]]]]
+,BulletList
+ [[BulletList
+   [[Para [Str "foo"]]
+   ,[Para [Str "bar"]]]]]]
diff --git a/test/docx/track_changes_scrubbed_metadata.docx b/test/docx/track_changes_scrubbed_metadata.docx
new file mode 100644
Binary files /dev/null and b/test/docx/track_changes_scrubbed_metadata.docx differ
diff --git a/test/docx/track_changes_scrubbed_metadata.native b/test/docx/track_changes_scrubbed_metadata.native
new file mode 100644
--- /dev/null
+++ b/test/docx/track_changes_scrubbed_metadata.native
@@ -0,0 +1,9 @@
+[Para [ Str "Here", Space, Str "is", Space, Str "a", Space
+      , Span ("",["deletion"],[("author","Author")]) [Str "dummy"]
+      , Span ("",["insertion"],[("author","Author")]) [Str "test"]
+      , Space
+      , Span ("",["comment-start"],[("id","3"),("author","Author")]) 
+        [Str "With",Space,Str "a",Space,Str "comment!"]
+      , Str "document",Span ("",["comment-end"],[("id","3")]) [],Str "."
+      ]
+]
diff --git a/test/lhs-test.html b/test/lhs-test.html
--- a/test/lhs-test.html
+++ b/test/lhs-test.html
@@ -6,6 +6,112 @@
   <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
   <title>lhs-test</title>
   <style>
+    html {
+      line-height: 1.7;
+      font-family: Georgia, serif;
+      font-size: 20px;
+      color: #1a1a1a;
+      background-color: #fdfdfd;
+    }
+    body {
+      margin: 0 auto;
+      max-width: 40em;
+      padding-left: 50px;
+      padding-right: 50px;
+      padding-top: 50px;
+      padding-bottom: 50px;
+      hyphens: auto;
+      word-wrap: break-word;
+      text-rendering: optimizeLegibility;
+      font-kerning: normal;
+    }
+    @media (max-width: 600px) {
+      body {
+        font-size: 0.9em;
+        padding: 1em;
+      }
+    }
+    @media print {
+      body {
+        background-color: transparent;
+        color: black;
+      }
+      p, h2, h3 {
+        orphans: 3;
+        widows: 3;
+      }
+      h2, h3, h4 {
+        page-break-after: avoid;
+      }
+    }
+    p {
+      margin-top: 1.7em;
+    }
+    a {
+      color: #1a1a1a;
+    }
+    a:visited {
+      color: #1a1a1a;
+    }
+    img {
+      max-width: 100%;
+    }
+    h1, h2, h3, h4, h5, h6 {
+      margin-top: 1.7em;
+    }
+    ol, ul {
+      padding-left: 1.7em;
+      margin-top: 1.7em;
+    }
+    li > ol, li > ul {
+      margin-top: 0;
+    }
+    blockquote {
+      margin: 1.7em 0 1.7em 1.7em;
+      padding-left: 1em;
+      border-left: 2px solid #e6e6e6;
+      font-style: italic;
+    }
+    code {
+      font-family: Menlo, Monaco, 'Lucida Console', Consolas, monospace;
+      background-color: #f0f0f0;
+      font-size: 85%;
+      margin: 0;
+      padding: .2em .4em;
+    }
+    pre {
+      line-height: 1.5em;
+      padding: 1em;
+      background-color: #f0f0f0;
+      overflow: auto;
+    }
+    pre code {
+      padding: 0;
+      overflow: visible;
+    }
+    hr {
+      background-color: #1a1a1a;
+      border: none;
+      height: 1px;
+      margin-top: 1.7em;
+    }
+    table {
+      border-collapse: collapse;
+      width: 100%;
+      overflow-x: auto;
+      display: block;
+    }
+    th, td {
+      border-bottom: 1px solid lightgray;
+      padding: 1em 3em 1em 0;
+    }
+    header {
+      margin-bottom: 6em;
+      text-align: center;
+    }
+    nav a:not(:hover) {
+      text-decoration: none;
+    }
     code{white-space: pre-wrap;}
     span.smallcaps{font-variant: small-caps;}
     span.underline{text-decoration: underline;}
@@ -84,9 +190,9 @@
 <h1 id="lhs-test">lhs test</h1>
 <p><code>unsplit</code> is an arrow that takes a pair of values and combines them to
 return a single value:</p>
-<div class="sourceCode" id="cb1"><pre class="sourceCode haskell literate"><code class="sourceCode haskell"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true"></a><span class="ot">unsplit ::</span> (<span class="dt">Arrow</span> a) <span class="ot">=&gt;</span> (b <span class="ot">-&gt;</span> c <span class="ot">-&gt;</span> d) <span class="ot">-&gt;</span> a (b, c) d</span>
-<span id="cb1-2"><a href="#cb1-2" aria-hidden="true"></a>unsplit <span class="ot">=</span> arr <span class="op">.</span> <span class="fu">uncurry</span></span>
-<span id="cb1-3"><a href="#cb1-3" aria-hidden="true"></a>          <span class="co">-- arr (\op (x,y) -&gt; x `op` y)</span></span></code></pre></div>
+<div class="sourceCode" id="cb1"><pre class="sourceCode haskell literate"><code class="sourceCode haskell"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="ot">unsplit ::</span> (<span class="dt">Arrow</span> a) <span class="ot">=&gt;</span> (b <span class="ot">-&gt;</span> c <span class="ot">-&gt;</span> d) <span class="ot">-&gt;</span> a (b, c) d</span>
+<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a>unsplit <span class="ot">=</span> arr <span class="op">.</span> <span class="fu">uncurry</span></span>
+<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a>          <span class="co">-- arr (\op (x,y) -&gt; x `op` y)</span></span></code></pre></div>
 <p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a
 pair of values (one arrow on the first item of the pair and one arrow on the
 second item of the pair).</p>
diff --git a/test/lhs-test.html+lhs b/test/lhs-test.html+lhs
--- a/test/lhs-test.html+lhs
+++ b/test/lhs-test.html+lhs
@@ -6,6 +6,112 @@
   <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
   <title>lhs-test</title>
   <style>
+    html {
+      line-height: 1.7;
+      font-family: Georgia, serif;
+      font-size: 20px;
+      color: #1a1a1a;
+      background-color: #fdfdfd;
+    }
+    body {
+      margin: 0 auto;
+      max-width: 40em;
+      padding-left: 50px;
+      padding-right: 50px;
+      padding-top: 50px;
+      padding-bottom: 50px;
+      hyphens: auto;
+      word-wrap: break-word;
+      text-rendering: optimizeLegibility;
+      font-kerning: normal;
+    }
+    @media (max-width: 600px) {
+      body {
+        font-size: 0.9em;
+        padding: 1em;
+      }
+    }
+    @media print {
+      body {
+        background-color: transparent;
+        color: black;
+      }
+      p, h2, h3 {
+        orphans: 3;
+        widows: 3;
+      }
+      h2, h3, h4 {
+        page-break-after: avoid;
+      }
+    }
+    p {
+      margin-top: 1.7em;
+    }
+    a {
+      color: #1a1a1a;
+    }
+    a:visited {
+      color: #1a1a1a;
+    }
+    img {
+      max-width: 100%;
+    }
+    h1, h2, h3, h4, h5, h6 {
+      margin-top: 1.7em;
+    }
+    ol, ul {
+      padding-left: 1.7em;
+      margin-top: 1.7em;
+    }
+    li > ol, li > ul {
+      margin-top: 0;
+    }
+    blockquote {
+      margin: 1.7em 0 1.7em 1.7em;
+      padding-left: 1em;
+      border-left: 2px solid #e6e6e6;
+      font-style: italic;
+    }
+    code {
+      font-family: Menlo, Monaco, 'Lucida Console', Consolas, monospace;
+      background-color: #f0f0f0;
+      font-size: 85%;
+      margin: 0;
+      padding: .2em .4em;
+    }
+    pre {
+      line-height: 1.5em;
+      padding: 1em;
+      background-color: #f0f0f0;
+      overflow: auto;
+    }
+    pre code {
+      padding: 0;
+      overflow: visible;
+    }
+    hr {
+      background-color: #1a1a1a;
+      border: none;
+      height: 1px;
+      margin-top: 1.7em;
+    }
+    table {
+      border-collapse: collapse;
+      width: 100%;
+      overflow-x: auto;
+      display: block;
+    }
+    th, td {
+      border-bottom: 1px solid lightgray;
+      padding: 1em 3em 1em 0;
+    }
+    header {
+      margin-bottom: 6em;
+      text-align: center;
+    }
+    nav a:not(:hover) {
+      text-decoration: none;
+    }
     code{white-space: pre-wrap;}
     span.smallcaps{font-variant: small-caps;}
     span.underline{text-decoration: underline;}
@@ -84,9 +190,9 @@
 <h1 id="lhs-test">lhs test</h1>
 <p><code>unsplit</code> is an arrow that takes a pair of values and combines them to
 return a single value:</p>
-<div class="sourceCode" id="cb1"><pre class="sourceCode literatehaskell literate"><code class="sourceCode literatehaskell"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true"></a><span class="ot">&gt; unsplit ::</span> (<span class="dt">Arrow</span> a) <span class="ot">=&gt;</span> (b <span class="ot">-&gt;</span> c <span class="ot">-&gt;</span> d) <span class="ot">-&gt;</span> a (b, c) d</span>
-<span id="cb1-2"><a href="#cb1-2" aria-hidden="true"></a><span class="ot">&gt;</span> unsplit <span class="ot">=</span> arr <span class="op">.</span> <span class="fu">uncurry</span></span>
-<span id="cb1-3"><a href="#cb1-3" aria-hidden="true"></a><span class="ot">&gt;</span>           <span class="co">-- arr (\op (x,y) -&gt; x `op` y)</span></span></code></pre></div>
+<div class="sourceCode" id="cb1"><pre class="sourceCode literatehaskell literate"><code class="sourceCode literatehaskell"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="ot">&gt; unsplit ::</span> (<span class="dt">Arrow</span> a) <span class="ot">=&gt;</span> (b <span class="ot">-&gt;</span> c <span class="ot">-&gt;</span> d) <span class="ot">-&gt;</span> a (b, c) d</span>
+<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a><span class="ot">&gt;</span> unsplit <span class="ot">=</span> arr <span class="op">.</span> <span class="fu">uncurry</span></span>
+<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a><span class="ot">&gt;</span>           <span class="co">-- arr (\op (x,y) -&gt; x `op` y)</span></span></code></pre></div>
 <p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a
 pair of values (one arrow on the first item of the pair and one arrow on the
 second item of the pair).</p>
diff --git a/test/lua/module/pandoc-utils.lua b/test/lua/module/pandoc-utils.lua
--- a/test/lua/module/pandoc-utils.lua
+++ b/test/lua/module/pandoc-utils.lua
@@ -90,4 +90,70 @@
       assert.is_falsy(pcall(utils.to_roman_numeral, 'not a number'))
     end)
   },
+
+  group 'to_simple_table' {
+    test('convertes Table', function ()
+      function simple_cell (blocks)
+        return {
+          attr = pandoc.Attr(),
+          alignment = "AlignDefault",
+          contents = blocks,
+          col_span = 1,
+          row_span = 1,
+        }
+      end
+      local tbl = pandoc.Table(
+        {long = {pandoc.Plain {
+                   pandoc.Str "the", pandoc.Space(), pandoc.Str "caption"}}},
+        {{pandoc.AlignDefault, nil}},
+        {pandoc.Attr(), {{pandoc.Attr(), {simple_cell{pandoc.Plain "head1"}}}}},
+        {{
+            attr = pandoc.Attr(),
+            body = {{pandoc.Attr(), {simple_cell{pandoc.Plain "cell1"}}}},
+            head = {},
+            row_head_columns = 0
+        }},
+        {pandoc.Attr(), {}},
+        pandoc.Attr()
+      )
+      local stbl = utils.to_simple_table(tbl)
+      assert.are_equal('SimpleTable', stbl.t)
+      assert.are_equal('head1', utils.stringify(stbl.headers[1]))
+      assert.are_equal('cell1', utils.stringify(stbl.rows[1][1]))
+      assert.are_equal('the caption', utils.stringify(pandoc.Span(stbl.caption)))
+    end),
+    test('fails on para', function ()
+      assert.is_falsy(pcall(utils.to_simple_table, pandoc.Para "nope"))
+    end),
+  },
+  group 'from_simple_table' {
+    test('converts SimpleTable to Table', function ()
+      local caption = {pandoc.Str "Overview"}
+      local aligns = {pandoc.AlignDefault, pandoc.AlignDefault}
+      local widths = {0, 0} -- let pandoc determine col widths
+      local headers = {
+        {pandoc.Plain "Language"},
+        {pandoc.Plain "Typing"}
+      }
+      local rows = {
+        {{pandoc.Plain "Haskell"}, {pandoc.Plain "static"}},
+        {{pandoc.Plain "Lua"}, {pandoc.Plain "Dynamic"}},
+      }
+      local simple_table = pandoc.SimpleTable(
+        caption,
+        aligns,
+        widths,
+        headers,
+        rows
+      )
+      local tbl = utils.from_simple_table(simple_table)
+      assert.are_equal("Table", tbl.t)
+      assert.are_same(
+        {pandoc.Plain(caption)},
+        tbl.caption.long
+      )
+      -- reversible
+      assert.are_same(simple_table, utils.to_simple_table(tbl))
+    end),
+  }
 }
diff --git a/test/markdown-citations.native b/test/markdown-citations.native
--- a/test/markdown-citations.native
+++ b/test/markdown-citations.native
@@ -1,17 +1,17 @@
 [Header 1 ("pandoc-with-citeproc-hs",[],[]) [Str "Pandoc",Space,Str "with",Space,Str "citeproc-hs"]
 ,BulletList
- [[Para [Cite [Citation {citationId = "nonexistent", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [Str "[@nonexistent]"]]]
- ,[Para [Cite [Citation {citationId = "nonexistent", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 0, citationHash = 0}] [Str "@nonexistent"]]]
- ,[Para [Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 0, citationHash = 0}] [Str "@item1"],Space,Str "says",Space,Str "blah."]]
- ,[Para [Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [Str "p.\160\&30"], citationMode = AuthorInText, citationNoteNum = 0, citationHash = 0}] [Str "@item1",Space,Str "[p.",Space,Str "30]"],Space,Str "says",Space,Str "blah."]]
- ,[Para [Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [Str "p.\160\&30,",Space,Str "with",Space,Str "suffix"], citationMode = AuthorInText, citationNoteNum = 0, citationHash = 0}] [Str "@item1",Space,Str "[p.",Space,Str "30,",Space,Str "with",Space,Str "suffix]"],Space,Str "says",Space,Str "blah."]]
- ,[Para [Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 0, citationHash = 0},Citation {citationId = "item2", citationPrefix = [], citationSuffix = [Space,Str "p.\160\&30"], citationMode = SuppressAuthor, citationNoteNum = 0, citationHash = 0},Citation {citationId = "\1087\1091\1085\1082\1090\&3", citationPrefix = [Str "see",Space,Str "also"], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [Str "@item1",Space,Str "[-@item2",Space,Str "p.",Space,Str "30;",Space,Str "see",Space,Str "also",Space,Str "@\1087\1091\1085\1082\1090\&3]"],Space,Str "says",Space,Str "blah."]]
- ,[Para [Str "In",Space,Str "a",Space,Str "note.",Note [Para [Cite [Citation {citationId = "\1087\1091\1085\1082\1090\&3", citationPrefix = [], citationSuffix = [Str "p.\160\&12"], citationMode = AuthorInText, citationNoteNum = 0, citationHash = 0}] [Str "@\1087\1091\1085\1082\1090\&3",Space,Str "[p.",Space,Str "12]"],Space,Str "and",Space,Str "a",Space,Str "citation",Space,Str "without",Space,Str "locators",Space,Cite [Citation {citationId = "\1087\1091\1085\1082\1090\&3", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [Str "[@\1087\1091\1085\1082\1090\&3]"],Str "."]]]]
- ,[Para [Str "A",Space,Str "citation",Space,Str "group",Space,Cite [Citation {citationId = "item1", citationPrefix = [Str "see"], citationSuffix = [Space,Str "chap.\160\&3"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "\1087\1091\1085\1082\1090\&3", citationPrefix = [Str "also"], citationSuffix = [Space,Str "p.\160\&34-35"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [Str "[see",Space,Str "@item1",Space,Str "chap.",Space,Str "3;",Space,Str "also",Space,Str "@\1087\1091\1085\1082\1090\&3",Space,Str "p.",Space,Str "34-35]"],Str "."]]
- ,[Para [Str "Another",Space,Str "one",Space,Cite [Citation {citationId = "item1", citationPrefix = [Str "see"], citationSuffix = [Space,Str "p.\160\&34-35"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [Str "[see",Space,Str "@item1",Space,Str "p.",Space,Str "34-35]"],Str "."]]
- ,[Para [Str "And",Space,Str "another",Space,Str "one",Space,Str "in",Space,Str "a",Space,Str "note.",Note [Para [Str "Some",Space,Str "citations",Space,Cite [Citation {citationId = "item1", citationPrefix = [Str "see"], citationSuffix = [Space,Str "chap.\160\&3"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "\1087\1091\1085\1082\1090\&3", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0},Citation {citationId = "item2", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [Str "[see",Space,Str "@item1",Space,Str "chap.",Space,Str "3;",Space,Str "@\1087\1091\1085\1082\1090\&3;",Space,Str "@item2]"],Str "."]]]]
- ,[Para [Str "Citation",Space,Str "with",Space,Str "a",Space,Str "suffix",Space,Str "and",Space,Str "locator",Space,Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [Space,Str "pp.\160\&33,",Space,Str "35-37,",Space,Str "and",Space,Str "nowhere",Space,Str "else"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [Str "[@item1",Space,Str "pp.",Space,Str "33,",Space,Str "35-37,",Space,Str "and",Space,Str "nowhere",Space,Str "else]"],Str "."]]
- ,[Para [Str "Citation",Space,Str "with",Space,Str "suffix",Space,Str "only",Space,Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [Space,Str "and",Space,Str "nowhere",Space,Str "else"], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [Str "[@item1",Space,Str "and",Space,Str "nowhere",Space,Str "else]"],Str "."]]
- ,[Para [Str "Now",Space,Str "some",Space,Str "modifiers.",Note [Para [Str "Like",Space,Str "a",Space,Str "citation",Space,Str "without",Space,Str "author:",Space,Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [], citationMode = SuppressAuthor, citationNoteNum = 0, citationHash = 0}] [Str "[-@item1]"],Str ",",Space,Str "and",Space,Str "now",Space,Str "Doe",Space,Str "with",Space,Str "a",Space,Str "locator",Space,Cite [Citation {citationId = "item2", citationPrefix = [], citationSuffix = [Space,Str "p.\160\&44"], citationMode = SuppressAuthor, citationNoteNum = 0, citationHash = 0}] [Str "[-@item2",Space,Str "p.",Space,Str "44]"],Str "."]]]]
- ,[Para [Str "With",Space,Str "some",Space,Str "markup",Space,Cite [Citation {citationId = "item1", citationPrefix = [Emph [Str "see"]], citationSuffix = [Space,Str "p.\160",Strong [Str "32"]], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [Str "[*see*",Space,Str "@item1",Space,Str "p.",Space,Str "**32**]"],Str "."]]]
+ [[Para [Cite [Citation {citationId = "nonexistent", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 1, citationHash = 0}] [Str "[@nonexistent]"]]]
+ ,[Para [Cite [Citation {citationId = "nonexistent", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 2, citationHash = 0}] [Str "@nonexistent"]]]
+ ,[Para [Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 3, citationHash = 0}] [Str "@item1"],Space,Str "says",Space,Str "blah."]]
+ ,[Para [Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [Str "p.\160\&30"], citationMode = AuthorInText, citationNoteNum = 4, citationHash = 0}] [Str "@item1",Space,Str "[p.",Space,Str "30]"],Space,Str "says",Space,Str "blah."]]
+ ,[Para [Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [Str "p.\160\&30,",Space,Str "with",Space,Str "suffix"], citationMode = AuthorInText, citationNoteNum = 5, citationHash = 0}] [Str "@item1",Space,Str "[p.",Space,Str "30,",Space,Str "with",Space,Str "suffix]"],Space,Str "says",Space,Str "blah."]]
+ ,[Para [Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [], citationMode = AuthorInText, citationNoteNum = 6, citationHash = 0},Citation {citationId = "item2", citationPrefix = [], citationSuffix = [Space,Str "p.\160\&30"], citationMode = SuppressAuthor, citationNoteNum = 6, citationHash = 0},Citation {citationId = "\1087\1091\1085\1082\1090\&3", citationPrefix = [Str "see",Space,Str "also"], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 6, citationHash = 0}] [Str "@item1",Space,Str "[-@item2",Space,Str "p.",Space,Str "30;",Space,Str "see",Space,Str "also",Space,Str "@\1087\1091\1085\1082\1090\&3]"],Space,Str "says",Space,Str "blah."]]
+ ,[Para [Str "In",Space,Str "a",Space,Str "note.",Note [Para [Cite [Citation {citationId = "\1087\1091\1085\1082\1090\&3", citationPrefix = [], citationSuffix = [Str "p.\160\&12"], citationMode = AuthorInText, citationNoteNum = 7, citationHash = 0}] [Str "@\1087\1091\1085\1082\1090\&3",Space,Str "[p.",Space,Str "12]"],Space,Str "and",Space,Str "a",Space,Str "citation",Space,Str "without",Space,Str "locators",Space,Cite [Citation {citationId = "\1087\1091\1085\1082\1090\&3", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 7, citationHash = 0}] [Str "[@\1087\1091\1085\1082\1090\&3]"],Str "."]]]]
+ ,[Para [Str "A",Space,Str "citation",Space,Str "group",Space,Cite [Citation {citationId = "item1", citationPrefix = [Str "see"], citationSuffix = [Space,Str "chap.\160\&3"], citationMode = NormalCitation, citationNoteNum = 8, citationHash = 0},Citation {citationId = "\1087\1091\1085\1082\1090\&3", citationPrefix = [Str "also"], citationSuffix = [Space,Str "p.\160\&34-35"], citationMode = NormalCitation, citationNoteNum = 8, citationHash = 0}] [Str "[see",Space,Str "@item1",Space,Str "chap.",Space,Str "3;",Space,Str "also",Space,Str "@\1087\1091\1085\1082\1090\&3",Space,Str "p.",Space,Str "34-35]"],Str "."]]
+ ,[Para [Str "Another",Space,Str "one",Space,Cite [Citation {citationId = "item1", citationPrefix = [Str "see"], citationSuffix = [Space,Str "p.\160\&34-35"], citationMode = NormalCitation, citationNoteNum = 9, citationHash = 0}] [Str "[see",Space,Str "@item1",Space,Str "p.",Space,Str "34-35]"],Str "."]]
+ ,[Para [Str "And",Space,Str "another",Space,Str "one",Space,Str "in",Space,Str "a",Space,Str "note.",Note [Para [Str "Some",Space,Str "citations",Space,Cite [Citation {citationId = "item1", citationPrefix = [Str "see"], citationSuffix = [Space,Str "chap.\160\&3"], citationMode = NormalCitation, citationNoteNum = 10, citationHash = 0},Citation {citationId = "\1087\1091\1085\1082\1090\&3", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 10, citationHash = 0},Citation {citationId = "item2", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 10, citationHash = 0}] [Str "[see",Space,Str "@item1",Space,Str "chap.",Space,Str "3;",Space,Str "@\1087\1091\1085\1082\1090\&3;",Space,Str "@item2]"],Str "."]]]]
+ ,[Para [Str "Citation",Space,Str "with",Space,Str "a",Space,Str "suffix",Space,Str "and",Space,Str "locator",Space,Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [Space,Str "pp.\160\&33,",Space,Str "35-37,",Space,Str "and",Space,Str "nowhere",Space,Str "else"], citationMode = NormalCitation, citationNoteNum = 11, citationHash = 0}] [Str "[@item1",Space,Str "pp.",Space,Str "33,",Space,Str "35-37,",Space,Str "and",Space,Str "nowhere",Space,Str "else]"],Str "."]]
+ ,[Para [Str "Citation",Space,Str "with",Space,Str "suffix",Space,Str "only",Space,Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [Space,Str "and",Space,Str "nowhere",Space,Str "else"], citationMode = NormalCitation, citationNoteNum = 12, citationHash = 0}] [Str "[@item1",Space,Str "and",Space,Str "nowhere",Space,Str "else]"],Str "."]]
+ ,[Para [Str "Now",Space,Str "some",Space,Str "modifiers.",Note [Para [Str "Like",Space,Str "a",Space,Str "citation",Space,Str "without",Space,Str "author:",Space,Cite [Citation {citationId = "item1", citationPrefix = [], citationSuffix = [], citationMode = SuppressAuthor, citationNoteNum = 13, citationHash = 0}] [Str "[-@item1]"],Str ",",Space,Str "and",Space,Str "now",Space,Str "Doe",Space,Str "with",Space,Str "a",Space,Str "locator",Space,Cite [Citation {citationId = "item2", citationPrefix = [], citationSuffix = [Space,Str "p.\160\&44"], citationMode = SuppressAuthor, citationNoteNum = 13, citationHash = 0}] [Str "[-@item2",Space,Str "p.",Space,Str "44]"],Str "."]]]]
+ ,[Para [Str "With",Space,Str "some",Space,Str "markup",Space,Cite [Citation {citationId = "item1", citationPrefix = [Emph [Str "see"]], citationSuffix = [Space,Str "p.\160",Strong [Str "32"]], citationMode = NormalCitation, citationNoteNum = 14, citationHash = 0}] [Str "[*see*",Space,Str "@item1",Space,Str "p.",Space,Str "**32**]"],Str "."]]]
 ,Header 1 ("references",[],[]) [Str "References"]]
diff --git a/test/markdown-reader-more.native b/test/markdown-reader-more.native
--- a/test/markdown-reader-more.native
+++ b/test/markdown-reader-more.native
@@ -328,7 +328,7 @@
 ,Header 2 ("reference-link-fallbacks",[],[]) [Str "Reference",Space,Str "link",Space,Str "fallbacks"]
 ,Para [Str "[",Emph [Str "not",Space,Str "a",Space,Str "link"],Str "]",Space,Str "[",Emph [Str "nope"],Str "]\8230"]
 ,Header 2 ("reference-link-followed-by-a-citation",[],[]) [Str "Reference",Space,Str "link",Space,Str "followed",Space,Str "by",Space,Str "a",Space,Str "citation"]
-,Para [Str "MapReduce",Space,Str "is",Space,Str "a",Space,Str "paradigm",Space,Str "popularized",Space,Str "by",Space,Link ("",[],[]) [Str "Google"] ("http://google.com",""),Space,Cite [Citation {citationId = "mapreduce", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 0, citationHash = 0}] [Str "[@mapreduce]"],Space,Str "as",Space,Str "its",SoftBreak,Str "most",Space,Str "vocal",Space,Str "proponent."]
+,Para [Str "MapReduce",Space,Str "is",Space,Str "a",Space,Str "paradigm",Space,Str "popularized",Space,Str "by",Space,Link ("",[],[]) [Str "Google"] ("http://google.com",""),Space,Cite [Citation {citationId = "mapreduce", citationPrefix = [], citationSuffix = [], citationMode = NormalCitation, citationNoteNum = 3, citationHash = 0}] [Str "[@mapreduce]"],Space,Str "as",Space,Str "its",SoftBreak,Str "most",Space,Str "vocal",Space,Str "proponent."]
 ,Header 2 ("empty-reference-links",[],[]) [Str "Empty",Space,Str "reference",Space,Str "links"]
 ,Para [Str "bar"]
 ,Para [Link ("",[],[]) [Str "foo2"] ("","")]
diff --git a/test/s5-fancy.html b/test/s5-fancy.html
--- a/test/s5-fancy.html
+++ b/test/s5-fancy.html
@@ -28,7 +28,7 @@
   <link rel="stylesheet" href="s5/default/opera.css" type="text/css" media="projection" id="operaFix" />
   <!-- S5 JS -->
   <script src="s5/default/slides.js" type="text/javascript"></script>
-  <script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" type="text/javascript"></script>
+  <script src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml-full.js" type="text/javascript"></script>
 </head>
 <body>
 <div class="layout">
diff --git a/test/tables/nordics.html4 b/test/tables/nordics.html4
new file mode 100644
--- /dev/null
+++ b/test/tables/nordics.html4
@@ -0,0 +1,59 @@
+<table id="nordics" source="wikipedia">
+<caption><p>States belonging to the <em>Nordics.</em></p></caption>
+<colgroup>
+<col width="30%" />
+<col width="30%" />
+<col width="20%" />
+<col width="20%" />
+</colgroup>
+<thead class="simple-head">
+<tr class="header">
+<th align="center">Name</th>
+<th align="center">Capital</th>
+<th align="center">Population<br />
+(in 2018)</th>
+<th align="center">Area<br />
+(in km<sup>2</sup>)</th>
+</tr>
+</thead>
+<tbody class="souvereign-states">
+<tr class="odd" class="country">
+<th align="center">Denmark</th>
+<td align="left">Copenhagen</td>
+<td align="left">5,809,502</td>
+<td align="left">43,094</td>
+</tr>
+<tr class="even" class="country">
+<th align="center">Finland</th>
+<td align="left">Helsinki</td>
+<td align="left">5,537,364</td>
+<td align="left">338,145</td>
+</tr>
+<tr class="odd" class="country">
+<th align="center">Iceland</th>
+<td align="left">Reykjavik</td>
+<td align="left">343,518</td>
+<td align="left">103,000</td>
+</tr>
+<tr class="even" class="country">
+<th align="center">Norway</th>
+<td align="left">Oslo</td>
+<td align="left">5,372,191</td>
+<td align="left">323,802</td>
+</tr>
+<tr class="odd" class="country">
+<th align="center">Sweden</th>
+<td align="left">Stockholm</td>
+<td align="left">10,313,447</td>
+<td align="left">450,295</td>
+</tr>
+</tbody><tfoot>
+<tr class="even" id="summary">
+<td align="center">Total</td>
+<td align="left"></td>
+<td align="left" id="total-population">27,376,022</td>
+<td align="left" id="total-area">1,258,336</td>
+</tr>
+</tfoot>
+
+</table>
diff --git a/test/tables/nordics.html5 b/test/tables/nordics.html5
new file mode 100644
--- /dev/null
+++ b/test/tables/nordics.html5
@@ -0,0 +1,59 @@
+<table id="nordics" data-source="wikipedia">
+<caption><p>States belonging to the <em>Nordics.</em></p></caption>
+<colgroup>
+<col style="width: 30%" />
+<col style="width: 30%" />
+<col style="width: 20%" />
+<col style="width: 20%" />
+</colgroup>
+<thead class="simple-head">
+<tr class="header">
+<th style="text-align: center;">Name</th>
+<th style="text-align: center;">Capital</th>
+<th style="text-align: center;">Population<br />
+(in 2018)</th>
+<th style="text-align: center;">Area<br />
+(in km<sup>2</sup>)</th>
+</tr>
+</thead>
+<tbody class="souvereign-states">
+<tr class="odd" class="country">
+<th style="text-align: center;">Denmark</th>
+<td style="text-align: left;">Copenhagen</td>
+<td style="text-align: left;">5,809,502</td>
+<td style="text-align: left;">43,094</td>
+</tr>
+<tr class="even" class="country">
+<th style="text-align: center;">Finland</th>
+<td style="text-align: left;">Helsinki</td>
+<td style="text-align: left;">5,537,364</td>
+<td style="text-align: left;">338,145</td>
+</tr>
+<tr class="odd" class="country">
+<th style="text-align: center;">Iceland</th>
+<td style="text-align: left;">Reykjavik</td>
+<td style="text-align: left;">343,518</td>
+<td style="text-align: left;">103,000</td>
+</tr>
+<tr class="even" class="country">
+<th style="text-align: center;">Norway</th>
+<td style="text-align: left;">Oslo</td>
+<td style="text-align: left;">5,372,191</td>
+<td style="text-align: left;">323,802</td>
+</tr>
+<tr class="odd" class="country">
+<th style="text-align: center;">Sweden</th>
+<td style="text-align: left;">Stockholm</td>
+<td style="text-align: left;">10,313,447</td>
+<td style="text-align: left;">450,295</td>
+</tr>
+</tbody><tfoot>
+<tr class="even" id="summary">
+<td style="text-align: center;">Total</td>
+<td style="text-align: left;"></td>
+<td style="text-align: left;" id="total-population">27,376,022</td>
+<td style="text-align: left;" id="total-area">1,258,336</td>
+</tr>
+</tfoot>
+
+</table>
diff --git a/test/tables/nordics.native b/test/tables/nordics.native
new file mode 100644
--- /dev/null
+++ b/test/tables/nordics.native
@@ -0,0 +1,46 @@
+[Table ("nordics",[],[("source","wikipedia")]) (Caption (Just [Str "Nordic countries"])
+ [Para [Str "States", Space, Str "belonging", Space, Str "to", Space, Str "the", Space, Emph [Str "Nordics."]]])
+ [(AlignCenter,ColWidth 0.3)
+ ,(AlignLeft,ColWidth 0.3)
+ ,(AlignLeft,ColWidth 0.2)
+ ,(AlignLeft,ColWidth 0.2)]
+ (TableHead ("",["simple-head"],[])
+  [Row ("",[],[])
+   [Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1) [Plain [Str "Name"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1) [Plain [Str "Capital"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1) [Plain [Str "Population", LineBreak, Str "(in", Space, Str "2018)"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1) [Plain [Str "Area", LineBreak, Str "(in", Space, Str "km", Superscript [Str "2"], Str ")"]]]])
+ [(TableBody ("",["souvereign-states"],[]) (RowHeadColumns 1)
+  []
+  [Row ("",["country"],[])
+   [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Denmark"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Copenhagen"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "5,809,502"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "43,094"]]]
+  ,Row ("",["country"],[])
+   [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Finland"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Helsinki"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "5,537,364"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "338,145"]]]
+  ,Row ("",["country"],[])
+   [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Iceland"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Reykjavik"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "343,518"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "103,000"]]]
+  ,Row ("",["country"],[])
+   [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Norway"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Oslo"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "5,372,191"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "323,802"]]]
+  ,Row ("",["country"],[])
+   [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Sweden"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Stockholm"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "10,313,447"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "450,295"]]]])]
+ (TableFoot ("",[],[])
+  [Row ("summary",[],[])
+   [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Total"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) []
+   ,Cell ("total-population",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "27,376,022"]]
+   ,Cell ("total-area",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "1,258,336"]]]])
+]
diff --git a/test/tables/planets.html4 b/test/tables/planets.html4
new file mode 100644
--- /dev/null
+++ b/test/tables/planets.html4
@@ -0,0 +1,133 @@
+<table>
+<caption><p>Data about the planets of our solar system.</p></caption>
+<thead>
+<tr class="header">
+<th align="center" colspan="2"></th>
+<th>Name</th>
+<th align="right">Mass (10^24kg)</th>
+<th align="right">Diameter (km)</th>
+<th align="right">Density (kg/m^3)</th>
+<th align="right">Gravity (m/s^2)</th>
+<th align="right">Length of day (hours)</th>
+<th align="right">Distance from Sun (10^6km)</th>
+<th align="right">Mean temperature (C)</th>
+<th align="right">Number of moons</th>
+<th>Notes</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<th align="center" colspan="2" rowspan="4">Terrestial planets</th>
+<th>Mercury</th>
+<td align="right">0.330</td>
+<td align="right">4,879</td>
+<td align="right">5427</td>
+<td align="right">3.7</td>
+<td align="right">4222.6</td>
+<td align="right">57.9</td>
+<td align="right">167</td>
+<td align="right">0</td>
+<td>Closest to the Sun</td>
+</tr>
+<tr class="even">
+<th>Venus</th>
+<td align="right">4.87</td>
+<td align="right">12,104</td>
+<td align="right">5243</td>
+<td align="right">8.9</td>
+<td align="right">2802.0</td>
+<td align="right">108.2</td>
+<td align="right">464</td>
+<td align="right">0</td>
+<td></td>
+</tr>
+<tr class="odd">
+<th>Earth</th>
+<td align="right">5.97</td>
+<td align="right">12,756</td>
+<td align="right">5514</td>
+<td align="right">9.8</td>
+<td align="right">24.0</td>
+<td align="right">149.6</td>
+<td align="right">15</td>
+<td align="right">1</td>
+<td>Our world</td>
+</tr>
+<tr class="even">
+<th>Mars</th>
+<td align="right">0.642</td>
+<td align="right">6,792</td>
+<td align="right">3933</td>
+<td align="right">3.7</td>
+<td align="right">24.7</td>
+<td align="right">227.9</td>
+<td align="right">-65</td>
+<td align="right">2</td>
+<td>The red planet</td>
+</tr>
+<tr class="odd">
+<th align="center" rowspan="4">Jovian planets</th>
+<th align="center" rowspan="2">Gas giants</th>
+<th>Jupiter</th>
+<td align="right">1898</td>
+<td align="right">142,984</td>
+<td align="right">1326</td>
+<td align="right">23.1</td>
+<td align="right">9.9</td>
+<td align="right">778.6</td>
+<td align="right">-110</td>
+<td align="right">67</td>
+<td>The largest planet</td>
+</tr>
+<tr class="even">
+<th>Saturn</th>
+<td align="right">568</td>
+<td align="right">120,536</td>
+<td align="right">687</td>
+<td align="right">9.0</td>
+<td align="right">10.7</td>
+<td align="right">1433.5</td>
+<td align="right">-140</td>
+<td align="right">62</td>
+<td></td>
+</tr>
+<tr class="odd">
+<th align="center" rowspan="2">Ice giants</th>
+<th>Uranus</th>
+<td align="right">86.8</td>
+<td align="right">51,118</td>
+<td align="right">1271</td>
+<td align="right">8.7</td>
+<td align="right">17.2</td>
+<td align="right">2872.5</td>
+<td align="right">-195</td>
+<td align="right">27</td>
+<td></td>
+</tr>
+<tr class="even">
+<th>Neptune</th>
+<td align="right">102</td>
+<td align="right">49,528</td>
+<td align="right">1638</td>
+<td align="right">11.0</td>
+<td align="right">16.1</td>
+<td align="right">4495.1</td>
+<td align="right">-200</td>
+<td align="right">14</td>
+<td></td>
+</tr>
+<tr class="odd">
+<th align="center" colspan="2">Dwarf planets</th>
+<th>Pluto</th>
+<td align="right">0.0146</td>
+<td align="right">2,370</td>
+<td align="right">2095</td>
+<td align="right">0.7</td>
+<td align="right">153.3</td>
+<td align="right">5906.4</td>
+<td align="right">-225</td>
+<td align="right">5</td>
+<td>Declassified as a planet in 2006.</td>
+</tr>
+</tbody>
+</table>
diff --git a/test/tables/planets.html5 b/test/tables/planets.html5
new file mode 100644
--- /dev/null
+++ b/test/tables/planets.html5
@@ -0,0 +1,133 @@
+<table>
+<caption><p>Data about the planets of our solar system.</p></caption>
+<thead>
+<tr class="header">
+<th style="text-align: center;" colspan="2"></th>
+<th>Name</th>
+<th style="text-align: right;">Mass (10^24kg)</th>
+<th style="text-align: right;">Diameter (km)</th>
+<th style="text-align: right;">Density (kg/m^3)</th>
+<th style="text-align: right;">Gravity (m/s^2)</th>
+<th style="text-align: right;">Length of day (hours)</th>
+<th style="text-align: right;">Distance from Sun (10^6km)</th>
+<th style="text-align: right;">Mean temperature (C)</th>
+<th style="text-align: right;">Number of moons</th>
+<th>Notes</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<th style="text-align: center;" colspan="2" rowspan="4">Terrestial planets</th>
+<th>Mercury</th>
+<td style="text-align: right;">0.330</td>
+<td style="text-align: right;">4,879</td>
+<td style="text-align: right;">5427</td>
+<td style="text-align: right;">3.7</td>
+<td style="text-align: right;">4222.6</td>
+<td style="text-align: right;">57.9</td>
+<td style="text-align: right;">167</td>
+<td style="text-align: right;">0</td>
+<td>Closest to the Sun</td>
+</tr>
+<tr class="even">
+<th>Venus</th>
+<td style="text-align: right;">4.87</td>
+<td style="text-align: right;">12,104</td>
+<td style="text-align: right;">5243</td>
+<td style="text-align: right;">8.9</td>
+<td style="text-align: right;">2802.0</td>
+<td style="text-align: right;">108.2</td>
+<td style="text-align: right;">464</td>
+<td style="text-align: right;">0</td>
+<td></td>
+</tr>
+<tr class="odd">
+<th>Earth</th>
+<td style="text-align: right;">5.97</td>
+<td style="text-align: right;">12,756</td>
+<td style="text-align: right;">5514</td>
+<td style="text-align: right;">9.8</td>
+<td style="text-align: right;">24.0</td>
+<td style="text-align: right;">149.6</td>
+<td style="text-align: right;">15</td>
+<td style="text-align: right;">1</td>
+<td>Our world</td>
+</tr>
+<tr class="even">
+<th>Mars</th>
+<td style="text-align: right;">0.642</td>
+<td style="text-align: right;">6,792</td>
+<td style="text-align: right;">3933</td>
+<td style="text-align: right;">3.7</td>
+<td style="text-align: right;">24.7</td>
+<td style="text-align: right;">227.9</td>
+<td style="text-align: right;">-65</td>
+<td style="text-align: right;">2</td>
+<td>The red planet</td>
+</tr>
+<tr class="odd">
+<th style="text-align: center;" rowspan="4">Jovian planets</th>
+<th style="text-align: center;" rowspan="2">Gas giants</th>
+<th>Jupiter</th>
+<td style="text-align: right;">1898</td>
+<td style="text-align: right;">142,984</td>
+<td style="text-align: right;">1326</td>
+<td style="text-align: right;">23.1</td>
+<td style="text-align: right;">9.9</td>
+<td style="text-align: right;">778.6</td>
+<td style="text-align: right;">-110</td>
+<td style="text-align: right;">67</td>
+<td>The largest planet</td>
+</tr>
+<tr class="even">
+<th>Saturn</th>
+<td style="text-align: right;">568</td>
+<td style="text-align: right;">120,536</td>
+<td style="text-align: right;">687</td>
+<td style="text-align: right;">9.0</td>
+<td style="text-align: right;">10.7</td>
+<td style="text-align: right;">1433.5</td>
+<td style="text-align: right;">-140</td>
+<td style="text-align: right;">62</td>
+<td></td>
+</tr>
+<tr class="odd">
+<th style="text-align: center;" rowspan="2">Ice giants</th>
+<th>Uranus</th>
+<td style="text-align: right;">86.8</td>
+<td style="text-align: right;">51,118</td>
+<td style="text-align: right;">1271</td>
+<td style="text-align: right;">8.7</td>
+<td style="text-align: right;">17.2</td>
+<td style="text-align: right;">2872.5</td>
+<td style="text-align: right;">-195</td>
+<td style="text-align: right;">27</td>
+<td></td>
+</tr>
+<tr class="even">
+<th>Neptune</th>
+<td style="text-align: right;">102</td>
+<td style="text-align: right;">49,528</td>
+<td style="text-align: right;">1638</td>
+<td style="text-align: right;">11.0</td>
+<td style="text-align: right;">16.1</td>
+<td style="text-align: right;">4495.1</td>
+<td style="text-align: right;">-200</td>
+<td style="text-align: right;">14</td>
+<td></td>
+</tr>
+<tr class="odd">
+<th style="text-align: center;" colspan="2">Dwarf planets</th>
+<th>Pluto</th>
+<td style="text-align: right;">0.0146</td>
+<td style="text-align: right;">2,370</td>
+<td style="text-align: right;">2095</td>
+<td style="text-align: right;">0.7</td>
+<td style="text-align: right;">153.3</td>
+<td style="text-align: right;">5906.4</td>
+<td style="text-align: right;">-225</td>
+<td style="text-align: right;">5</td>
+<td>Declassified as a planet in 2006.</td>
+</tr>
+</tbody>
+</table>
diff --git a/test/tables/planets.native b/test/tables/planets.native
new file mode 100644
--- /dev/null
+++ b/test/tables/planets.native
@@ -0,0 +1,138 @@
+[Table ("",[],[]) (Caption Nothing
+ [Para [Str "Data about the planets of our solar system."]])
+ [(AlignCenter,ColWidthDefault)
+ ,(AlignCenter,ColWidthDefault)
+ ,(AlignDefault,ColWidthDefault)
+ ,(AlignRight,ColWidthDefault)
+ ,(AlignRight,ColWidthDefault)
+ ,(AlignRight,ColWidthDefault)
+ ,(AlignRight,ColWidthDefault)
+ ,(AlignRight,ColWidthDefault)
+ ,(AlignRight,ColWidthDefault)
+ ,(AlignRight,ColWidthDefault)
+ ,(AlignRight,ColWidthDefault)
+ ,(AlignDefault,ColWidthDefault)]
+ (TableHead ("",[],[])
+  [Row ("",[],[])
+   [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 2) [Plain [Str ""]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Name"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Mass (10^24kg)"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Diameter (km)"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Density (kg/m^3)"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Gravity (m/s^2)"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Length of day (hours)"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Distance from Sun (10^6km)"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Mean temperature (C)"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Number of moons"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Notes"]]]]
+ )
+ [(TableBody ("",[],[]) (RowHeadColumns 3)
+  []
+  [Row ("",[],[])
+   [Cell ("",[],[]) AlignDefault (RowSpan 4) (ColSpan 2) [Plain [Str "Terrestial planets"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Mercury"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "0.330"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "4,879"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "5427"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "3.7"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "4222.6"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "57.9"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "167"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "0"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Closest to the Sun"]]]
+  ,Row ("",[],[])
+   [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Venus"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "4.87"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "12,104"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "5243"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "8.9"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "2802.0"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "108.2"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "464"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "0"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str ""]]]
+  ,Row ("",[],[])
+   [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Earth"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "5.97"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "12,756"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "5514"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "9.8"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "24.0"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "149.6"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "15"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "1"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Our world"]]]
+  ,Row ("",[],[])
+   [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Mars"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "0.642"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "6,792"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "3933"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "3.7"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "24.7"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "227.9"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "-65"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "2"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "The red planet"]]]
+  ,Row ("",[],[])
+   [Cell ("",[],[]) AlignDefault (RowSpan 4) (ColSpan 1) [Plain [Str "Jovian planets"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 2) (ColSpan 1) [Plain [Str "Gas giants"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Jupiter"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "1898"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "142,984"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "1326"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "23.1"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "9.9"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "778.6"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "-110"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "67"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "The largest planet"]]]
+  ,Row ("",[],[])
+   [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Saturn"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "568"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "120,536"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "687"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "9.0"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "10.7"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "1433.5"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "-140"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "62"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str ""]]]
+  ,Row ("",[],[])
+   [Cell ("",[],[]) AlignDefault (RowSpan 2) (ColSpan 1) [Plain [Str "Ice giants"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Uranus"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "86.8"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "51,118"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "1271"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "8.7"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "17.2"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "2872.5"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "-195"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "27"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str ""]]]
+  ,Row ("",[],[])
+   [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Neptune"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "102"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "49,528"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "1638"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "11.0"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "16.1"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "4495.1"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "-200"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "14"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str ""]]]
+  ,Row ("",[],[])
+   [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 2) [Plain [Str "Dwarf planets"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Pluto"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "0.0146"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "2,370"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "2095"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "0.7"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "153.3"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "5906.4"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "-225"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "5"]]
+   ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Declassified as a planet in 2006."]]]])]
+ (TableFoot ("",[],[])
+ []
+ )
+]
diff --git a/test/tables/students.html4 b/test/tables/students.html4
new file mode 100644
--- /dev/null
+++ b/test/tables/students.html4
@@ -0,0 +1,55 @@
+<table id="students" source="mdn">
+<caption><p>List of Students</p></caption>
+<colgroup>
+<col width="50%" />
+<col width="50%" />
+</colgroup>
+<thead>
+<tr class="header">
+<th align="center">Student ID</th>
+<th align="center">Name</th>
+</tr>
+</thead>
+<tbody class="souvereign-states">
+<tr class="odd">
+<th align="left" colspan="2">Computer Science</th>
+</tr>
+
+<tr class="odd">
+<td align="left">3741255</td>
+<td align="left">Jones, Martha</td>
+</tr>
+<tr class="even">
+<td align="left">4077830</td>
+<td align="left">Pierce, Benjamin</td>
+</tr>
+<tr class="odd">
+<td align="left">5151701</td>
+<td align="left">Kirk, James</td>
+</tr>
+</tbody>
+<tbody>
+<tr class="odd">
+<th align="left" colspan="2">Russian Literature</th>
+</tr>
+
+<tr class="odd">
+<td align="left">3971244</td>
+<td align="left">Nim, Victor</td>
+</tr>
+</tbody>
+<tbody>
+<tr class="odd">
+<th align="left" colspan="2">Astrophysics</th>
+</tr>
+
+<tr class="odd">
+<td align="left">4100332</td>
+<td align="left">Petrov, Alexandra</td>
+</tr>
+<tr class="even">
+<td align="left">4100332</td>
+<td align="left">Toyota, Hiroko</td>
+</tr>
+</tbody>
+</table>
diff --git a/test/tables/students.html5 b/test/tables/students.html5
new file mode 100644
--- /dev/null
+++ b/test/tables/students.html5
@@ -0,0 +1,55 @@
+<table id="students" data-source="mdn">
+<caption><p>List of Students</p></caption>
+<colgroup>
+<col style="width: 50%" />
+<col style="width: 50%" />
+</colgroup>
+<thead>
+<tr class="header">
+<th style="text-align: center;">Student ID</th>
+<th style="text-align: center;">Name</th>
+</tr>
+</thead>
+<tbody class="souvereign-states">
+<tr class="odd">
+<th style="text-align: left;" colspan="2">Computer Science</th>
+</tr>
+
+<tr class="odd">
+<td style="text-align: left;">3741255</td>
+<td style="text-align: left;">Jones, Martha</td>
+</tr>
+<tr class="even">
+<td style="text-align: left;">4077830</td>
+<td style="text-align: left;">Pierce, Benjamin</td>
+</tr>
+<tr class="odd">
+<td style="text-align: left;">5151701</td>
+<td style="text-align: left;">Kirk, James</td>
+</tr>
+</tbody>
+<tbody>
+<tr class="odd">
+<th style="text-align: left;" colspan="2">Russian Literature</th>
+</tr>
+
+<tr class="odd">
+<td style="text-align: left;">3971244</td>
+<td style="text-align: left;">Nim, Victor</td>
+</tr>
+</tbody>
+<tbody>
+<tr class="odd">
+<th style="text-align: left;" colspan="2">Astrophysics</th>
+</tr>
+
+<tr class="odd">
+<td style="text-align: left;">4100332</td>
+<td style="text-align: left;">Petrov, Alexandra</td>
+</tr>
+<tr class="even">
+<td style="text-align: left;">4100332</td>
+<td style="text-align: left;">Toyota, Hiroko</td>
+</tr>
+</tbody>
+</table>
diff --git a/test/tables/students.native b/test/tables/students.native
new file mode 100644
--- /dev/null
+++ b/test/tables/students.native
@@ -0,0 +1,37 @@
+[Table ("students",[],[("source","mdn")]) (Caption Nothing
+ [Para [Str "List", Space, Str "of", Space, Str "Students"]])
+ [(AlignLeft,ColWidth 0.5)
+ ,(AlignLeft,ColWidth 0.5)]
+ (TableHead ("",[],[])
+  [Row ("",[],[])
+   [Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1) [Plain [Str "Student", Space, Str "ID"]]
+   ,Cell ("",[],[]) AlignCenter (RowSpan 1) (ColSpan 1) [Plain [Str "Name"]]]])
+ [TableBody ("",["souvereign-states"],[]) (RowHeadColumns 0)
+   [Row ("",[],[])
+    [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 2) [Plain [Str "Computer", Space, Str "Science"]]]]
+   [Row ("",[],[])
+    [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "3741255"]]
+    ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Jones,", Space, Str "Martha"]]]
+   ,Row ("",[],[])
+    [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "4077830"]]
+    ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Pierce,", Space, Str "Benjamin"]]]
+   ,Row ("",[],[])
+    [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "5151701"]]
+    ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Kirk,", Space, Str "James"]]]]
+ ,TableBody ("",[],[]) (RowHeadColumns 0)
+   [Row ("",[],[])
+    [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 2) [Plain [Str "Russian", Space, Str "Literature"]]]]
+   [Row ("",[],[])
+    [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "3971244"]]
+    ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Nim,", Space, Str "Victor"]]]]
+ ,TableBody ("",[],[]) (RowHeadColumns 0)
+   [Row ("",[],[])
+    [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 2) [Plain [Str "Astrophysics"]]]]
+   [Row ("",[],[])
+    [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "4100332"]]
+    ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Petrov,", Space, Str "Alexandra"]]]
+   ,Row ("",[],[])
+    [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "4100332"]]
+    ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "Toyota,", Space, Str "Hiroko"]]]]]
+ (TableFoot ("",[],[]) [])
+]
diff --git a/test/test-pandoc.hs b/test/test-pandoc.hs
--- a/test/test-pandoc.hs
+++ b/test/test-pandoc.hs
@@ -44,6 +44,7 @@
 import qualified Tests.Writers.Plain
 import qualified Tests.Writers.Powerpoint
 import qualified Tests.Writers.RST
+import qualified Tests.Writers.AnnotatedTable
 import qualified Tests.Writers.TEI
 import Tests.Helpers (findPandoc)
 import Text.Pandoc.Shared (inDirectory)
@@ -72,6 +73,7 @@
           , testGroup "FB2" Tests.Writers.FB2.tests
           , testGroup "PowerPoint" Tests.Writers.Powerpoint.tests
           , testGroup "Ms" Tests.Writers.Ms.tests
+          , testGroup "AnnotatedTable" Tests.Writers.AnnotatedTable.tests
           ]
         , testGroup "Readers"
           [ testGroup "LaTeX" Tests.Readers.LaTeX.tests
diff --git a/test/writer.asciidoc b/test/writer.asciidoc
--- a/test/writer.asciidoc
+++ b/test/writer.asciidoc
@@ -622,7 +622,7 @@
 
 From ``Voyage dans la Lune'' by Georges Melies (1902):
 
-image:lalune.jpg[lalune,title="Voyage dans la Lune"]
+image::lalune.jpg[lalune,title="Voyage dans la Lune"]
 
 Here is a movie image:movie.jpg[movie] icon.
 
diff --git a/test/writer.custom b/test/writer.custom
--- a/test/writer.custom
+++ b/test/writer.custom
@@ -57,7 +57,7 @@
 <p>Code in a block quote:</p>
 
 <pre><code>sub status {
-    print &quot;working&quot;;
+    print "working";
 }</code></pre>
 
 <p>A list:</p>
@@ -92,7 +92,7 @@
 <pre><code>---- (should be four hyphens)
 
 sub status {
-    print &quot;working&quot;;
+    print "working";
 }
 
 this code block is indented by one tab</code></pre>
diff --git a/test/writer.html4 b/test/writer.html4
--- a/test/writer.html4
+++ b/test/writer.html4
@@ -9,6 +9,112 @@
   <meta name="date" content="2006-07-17" />
   <title>Pandoc Test Suite</title>
   <style type="text/css">
+    html {
+      line-height: 1.7;
+      font-family: Georgia, serif;
+      font-size: 20px;
+      color: #1a1a1a;
+      background-color: #fdfdfd;
+    }
+    body {
+      margin: 0 auto;
+      max-width: 40em;
+      padding-left: 50px;
+      padding-right: 50px;
+      padding-top: 50px;
+      padding-bottom: 50px;
+      hyphens: auto;
+      word-wrap: break-word;
+      text-rendering: optimizeLegibility;
+      font-kerning: normal;
+    }
+    @media (max-width: 600px) {
+      body {
+        font-size: 0.9em;
+        padding: 1em;
+      }
+    }
+    @media print {
+      body {
+        background-color: transparent;
+        color: black;
+      }
+      p, h2, h3 {
+        orphans: 3;
+        widows: 3;
+      }
+      h2, h3, h4 {
+        page-break-after: avoid;
+      }
+    }
+    p {
+      margin-top: 1.7em;
+    }
+    a {
+      color: #1a1a1a;
+    }
+    a:visited {
+      color: #1a1a1a;
+    }
+    img {
+      max-width: 100%;
+    }
+    h1, h2, h3, h4, h5, h6 {
+      margin-top: 1.7em;
+    }
+    ol, ul {
+      padding-left: 1.7em;
+      margin-top: 1.7em;
+    }
+    li > ol, li > ul {
+      margin-top: 0;
+    }
+    blockquote {
+      margin: 1.7em 0 1.7em 1.7em;
+      padding-left: 1em;
+      border-left: 2px solid #e6e6e6;
+      font-style: italic;
+    }
+    code {
+      font-family: Menlo, Monaco, 'Lucida Console', Consolas, monospace;
+      background-color: #f0f0f0;
+      font-size: 85%;
+      margin: 0;
+      padding: .2em .4em;
+    }
+    pre {
+      line-height: 1.5em;
+      padding: 1em;
+      background-color: #f0f0f0;
+      overflow: auto;
+    }
+    pre code {
+      padding: 0;
+      overflow: visible;
+    }
+    hr {
+      background-color: #1a1a1a;
+      border: none;
+      height: 1px;
+      margin-top: 1.7em;
+    }
+    table {
+      border-collapse: collapse;
+      width: 100%;
+      overflow-x: auto;
+      display: block;
+    }
+    th, td {
+      border-bottom: 1px solid lightgray;
+      padding: 1em 3em 1em 0;
+    }
+    header {
+      margin-bottom: 6em;
+      text-align: center;
+    }
+    nav a:not(:hover) {
+      text-decoration: none;
+    }
     code{white-space: pre-wrap;}
     span.smallcaps{font-variant: small-caps;}
     span.underline{text-decoration: underline;}
diff --git a/test/writer.html5 b/test/writer.html5
--- a/test/writer.html5
+++ b/test/writer.html5
@@ -9,6 +9,112 @@
   <meta name="dcterms.date" content="2006-07-17" />
   <title>Pandoc Test Suite</title>
   <style>
+    html {
+      line-height: 1.7;
+      font-family: Georgia, serif;
+      font-size: 20px;
+      color: #1a1a1a;
+      background-color: #fdfdfd;
+    }
+    body {
+      margin: 0 auto;
+      max-width: 40em;
+      padding-left: 50px;
+      padding-right: 50px;
+      padding-top: 50px;
+      padding-bottom: 50px;
+      hyphens: auto;
+      word-wrap: break-word;
+      text-rendering: optimizeLegibility;
+      font-kerning: normal;
+    }
+    @media (max-width: 600px) {
+      body {
+        font-size: 0.9em;
+        padding: 1em;
+      }
+    }
+    @media print {
+      body {
+        background-color: transparent;
+        color: black;
+      }
+      p, h2, h3 {
+        orphans: 3;
+        widows: 3;
+      }
+      h2, h3, h4 {
+        page-break-after: avoid;
+      }
+    }
+    p {
+      margin-top: 1.7em;
+    }
+    a {
+      color: #1a1a1a;
+    }
+    a:visited {
+      color: #1a1a1a;
+    }
+    img {
+      max-width: 100%;
+    }
+    h1, h2, h3, h4, h5, h6 {
+      margin-top: 1.7em;
+    }
+    ol, ul {
+      padding-left: 1.7em;
+      margin-top: 1.7em;
+    }
+    li > ol, li > ul {
+      margin-top: 0;
+    }
+    blockquote {
+      margin: 1.7em 0 1.7em 1.7em;
+      padding-left: 1em;
+      border-left: 2px solid #e6e6e6;
+      font-style: italic;
+    }
+    code {
+      font-family: Menlo, Monaco, 'Lucida Console', Consolas, monospace;
+      background-color: #f0f0f0;
+      font-size: 85%;
+      margin: 0;
+      padding: .2em .4em;
+    }
+    pre {
+      line-height: 1.5em;
+      padding: 1em;
+      background-color: #f0f0f0;
+      overflow: auto;
+    }
+    pre code {
+      padding: 0;
+      overflow: visible;
+    }
+    hr {
+      background-color: #1a1a1a;
+      border: none;
+      height: 1px;
+      margin-top: 1.7em;
+    }
+    table {
+      border-collapse: collapse;
+      width: 100%;
+      overflow-x: auto;
+      display: block;
+    }
+    th, td {
+      border-bottom: 1px solid lightgray;
+      padding: 1em 3em 1em 0;
+    }
+    header {
+      margin-bottom: 6em;
+      text-align: center;
+    }
+    nav a:not(:hover) {
+      text-decoration: none;
+    }
     code{white-space: pre-wrap;}
     span.smallcaps{font-variant: small-caps;}
     span.underline{text-decoration: underline;}
diff --git a/test/writer.icml b/test/writer.icml
--- a/test/writer.icml
+++ b/test/writer.icml
@@ -444,16 +444,19 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#headers" Name="Destination" DestinationUniqueKey="1" />
     <Content>Headers</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header2">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#level-2-with-an-embedded-link" Name="Destination" DestinationUniqueKey="1" />
     <Content>Level 2 with an </Content>
   </CharacterStyleRange>
   <HyperlinkTextSource Self="htss-1" Name="" Hidden="false">
     <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Link">
+      <HyperlinkTextDestination Self="HyperlinkTextDestination/#level-2-with-an-embedded-link" Name="Destination" DestinationUniqueKey="1" />
       <Content>embedded link</Content>
     </CharacterStyleRange>
   </HyperlinkTextSource>
@@ -461,42 +464,50 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header3">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#level-3-with-emphasis" Name="Destination" DestinationUniqueKey="1" />
     <Content>Level 3 with </Content>
   </CharacterStyleRange>
   <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Italic">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#level-3-with-emphasis" Name="Destination" DestinationUniqueKey="1" />
     <Content>emphasis</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header4">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#level-4" Name="Destination" DestinationUniqueKey="1" />
     <Content>Level 4</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header5">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#level-5" Name="Destination" DestinationUniqueKey="1" />
     <Content>Level 5</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#level-1" Name="Destination" DestinationUniqueKey="1" />
     <Content>Level 1</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header2">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#level-2-with-emphasis" Name="Destination" DestinationUniqueKey="1" />
     <Content>Level 2 with </Content>
   </CharacterStyleRange>
   <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Italic">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#level-2-with-emphasis" Name="Destination" DestinationUniqueKey="1" />
     <Content>emphasis</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header3">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#level-3" Name="Destination" DestinationUniqueKey="1" />
     <Content>Level 3</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -509,6 +520,7 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header2">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#level-2" Name="Destination" DestinationUniqueKey="1" />
     <Content>Level 2</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -521,6 +533,7 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#paragraphs" Name="Destination" DestinationUniqueKey="1" />
     <Content>Paragraphs</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -557,6 +570,7 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#block-quotes" Name="Destination" DestinationUniqueKey="1" />
     <Content>Block Quotes</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -637,6 +651,7 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#code-blocks" Name="Destination" DestinationUniqueKey="1" />
     <Content>Code Blocks</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -675,12 +690,14 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#lists" Name="Destination" DestinationUniqueKey="1" />
     <Content>Lists</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header2">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#unordered" Name="Destination" DestinationUniqueKey="1" />
     <Content>Unordered</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -831,6 +848,7 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header2">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#ordered" Name="Destination" DestinationUniqueKey="1" />
     <Content>Ordered</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -963,6 +981,7 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header2">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#nested" Name="Destination" DestinationUniqueKey="1" />
     <Content>Nested</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -1071,6 +1090,7 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header2">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#tabs-and-spaces" Name="Destination" DestinationUniqueKey="1" />
     <Content>Tabs and spaces</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -1101,6 +1121,7 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header2">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#fancy-list-markers" Name="Destination" DestinationUniqueKey="1" />
     <Content>Fancy list markers</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -1221,6 +1242,7 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#definition-lists" Name="Destination" DestinationUniqueKey="1" />
     <Content>Definition Lists</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -1533,6 +1555,7 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#html-blocks" Name="Destination" DestinationUniqueKey="1" />
     <Content>HTML Blocks</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -1691,6 +1714,7 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#inline-markup" Name="Destination" DestinationUniqueKey="1" />
     <Content>Inline Markup</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -1885,6 +1909,7 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#smart-quotes-ellipses-dashes" Name="Destination" DestinationUniqueKey="1" />
     <Content>Smart quotes, ellipses, dashes</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -2019,6 +2044,7 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#latex" Name="Destination" DestinationUniqueKey="1" />
     <Content>LaTeX</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -2198,6 +2224,7 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#special-characters" Name="Destination" DestinationUniqueKey="1" />
     <Content>Special Characters</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -2366,12 +2393,14 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#links" Name="Destination" DestinationUniqueKey="1" />
     <Content>Links</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header2">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#explicit" Name="Destination" DestinationUniqueKey="1" />
     <Content>Explicit</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -2468,6 +2497,7 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header2">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#reference" Name="Destination" DestinationUniqueKey="1" />
     <Content>Reference</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -2595,6 +2625,7 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header2">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#with-ampersands" Name="Destination" DestinationUniqueKey="1" />
     <Content>With ampersands</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -2657,6 +2688,7 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header2">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#autolinks" Name="Destination" DestinationUniqueKey="1" />
     <Content>Autolinks</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -2731,6 +2763,7 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#images" Name="Destination" DestinationUniqueKey="1" />
     <Content>Images</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -2815,6 +2848,7 @@
 <Br />
 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">
   <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
+    <HyperlinkTextDestination Self="HyperlinkTextDestination/#footnotes" Name="Destination" DestinationUniqueKey="1" />
     <Content>Footnotes</Content>
   </CharacterStyleRange>
 </ParagraphStyleRange>
@@ -2965,203 +2999,203 @@
 
   </Story>
   <HyperlinkURLDestination Self="HyperlinkURLDestination/http%3a//google.com" Name="link" DestinationURL="http://google.com" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-29" Name="http://google.com" Source="htss-29" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-29" Name="http://google.com" Source="htss-29" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination/http%3a//google.com</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination/http%3a//example.com/" Name="link" DestinationURL="http://example.com/" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-28" Name="http://example.com/" Source="htss-28" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-28" Name="http://example.com/" Source="htss-28" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination/http%3a//example.com/</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination/mailto%3anobody@nowhere.net" Name="link" DestinationURL="mailto:nobody@nowhere.net" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-27" Name="mailto:nobody@nowhere.net" Source="htss-27" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-27" Name="mailto:nobody@nowhere.net" Source="htss-27" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination/mailto%3anobody@nowhere.net</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination/http%3a//example.com/" Name="link" DestinationURL="http://example.com/" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-26" Name="http://example.com/" Source="htss-26" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-26" Name="http://example.com/" Source="htss-26" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination/http%3a//example.com/</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination/http%3a//example.com/?foo=1&amp;bar=2" Name="link" DestinationURL="http://example.com/?foo=1&amp;bar=2" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-25" Name="http://example.com/?foo=1&amp;bar=2" Source="htss-25" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-25" Name="http://example.com/?foo=1&amp;bar=2" Source="htss-25" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination/http%3a//example.com/?foo=1&amp;bar=2</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination//script?foo=1&amp;bar=2" Name="link" DestinationURL="/script?foo=1&amp;bar=2" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-24" Name="/script?foo=1&amp;bar=2" Source="htss-24" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-24" Name="/script?foo=1&amp;bar=2" Source="htss-24" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination//script?foo=1&amp;bar=2</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination//script?foo=1&amp;bar=2" Name="link" DestinationURL="/script?foo=1&amp;bar=2" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-23" Name="/script?foo=1&amp;bar=2" Source="htss-23" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-23" Name="/script?foo=1&amp;bar=2" Source="htss-23" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination//script?foo=1&amp;bar=2</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination/http%3a//att.com/" Name="link" DestinationURL="http://att.com/" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-22" Name="http://att.com/" Source="htss-22" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-22" Name="http://att.com/" Source="htss-22" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination/http%3a//att.com/</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination/http%3a//example.com/?foo=1&amp;bar=2" Name="link" DestinationURL="http://example.com/?foo=1&amp;bar=2" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-21" Name="http://example.com/?foo=1&amp;bar=2" Source="htss-21" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-21" Name="http://example.com/?foo=1&amp;bar=2" Source="htss-21" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination/http%3a//example.com/?foo=1&amp;bar=2</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination//url/" Name="link" DestinationURL="/url/" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-20" Name="/url/" Source="htss-20" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-20" Name="/url/" Source="htss-20" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination//url/</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination//url/" Name="link" DestinationURL="/url/" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-19" Name="/url/" Source="htss-19" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-19" Name="/url/" Source="htss-19" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination//url/</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination//url" Name="link" DestinationURL="/url" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-18" Name="/url" Source="htss-18" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-18" Name="/url" Source="htss-18" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination//url</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination//url" Name="link" DestinationURL="/url" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-17" Name="/url" Source="htss-17" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-17" Name="/url" Source="htss-17" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination//url</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination//url" Name="link" DestinationURL="/url" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-16" Name="/url" Source="htss-16" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-16" Name="/url" Source="htss-16" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination//url</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination//url/" Name="link" DestinationURL="/url/" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-15" Name="/url/" Source="htss-15" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-15" Name="/url/" Source="htss-15" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination//url/</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination//url/" Name="link" DestinationURL="/url/" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-14" Name="/url/" Source="htss-14" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-14" Name="/url/" Source="htss-14" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination//url/</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination//url/" Name="link" DestinationURL="/url/" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-13" Name="/url/" Source="htss-13" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-13" Name="/url/" Source="htss-13" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination//url/</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination/" Name="link" DestinationURL="" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-12" Name="" Source="htss-12" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-12" Name="" Source="htss-12" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination/</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination/mailto%3anobody@nowhere.net" Name="link" DestinationURL="mailto:nobody@nowhere.net" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-11" Name="mailto:nobody@nowhere.net" Source="htss-11" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-11" Name="mailto:nobody@nowhere.net" Source="htss-11" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination/mailto%3anobody@nowhere.net</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination//url/with_underscore" Name="link" DestinationURL="/url/with_underscore" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-10" Name="/url/with_underscore" Source="htss-10" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-10" Name="/url/with_underscore" Source="htss-10" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination//url/with_underscore</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination//url/" Name="link" DestinationURL="/url/" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-9" Name="/url/" Source="htss-9" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-9" Name="/url/" Source="htss-9" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination//url/</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination//url/" Name="link" DestinationURL="/url/" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-8" Name="/url/" Source="htss-8" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-8" Name="/url/" Source="htss-8" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination//url/</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination//url/" Name="link" DestinationURL="/url/" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-7" Name="/url/" Source="htss-7" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-7" Name="/url/" Source="htss-7" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination//url/</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination//url/" Name="link" DestinationURL="/url/" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-6" Name="/url/" Source="htss-6" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-6" Name="/url/" Source="htss-6" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination//url/</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination//url/" Name="link" DestinationURL="/url/" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-5" Name="/url/" Source="htss-5" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-5" Name="/url/" Source="htss-5" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination//url/</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination//url/" Name="link" DestinationURL="/url/" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-4" Name="/url/" Source="htss-4" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-4" Name="/url/" Source="htss-4" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination//url/</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination/http%3a//example.com/?foo=1&amp;bar=2" Name="link" DestinationURL="http://example.com/?foo=1&amp;bar=2" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-3" Name="http://example.com/?foo=1&amp;bar=2" Source="htss-3" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-3" Name="http://example.com/?foo=1&amp;bar=2" Source="htss-3" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination/http%3a//example.com/?foo=1&amp;bar=2</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination//url" Name="link" DestinationURL="/url" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-2" Name="/url" Source="htss-2" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-2" Name="/url" Source="htss-2" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination//url</Destination>
     </Properties>
   </Hyperlink>
   <HyperlinkURLDestination Self="HyperlinkURLDestination//url" Name="link" DestinationURL="/url" DestinationUniqueKey="1" />
-  <Hyperlink Self="uf-1" Name="/url" Source="htss-1" Visible="true" DestinationUniqueKey="1">
+  <Hyperlink Self="uf-1" Name="/url" Source="htss-1" Visible="false" DestinationUniqueKey="1">
     <Properties>
       <BorderColor type="enumeration">Black</BorderColor>
       <Destination type="object">HyperlinkURLDestination//url</Destination>
diff --git a/test/writer.markdown b/test/writer.markdown
--- a/test/writer.markdown
+++ b/test/writer.markdown
@@ -2,7 +2,7 @@
 author:
 - John MacFarlane
 - Anonymous
-date: 'July 17, 2006'
+date: July 17, 2006
 title: Pandoc Test Suite
 ---
 
diff --git a/test/writer.org b/test/writer.org
--- a/test/writer.org
+++ b/test/writer.org
@@ -12,49 +12,40 @@
   :PROPERTIES:
   :CUSTOM_ID: headers
   :END:
-
 ** Level 2 with an [[/url][embedded link]]
    :PROPERTIES:
    :CUSTOM_ID: level-2-with-an-embedded-link
    :END:
-
 *** Level 3 with /emphasis/
     :PROPERTIES:
     :CUSTOM_ID: level-3-with-emphasis
     :END:
-
 **** Level 4
      :PROPERTIES:
      :CUSTOM_ID: level-4
      :END:
-
 ***** Level 5
       :PROPERTIES:
       :CUSTOM_ID: level-5
       :END:
-
 * Level 1
   :PROPERTIES:
   :CUSTOM_ID: level-1
   :END:
-
 ** Level 2 with /emphasis/
    :PROPERTIES:
    :CUSTOM_ID: level-2-with-emphasis
    :END:
-
 *** Level 3
     :PROPERTIES:
     :CUSTOM_ID: level-3
     :END:
-
 with no blank line
 
 ** Level 2
    :PROPERTIES:
    :CUSTOM_ID: level-2
    :END:
-
 with no blank line
 
 --------------
@@ -63,7 +54,6 @@
   :PROPERTIES:
   :CUSTOM_ID: paragraphs
   :END:
-
 Here's a regular paragraph.
 
 In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
@@ -81,7 +71,6 @@
   :PROPERTIES:
   :CUSTOM_ID: block-quotes
   :END:
-
 E-mail style:
 
 #+BEGIN_QUOTE
@@ -123,7 +112,6 @@
   :PROPERTIES:
   :CUSTOM_ID: code-blocks
   :END:
-
 Code:
 
 #+BEGIN_EXAMPLE
@@ -150,12 +138,10 @@
   :PROPERTIES:
   :CUSTOM_ID: lists
   :END:
-
 ** Unordered
    :PROPERTIES:
    :CUSTOM_ID: unordered
    :END:
-
 Asterisks tight:
 
 - asterisk 1
@@ -202,7 +188,6 @@
    :PROPERTIES:
    :CUSTOM_ID: ordered
    :END:
-
 Tight:
 
 1. First
@@ -334,7 +319,6 @@
   :PROPERTIES:
   :CUSTOM_ID: definition-lists
   :END:
-
 Tight using spaces:
 
 - apple :: red fruit
@@ -403,7 +387,6 @@
   :PROPERTIES:
   :CUSTOM_ID: html-blocks
   :END:
-
 Simple block on one line:
 
 foo
@@ -561,7 +544,6 @@
   :PROPERTIES:
   :CUSTOM_ID: inline-markup
   :END:
-
 This is /emphasized/, and so /is this/.
 
 This is *strong*, and so *is this*.
@@ -593,7 +575,6 @@
   :PROPERTIES:
   :CUSTOM_ID: smart-quotes-ellipses-dashes
   :END:
-
 "Hello," said the spider. "'Shelob' is my name."
 
 'A', 'B', and 'C' are letters.
@@ -650,7 +631,6 @@
   :PROPERTIES:
   :CUSTOM_ID: special-characters
   :END:
-
 Here is some unicode:
 
 - I hat: Î
@@ -707,12 +687,10 @@
   :PROPERTIES:
   :CUSTOM_ID: links
   :END:
-
 ** Explicit
    :PROPERTIES:
    :CUSTOM_ID: explicit
    :END:
-
 Just a [[/url/][URL]].
 
 [[/url/][URL and title]].
@@ -735,7 +713,6 @@
    :PROPERTIES:
    :CUSTOM_ID: reference
    :END:
-
 Foo [[/url/][bar]].
 
 With [[/url/][embedded [brackets]]].
@@ -762,7 +739,6 @@
    :PROPERTIES:
    :CUSTOM_ID: with-ampersands
    :END:
-
 Here's a [[http://example.com/?foo=1&bar=2][link with an ampersand in the
 URL]].
 
@@ -776,7 +752,6 @@
    :PROPERTIES:
    :CUSTOM_ID: autolinks
    :END:
-
 With an ampersand: [[http://example.com/?foo=1&bar=2]]
 
 - In a list?
@@ -801,7 +776,6 @@
   :PROPERTIES:
   :CUSTOM_ID: images
   :END:
-
 From "Voyage dans la Lune" by Georges Melies (1902):
 
 #+CAPTION: lalune
@@ -815,7 +789,6 @@
   :PROPERTIES:
   :CUSTOM_ID: footnotes
   :END:
-
 Here is a footnote reference,[fn:1] and another.[fn:2] This should /not/ be a
 footnote reference, because it contains a space.[^my note] Here is an inline
 note.[fn:3]
diff --git a/trypandoc/trypandoc.hs b/trypandoc/trypandoc.hs
--- a/trypandoc/trypandoc.hs
+++ b/trypandoc/trypandoc.hs
@@ -74,8 +74,7 @@
 writerOpts :: WriterOptions
 writerOpts = def { writerReferenceLinks = True,
                    writerEmailObfuscation = NoObfuscation,
-                   writerHTMLMathMethod = MathJax (defaultMathJaxURL <>
-                       T.pack "tex-mml-chtml.js"),
+                   writerHTMLMathMethod = MathJax defaultMathJaxURL,
                    writerHighlightStyle = Just pygments }
 
 readerOpts :: ReaderOptions
