<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE article>
<article
  xmlns="http://docbook.org/ns/docbook" version="5.0"
  xmlns:xlink="http://www.w3.org/1999/xlink" >
  <info>
    <title>Pandoc User’s Guide</title>
    <authorgroup>
      <author>
        <personname>
          <firstname>John</firstname>
          <surname>MacFarlane</surname>
        </personname>
      </author>
    </authorgroup>
    <date>2025-10-20</date>
  </info>
  <section xml:id="synopsis">
    <title>Synopsis</title>
    <para>
      <literal>pandoc</literal> [<emphasis>options</emphasis>]
      [<emphasis>input-file</emphasis>]…
    </para>
  </section>
  <section xml:id="description">
    <title>Description</title>
    <para>
      Pandoc is a
      <link xlink:href="https://www.haskell.org">Haskell</link> library
      for converting from one markup format to another, and a
      command-line tool that uses this library.
    </para>
    <para>
      Pandoc can convert between numerous markup and word processing
      formats, including, but not limited to, various flavors of
      <link xlink:href="https://daringfireball.net/projects/markdown/">Markdown</link>,
      <link xlink:href="https://www.w3.org/html/">HTML</link>,
      <link xlink:href="https://www.latex-project.org/">LaTeX</link> and
      <link xlink:href="https://en.wikipedia.org/wiki/Office_Open_XML">Word
      docx</link>. For the full lists of input and output formats, see
      the <literal>--from</literal> and <literal>--to</literal>
      <link linkend="general-options">options below</link>. Pandoc can
      also produce
      <link xlink:href="https://www.adobe.com/pdf/">PDF</link> output:
      see <link linkend="creating-a-pdf">creating a PDF</link>, below.
    </para>
    <para>
      Pandoc’s enhanced version of Markdown includes syntax for
      <link linkend="tables">tables</link>,
      <link linkend="definition-lists">definition lists</link>,
      <link linkend="metadata-blocks">metadata blocks</link>,
      <link linkend="footnotes">footnotes</link>,
      <link linkend="citations">citations</link>,
      <link linkend="math">math</link>, and much more. See below under
      <link linkend="pandocs-markdown">Pandoc’s Markdown</link>.
    </para>
    <para>
      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 <emphasis>abstract syntax
      tree</emphasis> 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
      <link xlink:href="https://pandoc.org/filters.html">pandoc
      filters</link> to modify the intermediate AST.
    </para>
    <para>
      Because pandoc’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’s simple document model. While conversions from pandoc’s
      Markdown to all formats aspire to be perfect, conversions from
      formats more expressive than pandoc’s Markdown can be expected to
      be lossy.
    </para>
    <section xml:id="using-pandoc">
      <title>Using pandoc</title>
      <para>
        If no <emphasis>input-files</emphasis> are specified, input is
        read from <emphasis>stdin</emphasis>. Output goes to
        <emphasis>stdout</emphasis> by default. For output to a file,
        use the <literal>-o</literal> option:
      </para>
      <programlisting>
pandoc -o output.html input.txt
</programlisting>
      <para>
        By default, pandoc produces a document fragment. To produce a
        standalone document (e.g. a valid HTML file including
        <literal>&lt;head&gt;</literal> and
        <literal>&lt;body&gt;</literal>), use the <literal>-s</literal>
        or <literal>--standalone</literal> flag:
      </para>
      <programlisting>
pandoc -s -o output.html input.txt
</programlisting>
      <para>
        For more information on how standalone documents are produced,
        see <link linkend="templates">Templates</link> below.
      </para>
      <para>
        If multiple input files are given, pandoc will concatenate them
        all (with blank lines between them) before parsing. (Use
        <literal>--file-scope</literal> to parse files individually.)
      </para>
    </section>
    <section xml:id="specifying-formats">
      <title>Specifying formats</title>
      <para>
        The format of the input and output can be specified explicitly
        using command-line options. The input format can be specified
        using the <literal>-f/--from</literal> option, the output format
        using the <literal>-t/--to</literal> option. Thus, to convert
        <literal>hello.txt</literal> from Markdown to LaTeX, you could
        type:
      </para>
      <programlisting>
pandoc -f markdown -t latex hello.txt
</programlisting>
      <para>
        To convert <literal>hello.html</literal> from HTML to Markdown:
      </para>
      <programlisting>
pandoc -f html -t markdown hello.html
</programlisting>
      <para>
        Supported input and output formats are listed below under
        <link linkend="options">Options</link> (see
        <literal>-f</literal> for input formats and
        <literal>-t</literal> for output formats). You can also use
        <literal>pandoc --list-input-formats</literal> and
        <literal>pandoc --list-output-formats</literal> to print lists
        of supported formats.
      </para>
      <para>
        If the input or output format is not specified explicitly,
        pandoc will attempt to guess it from the extensions of the
        filenames. Thus, for example,
      </para>
      <programlisting>
pandoc -o hello.tex hello.txt
</programlisting>
      <para>
        will convert <literal>hello.txt</literal> from Markdown to
        LaTeX. If no output file is specified (so that output goes to
        <emphasis>stdout</emphasis>), or if the output file’s extension
        is unknown, the output format will default to HTML. If no input
        file is specified (so that input comes from
        <emphasis>stdin</emphasis>), or if the input files’ extensions
        are unknown, the input format will be assumed to be Markdown.
      </para>
    </section>
    <section xml:id="character-encoding">
      <title>Character encoding</title>
      <para>
        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
        <link xlink:href="https://www.gnu.org/software/libiconv/"><literal>iconv</literal></link>:
      </para>
      <programlisting>
iconv -t utf-8 input.txt | pandoc | iconv -f utf-8
</programlisting>
      <para>
        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
        <literal>-s/--standalone</literal> option.
      </para>
    </section>
    <section xml:id="creating-a-pdf">
      <title>Creating a PDF</title>
      <para>
        To produce a PDF, specify an output file with a
        <literal>.pdf</literal> extension:
      </para>
      <programlisting>
pandoc test.txt -o test.pdf
</programlisting>
      <para>
        By default, pandoc will use LaTeX to create the PDF, which
        requires that a LaTeX engine be installed (see
        <literal>--pdf-engine</literal> below). Alternatively, pandoc
        can use ConTeXt, roff ms, or HTML as an intermediate format. To
        do this, specify an output file with a <literal>.pdf</literal>
        extension, as before, but add the
        <literal>--pdf-engine</literal> option or
        <literal>-t context</literal>, <literal>-t html</literal>, or
        <literal>-t ms</literal> to the command line. The tool used to
        generate the PDF from the intermediate format may be specified
        using <literal>--pdf-engine</literal>.
      </para>
      <para>
        You can control the PDF style using variables, depending on the
        intermediate format used: see
        <link linkend="variables-for-latex">variables for LaTeX</link>,
        <link linkend="variables-for-context">variables for
        ConTeXt</link>,
        <link linkend="variables-for-wkhtmltopdf">variables for
        <literal>wkhtmltopdf</literal></link>,
        <link linkend="variables-for-ms">variables for ms</link>. When
        HTML is used as an intermediate format, the output can be styled
        using <literal>--css</literal>.
      </para>
      <para>
        To debug the PDF creation, it can be useful to look at the
        intermediate representation: instead of
        <literal>-o test.pdf</literal>, use for example
        <literal>-s -o test.tex</literal> to output the generated LaTeX.
        You can then test it with <literal>pdflatex test.tex</literal>.
      </para>
      <para>
        When using LaTeX, the following packages need to be available
        (they are included with all recent versions of
        <link xlink:href="https://www.tug.org/texlive/">TeX
        Live</link>):
        <link xlink:href="https://ctan.org/pkg/amsfonts"><literal>amsfonts</literal></link>,
        <link xlink:href="https://ctan.org/pkg/amsmath"><literal>amsmath</literal></link>,
        <link xlink:href="https://ctan.org/pkg/lm"><literal>lm</literal></link>,
        <link xlink:href="https://ctan.org/pkg/unicode-math"><literal>unicode-math</literal></link>,
        <link xlink:href="https://ctan.org/pkg/iftex"><literal>iftex</literal></link>,
        <link xlink:href="https://ctan.org/pkg/listings"><literal>listings</literal></link>
        (if the <literal>--listings</literal> option is used),
        <link xlink:href="https://ctan.org/pkg/fancyvrb"><literal>fancyvrb</literal></link>,
        <link xlink:href="https://ctan.org/pkg/longtable"><literal>longtable</literal></link>,
        <link xlink:href="https://ctan.org/pkg/booktabs"><literal>booktabs</literal></link>,
        <link xlink:href="https://ctan.org/pkg/multirow"><literal>multirow</literal></link>
        (if the document contains a table with cells that cross multiple
        rows),
        <link xlink:href="https://ctan.org/pkg/graphicx"><literal>graphicx</literal></link>
        (if the document contains images),
        <link xlink:href="https://ctan.org/pkg/bookmark"><literal>bookmark</literal></link>,
        <link xlink:href="https://ctan.org/pkg/xcolor"><literal>xcolor</literal></link>,
        <link xlink:href="https://ctan.org/pkg/soul"><literal>soul</literal></link>,
        <link xlink:href="https://ctan.org/pkg/geometry"><literal>geometry</literal></link>
        (with the <literal>geometry</literal> variable set),
        <link xlink:href="https://ctan.org/pkg/setspace"><literal>setspace</literal></link>
        (with <literal>linestretch</literal>), and
        <link xlink:href="https://ctan.org/pkg/babel"><literal>babel</literal></link>
        (with <literal>lang</literal>). If
        <literal>CJKmainfont</literal> is set,
        <link xlink:href="https://ctan.org/pkg/xecjk"><literal>xeCJK</literal></link>
        is needed if <literal>xelatex</literal> is used, else
        <link xlink:href="https://ctan.org/pkg/luatexja"><literal>luatexja</literal></link>
        is needed if <literal>lualatex</literal> is used.
        <link xlink:href="https://ctan.org/pkg/framed"><literal>framed</literal></link>
        is required if code is highlighted in a scheme that use a
        colored background. The use of <literal>xelatex</literal> or
        <literal>lualatex</literal> as the PDF engine requires
        <link xlink:href="https://ctan.org/pkg/fontspec"><literal>fontspec</literal></link>.
        <literal>lualatex</literal> uses
        <link xlink:href="https://ctan.org/pkg/selnolig"><literal>selnolig</literal></link>
        and
        <link xlink:href="https://ctan.org/pkg/lua-ul"><literal>lua-ul</literal></link>.
        <literal>xelatex</literal> uses
        <link xlink:href="https://ctan.org/pkg/bidi"><literal>bidi</literal></link>
        (with the <literal>dir</literal> variable set). If the
        <literal>mathspec</literal> variable is set,
        <literal>xelatex</literal> will use
        <link xlink:href="https://ctan.org/pkg/mathspec"><literal>mathspec</literal></link>
        instead of
        <link xlink:href="https://ctan.org/pkg/unicode-math"><literal>unicode-math</literal></link>.
        The
        <link xlink:href="https://ctan.org/pkg/csquotes"><literal>csquotes</literal></link>
        package will be used for
        <link linkend="typography">typography</link> if the
        <literal>csquotes</literal> variable or metadata field is set to
        a true value. The
        <link xlink:href="https://ctan.org/pkg/natbib"><literal>natbib</literal></link>,
        <link xlink:href="https://ctan.org/pkg/biblatex"><literal>biblatex</literal></link>,
        <link xlink:href="https://ctan.org/pkg/bibtex"><literal>bibtex</literal></link>,
        and
        <link xlink:href="https://ctan.org/pkg/biber"><literal>biber</literal></link>
        packages can optionally be used for
        <link linkend="citation-rendering">citation rendering</link>. If
        math with <literal>\cancel</literal>,
        <literal>\bcancel</literal>, or <literal>\xcancel</literal> is
        used, the
        <link xlink:href="https://ctan.org/pkg/cancel"><literal>cancel</literal></link>
        package is needed. The following packages will be used to
        improve output quality if present, but pandoc does not require
        them to be present:
        <link xlink:href="https://ctan.org/pkg/upquote"><literal>upquote</literal></link>
        (for straight quotes in verbatim environments),
        <link xlink:href="https://ctan.org/pkg/microtype"><literal>microtype</literal></link>
        (for better spacing adjustments),
        <link xlink:href="https://ctan.org/pkg/parskip"><literal>parskip</literal></link>
        (for better inter-paragraph spaces),
        <link xlink:href="https://ctan.org/pkg/xurl"><literal>xurl</literal></link>
        (for better line breaks in URLs), and
        <link xlink:href="https://ctan.org/pkg/footnotehyper"><literal>footnotehyper</literal></link>
        or
        <link xlink:href="https://ctan.org/pkg/footnote"><literal>footnote</literal></link>
        (to allow footnotes in tables).
      </para>
    </section>
    <section xml:id="reading-from-the-web">
      <title>Reading from the Web</title>
      <para>
        Instead of an input file, an absolute URI may be given. In this
        case pandoc will fetch the content using HTTP:
      </para>
      <programlisting>
pandoc -f html -t markdown https://www.fsf.org
</programlisting>
      <para>
        It is possible to supply a custom User-Agent string or other
        header when requesting a document from a URL:
      </para>
      <programlisting>
pandoc -f html -t markdown --request-header User-Agent:&quot;Mozilla/5.0&quot; \
  https://www.fsf.org
</programlisting>
    </section>
  </section>
  <section xml:id="options">
    <title>Options</title>
    <section xml:id="general-options">
      <title>General options</title>
      <variablelist>
        <varlistentry>
          <term>
            <literal>-f</literal> <emphasis>FORMAT</emphasis>,
            <literal>-r</literal> <emphasis>FORMAT</emphasis>,
            <literal>--from=</literal><emphasis>FORMAT</emphasis>,
            <literal>--read=</literal><emphasis>FORMAT</emphasis>
          </term>
          <listitem>
            <para>
              Specify input format. <emphasis>FORMAT</emphasis> can be:
            </para>
            <anchor xml:id="input-formats" />
            <itemizedlist spacing="compact">
              <listitem>
                <para>
                  <literal>bibtex</literal>
                  (<link xlink:href="https://ctan.org/pkg/bibtex">BibTeX</link>
                  bibliography)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>biblatex</literal>
                  (<link xlink:href="https://ctan.org/pkg/biblatex">BibLaTeX</link>
                  bibliography)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>bits</literal>
                  (<link xlink:href="https://jats.nlm.nih.gov/extensions/bits/">BITS</link>
                  XML, alias for <literal>jats</literal>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>commonmark</literal>
                  (<link xlink:href="https://commonmark.org">CommonMark</link>
                  Markdown)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>commonmark_x</literal>
                  (<link xlink:href="https://commonmark.org">CommonMark</link>
                  Markdown with extensions)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>creole</literal>
                  (<link xlink:href="http://www.wikicreole.org/wiki/Creole1.0">Creole
                  1.0</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>csljson</literal>
                  (<link xlink:href="https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html">CSL
                  JSON</link> bibliography)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>csv</literal>
                  (<link xlink:href="https://tools.ietf.org/html/rfc4180">CSV</link>
                  table)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>tsv</literal>
                  (<link xlink:href="https://www.iana.org/assignments/media-types/text/tab-separated-values">TSV</link>
                  table)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>djot</literal>
                  (<link xlink:href="https://djot.net">Djot
                  markup</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>docbook</literal>
                  (<link xlink:href="https://docbook.org">DocBook</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>docx</literal>
                  (<link xlink:href="https://en.wikipedia.org/wiki/Office_Open_XML">Word
                  docx</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>dokuwiki</literal>
                  (<link xlink:href="https://www.dokuwiki.org/dokuwiki">DokuWiki
                  markup</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>endnotexml</literal>
                  (<link xlink:href="https://support.clarivate.com/Endnote/s/article/EndNote-XML-Document-Type-Definition">EndNote
                  XML bibliography</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>epub</literal>
                  (<link xlink:href="http://idpf.org/epub">EPUB</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>fb2</literal>
                  (<link xlink:href="http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1">FictionBook2</link>
                  e-book)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>gfm</literal>
                  (<link xlink:href="https://help.github.com/articles/github-flavored-markdown/">GitHub-Flavored
                  Markdown</link>), or the deprecated and less accurate
                  <literal>markdown_github</literal>; use
                  <link linkend="markdown-variants"><literal>markdown_github</literal></link>
                  only if you need extensions not supported in
                  <link linkend="markdown-variants"><literal>gfm</literal></link>.
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>haddock</literal>
                  (<link xlink:href="https://www.haskell.org/haddock/doc/html/ch03s08.html">Haddock
                  markup</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>html</literal>
                  (<link xlink:href="https://www.w3.org/html/">HTML</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>ipynb</literal>
                  (<link xlink:href="https://nbformat.readthedocs.io/en/latest/">Jupyter
                  notebook</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>jats</literal>
                  (<link xlink:href="https://jats.nlm.nih.gov">JATS</link>
                  XML)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>jira</literal>
                  (<link xlink:href="https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all">Jira</link>/Confluence
                  wiki markup)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>json</literal> (JSON version of native AST)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>latex</literal>
                  (<link xlink:href="https://www.latex-project.org/">LaTeX</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>markdown</literal>
                  (<link linkend="pandocs-markdown">Pandoc’s
                  Markdown</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>markdown_mmd</literal>
                  (<link xlink:href="https://fletcherpenney.net/multimarkdown/">MultiMarkdown</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>markdown_phpextra</literal>
                  (<link xlink:href="https://michelf.ca/projects/php-markdown/extra/">PHP
                  Markdown Extra</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>markdown_strict</literal> (original
                  unextended
                  <link xlink:href="https://daringfireball.net/projects/markdown/">Markdown</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>mediawiki</literal>
                  (<link xlink:href="https://www.mediawiki.org/wiki/Help:Formatting">MediaWiki
                  markup</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>man</literal>
                  (<link xlink:href="https://man.cx/groff_man(7)">roff
                  man</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>mdoc</literal>
                  (<link xlink:href="https://mandoc.bsd.lv/man/mdoc.7.html">mdoc</link>
                  manual page markup)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>muse</literal>
                  (<link xlink:href="https://amusewiki.org/library/manual">Muse</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>native</literal> (native Haskell)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>odt</literal>
                  (<link xlink:href="https://en.wikipedia.org/wiki/OpenDocument">OpenDocument
                  text document</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>opml</literal>
                  (<link xlink:href="http://dev.opml.org/spec2.html">OPML</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>org</literal>
                  (<link xlink:href="https://orgmode.org">Emacs Org
                  mode</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>pod</literal> (Perl’s
                  <link xlink:href="https://perldoc.perl.org/perlpod">Plain
                  Old Documentation</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>ris</literal>
                  (<link xlink:href="https://en.wikipedia.org/wiki/RIS_(file_format)">RIS</link>
                  bibliography)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>rtf</literal>
                  (<link xlink:href="https://en.wikipedia.org/wiki/Rich_Text_Format">Rich
                  Text Format</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>rst</literal>
                  (<link xlink:href="https://docutils.sourceforge.io/docs/ref/rst/introduction.html">reStructuredText</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>t2t</literal>
                  (<link xlink:href="https://txt2tags.org">txt2tags</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>textile</literal>
                  (<link xlink:href="https://textile-lang.com">Textile</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>tikiwiki</literal>
                  (<link xlink:href="https://doc.tiki.org/Wiki-Syntax-Text#The_Markup_Language_Wiki-Syntax">TikiWiki
                  markup</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>twiki</literal>
                  (<link xlink:href="https://twiki.org/cgi-bin/view/TWiki/TextFormattingRules">TWiki
                  markup</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>typst</literal>
                  (<link xlink:href="https://typst.app">typst</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>vimwiki</literal>
                  (<link xlink:href="https://vimwiki.github.io">Vimwiki</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>xml</literal> (XML version of native AST)
                </para>
              </listitem>
              <listitem>
                <para>
                  the path of a custom Lua reader, see
                  <link linkend="custom-readers-and-writers">Custom
                  readers and writers</link> below
                </para>
              </listitem>
            </itemizedlist>
            <para>
              Extensions can be individually enabled or disabled by
              appending <literal>+EXTENSION</literal> or
              <literal>-EXTENSION</literal> to the format name. See
              <link linkend="extensions">Extensions</link> below, for a
              list of extensions and their names. See
              <literal>--list-input-formats</literal> and
              <literal>--list-extensions</literal>, below.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>-t</literal> <emphasis>FORMAT</emphasis>,
            <literal>-w</literal> <emphasis>FORMAT</emphasis>,
            <literal>--to=</literal><emphasis>FORMAT</emphasis>,
            <literal>--write=</literal><emphasis>FORMAT</emphasis>
          </term>
          <listitem>
            <para>
              Specify output format. <emphasis>FORMAT</emphasis> can be:
            </para>
            <anchor xml:id="output-formats" />
            <itemizedlist spacing="compact">
              <listitem>
                <para>
                  <literal>ansi</literal> (text with
                  <link xlink:href="https://en.wikipedia.org/wiki/ANSI_escape_code">ANSI
                  escape codes</link>, for terminal viewing)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>asciidoc</literal> (modern
                  <link xlink:href="https://asciidoc.org/">AsciiDoc</link>
                  as interpreted by
                  <link xlink:href="https://asciidoctor.org/">AsciiDoctor</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>asciidoc_legacy</literal>
                  (<link xlink:href="https://asciidoc.org/">AsciiDoc</link>
                  as interpreted by
                  <link xlink:href="https://github.com/asciidoc-py/asciidoc-py"><literal>asciidoc-py</literal></link>).
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>asciidoctor</literal> (deprecated synonym for
                  <literal>asciidoc</literal>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>beamer</literal>
                  (<link xlink:href="https://ctan.org/pkg/beamer">LaTeX
                  beamer</link> slide show)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>bibtex</literal>
                  (<link xlink:href="https://ctan.org/pkg/bibtex">BibTeX</link>
                  bibliography)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>biblatex</literal>
                  (<link xlink:href="https://ctan.org/pkg/biblatex">BibLaTeX</link>
                  bibliography)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>chunkedhtml</literal> (zip archive of
                  multiple linked HTML files)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>commonmark</literal>
                  (<link xlink:href="https://commonmark.org">CommonMark</link>
                  Markdown)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>commonmark_x</literal>
                  (<link xlink:href="https://commonmark.org">CommonMark</link>
                  Markdown with extensions)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>context</literal>
                  (<link xlink:href="https://www.contextgarden.net/">ConTeXt</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>csljson</literal>
                  (<link xlink:href="https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html">CSL
                  JSON</link> bibliography)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>djot</literal>
                  (<link xlink:href="https://djot.net">Djot
                  markup</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>docbook</literal> or
                  <literal>docbook4</literal>
                  (<link xlink:href="https://docbook.org">DocBook</link>
                  4)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>docbook5</literal> (DocBook 5)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>docx</literal>
                  (<link xlink:href="https://en.wikipedia.org/wiki/Office_Open_XML">Word
                  docx</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>dokuwiki</literal>
                  (<link xlink:href="https://www.dokuwiki.org/dokuwiki">DokuWiki
                  markup</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>epub</literal> or <literal>epub3</literal>
                  (<link xlink:href="http://idpf.org/epub">EPUB</link>
                  v3 book)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>epub2</literal> (EPUB v2)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>fb2</literal>
                  (<link xlink:href="http://www.fictionbook.org/index.php/Eng:XML_Schema_Fictionbook_2.1">FictionBook2</link>
                  e-book)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>gfm</literal>
                  (<link xlink:href="https://help.github.com/articles/github-flavored-markdown/">GitHub-Flavored
                  Markdown</link>), or the deprecated and less accurate
                  <literal>markdown_github</literal>; use
                  <link linkend="markdown-variants"><literal>markdown_github</literal></link>
                  only if you need extensions not supported in
                  <link linkend="markdown-variants"><literal>gfm</literal></link>.
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>haddock</literal>
                  (<link xlink:href="https://www.haskell.org/haddock/doc/html/ch03s08.html">Haddock
                  markup</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>html</literal> or <literal>html5</literal>
                  (<link xlink:href="https://www.w3.org/html/">HTML</link>,
                  i.e. <link xlink:href="https://html.spec.whatwg.org/">HTML5</link>/XHTML
                  <link xlink:href="https://www.w3.org/TR/html-polyglot/">polyglot
                  markup</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>html4</literal>
                  (<link xlink:href="https://www.w3.org/TR/xhtml1/">XHTML</link>
                  1.0 Transitional)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>icml</literal>
                  (<link xlink:href="https://manualzz.com/doc/9627253/adobe-indesign-cs6-idml-cookbook">InDesign
                  ICML</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>ipynb</literal>
                  (<link xlink:href="https://nbformat.readthedocs.io/en/latest/">Jupyter
                  notebook</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>jats_archiving</literal>
                  (<link xlink:href="https://jats.nlm.nih.gov">JATS</link>
                  XML, Archiving and Interchange Tag Set)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>jats_articleauthoring</literal>
                  (<link xlink:href="https://jats.nlm.nih.gov">JATS</link>
                  XML, Article Authoring Tag Set)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>jats_publishing</literal>
                  (<link xlink:href="https://jats.nlm.nih.gov">JATS</link>
                  XML, Journal Publishing Tag Set)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>jats</literal> (alias for
                  <literal>jats_archiving</literal>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>jira</literal>
                  (<link xlink:href="https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all">Jira</link>/Confluence
                  wiki markup)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>json</literal> (JSON version of native AST)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>latex</literal>
                  (<link xlink:href="https://www.latex-project.org/">LaTeX</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>man</literal>
                  (<link xlink:href="https://man.cx/groff_man(7)">roff
                  man</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>markdown</literal>
                  (<link linkend="pandocs-markdown">Pandoc’s
                  Markdown</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>markdown_mmd</literal>
                  (<link xlink:href="https://fletcherpenney.net/multimarkdown/">MultiMarkdown</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>markdown_phpextra</literal>
                  (<link xlink:href="https://michelf.ca/projects/php-markdown/extra/">PHP
                  Markdown Extra</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>markdown_strict</literal> (original
                  unextended
                  <link xlink:href="https://daringfireball.net/projects/markdown/">Markdown</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>markua</literal>
                  (<link xlink:href="https://leanpub.com/markua/read">Markua</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>mediawiki</literal>
                  (<link xlink:href="https://www.mediawiki.org/wiki/Help:Formatting">MediaWiki
                  markup</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>ms</literal>
                  (<link xlink:href="https://man.cx/groff_ms(7)">roff
                  ms</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>muse</literal>
                  (<link xlink:href="https://amusewiki.org/library/manual">Muse</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>native</literal> (native Haskell)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>odt</literal>
                  (<link xlink:href="https://en.wikipedia.org/wiki/OpenDocument">OpenDocument
                  text document</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>opml</literal>
                  (<link xlink:href="http://dev.opml.org/spec2.html">OPML</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>opendocument</literal>
                  (<link xlink:href="https://www.oasis-open.org/2021/06/16/opendocument-v1-3-oasis-standard-published/">OpenDocument
                  XML</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>org</literal>
                  (<link xlink:href="https://orgmode.org">Emacs Org
                  mode</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>pdf</literal>
                  (<link xlink:href="https://www.adobe.com/pdf/">PDF</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>plain</literal> (plain text)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>pptx</literal>
                  (<link xlink:href="https://en.wikipedia.org/wiki/Microsoft_PowerPoint">PowerPoint</link>
                  slide show)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>rst</literal>
                  (<link xlink:href="https://docutils.sourceforge.io/docs/ref/rst/introduction.html">reStructuredText</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>rtf</literal>
                  (<link xlink:href="https://en.wikipedia.org/wiki/Rich_Text_Format">Rich
                  Text Format</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>texinfo</literal>
                  (<link xlink:href="https://www.gnu.org/software/texinfo/">GNU
                  Texinfo</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>textile</literal>
                  (<link xlink:href="https://textile-lang.com">Textile</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>slideous</literal>
                  (<link xlink:href="https://goessner.net/articles/slideous/">Slideous</link>
                  HTML and JavaScript slide show)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>slidy</literal>
                  (<link xlink:href="https://www.w3.org/Talks/Tools/Slidy2/">Slidy</link>
                  HTML and JavaScript slide show)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>dzslides</literal>
                  (<link xlink:href="https://paulrouget.com/dzslides/">DZSlides</link>
                  HTML5 + JavaScript slide show)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>revealjs</literal>
                  (<link xlink:href="https://revealjs.com/">reveal.js</link>
                  HTML5 + JavaScript slide show)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>s5</literal>
                  (<link xlink:href="https://meyerweb.com/eric/tools/s5/">S5</link>
                  HTML and JavaScript slide show)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>tei</literal>
                  (<link xlink:href="https://github.com/TEIC/TEI-Simple">TEI
                  Simple</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>typst</literal>
                  (<link xlink:href="https://typst.app">typst</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>vimdoc</literal>
                  (<link xlink:href="https://vimhelp.org/helphelp.txt.html#help-writing">Vimdoc</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>xml</literal> (XML version of native AST)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>xwiki</literal>
                  (<link xlink:href="https://www.xwiki.org/xwiki/bin/view/Documentation/UserGuide/Features/XWikiSyntax/">XWiki
                  markup</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>zimwiki</literal>
                  (<link xlink:href="https://zim-wiki.org/manual/Help/Wiki_Syntax.html">ZimWiki
                  markup</link>)
                </para>
              </listitem>
              <listitem>
                <para>
                  the path of a custom Lua writer, see
                  <link linkend="custom-readers-and-writers">Custom
                  readers and writers</link> below
                </para>
              </listitem>
            </itemizedlist>
            <para>
              Note that <literal>odt</literal>, <literal>docx</literal>,
              <literal>epub</literal>, and <literal>pdf</literal> output
              will not be directed to <emphasis>stdout</emphasis> unless
              forced with <literal>-o -</literal>.
            </para>
            <para>
              Extensions can be individually enabled or disabled by
              appending <literal>+EXTENSION</literal> or
              <literal>-EXTENSION</literal> to the format name. See
              <link linkend="extensions">Extensions</link> below, for a
              list of extensions and their names. See
              <literal>--list-output-formats</literal> and
              <literal>--list-extensions</literal>, below.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>-o</literal> <emphasis>FILE</emphasis>,
            <literal>--output=</literal><emphasis>FILE</emphasis>
          </term>
          <listitem>
            <para>
              Write output to <emphasis>FILE</emphasis> instead of
              <emphasis>stdout</emphasis>. If <emphasis>FILE</emphasis>
              is <literal>-</literal>, output will go to
              <emphasis>stdout</emphasis>, even if a non-textual format
              (<literal>docx</literal>, <literal>odt</literal>,
              <literal>epub2</literal>, <literal>epub3</literal>) is
              specified. If the output format is
              <literal>chunkedhtml</literal> and
              <emphasis>FILE</emphasis> has no extension, then instead
              of producing a <literal>.zip</literal> file pandoc will
              create a directory <emphasis>FILE</emphasis> and unpack
              the zip archive there (unless <emphasis>FILE</emphasis>
              already exists, in which case an error will be raised).
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--data-dir=</literal><emphasis>DIRECTORY</emphasis>
          </term>
          <listitem>
            <para>
              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 <literal>pandoc</literal> subdirectory of
              the XDG data directory (by default,
              <literal>$HOME/.local/share</literal>, overridable by
              setting the <literal>XDG_DATA_HOME</literal> environment
              variable). If that directory does not exist and
              <literal>$HOME/.pandoc</literal> exists, it will be used
              (for backwards compatibility). On Windows the default user
              data directory is <literal>%APPDATA%\pandoc</literal>. You
              can find the default user data directory on your system by
              looking at the output of
              <literal>pandoc --version</literal>. Data files placed in
              this directory (for example,
              <literal>reference.odt</literal>,
              <literal>reference.docx</literal>,
              <literal>epub.css</literal>, <literal>templates</literal>)
              will override pandoc’s normal defaults. (Note that the
              user data directory is not created by pandoc, so you will
              need to create it yourself if you want to make use of it.)
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>-d</literal> <emphasis>FILE</emphasis>,
            <literal>--defaults=</literal><emphasis>FILE</emphasis>
          </term>
          <listitem>
            <para>
              Specify a set of default option settings.
              <emphasis>FILE</emphasis> 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 <literal>defaults</literal> subdirectory of the user
              data directory (see <literal>--data-dir</literal>). The
              <literal>.yaml</literal> extension may be omitted. See the
              section <link linkend="defaults-files">Defaults
              files</link> for more information on the file format.
              Settings from the defaults file may be overridden or
              extended by subsequent options on the command line.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--bash-completion</literal>
          </term>
          <listitem>
            <para>
              Generate a bash completion script. To enable bash
              completion with pandoc, add this to your
              <literal>.bashrc</literal>:
            </para>
            <programlisting>
eval &quot;$(pandoc --bash-completion)&quot;
</programlisting>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--verbose</literal>
          </term>
          <listitem>
            <para>
              Give verbose debugging output.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--quiet</literal>
          </term>
          <listitem>
            <para>
              Suppress warning messages.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--fail-if-warnings[=true|false]</literal>
          </term>
          <listitem>
            <para>
              Exit with error status if there are any warnings.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--log=</literal><emphasis>FILE</emphasis>
          </term>
          <listitem>
            <para>
              Write log messages in machine-readable JSON format to
              <emphasis>FILE</emphasis>. All messages above DEBUG level
              will be written, regardless of verbosity settings
              (<literal>--verbose</literal>,
              <literal>--quiet</literal>).
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--list-input-formats</literal>
          </term>
          <listitem>
            <para>
              List supported input formats, one per line.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--list-output-formats</literal>
          </term>
          <listitem>
            <para>
              List supported output formats, one per line.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--list-extensions</literal>[<literal>=</literal><emphasis>FORMAT</emphasis>]
          </term>
          <listitem>
            <para>
              List supported extensions for <emphasis>FORMAT</emphasis>,
              one per line, preceded by a <literal>+</literal> or
              <literal>-</literal> indicating whether it is enabled by
              default in <emphasis>FORMAT</emphasis>. If
              <emphasis>FORMAT</emphasis> is not specified, defaults for
              pandoc’s Markdown are given.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--list-highlight-languages</literal>
          </term>
          <listitem>
            <para>
              List supported languages for syntax highlighting, one per
              line.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--list-highlight-styles</literal>
          </term>
          <listitem>
            <para>
              List supported styles for syntax highlighting, one per
              line. See <literal>--syntax-highlighting</literal>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>-v</literal>, <literal>--version</literal>
          </term>
          <listitem>
            <para>
              Print version.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>-h</literal>, <literal>--help</literal>
          </term>
          <listitem>
            <para>
              Show usage message.
            </para>
          </listitem>
        </varlistentry>
      </variablelist>
    </section>
    <section xml:id="reader-options">
      <title>Reader options</title>
      <variablelist>
        <varlistentry>
          <term>
            <literal>--shift-heading-level-by=</literal><emphasis>NUMBER</emphasis>
          </term>
          <listitem>
            <para>
              Shift heading levels by a positive or negative integer.
              For example, with
              <literal>--shift-heading-level-by=-1</literal>, 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.
              <literal>--shift-heading-level-by=-1</literal> 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.
              <literal>--shift-heading-level-by=1</literal> 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.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--base-header-level=</literal><emphasis>NUMBER</emphasis>
          </term>
          <listitem>
            <para>
              <emphasis>Deprecated. Use
              <literal>--shift-heading-level-by</literal>=X instead,
              where X = NUMBER - 1.</emphasis> Specify the base level
              for headings (defaults to 1).
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--indented-code-classes=</literal><emphasis>CLASSES</emphasis>
          </term>
          <listitem>
            <para>
              Specify classes to use for indented code blocks—for
              example, <literal>perl,numberLines</literal> or
              <literal>haskell</literal>. Multiple classes may be
              separated by spaces or commas.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--default-image-extension=</literal><emphasis>EXTENSION</emphasis>
          </term>
          <listitem>
            <para>
              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.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--file-scope[=true|false]</literal>
          </term>
          <listitem>
            <para>
              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 <literal>--file-scope</literal>.
            </para>
            <para>
              If two or more files are processed using
              <literal>--file-scope</literal>, prefixes based on the
              filenames will be added to identifiers in order to
              disambiguate them, and internal links will be adjusted
              accordingly. For example, a header with identifier
              <literal>foo</literal> in
              <literal>subdir/file1.txt</literal> will have its
              identifier changed to
              <literal>subdir__file1.txt__foo</literal>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>-F</literal> <emphasis>PROGRAM</emphasis>,
            <literal>--filter=</literal><emphasis>PROGRAM</emphasis>
          </term>
          <listitem>
            <para>
              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’s own JSON input and output. The name of the
              output format will be passed to the filter as the first
              argument. Hence,
            </para>
            <programlisting>
pandoc --filter ./caps.py -t latex
</programlisting>
            <para>
              is equivalent to
            </para>
            <programlisting>
pandoc -t json | ./caps.py latex | pandoc -f json -t latex
</programlisting>
            <para>
              The latter form may be useful for debugging filters.
            </para>
            <para>
              Filters may be written in any language.
              <literal>Text.Pandoc.JSON</literal> exports
              <literal>toJSONFilter</literal> to facilitate writing
              filters in Haskell. Those who would prefer to write
              filters in python can use the module
              <link xlink:href="https://github.com/jgm/pandocfilters"><literal>pandocfilters</literal></link>,
              installable from PyPI. There are also pandoc filter
              libraries in
              <link xlink:href="https://github.com/vinai/pandocfilters-php">PHP</link>,
              <link xlink:href="https://metacpan.org/pod/Pandoc::Filter">perl</link>,
              and
              <link xlink:href="https://github.com/mvhenderson/pandoc-filter-node">JavaScript/node.js</link>.
            </para>
            <para>
              In order of preference, pandoc will look for filters in
            </para>
            <orderedlist numeration="arabic">
              <listitem>
                <para>
                  a specified full or relative path (executable or
                  non-executable),
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>$DATADIR/filters</literal> (executable or
                  non-executable) where <literal>$DATADIR</literal> is
                  the user data directory (see
                  <literal>--data-dir</literal>, above),
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>$PATH</literal> (executable only).
                </para>
              </listitem>
            </orderedlist>
            <para>
              Filters, Lua-filters, and citeproc processing are applied
              in the order specified on the command line.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>-L</literal> <emphasis>SCRIPT</emphasis>,
            <literal>--lua-filter=</literal><emphasis>SCRIPT</emphasis>
          </term>
          <listitem>
            <para>
              Transform the document in a similar fashion as JSON
              filters (see <literal>--filter</literal>), but use
              pandoc’s built-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.
            </para>
            <para>
              The <literal>pandoc</literal> Lua module provides helper
              functions for element creation. It is always loaded into
              the script’s Lua environment.
            </para>
            <para>
              See the
              <link xlink:href="https://pandoc.org/lua-filters.html">Lua
              filters documentation</link> for further details.
            </para>
            <para>
              In order of preference, pandoc will look for Lua filters
              in
            </para>
            <orderedlist numeration="arabic">
              <listitem>
                <para>
                  a specified full or relative path,
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>$DATADIR/filters</literal> where
                  <literal>$DATADIR</literal> is the user data directory
                  (see <literal>--data-dir</literal>, above).
                </para>
              </listitem>
            </orderedlist>
            <para>
              Filters, Lua filters, and citeproc processing are applied
              in the order specified on the command line.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>-M</literal>
            <emphasis>KEY</emphasis>[<literal>=</literal><emphasis>VAL</emphasis>],
            <literal>--metadata=</literal><emphasis>KEY</emphasis>[<literal>:</literal><emphasis>VAL</emphasis>]
          </term>
          <listitem>
            <para>
              Set the metadata field <emphasis>KEY</emphasis> to the
              value <emphasis>VAL</emphasis>. A value specified on the
              command line overrides a value specified in the document
              using <link linkend="extension-yaml_metadata_block">YAML
              metadata blocks</link>. Values will be parsed as YAML
              boolean or string values. If no value is specified, the
              value will be treated as Boolean true. Like
              <literal>--variable</literal>,
              <literal>--metadata</literal> causes template variables to
              be set. But unlike <literal>--variable</literal>,
              <literal>--metadata</literal> 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.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--metadata-file=</literal><emphasis>FILE</emphasis>
          </term>
          <listitem>
            <para>
              Read metadata from the supplied YAML (or JSON) file. This
              option can be used with every input format, but string
              scalars in the metadata file will always be parsed as
              Markdown. (If the input format is Markdown or a Markdown
              variant, then the same variant will be used to parse the
              metadata file; if it is a non-Markdown format, pandoc’s
              default Markdown extensions will be used.) 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
              <literal>-M</literal>, overwrite values specified with
              this option. The file will be searched for first in the
              working directory, and then in the
              <literal>metadata</literal> subdirectory of the user data
              directory (see <literal>--data-dir</literal>).
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>-p</literal>,
            <literal>--preserve-tabs[=true|false]</literal>
          </term>
          <listitem>
            <para>
              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.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--tab-stop=</literal><emphasis>NUMBER</emphasis>
          </term>
          <listitem>
            <para>
              Specify the number of spaces per tab (default is 4).
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--track-changes=accept</literal>|<literal>reject</literal>|<literal>all</literal>
          </term>
          <listitem>
            <para>
              Specifies what to do with insertions, deletions, and
              comments produced by the MS Word <quote>Track
              Changes</quote> feature. <literal>accept</literal> (the
              default) processes all the insertions and deletions.
              <literal>reject</literal> ignores them. Both
              <literal>accept</literal> and <literal>reject</literal>
              ignore comments. <literal>all</literal> includes all
              insertions, deletions, and comments, wrapped in spans with
              <literal>insertion</literal>, <literal>deletion</literal>,
              <literal>comment-start</literal>, and
              <literal>comment-end</literal> classes, respectively. The
              author and time of change is included.
              <literal>all</literal> is useful for scripting: only
              accepting changes from a certain reviewer, say, or before
              a certain date. If a paragraph is inserted or deleted,
              <literal>track-changes=all</literal> produces a span with
              the class
              <literal>paragraph-insertion</literal>/<literal>paragraph-deletion</literal>
              before the affected paragraph break. This option only
              affects the docx reader.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--extract-media=</literal><emphasis>DIR</emphasis>
          </term>
          <listitem>
            <para>
              Extract images and other media contained in or linked from
              the source document to the path <emphasis>DIR</emphasis>,
              creating it if necessary, and adjust the images references
              in the document so they point to the extracted files.
              Media are downloaded, read from the file system, or
              extracted from a binary container (e.g. docx), as needed.
              The original file paths are used if they are relative
              paths not containing <literal>..</literal>. Otherwise
              filenames are constructed from the SHA1 hash of the
              contents.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--abbreviations=</literal><emphasis>FILE</emphasis>
          </term>
          <listitem>
            <para>
              Specifies a custom abbreviations file, with abbreviations
              one to a line. If this option is not specified, pandoc
              will read the data file <literal>abbreviations</literal>
              from the user data directory or fall back on a system
              default. To see the system default, use
              <literal>pandoc --print-default-data-file=abbreviations</literal>.
              The only use pandoc makes of this list is in the Markdown
              reader. Strings found in this list will be followed by a
              nonbreaking space, and the period will not produce
              sentence-ending space in formats like LaTeX. The strings
              may not contain spaces.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--trace[=true|false]</literal>
          </term>
          <listitem>
            <para>
              Print diagnostic output tracing parser progress to stderr.
              This option is intended for use by developers in
              diagnosing performance issues.
            </para>
          </listitem>
        </varlistentry>
      </variablelist>
    </section>
    <section xml:id="general-writer-options">
      <title>General writer options</title>
      <variablelist>
        <varlistentry>
          <term>
            <literal>-s</literal>, <literal>--standalone</literal>
          </term>
          <listitem>
            <para>
              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
              <literal>pdf</literal>, <literal>epub</literal>,
              <literal>epub3</literal>, <literal>fb2</literal>,
              <literal>docx</literal>, and <literal>odt</literal>
              output. For <literal>native</literal> output, this option
              causes metadata to be included; otherwise, metadata is
              suppressed.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--template=</literal><emphasis>FILE</emphasis>|<emphasis>URL</emphasis>
          </term>
          <listitem>
            <para>
              Use the specified file as a custom template for the
              generated document. Implies
              <literal>--standalone</literal>. See
              <link linkend="templates">Templates</link>, below, for a
              description of template syntax. If the template is not
              found, pandoc will search for it in the
              <literal>templates</literal> subdirectory of the user data
              directory (see <literal>--data-dir</literal>). If no
              extension is specified and an extensionless template is
              not found, pandoc will look for a template with an
              extension corresponding to the writer, so that
              <literal>--template=special</literal> looks for
              <literal>special.html</literal> for HTML output. If this
              option is not used, a default template appropriate for the
              output format will be used (see
              <literal>-D/--print-default-template</literal>).
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>-V</literal>
            <emphasis>KEY</emphasis>[<literal>=</literal><emphasis>VAL</emphasis>],
            <literal>--variable=</literal><emphasis>KEY</emphasis>[<literal>=</literal><emphasis>VAL</emphasis>]
          </term>
          <listitem>
            <para>
              Set the template variable <emphasis>KEY</emphasis> to the
              string value <emphasis>VAL</emphasis> when rendering the
              document in standalone mode. Either <literal>:</literal>
              or <literal>=</literal> may be used to separate
              <emphasis>KEY</emphasis> from <emphasis>VAL</emphasis>. If
              no <emphasis>VAL</emphasis> is specified, the key will be
              given the value <literal>true</literal>. Structured values
              (lists, maps) cannot be assigned using this option, but
              they can be assigned in the <literal>variables</literal>
              section of a <link linkend="defaults-files">defaults
              file</link> or using the
              <literal>--variable-json</literal> option. If the variable
              already has a <emphasis>list</emphasis> value, the value
              will be added to the list. If it already has another kind
              of value, it will be made into a list containing the
              previous and the new value. For example,
              <literal>-V keyword=Joe -V author=Sue</literal> makes
              <literal>author</literal> contain a list of strings:
              <literal>Joe</literal> and <literal>Sue</literal>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--variable-json=</literal><emphasis>KEY</emphasis>[<literal>=</literal>:<emphasis>JSON</emphasis>]
          </term>
          <listitem>
            <para>
              Set the template variable <emphasis>KEY</emphasis> to the
              value specified by a JSON string (this may be a boolean, a
              string, a list, or a mapping; a number will be treated as
              a string). For example,
              <literal>--variable-json foo=false</literal> will give
              <literal>foo</literal> the boolean false value, while
              <literal>--variable-json foo='&quot;false&quot;'</literal>
              will give it the string value
              <literal>&quot;false&quot;</literal>. Either
              <literal>:</literal> or <literal>=</literal> may be used
              to separate <emphasis>KEY</emphasis> from
              <emphasis>VAL</emphasis>. If the variable already has a
              value, this value will be replaced.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--sandbox[=true|false]</literal>
          </term>
          <listitem>
            <para>
              Run pandoc in a sandbox, limiting IO operations in readers
              and writers to reading the files specified on the command
              line. Note that this option does not limit IO operations
              by filters or in the production of PDF documents. But it
              does offer security against, for example, disclosure of
              files through the use of <literal>include</literal>
              directives. Anyone using pandoc on untrusted user input
              should use this option.
            </para>
            <para>
              Note: some readers and writers (e.g.,
              <literal>docx</literal>) need access to data files. If
              these are stored on the file system, then pandoc will not
              be able to find them when run in
              <literal>--sandbox</literal> mode and will raise an error.
              For these applications, we recommend using a pandoc binary
              compiled with the <literal>embed_data_files</literal>
              option, which causes the data files to be baked into the
              binary instead of being stored on the file system.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>-D</literal> <emphasis>FORMAT</emphasis>,
            <literal>--print-default-template=</literal><emphasis>FORMAT</emphasis>
          </term>
          <listitem>
            <para>
              Print the system default template for an output
              <emphasis>FORMAT</emphasis>. (See <literal>-t</literal>
              for a list of possible <emphasis>FORMAT</emphasis>s.)
              Templates in the user data directory are ignored. This
              option may be used with
              <literal>-o</literal>/<literal>--output</literal> to
              redirect output to a file, but
              <literal>-o</literal>/<literal>--output</literal> must
              come before <literal>--print-default-template</literal> on
              the command line.
            </para>
            <para>
              Note that some of the default templates use partials, for
              example <literal>styles.html</literal>. To print the
              partials, use
              <literal>--print-default-data-file</literal>: for example,
              <literal>--print-default-data-file=templates/styles.html</literal>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--print-default-data-file=</literal><emphasis>FILE</emphasis>
          </term>
          <listitem>
            <para>
              Print a system default data file. Files in the user data
              directory are ignored. This option may be used with
              <literal>-o</literal>/<literal>--output</literal> to
              redirect output to a file, but
              <literal>-o</literal>/<literal>--output</literal> must
              come before <literal>--print-default-data-file</literal>
              on the command line.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--eol=crlf</literal>|<literal>lf</literal>|<literal>native</literal>
          </term>
          <listitem>
            <para>
              Manually specify line endings: <literal>crlf</literal>
              (Windows), <literal>lf</literal> (macOS/Linux/UNIX), or
              <literal>native</literal> (line endings appropriate to the
              OS on which pandoc is being run). The default is
              <literal>native</literal>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--dpi</literal>=<emphasis>NUMBER</emphasis>
          </term>
          <listitem>
            <para>
              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.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--wrap=auto</literal>|<literal>none</literal>|<literal>preserve</literal>
          </term>
          <listitem>
            <para>
              Determine how text is wrapped in the output (the source
              code, not the rendered version). With
              <literal>auto</literal> (the default), pandoc will attempt
              to wrap lines to the column width specified by
              <literal>--columns</literal> (default 72). With
              <literal>none</literal>, pandoc will not wrap lines at
              all. With <literal>preserve</literal>, 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).
              In <literal>ipynb</literal> output, this option affects
              wrapping of the contents of Markdown cells.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--columns=</literal><emphasis>NUMBER</emphasis>
          </term>
          <listitem>
            <para>
              Specify length of lines in characters. This affects text
              wrapping in the generated source code (see
              <literal>--wrap</literal>). It also affects calculation of
              column widths for plain text tables (see
              <link linkend="tables">Tables</link> below).
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--toc[=true|false]</literal>,
            <literal>--table-of-contents[=true|false]</literal>
          </term>
          <listitem>
            <para>
              Include an automatically generated table of contents (or,
              in the case of <literal>latex</literal>,
              <literal>context</literal>, <literal>docx</literal>,
              <literal>odt</literal>, <literal>opendocument</literal>,
              <literal>rst</literal>, or <literal>ms</literal>, an
              instruction to create one) in the output document. This
              option has no effect unless
              <literal>-s/--standalone</literal> is used, and it has no
              effect on <literal>man</literal>,
              <literal>docbook4</literal>, <literal>docbook5</literal>,
              or <literal>jats</literal> output.
            </para>
            <para>
              Note that if you are producing a PDF via
              <literal>ms</literal> and using (the default)
              <literal>pdfroff</literal> as a
              <literal>--pdf-engine</literal>, 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
              <literal>--pdf-engine-opt=--no-toc-relocation</literal>.
              If <literal>groff</literal> is used as the
              <literal>--pdf-engine</literal>, the table of contents
              will always appear at the end of the document.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--toc-depth=</literal><emphasis>NUMBER</emphasis>
          </term>
          <listitem>
            <para>
              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).
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--lof[=true|false]</literal>,
            <literal>--list-of-figures[=true|false]</literal>
          </term>
          <listitem>
            <para>
              Include an automatically generated list of figures (or, in
              some formats, an instruction to create one) in the output
              document. This option has no effect unless
              <literal>-s/--standalone</literal> is used, and it only
              has an effect on <literal>latex</literal>,
              <literal>context</literal>, and <literal>docx</literal>
              output.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--lot[=true|false]</literal>,
            <literal>--list-of-tables[=true|false]</literal>
          </term>
          <listitem>
            <para>
              Include an automatically generated list of tables (or, in
              some formats, an instruction to create one) in the output
              document. This option has no effect unless
              <literal>-s/--standalone</literal> is used, and it only
              has an effect on <literal>latex</literal>,
              <literal>context</literal>, and <literal>docx</literal>
              output.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--strip-comments[=true|false]</literal>
          </term>
          <listitem>
            <para>
              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
              <literal>markdown_in_html_blocks</literal> extension is
              not set.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--syntax-highlighting=&quot;default&quot;|&quot;none&quot;|&quot;idiomatic&quot;|</literal><emphasis>STYLE</emphasis><literal>|</literal><emphasis>FILE</emphasis>
          </term>
          <listitem>
            <para>
              The method to use for code syntax highlighting. Setting a
              specific <emphasis>STYLE</emphasis> causes highlighting to
              be performed with the internal highlighting engine, using
              KDE syntax definitions and styles. The
              <literal>&quot;idiomatic&quot;</literal> method uses a
              format-specific highlighter if one is available, or the
              default style if the target format has no idiomatic
              highlighting method. Setting this option to
              <literal>none</literal> disables all syntax highlighting.
              The <literal>&quot;default&quot;</literal> method uses a
              format-specific default.
            </para>
            <para>
              The default for HTML, EPUB, Docx, Ms, Man, and LaTeX
              output is to use the internal highlighter with the default
              style; Typst output relies on Typst’s own syntax
              highlighting system by default.
            </para>
            <para>
              The
              <link xlink:href="https://ctan.org/pkg/listings"><literal>listings</literal></link>
              LaTeX package is used for idiomatic highlighting in LaTeX.
              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:
              <link xlink:href="https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings#Encoding_issue">Encoding
              issue with the listings package</link>.
            </para>
            <para>
              Style options are <literal>pygments</literal> (the
              default), <literal>kate</literal>,
              <literal>monochrome</literal>,
              <literal>breezeDark</literal>,
              <literal>espresso</literal>, <literal>zenburn</literal>,
              <literal>haddock</literal>, and <literal>tango</literal>.
              For more information on syntax highlighting in pandoc, see
              <link linkend="syntax-highlighting">Syntax
              highlighting</link>, below. See also
              <literal>--list-highlight-styles</literal>.
            </para>
            <para>
              Instead of a <emphasis>STYLE</emphasis> name, a JSON file
              with extension <literal>.theme</literal> may be supplied.
              This will be parsed as a KDE syntax highlighting theme and
              (if valid) used as the highlighting style.
            </para>
            <para>
              To generate the JSON version of an existing style, use
              <literal>--print-highlight-style</literal>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--no-highlight</literal>
          </term>
          <listitem>
            <para>
              <emphasis>Deprecated, use
              <literal>--syntax-highlighting=none</literal>
              instead.</emphasis>
            </para>
            <para>
              Disables syntax highlighting for code blocks and inlines,
              even when a language attribute is given.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--highlight-style=</literal><emphasis>STYLE</emphasis>|<emphasis>FILE</emphasis>
          </term>
          <listitem>
            <para>
              <emphasis>Deprecated, use
              <literal>--syntax-highlighting=</literal><emphasis>STYLE</emphasis>|<emphasis>FILE</emphasis>
              instead.</emphasis>
            </para>
            <para>
              Specifies the coloring style to be used in highlighted
              source code.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--print-highlight-style=</literal><emphasis>STYLE</emphasis>|<emphasis>FILE</emphasis>
          </term>
          <listitem>
            <para>
              Prints a JSON version of a highlighting style, which can
              be modified, saved with a <literal>.theme</literal>
              extension, and used with
              <literal>--syntax-highlighting</literal>. This option may
              be used with
              <literal>-o</literal>/<literal>--output</literal> to
              redirect output to a file, but
              <literal>-o</literal>/<literal>--output</literal> must
              come before <literal>--print-highlight-style</literal> on
              the command line.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--syntax-definition=</literal><emphasis>FILE</emphasis>
          </term>
          <listitem>
            <para>
              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.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>-H</literal> <emphasis>FILE</emphasis>,
            <literal>--include-in-header=</literal><emphasis>FILE</emphasis>|<emphasis>URL</emphasis>
          </term>
          <listitem>
            <para>
              Include contents of <emphasis>FILE</emphasis>, 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 <literal>--standalone</literal>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>-B</literal> <emphasis>FILE</emphasis>,
            <literal>--include-before-body=</literal><emphasis>FILE</emphasis>|<emphasis>URL</emphasis>
          </term>
          <listitem>
            <para>
              Include contents of <emphasis>FILE</emphasis>, verbatim,
              at the beginning of the document body (e.g. after the
              <literal>&lt;body&gt;</literal> tag in HTML, or the
              <literal>\begin{document}</literal> 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 <literal>--standalone</literal>. Note
              that if the output format is <literal>odt</literal>, this
              file must be in OpenDocument XML format suitable for
              insertion into the body of the document, and if the output
              is <literal>docx</literal>, this file must be in
              appropriate OpenXML format.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>-A</literal> <emphasis>FILE</emphasis>,
            <literal>--include-after-body=</literal><emphasis>FILE</emphasis>|<emphasis>URL</emphasis>
          </term>
          <listitem>
            <para>
              Include contents of <emphasis>FILE</emphasis>, verbatim,
              at the end of the document body (before the
              <literal>&lt;/body&gt;</literal> tag in HTML, or the
              <literal>\end{document}</literal> command in LaTeX). This
              option can be used repeatedly to include multiple files.
              They will be included in the order specified. Implies
              <literal>--standalone</literal>. Note that if the output
              format is <literal>odt</literal>, this file must be in
              OpenDocument XML format suitable for insertion into the
              body of the document, and if the output is
              <literal>docx</literal>, this file must be in appropriate
              OpenXML format.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--resource-path=</literal><emphasis>SEARCHPATH</emphasis>
          </term>
          <listitem>
            <para>
              List of paths to search for images and other resources.
              The paths should be separated by <literal>:</literal> on
              Linux, UNIX, and macOS systems, and by
              <literal>;</literal> on Windows. If
              <literal>--resource-path</literal> is not specified, the
              default resource path is the working directory. Note that,
              if <literal>--resource-path</literal> is specified, the
              working directory must be explicitly listed or it will not
              be searched. For example:
              <literal>--resource-path=.:test</literal> will search the
              working directory and the <literal>test</literal>
              subdirectory, in that order. This option can be used
              repeatedly. Search path components that come later on the
              command line will be searched before those that come
              earlier, so
              <literal>--resource-path foo:bar --resource-path baz:bim</literal>
              is equivalent to
              <literal>--resource-path baz:bim:foo:bar</literal>. Note
              that this option only has an effect when pandoc itself
              needs to find an image (e.g., in producing a PDF or docx,
              or when <literal>--embed-resources</literal> is used.) It
              will not cause image paths to be rewritten in other cases
              (e.g., when pandoc is generating LaTeX or HTML).
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--request-header=</literal><emphasis>NAME</emphasis><literal>:</literal><emphasis>VAL</emphasis>
          </term>
          <listitem>
            <para>
              Set the request header <emphasis>NAME</emphasis> to the
              value <emphasis>VAL</emphasis> 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’re behind a proxy, you also need to set the
              environment variable <literal>http_proxy</literal> to
              <literal>http://...</literal>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--no-check-certificate[=true|false]</literal>
          </term>
          <listitem>
            <para>
              Disable the certificate verification to allow access to
              unsecure HTTP resources (for example when the certificate
              is no longer valid or self signed).
            </para>
          </listitem>
        </varlistentry>
      </variablelist>
    </section>
    <section xml:id="options-affecting-specific-writers">
      <title>Options affecting specific writers</title>
      <variablelist>
        <varlistentry>
          <term>
            <literal>--self-contained[=true|false]</literal>
          </term>
          <listitem>
            <para>
              <emphasis>Deprecated synonym for
              <literal>--embed-resources --standalone</literal>.</emphasis>
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--embed-resources[=true|false]</literal>
          </term>
          <listitem>
            <para>
              Produce a standalone HTML file with no external
              dependencies, using <literal>data:</literal> URIs to
              incorporate the contents of linked scripts, stylesheets,
              images, and videos. The resulting file should be
              <quote>self-contained,</quote> 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 <literal>html4</literal>,
              <literal>html5</literal>, <literal>html+lhs</literal>,
              <literal>html5+lhs</literal>, <literal>s5</literal>,
              <literal>slidy</literal>, <literal>slideous</literal>,
              <literal>dzslides</literal>, and
              <literal>revealjs</literal>. 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
              <literal>data-external=&quot;1&quot;</literal> 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, fonts may be missing when
              <literal>--mathjax</literal> is used, and some advanced
              features (e.g. zoom or speaker notes) may not work in an
              offline <quote>self-contained</quote>
              <literal>reveal.js</literal> slide show.
            </para>
            <para>
              For SVG images, <literal>img</literal> tags with
              <literal>data:</literal> URIs are used, unless the image
              has the class <literal>inline-svg</literal>, in which case
              an inline SVG element is inserted. This approach is
              recommended when there are many occurrences of the same
              SVG in a document, as <literal>&lt;use&gt;</literal>
              elements will be used to reduce duplication.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--link-images[=true|false]</literal>
          </term>
          <listitem>
            <para>
              Include links to images instead of embedding the images in
              ODT. (This option currently only affects ODT output.)
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--html-q-tags[=true|false]</literal>
          </term>
          <listitem>
            <para>
              Use <literal>&lt;q&gt;</literal> tags for quotes in HTML.
              (This option only has an effect if the
              <literal>smart</literal> extension is enabled for the
              input format used.)
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--ascii[=true|false]</literal>
          </term>
          <listitem>
            <para>
              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 man and ms (which use
              hexadecimal escapes), and to a limited degree LaTeX (which
              uses standard commands for accented characters when
              possible).
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--reference-links[=true|false]</literal>
          </term>
          <listitem>
            <para>
              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 <literal>--reference-location</literal>
              option.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--reference-location=block</literal>|<literal>section</literal>|<literal>document</literal>
          </term>
          <listitem>
            <para>
              Specify whether footnotes (and references, if
              <literal>reference-links</literal> is set) are placed at
              the end of the current (top-level) block, the current
              section, or the document. The default is
              <literal>document</literal>. Currently this option only
              affects the <literal>markdown</literal>,
              <literal>muse</literal>, <literal>html</literal>,
              <literal>epub</literal>, <literal>slidy</literal>,
              <literal>s5</literal>, <literal>slideous</literal>,
              <literal>dzslides</literal>, and
              <literal>revealjs</literal> writers. In slide formats,
              specifying <literal>--reference-location=section</literal>
              will cause notes to be rendered at the bottom of a slide.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--figure-caption-position=above</literal>|<literal>below</literal>
          </term>
          <listitem>
            <para>
              Specify whether figure captions go above or below figures
              (default is <literal>below</literal>). This option only
              affects HTML, LaTeX, Docx, ODT, and Typst output.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--table-caption-position=above</literal>|<literal>below</literal>
          </term>
          <listitem>
            <para>
              Specify whether table captions go above or below tables
              (default is <literal>above</literal>). This option only
              affects HTML, LaTeX, Docx, ODT, and Typst output.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--markdown-headings=setext</literal>|<literal>atx</literal>
          </term>
          <listitem>
            <para>
              Specify whether to use ATX-style
              (<literal>#</literal>-prefixed) or Setext-style
              (underlined) headings for level 1 and 2 headings in
              Markdown output. (The default is <literal>atx</literal>.)
              ATX-style headings are always used for levels 3+. This
              option also affects Markdown cells in
              <literal>ipynb</literal> output.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--list-tables[=true|false]</literal>
          </term>
          <listitem>
            <para>
              Render tables as list tables in RST output.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--top-level-division=default</literal>|<literal>section</literal>|<literal>chapter</literal>|<literal>part</literal>
          </term>
          <listitem>
            <para>
              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, <literal>section</literal> is chosen. When the
              <literal>documentclass</literal> variable is set to
              <literal>report</literal>, <literal>book</literal>, or
              <literal>memoir</literal> (unless the
              <literal>article</literal> option is specified),
              <literal>chapter</literal> is implied as the setting for
              this option. If <literal>beamer</literal> is the output
              format, specifying either <literal>chapter</literal> or
              <literal>part</literal> will cause top-level headings to
              become <literal>\part{..}</literal>, while second-level
              headings remain as their default type.
            </para>
            <para>
              In Docx output, this option adds section breaks before
              first-level headings if <literal>chapter</literal> is
              selected, and before first- and second-level headings if
              <literal>part</literal> is selected. Footnote numbers will
              restart with each section break unless the reference doc
              modifies this.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>-N</literal>,
            <literal>--number-sections=[true|false]</literal>
          </term>
          <listitem>
            <para>
              Number section headings in LaTeX, ConTeXt, HTML, Docx, ms,
              or EPUB output. By default, sections are not numbered.
              Sections with class <literal>unnumbered</literal> will
              never be numbered, even if
              <literal>--number-sections</literal> is specified.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--number-offset=</literal><emphasis>NUMBER</emphasis>[<literal>,</literal><emphasis>NUMBER</emphasis><literal>,</literal><emphasis>…</emphasis>]
          </term>
          <listitem>
            <para>
              Offsets for section heading numbers. The first number is
              added to the section number for level-1 headings, the
              second for level-2 headings, and so on. So, for example,
              if you want the first level-1 heading in your document to
              be numbered <quote>6</quote> instead of <quote>1</quote>,
              specify <literal>--number-offset=5</literal>. If your
              document starts with a level-2 heading which you want to
              be numbered <quote>1.5</quote>, specify
              <literal>--number-offset=1,4</literal>.
              <literal>--number-offset</literal> only directly affects
              the number of the first section heading in a document;
              subsequent numbers increment in the normal way. Implies
              <literal>--number-sections</literal>. Currently this
              feature only affects HTML and Docx output.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--listings[=true|false]</literal>
          </term>
          <listitem>
            <para>
              *Deprecated, use
              <literal>--syntax-highlighting=idiomatic</literal> or
              <literal>--syntax-highlighting=default</literal> instead.
            </para>
            <para>
              Use the
              <link xlink:href="https://ctan.org/pkg/listings"><literal>listings</literal></link>
              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:
              <link xlink:href="https://en.wikibooks.org/wiki/LaTeX/Source_Code_Listings#Encoding_issue">Encoding
              issue with the listings package</link>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>-i</literal>,
            <literal>--incremental[=true|false]</literal>
          </term>
          <listitem>
            <para>
              Make list items in slide shows display incrementally (one
              by one). The default is for lists to be displayed all at
              once.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--slide-level=</literal><emphasis>NUMBER</emphasis>
          </term>
          <listitem>
            <para>
              Specifies that headings with the specified level create
              slides (for <literal>beamer</literal>,
              <literal>revealjs</literal>, <literal>pptx</literal>,
              <literal>s5</literal>, <literal>slidy</literal>,
              <literal>slideous</literal>, <literal>dzslides</literal>).
              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. Valid values are
              0-6. If a slide level of 0 is specified, slides will not
              be split automatically on headings, and horizontal rules
              must be used to indicate slide boundaries. If a slide
              level is not specified explicitly, the slide level will be
              set automatically based on the contents of the document;
              see <link linkend="structuring-the-slide-show">Structuring
              the slide show</link>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--section-divs[=true|false]</literal>
          </term>
          <listitem>
            <para>
              Wrap sections in <literal>&lt;section&gt;</literal> tags
              (or <literal>&lt;div&gt;</literal> tags for
              <literal>html4</literal>), and attach identifiers to the
              enclosing <literal>&lt;section&gt;</literal> (or
              <literal>&lt;div&gt;</literal>) rather than the heading
              itself (see <link linkend="heading-identifiers">Heading
              identifiers</link>, below). This option only affects HTML
              output (and does not affect HTML slide formats).
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--email-obfuscation=none</literal>|<literal>javascript</literal>|<literal>references</literal>
          </term>
          <listitem>
            <para>
              Specify a method for obfuscating
              <literal>mailto:</literal> links in HTML documents.
              <literal>none</literal> leaves <literal>mailto:</literal>
              links as they are. <literal>javascript</literal>
              obfuscates them using JavaScript.
              <literal>references</literal> obfuscates them by printing
              their letters as decimal or hexadecimal character
              references. The default is <literal>none</literal>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--id-prefix=</literal><emphasis>STRING</emphasis>
          </term>
          <listitem>
            <para>
              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.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>-T</literal> <emphasis>STRING</emphasis>,
            <literal>--title-prefix=</literal><emphasis>STRING</emphasis>
          </term>
          <listitem>
            <para>
              Specify <emphasis>STRING</emphasis> 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 <literal>--standalone</literal>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>-c</literal> <emphasis>URL</emphasis>,
            <literal>--css=</literal><emphasis>URL</emphasis>
          </term>
          <listitem>
            <para>
              Link to a CSS style sheet. This option can be used
              repeatedly to include multiple files. They will be
              included in the order specified. This option only affects
              HTML (including HTML slide shows) and EPUB output. It
              should be used together with
              <literal>-s/--standalone</literal>, because the link to
              the stylesheet goes in the document header.
            </para>
            <para>
              A stylesheet is required for generating EPUB. If none is
              provided using this option (or the <literal>css</literal>
              or <literal>stylesheet</literal> metadata fields), pandoc
              will look for a file <literal>epub.css</literal> in the
              user data directory (see <literal>--data-dir</literal>).
              If it is not found there, sensible defaults will be used.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <anchor xml:id="option--reference-doc" /><literal>--reference-doc=</literal><emphasis>FILE</emphasis>|<emphasis>URL</emphasis>
          </term>
          <listitem>
            <para>
              Use the specified file as a style reference in producing a
              docx or ODT file.
            </para>
            <variablelist>
              <varlistentry>
                <term>
                  Docx
                </term>
                <listitem>
                  <para>
                    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 <literal>reference.docx</literal> in the user
                    data directory (see <literal>--data-dir</literal>).
                    If this is not found either, sensible defaults will
                    be used.
                  </para>
                  <para>
                    To produce a custom
                    <literal>reference.docx</literal>, first get a copy
                    of the default <literal>reference.docx</literal>:
                    <literal>pandoc -o custom-reference.docx --print-default-data-file reference.docx</literal>.
                    Then open <literal>custom-reference.docx</literal>
                    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:
                  </para>
                  <para>
                    Paragraph styles:
                  </para>
                  <itemizedlist spacing="compact">
                    <listitem>
                      <para>
                        Normal
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Body Text
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        First Paragraph
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Compact
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Title
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Subtitle
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Author
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Date
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Abstract
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        AbstractTitle
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Bibliography
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Heading 1
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Heading 2
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Heading 3
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Heading 4
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Heading 5
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Heading 6
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Heading 7
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Heading 8
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Heading 9
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Block Text [for block quotes]
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Footnote Block Text [for block quotes in
                        footnotes]
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Source Code
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Footnote Text
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Definition Term
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Definition
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Caption
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Table Caption
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Image Caption
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Figure
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Captioned Figure
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        TOC Heading
                      </para>
                    </listitem>
                  </itemizedlist>
                  <para>
                    Character styles:
                  </para>
                  <itemizedlist spacing="compact">
                    <listitem>
                      <para>
                        Default Paragraph Font
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Verbatim Char
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Footnote Reference
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Hyperlink
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Section Number
                      </para>
                    </listitem>
                  </itemizedlist>
                  <para>
                    Table style:
                  </para>
                  <itemizedlist spacing="compact">
                    <listitem>
                      <para>
                        Table
                      </para>
                    </listitem>
                  </itemizedlist>
                </listitem>
              </varlistentry>
              <varlistentry>
                <term>
                  ODT
                </term>
                <listitem>
                  <para>
                    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
                    <literal>reference.odt</literal> in the user data
                    directory (see <literal>--data-dir</literal>). If
                    this is not found either, sensible defaults will be
                    used.
                  </para>
                  <para>
                    To produce a custom
                    <literal>reference.odt</literal>, first get a copy
                    of the default <literal>reference.odt</literal>:
                    <literal>pandoc -o custom-reference.odt --print-default-data-file reference.odt</literal>.
                    Then open <literal>custom-reference.odt</literal> in
                    LibreOffice, modify the styles as you wish, and save
                    the file.
                  </para>
                </listitem>
              </varlistentry>
              <varlistentry>
                <term>
                  PowerPoint
                </term>
                <listitem>
                  <para>
                    Templates included with Microsoft PowerPoint 2013
                    (either with <literal>.pptx</literal> or
                    <literal>.potx</literal> extension) are known to
                    work, as are most templates derived from these.
                  </para>
                  <para>
                    The specific requirement is that the template should
                    contain layouts with the following names (as seen
                    within PowerPoint):
                  </para>
                  <itemizedlist spacing="compact">
                    <listitem>
                      <para>
                        Title Slide
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Title and Content
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Section Header
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Two Content
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Comparison
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Content with Caption
                      </para>
                    </listitem>
                    <listitem>
                      <para>
                        Blank
                      </para>
                    </listitem>
                  </itemizedlist>
                  <para>
                    For each name, the first layout found with that name
                    will be used. If no layout is found with one of the
                    names, pandoc will output a warning and use the
                    layout with that name from the default reference doc
                    instead. (How these layouts are used is described in
                    <link linkend="powerpoint-layout-choice">PowerPoint
                    layout choice</link>.)
                  </para>
                  <para>
                    All templates included with a recent version of MS
                    PowerPoint will fit these criteria. (You can click
                    on <literal>Layout</literal> under the
                    <literal>Home</literal> menu to check.)
                  </para>
                  <para>
                    You can also modify the default
                    <literal>reference.pptx</literal>: first run
                    <literal>pandoc -o custom-reference.pptx --print-default-data-file reference.pptx</literal>,
                    and then modify
                    <literal>custom-reference.pptx</literal> in MS
                    PowerPoint (pandoc will use the layouts with the
                    names listed above).
                  </para>
                </listitem>
              </varlistentry>
            </variablelist>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--split-level=</literal><emphasis>NUMBER</emphasis>
          </term>
          <listitem>
            <para>
              Specify the heading level at which to split an EPUB or
              chunked HTML document into separate files. The default is
              to split into chapters at level-1 headings. In the case of
              EPUB, 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.
              For chunked HTML, this option determines how much content
              goes in each <quote>chunk.</quote>
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--chunk-template=</literal><emphasis>PATHTEMPLATE</emphasis>
          </term>
          <listitem>
            <para>
              Specify a template for the filenames in a
              <literal>chunkedhtml</literal> document. In the template,
              <literal>%n</literal> will be replaced by the chunk number
              (padded with leading 0s to 3 digits),
              <literal>%s</literal> with the section number of the
              chunk, <literal>%h</literal> with the heading text (with
              formatting removed), <literal>%i</literal> with the
              section identifier. For example,
              <literal>%section-%s-%i.html</literal> might be resolved
              to <literal>section-1.1-introduction.html</literal>. The
              characters <literal>/</literal> and <literal>\</literal>
              are not allowed in chunk templates and will be ignored.
              The default is <literal>%s-%i.html</literal>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--epub-chapter-level=</literal><emphasis>NUMBER</emphasis>
          </term>
          <listitem>
            <para>
              <emphasis>Deprecated synonym for
              <literal>--split-level</literal>.</emphasis>
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--epub-cover-image=</literal><emphasis>FILE</emphasis>
          </term>
          <listitem>
            <para>
              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 <literal>cover-image</literal> in a YAML
              metadata block (see <link linkend="epub-metadata">EPUB
              Metadata</link>, below).
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--epub-title-page=true</literal>|<literal>false</literal>
          </term>
          <listitem>
            <para>
              Determines whether a the title page is included in the
              EPUB (default is <literal>true</literal>).
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--epub-metadata=</literal><emphasis>FILE</emphasis>
          </term>
          <listitem>
            <para>
              Look in the specified XML file for metadata for the EPUB.
              The file should contain a series of
              <link xlink:href="https://www.dublincore.org/specifications/dublin-core/dces/">Dublin
              Core elements</link>. For example:
            </para>
            <programlisting>
 &lt;dc:rights&gt;Creative Commons&lt;/dc:rights&gt;
 &lt;dc:language&gt;es-AR&lt;/dc:language&gt;
</programlisting>
            <para>
              By default, pandoc will include the following metadata
              elements: <literal>&lt;dc:title&gt;</literal> (from the
              document title), <literal>&lt;dc:creator&gt;</literal>
              (from the document authors),
              <literal>&lt;dc:date&gt;</literal> (from the document
              date, which should be in
              <link xlink:href="https://www.w3.org/TR/NOTE-datetime">ISO
              8601 format</link>),
              <literal>&lt;dc:language&gt;</literal> (from the
              <literal>lang</literal> variable, or, if is not set, the
              locale), and
              <literal>&lt;dc:identifier id=&quot;BookId&quot;&gt;</literal>
              (a randomly generated UUID). Any of these may be
              overridden by elements in the metadata file.
            </para>
            <para>
              Note: if the source document is Markdown, a YAML metadata
              block in the document can be used instead. See below under
              <link linkend="epub-metadata">EPUB Metadata</link>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--epub-embed-font=</literal><emphasis>FILE</emphasis>
          </term>
          <listitem>
            <para>
              Embed the specified font in the EPUB. This option can be
              repeated to embed multiple fonts. Wildcards can also be
              used: for example, <literal>DejaVuSans-*.ttf</literal>.
              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
              <literal>--css</literal>):
            </para>
            <programlisting>
@font-face {
   font-family: DejaVuSans;
   font-style: normal;
   font-weight: normal;
   src:url(&quot;../fonts/DejaVuSans-Regular.ttf&quot;);
}
@font-face {
   font-family: DejaVuSans;
   font-style: normal;
   font-weight: bold;
   src:url(&quot;../fonts/DejaVuSans-Bold.ttf&quot;);
}
@font-face {
   font-family: DejaVuSans;
   font-style: italic;
   font-weight: normal;
   src:url(&quot;../fonts/DejaVuSans-Oblique.ttf&quot;);
}
@font-face {
   font-family: DejaVuSans;
   font-style: italic;
   font-weight: bold;
   src:url(&quot;../fonts/DejaVuSans-BoldOblique.ttf&quot;);
}
body { font-family: &quot;DejaVuSans&quot;; }
</programlisting>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--epub-subdirectory=</literal><emphasis>DIRNAME</emphasis>
          </term>
          <listitem>
            <para>
              Specify the subdirectory in the OCF container that is to
              hold the EPUB-specific contents. The default is
              <literal>EPUB</literal>. To put the EPUB contents in the
              top level, use an empty string.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--ipynb-output=all|none|best</literal>
          </term>
          <listitem>
            <para>
              Determines how ipynb output cells are treated.
              <literal>all</literal> means that all of the data formats
              included in the original are preserved.
              <literal>none</literal> means that the contents of data
              cells are omitted. <literal>best</literal> causes pandoc
              to try to pick the richest data block in each output cell
              that is compatible with the output format. The default is
              <literal>best</literal>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--pdf-engine=</literal><emphasis>PROGRAM</emphasis>
          </term>
          <listitem>
            <para>
              Use the specified engine when producing PDF output. Valid
              values are <literal>pdflatex</literal>,
              <literal>lualatex</literal>, <literal>xelatex</literal>,
              <literal>latexmk</literal>, <literal>tectonic</literal>,
              <literal>wkhtmltopdf</literal>,
              <literal>weasyprint</literal>,
              <literal>pagedjs-cli</literal>, <literal>prince</literal>,
              <literal>context</literal>, <literal>groff</literal>,
              <literal>pdfroff</literal>, and <literal>typst</literal>.
              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
              <literal>-t/--to</literal>:
            </para>
            <itemizedlist spacing="compact">
              <listitem>
                <para>
                  <literal>-t latex</literal> or none:
                  <literal>pdflatex</literal> (other options:
                  <literal>xelatex</literal>,
                  <literal>lualatex</literal>,
                  <literal>tectonic</literal>,
                  <literal>latexmk</literal>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>-t context</literal>:
                  <literal>context</literal>
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>-t html</literal>:
                  <literal>weasyprint</literal> (other options:
                  <literal>prince</literal>,
                  <literal>wkhtmltopdf</literal>,
                  <literal>pagedjs-cli</literal>; see
                  <link xlink:href="https://print-css.rocks">print-css.rocks</link>
                  for a good introduction to PDF generation from
                  HTML/CSS)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>-t ms</literal>: <literal>pdfroff</literal>
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>-t typst</literal>: <literal>typst</literal>
                </para>
              </listitem>
            </itemizedlist>
            <para>
              This option is normally intended to be used when a PDF
              file is specified as <literal>-o/--output</literal>.
              However, it may still have an effect when other output
              formats are requested. For example, <literal>ms</literal>
              output will include <literal>.pdfhref</literal> macros
              only if a <literal>--pdf-engine</literal> is selected, and
              the macros will be differently encoded depending on
              whether <literal>groff</literal> or
              <literal>pdfroff</literal> is specified.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--pdf-engine-opt=</literal><emphasis>STRING</emphasis>
          </term>
          <listitem>
            <para>
              Use the given string as a command-line argument to the
              <literal>pdf-engine</literal>. For example, to use a
              persistent directory <literal>foo</literal> for
              <literal>latexmk</literal>’s auxiliary files, use
              <literal>--pdf-engine-opt=-outdir=foo</literal>. Note that
              no check for duplicate options is done.
            </para>
          </listitem>
        </varlistentry>
      </variablelist>
    </section>
    <section xml:id="citation-rendering">
      <title>Citation rendering</title>
      <variablelist>
        <varlistentry>
          <term>
            <literal>-C</literal>, <literal>--citeproc</literal>
          </term>
          <listitem>
            <para>
              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 <literal>--bibliography</literal> option or the
              <literal>bibliography</literal> field in metadata, or via
              a <literal>references</literal> section in metadata
              containing a list of citations in CSL YAML format with
              Markdown formatting. The style is controlled by a
              <link xlink:href="https://docs.citationstyles.org/en/stable/specification.html">CSL</link>
              stylesheet specified using the <literal>--csl</literal>
              option or the <literal>csl</literal> field in metadata.
              (If no stylesheet is specified, the
              <literal>chicago-author-date</literal> style will be used
              by default.) The citation processing transformation may be
              applied before or after filters or Lua filters (see
              <literal>--filter</literal>,
              <literal>--lua-filter</literal>): these transformations
              are applied in the order they appear on the command line.
              For more information, see the section on
              <link linkend="citations">Citations</link>.
            </para>
            <para>
              Note: if this option is specified, the
              <literal>citations</literal> extension will be disabled
              automatically in the writer, to ensure that the
              citeproc-generated citations will be rendered instead of
              the format’s own citation syntax.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--bibliography=</literal><emphasis>FILE</emphasis>
          </term>
          <listitem>
            <para>
              Set the <literal>bibliography</literal> field in the
              document’s metadata to <emphasis>FILE</emphasis>,
              overriding any value set in the metadata. If you supply
              this argument multiple times, each
              <emphasis>FILE</emphasis> will be added to bibliography.
              If <emphasis>FILE</emphasis> is a URL, it will be fetched
              via HTTP. If <emphasis>FILE</emphasis> is not found
              relative to the working directory, it will be sought in
              the resource path (see
              <literal>--resource-path</literal>).
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--csl=</literal><emphasis>FILE</emphasis>
          </term>
          <listitem>
            <para>
              Set the <literal>csl</literal> field in the document’s
              metadata to <emphasis>FILE</emphasis>, overriding any
              value set in the metadata. (This is equivalent to
              <literal>--metadata csl=FILE</literal>.) If
              <emphasis>FILE</emphasis> is a URL, it will be fetched via
              HTTP. If <emphasis>FILE</emphasis> is not found relative
              to the working directory, it will be sought in the
              resource path (see <literal>--resource-path</literal>) and
              finally in the <literal>csl</literal> subdirectory of the
              pandoc user data directory.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--citation-abbreviations=</literal><emphasis>FILE</emphasis>
          </term>
          <listitem>
            <para>
              Set the <literal>citation-abbreviations</literal> field in
              the document’s metadata to <emphasis>FILE</emphasis>,
              overriding any value set in the metadata. (This is
              equivalent to
              <literal>--metadata citation-abbreviations=FILE</literal>.)
              If <emphasis>FILE</emphasis> is a URL, it will be fetched
              via HTTP. If <emphasis>FILE</emphasis> is not found
              relative to the working directory, it will be sought in
              the resource path (see <literal>--resource-path</literal>)
              and finally in the <literal>csl</literal> subdirectory of
              the pandoc user data directory.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--natbib</literal>
          </term>
          <listitem>
            <para>
              Use
              <link xlink:href="https://ctan.org/pkg/natbib"><literal>natbib</literal></link>
              for citations in LaTeX output. This option is not for use
              with the <literal>--citeproc</literal> option or with PDF
              output. It is intended for use in producing a LaTeX file
              that can be processed with
              <link xlink:href="https://ctan.org/pkg/bibtex"><literal>bibtex</literal></link>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--biblatex</literal>
          </term>
          <listitem>
            <para>
              Use
              <link xlink:href="https://ctan.org/pkg/biblatex"><literal>biblatex</literal></link>
              for citations in LaTeX output. This option is not for use
              with the <literal>--citeproc</literal> option or with PDF
              output. It is intended for use in producing a LaTeX file
              that can be processed with
              <link xlink:href="https://ctan.org/pkg/bibtex"><literal>bibtex</literal></link>
              or
              <link xlink:href="https://ctan.org/pkg/biber"><literal>biber</literal></link>.
            </para>
          </listitem>
        </varlistentry>
      </variablelist>
    </section>
    <section xml:id="math-rendering-in-html">
      <title>Math rendering in HTML</title>
      <para>
        The default is to render TeX math as far as possible using
        Unicode characters. Formulas are put inside a
        <literal>span</literal> with
        <literal>class=&quot;math&quot;</literal>, 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 <literal>--mathjax</literal> or another of the
        following options.
      </para>
      <variablelist>
        <varlistentry>
          <term>
            <literal>--mathjax</literal>[<literal>=</literal><emphasis>URL</emphasis>]
          </term>
          <listitem>
            <para>
              Use
              <link xlink:href="https://www.mathjax.org">MathJax</link>
              to display embedded TeX math in HTML output. TeX math will
              be put between <literal>\(...\)</literal> (for inline
              math) or <literal>\[...\]</literal> (for display math) and
              wrapped in <literal>&lt;span&gt;</literal> tags with class
              <literal>math</literal>. Then the MathJax JavaScript will
              render it. The <emphasis>URL</emphasis> should point to
              the <literal>MathJax.js</literal> load script. If a
              <emphasis>URL</emphasis> is not provided, a link to the
              Cloudflare CDN will be inserted.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--mathml</literal>
          </term>
          <listitem>
            <para>
              Convert TeX math to
              <link xlink:href="https://www.w3.org/Math/">MathML</link>
              (in <literal>epub3</literal>, <literal>docbook4</literal>,
              <literal>docbook5</literal>, <literal>jats</literal>,
              <literal>html4</literal> and <literal>html5</literal>).
              This is the default in <literal>odt</literal> output.
              MathML is supported natively by the main web browsers and
              select e-book readers.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--webtex</literal>[<literal>=</literal><emphasis>URL</emphasis>]
          </term>
          <listitem>
            <para>
              Convert TeX formulas to <literal>&lt;img&gt;</literal>
              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
              <literal>--webtex https://latex.codecogs.com/svg.latex?</literal>.
              If no URL is specified, the CodeCogs URL generating PNGs
              will be used
              (<literal>https://latex.codecogs.com/png.latex?</literal>).
              Note: the <literal>--webtex</literal> option will affect
              Markdown output as well as HTML, which is useful if you’re
              targeting a version of Markdown without native math
              support.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--katex</literal>[<literal>=</literal><emphasis>URL</emphasis>]
          </term>
          <listitem>
            <para>
              Use
              <link xlink:href="https://github.com/Khan/KaTeX">KaTeX</link>
              to display embedded TeX math in HTML output. The
              <emphasis>URL</emphasis> is the base URL for the KaTeX
              library. That directory should contain a
              <literal>katex.min.js</literal> and a
              <literal>katex.min.css</literal> file. If a
              <emphasis>URL</emphasis> is not provided, a link to the
              KaTeX CDN will be inserted.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--gladtex</literal>
          </term>
          <listitem>
            <para>
              Enclose TeX math in <literal>&lt;eq&gt;</literal> tags in
              HTML output. The resulting HTML can then be processed by
              <link xlink:href="https://humenda.github.io/GladTeX/">GladTeX</link>
              to produce SVG images of the typeset formulas and an HTML
              file with these images embedded.
            </para>
            <programlisting>
pandoc -s --gladtex input.md -o myfile.htex
gladtex -d image_dir myfile.htex
# produces myfile.html and images in image_dir
</programlisting>
          </listitem>
        </varlistentry>
      </variablelist>
    </section>
    <section xml:id="options-for-wrapper-scripts">
      <title>Options for wrapper scripts</title>
      <variablelist>
        <varlistentry>
          <term>
            <literal>--dump-args[=true|false]</literal>
          </term>
          <listitem>
            <para>
              Print information about command-line arguments to
              <emphasis>stdout</emphasis>, 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 <literal>-o</literal> option, or
              <literal>-</literal> (for <emphasis>stdout</emphasis>) 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 <literal>--</literal> separator at the end of the
              line.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>--ignore-args[=true|false]</literal>
          </term>
          <listitem>
            <para>
              Ignore command-line arguments (for use in wrapper
              scripts). Regular pandoc options are not ignored. Thus,
              for example,
            </para>
            <programlisting>
pandoc --ignore-args -o foo.html -s foo.txt -- -e latin1
</programlisting>
            <para>
              is equivalent to
            </para>
            <programlisting>
pandoc -o foo.html -s
</programlisting>
          </listitem>
        </varlistentry>
      </variablelist>
    </section>
  </section>
  <section xml:id="exit-codes">
    <title>Exit codes</title>
    <para>
      If pandoc completes successfully, it will return exit code 0.
      Nonzero exit codes have the following meanings:
    </para>
    <informaltable>
      <tgroup cols="2">
        <colspec align="right" />
        <colspec align="left" />
        <thead>
          <row>
            <entry>
              Code
            </entry>
            <entry>
              Error
            </entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>
              1
            </entry>
            <entry>
              PandocIOError
            </entry>
          </row>
          <row>
            <entry>
              3
            </entry>
            <entry>
              PandocFailOnWarningError
            </entry>
          </row>
          <row>
            <entry>
              4
            </entry>
            <entry>
              PandocAppError
            </entry>
          </row>
          <row>
            <entry>
              5
            </entry>
            <entry>
              PandocTemplateError
            </entry>
          </row>
          <row>
            <entry>
              6
            </entry>
            <entry>
              PandocOptionError
            </entry>
          </row>
          <row>
            <entry>
              21
            </entry>
            <entry>
              PandocUnknownReaderError
            </entry>
          </row>
          <row>
            <entry>
              22
            </entry>
            <entry>
              PandocUnknownWriterError
            </entry>
          </row>
          <row>
            <entry>
              23
            </entry>
            <entry>
              PandocUnsupportedExtensionError
            </entry>
          </row>
          <row>
            <entry>
              24
            </entry>
            <entry>
              PandocCiteprocError
            </entry>
          </row>
          <row>
            <entry>
              25
            </entry>
            <entry>
              PandocBibliographyError
            </entry>
          </row>
          <row>
            <entry>
              31
            </entry>
            <entry>
              PandocEpubSubdirectoryError
            </entry>
          </row>
          <row>
            <entry>
              43
            </entry>
            <entry>
              PandocPDFError
            </entry>
          </row>
          <row>
            <entry>
              44
            </entry>
            <entry>
              PandocXMLError
            </entry>
          </row>
          <row>
            <entry>
              47
            </entry>
            <entry>
              PandocPDFProgramNotFoundError
            </entry>
          </row>
          <row>
            <entry>
              61
            </entry>
            <entry>
              PandocHttpError
            </entry>
          </row>
          <row>
            <entry>
              62
            </entry>
            <entry>
              PandocShouldNeverHappenError
            </entry>
          </row>
          <row>
            <entry>
              63
            </entry>
            <entry>
              PandocSomeError
            </entry>
          </row>
          <row>
            <entry>
              64
            </entry>
            <entry>
              PandocParseError
            </entry>
          </row>
          <row>
            <entry>
              66
            </entry>
            <entry>
              PandocMakePDFError
            </entry>
          </row>
          <row>
            <entry>
              67
            </entry>
            <entry>
              PandocSyntaxMapError
            </entry>
          </row>
          <row>
            <entry>
              83
            </entry>
            <entry>
              PandocFilterError
            </entry>
          </row>
          <row>
            <entry>
              84
            </entry>
            <entry>
              PandocLuaError
            </entry>
          </row>
          <row>
            <entry>
              89
            </entry>
            <entry>
              PandocNoScriptingEngine
            </entry>
          </row>
          <row>
            <entry>
              91
            </entry>
            <entry>
              PandocMacroLoop
            </entry>
          </row>
          <row>
            <entry>
              92
            </entry>
            <entry>
              PandocUTF8DecodingError
            </entry>
          </row>
          <row>
            <entry>
              93
            </entry>
            <entry>
              PandocIpynbDecodingError
            </entry>
          </row>
          <row>
            <entry>
              94
            </entry>
            <entry>
              PandocUnsupportedCharsetError
            </entry>
          </row>
          <row>
            <entry>
              95
            </entry>
            <entry>
              PandocInputNotTextError
            </entry>
          </row>
          <row>
            <entry>
              97
            </entry>
            <entry>
              PandocCouldNotFindDataFileError
            </entry>
          </row>
          <row>
            <entry>
              98
            </entry>
            <entry>
              PandocCouldNotFindMetadataFileError
            </entry>
          </row>
          <row>
            <entry>
              99
            </entry>
            <entry>
              PandocResourceNotFound
            </entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>
  </section>
  <section xml:id="defaults-files">
    <title>Defaults files</title>
    <para>
      The <literal>--defaults</literal> option may be used to specify a
      package of options, in the form of a YAML file.
    </para>
    <para>
      Fields that are omitted will just have their regular default
      values. So a defaults file can be as simple as one line:
    </para>
    <programlisting language="yaml">
verbosity: INFO
</programlisting>
    <para>
      In fields that expect a file path (or list of file paths), the
      following syntax may be used to interpolate environment variables:
    </para>
    <programlisting language="yaml">
csl:  ${HOME}/mycsldir/special.csl
</programlisting>
    <para>
      <literal>${USERDATA}</literal> may also be used; this will always
      resolve to the user data directory that is current when the
      defaults file is parsed, regardless of the setting of the
      environment variable <literal>USERDATA</literal>.
    </para>
    <para>
      <literal>${.}</literal> will resolve to the directory containing
      the defaults file itself. This allows you to refer to resources
      contained in that directory:
    </para>
    <programlisting language="yaml">
epub-cover-image: ${.}/cover.jpg
epub-metadata: ${.}/meta.xml
resource-path:
- .             # the working directory from which pandoc is run
- ${.}/images   # the images subdirectory of the directory
                # containing this defaults file
</programlisting>
    <para>
      This environment variable interpolation syntax
      <emphasis>only</emphasis> works in fields that expect file paths.
    </para>
    <para>
      Defaults files can be placed in the <literal>defaults</literal>
      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
      <literal>letter.yaml</literal> in the <literal>defaults</literal>
      subdirectory of the user data directory, and then invoke these
      defaults from any directory using
      <literal>pandoc --defaults letter</literal> or
      <literal>pandoc -dletter</literal>.
    </para>
    <para>
      When multiple defaults are used, their contents will be combined.
    </para>
    <para>
      Note that, where command-line arguments may be repeated
      (<literal>--metadata-file</literal>, <literal>--css</literal>,
      <literal>--include-in-header</literal>,
      <literal>--include-before-body</literal>,
      <literal>--include-after-body</literal>,
      <literal>--variable</literal>, <literal>--metadata</literal>,
      <literal>--syntax-definition</literal>), the values specified on
      the command line will combine with values specified in the
      defaults file, rather than replacing them.
    </para>
    <para>
      The following tables show the mapping between the command line and
      defaults file entries.
    </para>
    <informaltable>
      <tgroup cols="2">
        <colspec colwidth="48*" align="left" />
        <colspec colwidth="50*" align="left" />
        <thead>
          <row>
            <entry>
              command line
            </entry>
            <entry>
              defaults file
            </entry>
          </row>
        </thead>
        <tbody>
          <row>
            <entry>
              <programlisting>
foo.md
</programlisting>
            </entry>
            <entry>
              <programlisting language="yaml">
input-file: foo.md
</programlisting>
            </entry>
          </row>
          <row>
            <entry>
              <programlisting>
foo.md bar.md

</programlisting>
            </entry>
            <entry>
              <programlisting language="yaml">
input-files:
  - foo.md
  - bar.md
</programlisting>
            </entry>
          </row>
        </tbody>
      </tgroup>
    </informaltable>
    <para>
      The value of <literal>input-files</literal> may be left empty to
      indicate input from stdin, and it can be an empty sequence
      <literal>[]</literal> for no input.
    </para>
    <section xml:id="general-options-1">
      <title>General options</title>
      <informaltable>
        <tgroup cols="2">
          <colspec colwidth="48*" align="left" />
          <colspec colwidth="50*" align="left" />
          <thead>
            <row>
              <entry>
                command line
              </entry>
              <entry>
                defaults file
              </entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>
                <programlisting>
--from markdown+emoji
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
from: markdown+emoji
</programlisting>
                <programlisting language="yaml">
reader: markdown+emoji
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--to markdown+hard_line_breaks
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
to: markdown+hard_line_breaks
</programlisting>
                <programlisting language="yaml">
writer: markdown+hard_line_breaks
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--output foo.pdf
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
output-file: foo.pdf
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--output -
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
output-file:
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--data-dir dir
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
data-dir: dir
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--defaults file
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
defaults:
- file
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--verbose
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
verbosity: INFO
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--quiet
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
verbosity: ERROR
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--fail-if-warnings
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
fail-if-warnings: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--sandbox
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
sandbox: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--log=FILE
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
log-file: FILE
</programlisting>
              </entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
      <para>
        Options specified in a defaults file itself always have priority
        over those in another file included with a
        <literal>defaults:</literal> entry.
      </para>
      <para>
        <literal>verbosity</literal> can have the values
        <literal>ERROR</literal>, <literal>WARNING</literal>, or
        <literal>INFO</literal>.
      </para>
    </section>
    <section xml:id="reader-options-1">
      <title>Reader options</title>
      <informaltable>
        <tgroup cols="2">
          <colspec colwidth="48*" align="left" />
          <colspec colwidth="50*" align="left" />
          <thead>
            <row>
              <entry>
                command line
              </entry>
              <entry>
                defaults file
              </entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>
                <programlisting>
--shift-heading-level-by -1
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
shift-heading-level-by: -1
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--indented-code-classes python
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
indented-code-classes:
  - python
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--default-image-extension &quot;.jpg&quot;
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
default-image-extension: '.jpg'
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--file-scope
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
file-scope: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--citeproc \
 --lua-filter count-words.lua \
 --filter special.lua

</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
filters:
  - citeproc
  - count-words.lua
  - type: json
    path: special.lua
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--metadata key=value \
 --metadata key2
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
metadata:
  key: value
  key2: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--metadata-file meta.yaml
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
metadata-files:
  - meta.yaml
</programlisting>
                <programlisting language="yaml">
metadata-file: meta.yaml
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--preserve-tabs
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
preserve-tabs: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--tab-stop 8
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
tab-stop: 8
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--track-changes accept
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
track-changes: accept
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--extract-media dir
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
extract-media: dir
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--abbreviations abbrevs.txt
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
abbreviations: abbrevs.txt
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--trace
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
trace: true
</programlisting>
              </entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
      <para>
        Metadata values specified in a defaults file are parsed as
        literal string text, not Markdown.
      </para>
      <para>
        Filters will be assumed to be Lua filters if they have the
        <literal>.lua</literal> 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 <literal>citeproc</literal> or
        <literal>{type: citeproc}</literal>.
      </para>
    </section>
    <section xml:id="general-writer-options-1">
      <title>General writer options</title>
      <informaltable>
        <tgroup cols="2">
          <colspec colwidth="48*" align="left" />
          <colspec colwidth="50*" align="left" />
          <thead>
            <row>
              <entry>
                command line
              </entry>
              <entry>
                defaults file
              </entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>
                <programlisting>
--standalone
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
standalone: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--template letter
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
template: letter
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--variable key=val \
  --variable key2
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
variables:
  key: val
  key2: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--eol nl
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
eol: nl
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--dpi 300
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
dpi: 300
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--wrap 60
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
wrap: 60
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--columns 72
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
columns: 72
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--table-of-contents
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
table-of-contents: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--toc
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
toc: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--toc-depth 3
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
toc-depth: 3
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--strip-comments
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
strip-comments: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--no-highlight
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
syntax-highlighting: 'none'
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--syntax-highlighting kate
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
syntax-highlighting: kate
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--syntax-definition mylang.xml
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
syntax-definitions:
  - mylang.xml
</programlisting>
                <programlisting language="yaml">
syntax-definition: mylang.xml
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--include-in-header inc.tex
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
include-in-header:
  - inc.tex
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--include-before-body inc.tex
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
include-before-body:
  - inc.tex
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--include-after-body inc.tex
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
include-after-body:
  - inc.tex
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--resource-path .:foo
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
resource-path: ['.','foo']
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--request-header foo:bar
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
request-headers:
  - [&quot;User-Agent&quot;, &quot;Mozilla/5.0&quot;]
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--no-check-certificate
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
no-check-certificate: true
</programlisting>
              </entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
    </section>
    <section xml:id="options-affecting-specific-writers-1">
      <title>Options affecting specific writers</title>
      <informaltable>
        <tgroup cols="2">
          <colspec colwidth="48*" align="left" />
          <colspec colwidth="50*" align="left" />
          <thead>
            <row>
              <entry>
                command line
              </entry>
              <entry>
                defaults file
              </entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>
                <programlisting>
--self-contained
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
self-contained: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--link-images
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
link-images: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--html-q-tags
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
html-q-tags: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--ascii
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
ascii: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--reference-links
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
reference-links: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--reference-location block
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
reference-location: block
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--figure-caption-position=above
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
figure-caption-position: above
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--table-caption-position=below
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
table-caption-position: below
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--markdown-headings atx
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
markdown-headings: atx
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--list-tables
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
list-tables: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--top-level-division chapter
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
top-level-division: chapter
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--number-sections
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
number-sections: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--number-offset=1,4
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
number-offset: \[1,4\]
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--listings
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
listings: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--list-of-figures
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
list-of-figures: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--lof
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
lof: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--list-of-tables
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
list-of-tables: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--lot
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
lot: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--incremental
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
incremental: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--slide-level 2
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
slide-level: 2
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--section-divs
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
section-divs: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--email-obfuscation references
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
email-obfuscation: references
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--id-prefix ch1
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
identifier-prefix: ch1
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--title-prefix MySite
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
title-prefix: MySite
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--css styles/screen.css  \
  --css styles/special.css
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
css:
  - styles/screen.css
  - styles/special.css
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--reference-doc my.docx
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
reference-doc: my.docx
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--epub-cover-image cover.jpg
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
epub-cover-image: cover.jpg
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--epub-title-page=false
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
epub-title-page: false
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--epub-metadata meta.xml
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
epub-metadata: meta.xml
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--epub-embed-font special.otf \
  --epub-embed-font headline.otf
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
epub-fonts:
  - special.otf
  - headline.otf
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--split-level 2
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
split-level: 2
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--chunk-template=&quot;%i.html&quot;
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
chunk-template: &quot;%i.html&quot;
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--epub-subdirectory=&quot;&quot;
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
epub-subdirectory: ''
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--ipynb-output best
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
ipynb-output: best
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--pdf-engine xelatex
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
pdf-engine: xelatex
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--pdf-engine-opt=--shell-escape
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
pdf-engine-opts:
  - '-shell-escape'
</programlisting>
                <programlisting language="yaml">
pdf-engine-opt: '-shell-escape'
</programlisting>
              </entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
    </section>
    <section xml:id="citation-rendering-1">
      <title>Citation rendering</title>
      <informaltable>
        <tgroup cols="2">
          <colspec colwidth="48*" align="left" />
          <colspec colwidth="50*" align="left" />
          <thead>
            <row>
              <entry>
                command line
              </entry>
              <entry>
                defaults file
              </entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>
                <programlisting>
--citeproc
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
citeproc: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--bibliography logic.bib
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
bibliography: logic.bib
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--csl ieee.csl
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
csl: ieee.csl
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--citation-abbreviations ab.json
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
citation-abbreviations: ab.json
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--natbib
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
cite-method: natbib
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--biblatex
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
cite-method: biblatex
</programlisting>
              </entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
      <para>
        <literal>cite-method</literal> can be
        <literal>citeproc</literal>, <literal>natbib</literal>, or
        <literal>biblatex</literal>. This only affects LaTeX output. If
        you want to use citeproc to format citations, you should also
        set <quote>citeproc: true</quote>.
      </para>
      <para>
        If you need control over when the citeproc processing is done
        relative to other filters, you should instead use
        <literal>citeproc</literal> in the list of
        <literal>filters</literal> (see
        <link linkend="reader-options-1">Reader options</link>).
      </para>
    </section>
    <section xml:id="math-rendering-in-html-1">
      <title>Math rendering in HTML</title>
      <informaltable>
        <tgroup cols="2">
          <colspec colwidth="48*" align="left" />
          <colspec colwidth="50*" align="left" />
          <thead>
            <row>
              <entry>
                command line
              </entry>
              <entry>
                defaults file
              </entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>
                <programlisting>
--mathjax
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
html-math-method:
  method: mathjax
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--mathml
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
html-math-method:
  method: mathml
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--webtex
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
html-math-method:
  method: webtex
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--katex
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
html-math-method:
  method: katex
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--gladtex
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
html-math-method:
  method: gladtex
</programlisting>
              </entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
      <para>
        In addition to the values listed above,
        <literal>method</literal> can have the value
        <literal>plain</literal>.
      </para>
      <para>
        If the command line option accepts a URL argument, an
        <literal>url:</literal> field can be added to
        <literal>html-math-method:</literal>.
      </para>
    </section>
    <section xml:id="options-for-wrapper-scripts-1">
      <title>Options for wrapper scripts</title>
      <informaltable>
        <tgroup cols="2">
          <colspec colwidth="48*" align="left" />
          <colspec colwidth="50*" align="left" />
          <thead>
            <row>
              <entry>
                command line
              </entry>
              <entry>
                defaults file
              </entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>
                <programlisting>
--dump-args
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
dump-args: true
</programlisting>
              </entry>
            </row>
            <row>
              <entry>
                <programlisting>
--ignore-args
</programlisting>
              </entry>
              <entry>
                <programlisting language="yaml">
ignore-args: true
</programlisting>
              </entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
    </section>
  </section>
  <section xml:id="templates">
    <title>Templates</title>
    <para>
      When the <literal>-s/--standalone</literal> 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
    </para>
    <programlisting>
pandoc -D *FORMAT*
</programlisting>
    <para>
      where <emphasis>FORMAT</emphasis> is the name of the output
      format. A custom template can be specified using the
      <literal>--template</literal> option. You can also override the
      system default templates for a given output format
      <emphasis>FORMAT</emphasis> by putting a file
      <literal>templates/default.*FORMAT*</literal> in the user data
      directory (see <literal>--data-dir</literal>, above).
      <emphasis>Exceptions:</emphasis>
    </para>
    <itemizedlist spacing="compact">
      <listitem>
        <para>
          For <literal>odt</literal> output, customize the
          <literal>default.opendocument</literal> template.
        </para>
      </listitem>
      <listitem>
        <para>
          For <literal>docx</literal> output, customize the
          <literal>default.openxml</literal> template.
        </para>
      </listitem>
      <listitem>
        <para>
          For <literal>pdf</literal> output, customize the
          <literal>default.latex</literal> template (or the
          <literal>default.context</literal> template, if you use
          <literal>-t context</literal>, or the
          <literal>default.ms</literal> template, if you use
          <literal>-t ms</literal>, or the
          <literal>default.html</literal> template, if you use
          <literal>-t html</literal>).
        </para>
      </listitem>
      <listitem>
        <para>
          <literal>pptx</literal> has no template.
        </para>
      </listitem>
    </itemizedlist>
    <para>
      Note that <literal>docx</literal>, <literal>odt</literal>, and
      <literal>pptx</literal> output can also be customized using
      <literal>--reference-doc</literal>. Use a reference doc to adjust
      the styles in your document; use a template to handle variable
      interpolation and customize the presentation of metadata, the
      position of the table of contents, boilerplate text, etc.
    </para>
    <para>
      Templates contain <emphasis>variables</emphasis>, which allow for
      the inclusion of arbitrary information at any point in the file.
      They may be set at the command line using the
      <literal>-V/--variable</literal> option. If a variable is not set,
      pandoc will look for the key in the document’s metadata, which can
      be set using either
      <link linkend="extension-yaml_metadata_block">YAML metadata
      blocks</link> or with the <literal>-M/--metadata</literal> option.
      In addition, some variables are given default values by pandoc.
      See <link linkend="variables">Variables</link> below for a list of
      variables used in pandoc’s default templates.
    </para>
    <para>
      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
      <link xlink:href="https://github.com/jgm/pandoc-templates">pandoc-templates</link>
      repository and merge in changes after each pandoc release.
    </para>
    <section xml:id="template-syntax">
      <title>Template syntax</title>
      <section xml:id="comments">
        <title>Comments</title>
        <para>
          Anything between the sequence <literal>$--</literal> and the
          end of the line will be treated as a comment and omitted from
          the output.
        </para>
      </section>
      <section xml:id="delimiters">
        <title>Delimiters</title>
        <para>
          To mark variables and control structures in the template,
          either <literal>$</literal>…<literal>$</literal> or
          <literal>${</literal>…<literal>}</literal> 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
          preceded by one or more spaces or tabs, which will be ignored.
        </para>
        <para>
          To include a literal <literal>$</literal> in the document, use
          <literal>$$</literal>.
        </para>
      </section>
      <section xml:id="interpolated-variables">
        <title>Interpolated variables</title>
        <para>
          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,
          <literal>_</literal>, <literal>-</literal>, and
          <literal>.</literal>. The keywords <literal>it</literal>,
          <literal>if</literal>, <literal>else</literal>,
          <literal>endif</literal>, <literal>for</literal>,
          <literal>sep</literal>, and <literal>endfor</literal> may not
          be used as variable names. Examples:
        </para>
        <programlisting>
$foo$
$foo.bar.baz$
$foo_bar.baz-bim$
$ foo $
${foo}
${foo.bar.baz}
${foo_bar.baz-bim}
${ foo }
</programlisting>
        <para>
          Variable names with periods are used to get at structured
          variable values. So, for example,
          <literal>employee.salary</literal> will return the value of
          the <literal>salary</literal> field of the object that is the
          value of the <literal>employee</literal> field.
        </para>
        <itemizedlist spacing="compact">
          <listitem>
            <para>
              If the value of the variable is a 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.)
            </para>
          </listitem>
          <listitem>
            <para>
              If the value is a list, the values will be concatenated.
            </para>
          </listitem>
          <listitem>
            <para>
              If the value is a map, the string <literal>true</literal>
              will be rendered.
            </para>
          </listitem>
          <listitem>
            <para>
              Every other value will be rendered as the empty string.
            </para>
          </listitem>
        </itemizedlist>
      </section>
      <section xml:id="conditionals">
        <title>Conditionals</title>
        <para>
          A conditional begins with <literal>if(variable)</literal>
          (enclosed in matched delimiters) and ends with
          <literal>endif</literal> (enclosed in matched delimiters). It
          may optionally contain an <literal>else</literal> (enclosed in
          matched delimiters). The <literal>if</literal> section is used
          if <literal>variable</literal> has a true value, otherwise the
          <literal>else</literal> section is used (if present). The
          following values count as true:
        </para>
        <itemizedlist spacing="compact">
          <listitem>
            <para>
              any map
            </para>
          </listitem>
          <listitem>
            <para>
              any array containing at least one true value
            </para>
          </listitem>
          <listitem>
            <para>
              any nonempty string
            </para>
          </listitem>
          <listitem>
            <para>
              boolean True
            </para>
          </listitem>
        </itemizedlist>
        <para>
          Note that in YAML metadata (and metadata specified on the
          command line using <literal>-M/--metadata</literal>), unquoted
          <literal>true</literal> and <literal>false</literal> will be
          interpreted as Boolean values. But a variable specified on the
          command line using <literal>-V/--variable</literal> will
          always be given a string value. Hence a conditional
          <literal>if(foo)</literal> will be triggered if you use
          <literal>-V foo=false</literal>, but not if you use
          <literal>-M foo=false</literal>.
        </para>
        <para>
          Examples:
        </para>
        <programlisting>
$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}
</programlisting>
        <para>
          The keyword <literal>elseif</literal> may be used to simplify
          complex nested conditionals:
        </para>
        <programlisting>
$if(foo)$
XXX
$elseif(bar)$
YYY
$else$
ZZZ
$endif$
</programlisting>
      </section>
      <section xml:id="for-loops">
        <title>For loops</title>
        <para>
          A for loop begins with <literal>for(variable)</literal>
          (enclosed in matched delimiters) and ends with
          <literal>endfor</literal> (enclosed in matched delimiters).
        </para>
        <itemizedlist spacing="compact">
          <listitem>
            <para>
              If <literal>variable</literal> is an array, the material
              inside the loop will be evaluated repeatedly, with
              <literal>variable</literal> being set to each value of the
              array in turn, and concatenated.
            </para>
          </listitem>
          <listitem>
            <para>
              If <literal>variable</literal> is a map, the material
              inside will be set to the map.
            </para>
          </listitem>
          <listitem>
            <para>
              If the value of the associated variable is not an array or
              a map, a single iteration will be performed on its value.
            </para>
          </listitem>
        </itemizedlist>
        <para>
          Examples:
        </para>
        <programlisting>
$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$
</programlisting>
        <para>
          You may optionally specify a separator between consecutive
          values using <literal>sep</literal> (enclosed in matched
          delimiters). The material between <literal>sep</literal> and
          the <literal>endfor</literal> is the separator.
        </para>
        <programlisting>
${ for(foo) }${ foo }${ sep }, ${ endfor }
</programlisting>
        <para>
          Instead of using <literal>variable</literal> inside the loop,
          the special anaphoric keyword <literal>it</literal> may be
          used.
        </para>
        <programlisting>
${ for(foo.bar) }
  - ${ it.last }, ${ it.first }
${ endfor }
</programlisting>
      </section>
      <section xml:id="partials">
        <title>Partials</title>
        <para>
          Partials (subtemplates stored in different files) may be
          included by using the name of the partial, followed by
          <literal>()</literal>, for example:
        </para>
        <programlisting>
${ styles() }
</programlisting>
        <para>
          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:
        </para>
        <programlisting>
${ styles.html() }
</programlisting>
        <para>
          (If a partial is not found in the directory of the template
          and the template path is given as a relative path, it will
          also be sought in the <literal>templates</literal>
          subdirectory of the user data directory.)
        </para>
        <para>
          Partials may optionally be applied to variables using a colon:
        </para>
        <programlisting>
${ date:fancy() }

${ articles:bibentry() }
</programlisting>
        <para>
          If <literal>articles</literal> is an array, this will iterate
          over its values, applying the partial
          <literal>bibentry()</literal> to each one. So the second
          example above is equivalent to
        </para>
        <programlisting>
${ for(articles) }
${ it:bibentry() }
${ endfor }
</programlisting>
        <para>
          Note that the anaphoric keyword <literal>it</literal> must be
          used when iterating over partials. In the above examples, the
          <literal>bibentry</literal> partial should contain
          <literal>it.title</literal> (and so on) instead of
          <literal>articles.title</literal>.
        </para>
        <para>
          Final newlines are omitted from included partials.
        </para>
        <para>
          Partials may include other partials.
        </para>
        <para>
          A separator between values of an array may be specified in
          square brackets, immediately after the variable name or
          partial:
        </para>
        <programlisting>
${months[, ]}

${articles:bibentry()[; ]}
</programlisting>
        <para>
          The separator in this case is literal and (unlike with
          <literal>sep</literal> in an explicit <literal>for</literal>
          loop) cannot contain interpolated variables or other template
          directives.
        </para>
      </section>
      <section xml:id="nesting">
        <title>Nesting</title>
        <para>
          To ensure that content is <quote>nested,</quote> that is,
          subsequent lines indented, use the <literal>^</literal>
          directive:
        </para>
        <programlisting>
$item.number$  $^$$item.description$ ($item.price$)
</programlisting>
        <para>
          In this example, if <literal>item.description</literal> has
          multiple lines, they will all be indented to line up with the
          first line:
        </para>
        <programlisting>
00123  A fine bottle of 18-year old
       Oban whiskey. ($148)
</programlisting>
        <para>
          To nest multiple lines to the same level, align them with the
          <literal>^</literal> directive in the template. For example:
        </para>
        <programlisting>
$item.number$  $^$$item.description$ ($item.price$)
               (Available til $item.sellby$.)
</programlisting>
        <para>
          will produce
        </para>
        <programlisting>
00123  A fine bottle of 18-year old
       Oban whiskey. ($148)
       (Available til March 30, 2020.)
</programlisting>
        <para>
          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’s value contains multiple
          lines, it will be nested automatically.
        </para>
      </section>
      <section xml:id="breakable-spaces">
        <title>Breakable spaces</title>
        <para>
          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
          <literal>~</literal> keyword (ended with another
          <literal>~</literal>).
        </para>
        <programlisting>
$~$This long line may break if the document is rendered
with a short line length.$~$
</programlisting>
      </section>
      <section xml:id="pipes">
        <title>Pipes</title>
        <para>
          A pipe transforms the value of a variable or partial. Pipes
          are specified using a slash (<literal>/</literal>) between the
          variable name (or partial) and the pipe name. Example:
        </para>
        <programlisting>
$for(name)$
$name/uppercase$
$endfor$

$for(metadata/pairs)$
- $it.key$: $it.value$
$endfor$

$employee:name()/uppercase$
</programlisting>
        <para>
          Pipes may be chained:
        </para>
        <programlisting>
$for(employees/pairs)$
$it.key/alpha/uppercase$. $it.name$
$endfor$
</programlisting>
        <para>
          Some pipes take parameters:
        </para>
        <programlisting>
|----------------------|------------|
$for(employee)$
$it.name.first/uppercase/left 20 &quot;| &quot;$$it.name.salary/right 10 &quot; | &quot; &quot; |&quot;$
$endfor$
|----------------------|------------|
</programlisting>
        <para>
          Currently the following pipes are predefined:
        </para>
        <itemizedlist>
          <listitem>
            <para>
              <literal>pairs</literal>: Converts a map or array to an
              array of maps, each with <literal>key</literal> and
              <literal>value</literal> fields. If the original value was
              an array, the <literal>key</literal> will be the array
              index, starting with 1.
            </para>
          </listitem>
          <listitem>
            <para>
              <literal>uppercase</literal>: Converts text to uppercase.
            </para>
          </listitem>
          <listitem>
            <para>
              <literal>lowercase</literal>: Converts text to lowercase.
            </para>
          </listitem>
          <listitem>
            <para>
              <literal>length</literal>: Returns the length of the
              value: number of characters for a textual value, number of
              elements for a map or array.
            </para>
          </listitem>
          <listitem>
            <para>
              <literal>reverse</literal>: Reverses a textual value or
              array, and has no effect on other values.
            </para>
          </listitem>
          <listitem>
            <para>
              <literal>first</literal>: Returns the first value of an
              array, if applied to a non-empty array; otherwise returns
              the original value.
            </para>
          </listitem>
          <listitem>
            <para>
              <literal>last</literal>: Returns the last value of an
              array, if applied to a non-empty array; otherwise returns
              the original value.
            </para>
          </listitem>
          <listitem>
            <para>
              <literal>rest</literal>: Returns all but the first value
              of an array, if applied to a non-empty array; otherwise
              returns the original value.
            </para>
          </listitem>
          <listitem>
            <para>
              <literal>allbutlast</literal>: Returns all but the last
              value of an array, if applied to a non-empty array;
              otherwise returns the original value.
            </para>
          </listitem>
          <listitem>
            <para>
              <literal>chomp</literal>: Removes trailing newlines (and
              breakable space).
            </para>
          </listitem>
          <listitem>
            <para>
              <literal>nowrap</literal>: Disables line wrapping on
              breakable spaces.
            </para>
          </listitem>
          <listitem>
            <para>
              <literal>alpha</literal>: Converts textual values that can
              be read as an integer into lowercase alphabetic characters
              <literal>a..z</literal> (mod 26). This can be used to get
              lettered enumeration from array indices. To get uppercase
              letters, chain with <literal>uppercase</literal>.
            </para>
          </listitem>
          <listitem>
            <para>
              <literal>roman</literal>: Converts textual values that can
              be read as an integer into lowercase roman numerals. This
              can be used to get lettered enumeration from array
              indices. To get uppercase roman, chain with
              <literal>uppercase</literal>.
            </para>
          </listitem>
          <listitem>
            <para>
              <literal>left n &quot;leftborder&quot; &quot;rightborder&quot;</literal>:
              Renders a textual value in a block of width
              <literal>n</literal>, 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 <literal>&quot;</literal> and <literal>\</literal>
              characters must be backslash-escaped.
            </para>
          </listitem>
          <listitem>
            <para>
              <literal>right n &quot;leftborder&quot; &quot;rightborder&quot;</literal>:
              Renders a textual value in a block of width
              <literal>n</literal>, aligned to the right, and has no
              effect on other values.
            </para>
          </listitem>
          <listitem>
            <para>
              <literal>center n &quot;leftborder&quot; &quot;rightborder&quot;</literal>:
              Renders a textual value in a block of width
              <literal>n</literal>, aligned to the center, and has no
              effect on other values.
            </para>
          </listitem>
        </itemizedlist>
      </section>
    </section>
    <section xml:id="variables">
      <title>Variables</title>
      <section xml:id="metadata-variables">
        <title>Metadata variables</title>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              <literal>title</literal>, <literal>author</literal>,
              <literal>date</literal>
            </term>
            <listitem>
              <para>
                allow identification of basic aspects of the document.
                Included in PDF metadata through LaTeX and ConTeXt.
                These can be set through a
                <link linkend="extension-pandoc_title_block">pandoc
                title block</link>, which allows for multiple authors,
                or through a
                <link linkend="extension-yaml_metadata_block">YAML
                metadata block</link>:
              </para>
              <programlisting>
---
author:
- Aristotle
- Peter Abelard
...
</programlisting>
              <para>
                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 <literal>title-meta</literal>,
                <literal>author-meta</literal>, and
                <literal>date-meta</literal> variables. (By default
                these are set automatically, based on
                <literal>title</literal>, <literal>author</literal>, and
                <literal>date</literal>.) The page title in HTML is set
                by <literal>pagetitle</literal>, which is equal to
                <literal>title</literal> by default.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>subtitle</literal>
            </term>
            <listitem>
              <para>
                document subtitle, included in HTML, EPUB, LaTeX,
                ConTeXt, and docx documents
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>abstract</literal>
            </term>
            <listitem>
              <para>
                document summary, included in HTML, LaTeX, ConTeXt,
                AsciiDoc, and docx documents
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>abstract-title</literal>
            </term>
            <listitem>
              <para>
                title of abstract, currently used only in HTML, EPUB,
                docx, and Typst. This will be set automatically to a
                localized value, depending on <literal>lang</literal>,
                but can be manually overridden.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>keywords</literal>
            </term>
            <listitem>
              <para>
                list of keywords to be included in HTML, PDF, ODT, pptx,
                docx and AsciiDoc metadata; repeat as for
                <literal>author</literal>, above
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>subject</literal>
            </term>
            <listitem>
              <para>
                document subject, included in ODT, PDF, docx, EPUB, and
                pptx metadata
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>description</literal>
            </term>
            <listitem>
              <para>
                document description, included in ODT, docx and pptx
                metadata. Some applications show this as
                <literal>Comments</literal> metadata.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>category</literal>
            </term>
            <listitem>
              <para>
                document category, included in docx and pptx metadata
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
        <para>
          Additionally, any root-level string metadata, not included in
          ODT, docx or pptx metadata is added as a <emphasis>custom
          property</emphasis>. The following
          <link xlink:href="https://yaml.org/spec/1.2/spec.html">YAML</link>
          metadata block for instance:
        </para>
        <programlisting>
---
title:  'This is the title'
subtitle: &quot;This is the subtitle&quot;
author:
- Author One
- Author Two
description: |
    This is a long
    description.

    It consists of two paragraphs
...
</programlisting>
        <para>
          will include <literal>title</literal>,
          <literal>author</literal> and <literal>description</literal>
          as standard document properties and
          <literal>subtitle</literal> as a custom property when
          converting to docx, ODT or pptx.
        </para>
      </section>
      <section xml:id="language-variables">
        <title>Language variables</title>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              <literal>lang</literal>
            </term>
            <listitem>
              <para>
                identifies the main language of the document using IETF
                language tags (following the
                <link xlink:href="https://tools.ietf.org/html/bcp47">BCP
                47</link> standard), such as <literal>en</literal> or
                <literal>en-GB</literal>. The
                <link xlink:href="https://r12a.github.io/app-subtags/">Language
                subtag lookup</link> tool can look up or verify these
                tags. This affects most formats, and controls
                hyphenation in PDF output when using LaTeX (through
                <link xlink:href="https://ctan.org/pkg/babel"><literal>babel</literal></link>
                and
                <link xlink:href="https://ctan.org/pkg/polyglossia"><literal>polyglossia</literal></link>)
                or ConTeXt.
              </para>
              <para>
                Use native pandoc <link linkend="divs-and-spans">Divs
                and Spans</link> with the <literal>lang</literal>
                attribute to switch the language:
              </para>
              <programlisting>
---
lang: en-GB
...

Text in the main document language (British English).

::: {lang=fr-CA}
&gt; Cette citation est écrite en français canadien.
:::

More text in English. ['Zitat auf Deutsch.']{lang=de}
</programlisting>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>dir</literal>
            </term>
            <listitem>
              <para>
                the base script direction, either <literal>rtl</literal>
                (right-to-left) or <literal>ltr</literal>
                (left-to-right).
              </para>
              <para>
                For bidirectional documents, native pandoc
                <literal>span</literal>s and <literal>div</literal>s
                with the <literal>dir</literal> attribute (value
                <literal>rtl</literal> or <literal>ltr</literal>) 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
                <link xlink:href="https://www.w3.org/International/articles/inline-bidi-markup/uba-basics">Unicode
                Bidirectional Algorithm</link>.
              </para>
              <para>
                When using LaTeX for bidirectional documents, only the
                <literal>xelatex</literal> engine is fully supported
                (use <literal>--pdf-engine=xelatex</literal>).
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section xml:id="variables-for-html">
        <title>Variables for HTML</title>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              <literal>document-css</literal>
            </term>
            <listitem>
              <para>
                Enables inclusion of most of the
                <link xlink:href="https://developer.mozilla.org/en-US/docs/Learn/CSS">CSS</link>
                in the <literal>styles.html</literal>
                <link linkend="partials">partial</link> (have a look
                with
                <literal>pandoc --print-default-data-file=templates/styles.html</literal>).
                Unless you use <literal>--css</literal>, this variable
                is set to <literal>true</literal> by default. You can
                disable it with
                e.g. <literal>pandoc -M document-css=false</literal>.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>mainfont</literal>
            </term>
            <listitem>
              <para>
                sets the CSS <literal>font-family</literal> property on
                the <literal>html</literal> element.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>fontsize</literal>
            </term>
            <listitem>
              <para>
                sets the base CSS <literal>font-size</literal>, which
                you’d usually set to e.g. <literal>20px</literal>, but
                it also accepts <literal>pt</literal> (12pt = 16px in
                most browsers).
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>fontcolor</literal>
            </term>
            <listitem>
              <para>
                sets the CSS <literal>color</literal> property on the
                <literal>html</literal> element.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>linkcolor</literal>
            </term>
            <listitem>
              <para>
                sets the CSS <literal>color</literal> property on all
                links.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>monofont</literal>
            </term>
            <listitem>
              <para>
                sets the CSS <literal>font-family</literal> property on
                <literal>code</literal> elements.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>monobackgroundcolor</literal>
            </term>
            <listitem>
              <para>
                sets the CSS <literal>background-color</literal>
                property on <literal>code</literal> elements and adds
                extra padding.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>linestretch</literal>
            </term>
            <listitem>
              <para>
                sets the CSS <literal>line-height</literal> property on
                the <literal>html</literal> element, which is preferred
                to be unitless.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>maxwidth</literal>
            </term>
            <listitem>
              <para>
                sets the CSS <literal>max-width</literal> property
                (default is 36em).
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>backgroundcolor</literal>
            </term>
            <listitem>
              <para>
                sets the CSS <literal>background-color</literal>
                property on the <literal>html</literal> element.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>margin-left</literal>,
              <literal>margin-right</literal>,
              <literal>margin-top</literal>,
              <literal>margin-bottom</literal>
            </term>
            <listitem>
              <para>
                sets the corresponding CSS <literal>padding</literal>
                properties on the <literal>body</literal> element.
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
        <para>
          To override or extend some
          <link xlink:href="https://developer.mozilla.org/en-US/docs/Learn/CSS">CSS</link>
          for just one document, include for example:
        </para>
        <programlisting>
---
header-includes: |
  &lt;style&gt;
  blockquote {
    font-style: italic;
  }
  tr.even {
    background-color: #f0f0f0;
  }
  td, th {
    padding: 0.5em 2em 0.5em 0.5em;
  }
  tbody {
    border-bottom: none;
  }
  &lt;/style&gt;
---
</programlisting>
      </section>
      <section xml:id="variables-for-html-math">
        <title>Variables for HTML math</title>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              <literal>classoption</literal>
            </term>
            <listitem>
              <para>
                when using <literal>--katex</literal>, you can render
                display math equations flush left using
                <link linkend="layout">YAML metadata</link> or with
                <literal>-M classoption=fleqn</literal>.
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section xml:id="variables-for-html-slides">
        <title>Variables for HTML slides</title>
        <para>
          These affect HTML output when
          <link linkend="slide-shows">producing slide shows with
          pandoc</link>.
        </para>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              <literal>institute</literal>
            </term>
            <listitem>
              <para>
                author affiliations: can be a list when there are
                multiple authors
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>revealjs-url</literal>
            </term>
            <listitem>
              <para>
                base URL for reveal.js documents (defaults to
                <literal>https://unpkg.com/reveal.js@^5</literal>)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>s5-url</literal>
            </term>
            <listitem>
              <para>
                base URL for S5 documents (defaults to
                <literal>s5/default</literal>)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>slidy-url</literal>
            </term>
            <listitem>
              <para>
                base URL for Slidy documents (defaults to
                <literal>https://www.w3.org/Talks/Tools/Slidy2</literal>)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>slideous-url</literal>
            </term>
            <listitem>
              <para>
                base URL for Slideous documents (defaults to
                <literal>slideous</literal>)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>title-slide-attributes</literal>
            </term>
            <listitem>
              <para>
                additional attributes for the title slide of reveal.js
                slide shows. See
                <link linkend="background-in-reveal.js-beamer-and-pptx">background
                in reveal.js, beamer, and pptx</link> for an example.
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
        <para>
          All <link xlink:href="https://revealjs.com/config/">reveal.js
          configuration options</link> are available as variables. To
          turn off boolean flags that default to true in reveal.js, use
          <literal>0</literal>.
        </para>
      </section>
      <section xml:id="variables-for-beamer-slides">
        <title>Variables for Beamer slides</title>
        <para>
          These variables change the appearance of PDF slides using
          <link xlink:href="https://ctan.org/pkg/beamer"><literal>beamer</literal></link>.
        </para>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              <literal>aspectratio</literal>
            </term>
            <listitem>
              <para>
                slide aspect ratio (<literal>43</literal> for 4:3
                [default], <literal>169</literal> for 16:9,
                <literal>1610</literal> for 16:10,
                <literal>149</literal> for 14:9, <literal>141</literal>
                for 1.41:1, <literal>54</literal> for 5:4,
                <literal>32</literal> for 3:2)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>beameroption</literal>
            </term>
            <listitem>
              <para>
                add extra beamer option with
                <literal>\setbeameroption{}</literal>
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>institute</literal>
            </term>
            <listitem>
              <para>
                author affiliations: can be a list when there are
                multiple authors
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>logo</literal>
            </term>
            <listitem>
              <para>
                logo image for slides
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>navigation</literal>
            </term>
            <listitem>
              <para>
                controls navigation symbols (default is
                <literal>empty</literal> for no navigation symbols;
                other valid values are <literal>frame</literal>,
                <literal>vertical</literal>, and
                <literal>horizontal</literal>)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>section-titles</literal>
            </term>
            <listitem>
              <para>
                enables <quote>title pages</quote> for new sections
                (default is true)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>theme</literal>, <literal>colortheme</literal>,
              <literal>fonttheme</literal>,
              <literal>innertheme</literal>,
              <literal>outertheme</literal>
            </term>
            <listitem>
              <para>
                beamer themes
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>themeoptions</literal>,
              <literal>colorthemeoptions</literal>,
              <literal>fontthemeoptions</literal>,
              <literal>innerthemeoptions</literal>,
              <literal>outerthemeoptions</literal>
            </term>
            <listitem>
              <para>
                options for LaTeX beamer themes (lists)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>titlegraphic</literal>
            </term>
            <listitem>
              <para>
                image for title slide: can be a list
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>titlegraphicoptions</literal>
            </term>
            <listitem>
              <para>
                options for title slide image
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>shorttitle</literal>,
              <literal>shortsubtitle</literal>,
              <literal>shortauthor</literal>,
              <literal>shortinstitute</literal>,
              <literal>shortdate</literal>
            </term>
            <listitem>
              <para>
                some beamer themes use short versions of the title,
                subtitle, author, institute, date
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section xml:id="variables-for-powerpoint">
        <title>Variables for PowerPoint</title>
        <para>
          These variables control the visual aspects of a slide show
          that are not easily controlled via templates.
        </para>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              <literal>monofont</literal>
            </term>
            <listitem>
              <para>
                font to use for code.
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section xml:id="variables-for-latex">
        <title>Variables for LaTeX</title>
        <para>
          Pandoc uses these variables when
          <link linkend="creating-a-pdf">creating a PDF</link> with a
          LaTeX engine.
        </para>
        <section xml:id="layout">
          <title>Layout</title>
          <variablelist spacing="compact">
            <varlistentry>
              <term>
                <literal>block-headings</literal>
              </term>
              <listitem>
                <para>
                  make <literal>\paragraph</literal> and
                  <literal>\subparagraph</literal> (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
                  <literal>\subsubsection</literal> (third- or
                  fourth-level headings). Instead of using this option,
                  <link xlink:href="https://ctan.org/pkg/koma-script">KOMA-Script</link>
                  can adjust headings more extensively:
                </para>
                <programlisting>
---
documentclass: scrartcl
header-includes: |
  \RedeclareSectionCommand[
    beforeskip=-10pt plus -2pt minus -1pt,
    afterskip=1sp plus -1sp minus 1sp,
    font=\normalfont\itshape]{paragraph}
  \RedeclareSectionCommand[
    beforeskip=-10pt plus -2pt minus -1pt,
    afterskip=1sp plus -1sp minus 1sp,
    font=\normalfont\scshape,
    indent=0pt]{subparagraph}
...
</programlisting>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>classoption</literal>
              </term>
              <listitem>
                <para>
                  option for document class,
                  e.g. <literal>oneside</literal>; repeat for multiple
                  options:
                </para>
                <programlisting>
---
classoption:
- twocolumn
- landscape
...
</programlisting>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>documentclass</literal>
              </term>
              <listitem>
                <para>
                  document class: usually one of the standard classes,
                  <link xlink:href="https://ctan.org/pkg/article"><literal>article</literal></link>,
                  <link xlink:href="https://ctan.org/pkg/book"><literal>book</literal></link>,
                  and
                  <link xlink:href="https://ctan.org/pkg/report"><literal>report</literal></link>;
                  the
                  <link xlink:href="https://ctan.org/pkg/koma-script">KOMA-Script</link>
                  equivalents, <literal>scrartcl</literal>,
                  <literal>scrbook</literal>, and
                  <literal>scrreprt</literal>, which default to smaller
                  margins; or
                  <link xlink:href="https://ctan.org/pkg/memoir"><literal>memoir</literal></link>
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>geometry</literal>
              </term>
              <listitem>
                <para>
                  option for
                  <link xlink:href="https://ctan.org/pkg/geometry"><literal>geometry</literal></link>
                  package, e.g. <literal>margin=1in</literal>; repeat
                  for multiple options:
                </para>
                <programlisting>
---
geometry:
- top=30mm
- left=20mm
- heightrounded
...
</programlisting>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>shorthands</literal>
              </term>
              <listitem>
                <para>
                  Enable language-specific shorthands when loading
                  <literal>babel</literal>. (By default, pandoc includes
                  <literal>shorthands=off</literal> when loading
                  <literal>babel</literal>, disabling language-specific
                  shorthands.)
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>hyperrefoptions</literal>
              </term>
              <listitem>
                <para>
                  option for
                  <link xlink:href="https://ctan.org/pkg/hyperref"><literal>hyperref</literal></link>
                  package, e.g. <literal>linktoc=all</literal>; repeat
                  for multiple options:
                </para>
                <programlisting>
---
hyperrefoptions:
- linktoc=all
- pdfwindowui
- pdfpagemode=FullScreen
...
</programlisting>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>indent</literal>
              </term>
              <listitem>
                <para>
                  if true, pandoc will use document class settings for
                  indentation (the default LaTeX template otherwise
                  removes indentation and adds space between paragraphs)
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>linestretch</literal>
              </term>
              <listitem>
                <para>
                  adjusts line spacing using the
                  <link xlink:href="https://ctan.org/pkg/setspace"><literal>setspace</literal></link>
                  package, e.g. <literal>1.25</literal>,
                  <literal>1.5</literal>
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>margin-left</literal>,
                <literal>margin-right</literal>,
                <literal>margin-top</literal>,
                <literal>margin-bottom</literal>
              </term>
              <listitem>
                <para>
                  sets margins if <literal>geometry</literal> is not
                  used (otherwise <literal>geometry</literal> overrides
                  these)
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>pagestyle</literal>
              </term>
              <listitem>
                <para>
                  control <literal>\pagestyle{}</literal>: the default
                  article class supports <literal>plain</literal>
                  (default), <literal>empty</literal> (no running heads
                  or page numbers), and <literal>headings</literal>
                  (section titles in running heads)
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>papersize</literal>
              </term>
              <listitem>
                <para>
                  paper size, e.g. <literal>letter</literal>,
                  <literal>a4</literal>
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>secnumdepth</literal>
              </term>
              <listitem>
                <para>
                  numbering depth for sections (with
                  <literal>--number-sections</literal> option or
                  <literal>numbersections</literal> variable)
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>beamerarticle</literal>
              </term>
              <listitem>
                <para>
                  produce an article from Beamer slides. Note: if you
                  set this variable, you must specify the beamer writer
                  but use the default <emphasis>LaTeX</emphasis>
                  template: for example,
                  <literal>pandoc -Vbeamerarticle -t beamer --template default.latex</literal>.
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>handout</literal>
              </term>
              <listitem>
                <para>
                  produce a handout version of Beamer slides (with
                  overlays condensed into single slides)
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>csquotes</literal>
              </term>
              <listitem>
                <para>
                  load <literal>csquotes</literal> package and use
                  <literal>\enquote</literal> or
                  <literal>\enquote*</literal> for quoted text.
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>csquotesoptions</literal>
              </term>
              <listitem>
                <para>
                  options to use for <literal>csquotes</literal> package
                  (repeat for multiple options).
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>babeloptions</literal>
              </term>
              <listitem>
                <para>
                  options to pass to the babel package (may be repeated
                  for multiple options). This defaults to
                  <literal>provide=*</literal> if the main language
                  isn’t a European language written with Latin or
                  Cyrillic script or Vietnamese. Most users will not
                  need to adjust the default setting.
                </para>
              </listitem>
            </varlistentry>
          </variablelist>
        </section>
        <section xml:id="fonts">
          <title>Fonts</title>
          <variablelist spacing="compact">
            <varlistentry>
              <term>
                <literal>fontenc</literal>
              </term>
              <listitem>
                <para>
                  allows font encoding to be specified through
                  <literal>fontenc</literal> package (with
                  <literal>pdflatex</literal>); default is
                  <literal>T1</literal> (see
                  <link xlink:href="https://ctan.org/pkg/encguide">LaTeX
                  font encodings guide</link>)
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>fontfamily</literal>
              </term>
              <listitem>
                <para>
                  font package for use with <literal>pdflatex</literal>:
                  <link xlink:href="https://www.tug.org/texlive/">TeX
                  Live</link> includes many options, documented in the
                  <link xlink:href="https://tug.org/FontCatalogue/">LaTeX
                  Font Catalogue</link>. The default is
                  <link xlink:href="https://ctan.org/pkg/lm">Latin
                  Modern</link>.
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>fontfamilyoptions</literal>
              </term>
              <listitem>
                <para>
                  options for package used as
                  <literal>fontfamily</literal>; repeat for multiple
                  options. For example, to use the Libertine font with
                  proportional lowercase (old-style) figures through the
                  <link xlink:href="https://ctan.org/pkg/libertinus"><literal>libertinus</literal></link>
                  package:
                </para>
                <programlisting>
---
fontfamily: libertinus
fontfamilyoptions:
- osf
- p
...
</programlisting>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>fontsize</literal>
              </term>
              <listitem>
                <para>
                  font size for body text. The standard classes allow
                  10pt, 11pt, and 12pt. To use another size, set
                  <literal>documentclass</literal> to one of the
                  <link xlink:href="https://ctan.org/pkg/koma-script">KOMA-Script</link>
                  classes, such as <literal>scrartcl</literal> or
                  <literal>scrbook</literal>.
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>mainfont</literal>,
                <literal>sansfont</literal>,
                <literal>monofont</literal>,
                <literal>mathfont</literal>,
                <literal>CJKmainfont</literal>,
                <literal>CJKsansfont</literal>,
                <literal>CJKmonofont</literal>
              </term>
              <listitem>
                <para>
                  font families for use with <literal>xelatex</literal>
                  or <literal>lualatex</literal>: take the name of any
                  system font, using the
                  <link xlink:href="https://ctan.org/pkg/fontspec"><literal>fontspec</literal></link>
                  package. <literal>CJKmainfont</literal> uses the
                  <link xlink:href="https://ctan.org/pkg/xecjk"><literal>xecjk</literal></link>
                  package if <literal>xelatex</literal> is used, or the
                  <link xlink:href="https://ctan.org/pkg/luatexja"><literal>luatexja</literal></link>
                  package if <literal>lualatex</literal> is used.
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>mainfontoptions</literal>,
                <literal>sansfontoptions</literal>,
                <literal>monofontoptions</literal>,
                <literal>mathfontoptions</literal>,
                <literal>CJKoptions</literal>,
                <literal>luatexjapresetoptions</literal>
              </term>
              <listitem>
                <para>
                  options to use with <literal>mainfont</literal>,
                  <literal>sansfont</literal>,
                  <literal>monofont</literal>,
                  <literal>mathfont</literal>,
                  <literal>CJKmainfont</literal> in
                  <literal>xelatex</literal> and
                  <literal>lualatex</literal>. Allow for any choices
                  available through
                  <link xlink:href="https://ctan.org/pkg/fontspec"><literal>fontspec</literal></link>;
                  repeat for multiple options. For example, to use the
                  <link xlink:href="http://www.gust.org.pl/projects/e-foundry/tex-gyre">TeX
                  Gyre</link> version of Palatino with lowercase
                  figures:
                </para>
                <programlisting>
---
mainfont: TeX Gyre Pagella
mainfontoptions:
- Numbers=Lowercase
- Numbers=Proportional
...
</programlisting>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>mainfontfallback</literal>,
                <literal>sansfontfallback</literal>,
                <literal>monofontfallback</literal>
              </term>
              <listitem>
                <para>
                  fonts to try if a glyph isn’t found in
                  <literal>mainfont</literal>,
                  <literal>sansfont</literal>, or
                  <literal>monofont</literal> respectively. These are
                  lists. The font name must be followed by a colon and
                  optionally a set of options, for example:
                </para>
                <programlisting>
---
mainfontfallback:
  - &quot;FreeSans:&quot;
  - &quot;NotoColorEmoji:mode=harf&quot;
...
</programlisting>
                <para>
                  Font fallbacks currently only work with
                  <literal>lualatex</literal>.
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>babelfonts</literal>
              </term>
              <listitem>
                <para>
                  a map of Babel language names
                  (e.g. <literal>chinese</literal>) to the font to be
                  used with the language:
                </para>
                <programlisting>
---
babelfonts:
  chinese-hant: &quot;Noto Serif CJK TC&quot;
  russian: &quot;Noto Serif&quot;
...
</programlisting>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>microtypeoptions</literal>
              </term>
              <listitem>
                <para>
                  options to pass to the microtype package
                </para>
              </listitem>
            </varlistentry>
          </variablelist>
        </section>
        <section xml:id="links">
          <title>Links</title>
          <variablelist spacing="compact">
            <varlistentry>
              <term>
                <literal>colorlinks</literal>
              </term>
              <listitem>
                <para>
                  add color to link text; automatically enabled if any
                  of <literal>linkcolor</literal>,
                  <literal>filecolor</literal>,
                  <literal>citecolor</literal>,
                  <literal>urlcolor</literal>, or
                  <literal>toccolor</literal> are set
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>boxlinks</literal>
              </term>
              <listitem>
                <para>
                  add visible box around links (has no effect if
                  <literal>colorlinks</literal> is set)
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>linkcolor</literal>,
                <literal>filecolor</literal>,
                <literal>citecolor</literal>,
                <literal>urlcolor</literal>, <literal>toccolor</literal>
              </term>
              <listitem>
                <para>
                  color for internal links, external links, citation
                  links, linked URLs, and links in table of contents,
                  respectively: uses options allowed by
                  <link xlink:href="https://ctan.org/pkg/xcolor"><literal>xcolor</literal></link>,
                  including the <literal>dvipsnames</literal>,
                  <literal>svgnames</literal>, and
                  <literal>x11names</literal> lists
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>links-as-notes</literal>
              </term>
              <listitem>
                <para>
                  causes links to be printed as footnotes
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>urlstyle</literal>
              </term>
              <listitem>
                <para>
                  style for URLs (e.g., <literal>tt</literal>,
                  <literal>rm</literal>, <literal>sf</literal>, and, the
                  default, <literal>same</literal>)
                </para>
              </listitem>
            </varlistentry>
          </variablelist>
        </section>
        <section xml:id="front-matter">
          <title>Front matter</title>
          <variablelist spacing="compact">
            <varlistentry>
              <term>
                <literal>lof</literal>, <literal>lot</literal>
              </term>
              <listitem>
                <para>
                  include list of figures, list of tables (can also be
                  set using <literal>--lof/--list-of-figures</literal>,
                  <literal>--lot/--list-of-tables</literal>)
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>thanks</literal>
              </term>
              <listitem>
                <para>
                  contents of acknowledgments footnote after document
                  title
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>toc</literal>
              </term>
              <listitem>
                <para>
                  include table of contents (can also be set using
                  <literal>--toc/--table-of-contents</literal>)
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>toc-depth</literal>
              </term>
              <listitem>
                <para>
                  level of section to include in table of contents
                </para>
              </listitem>
            </varlistentry>
          </variablelist>
        </section>
        <section xml:id="biblatex-bibliographies">
          <title>BibLaTeX Bibliographies</title>
          <para>
            These variables function when using BibLaTeX for
            <link linkend="citation-rendering">citation
            rendering</link>.
          </para>
          <variablelist spacing="compact">
            <varlistentry>
              <term>
                <literal>biblatexoptions</literal>
              </term>
              <listitem>
                <para>
                  list of options for biblatex
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>biblio-style</literal>
              </term>
              <listitem>
                <para>
                  bibliography style, when used with
                  <literal>--natbib</literal> and
                  <literal>--biblatex</literal>
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>biblio-title</literal>
              </term>
              <listitem>
                <para>
                  bibliography title, when used with
                  <literal>--natbib</literal> and
                  <literal>--biblatex</literal>
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>bibliography</literal>
              </term>
              <listitem>
                <para>
                  bibliography to use for resolving references
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                <literal>natbiboptions</literal>
              </term>
              <listitem>
                <para>
                  list of options for natbib
                </para>
              </listitem>
            </varlistentry>
          </variablelist>
        </section>
        <section xml:id="other">
          <title>Other</title>
          <variablelist spacing="compact">
            <varlistentry>
              <term>
                <literal>pdf-trailer-id</literal>
              </term>
              <listitem>
                <para>
                  the PDF trailer ID; must be two PDF byte strings if
                  set, conventionally with 16 bytes each. E.g.,
                  <literal>&lt;00112233445566778899aabbccddeeff&gt; &lt;00112233445566778899aabbccddeeff&gt;</literal>.
                </para>
                <para>
                  See the section on
                  <link linkend="reproducible-builds">reproducible
                  builds</link>.
                </para>
              </listitem>
            </varlistentry>
          </variablelist>
        </section>
      </section>
      <section xml:id="variables-for-context">
        <title>Variables for ConTeXt</title>
        <para>
          Pandoc uses these variables when
          <link linkend="creating-a-pdf">creating a PDF</link> with
          ConTeXt.
        </para>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              <literal>fontsize</literal>
            </term>
            <listitem>
              <para>
                font size for body text (e.g. <literal>10pt</literal>,
                <literal>12pt</literal>)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>headertext</literal>,
              <literal>footertext</literal>
            </term>
            <listitem>
              <para>
                text to be placed in running header or footer (see
                <link xlink:href="https://wiki.contextgarden.net/Document_layout_and_layers/Headers_and_footers">ConTeXt
                Headers and Footers</link>); repeat up to four times for
                different placement
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>indenting</literal>
            </term>
            <listitem>
              <para>
                controls indentation of paragraphs,
                e.g. <literal>yes,small,next</literal> (see
                <link xlink:href="https://wiki.contextgarden.net/Text_blocks/Typography/Indentation">ConTeXt
                Indentation</link>); repeat for multiple options
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>interlinespace</literal>
            </term>
            <listitem>
              <para>
                adjusts line spacing, e.g. <literal>4ex</literal> (using
                <link xlink:href="https://wiki.contextgarden.net/Command/setupinterlinespace"><literal>setupinterlinespace</literal></link>);
                repeat for multiple options
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>layout</literal>
            </term>
            <listitem>
              <para>
                options for page margins and text arrangement (see
                <link xlink:href="https://wiki.contextgarden.net/Document_layout_and_layers/Tutorials">ConTeXt
                Layout</link>); repeat for multiple options
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>linkcolor</literal>,
              <literal>contrastcolor</literal>
            </term>
            <listitem>
              <para>
                color for links outside and inside a page,
                e.g. <literal>red</literal>, <literal>blue</literal>
                (see
                <link xlink:href="https://wiki.contextgarden.net/Color">ConTeXt
                Color</link>)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>linkstyle</literal>
            </term>
            <listitem>
              <para>
                typeface style for links,
                e.g. <literal>normal</literal>, <literal>bold</literal>,
                <literal>slanted</literal>,
                <literal>boldslanted</literal>, <literal>type</literal>,
                <literal>cap</literal>, <literal>small</literal>
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>lof</literal>, <literal>lot</literal>
            </term>
            <listitem>
              <para>
                include list of figures, list of tables
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>mainfont</literal>, <literal>sansfont</literal>,
              <literal>monofont</literal>, <literal>mathfont</literal>
            </term>
            <listitem>
              <para>
                font families: take the name of any system font (see
                <link xlink:href="https://wiki.contextgarden.net/Characters_words_and_fonts/Tutorials">ConTeXt
                Font Switching</link>)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>mainfontfallback</literal>,
              <literal>sansfontfallback</literal>,
              <literal>monofontfallback</literal>
            </term>
            <listitem>
              <para>
                list of fonts to try, in order, if a glyph is not found
                in the main font. Use
                <literal>\definefallbackfamily</literal>-compatible font
                name syntax. Emoji fonts are unsupported.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>margin-left</literal>,
              <literal>margin-right</literal>,
              <literal>margin-top</literal>,
              <literal>margin-bottom</literal>
            </term>
            <listitem>
              <para>
                sets margins, if <literal>layout</literal> is not used
                (otherwise <literal>layout</literal> overrides these)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>pagenumbering</literal>
            </term>
            <listitem>
              <para>
                page number style and location (using
                <link xlink:href="https://wiki.contextgarden.net/Command/setuppagenumbering"><literal>setuppagenumbering</literal></link>);
                repeat for multiple options
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>papersize</literal>
            </term>
            <listitem>
              <para>
                paper size, e.g. <literal>letter</literal>,
                <literal>A4</literal>, <literal>landscape</literal> (see
                <link xlink:href="https://wiki.contextgarden.net/Document_layout_and_layers/Paper_setup">ConTeXt
                Paper Setup</link>); repeat for multiple options
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>pdfa</literal>
            </term>
            <listitem>
              <para>
                adds to the preamble the setup necessary to generate
                PDF/A of the type specified,
                e.g. <literal>1a:2005</literal>, <literal>2a</literal>.
                If no type is specified (i.e. the value is set to True,
                by e.g. <literal>--metadata=pdfa</literal> or
                <literal>pdfa: true</literal> in a YAML metadata block),
                <literal>1b:2005</literal> will be used as default, for
                reasons of backwards compatibility. Using
                <literal>--variable=pdfa</literal> 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
                <literal>pdfaiccprofile</literal> and
                <literal>pdfaintent</literal>. See also
                <link xlink:href="https://wiki.contextgarden.net/Input_and_compilation/PDF/PDFA">ConTeXt
                PDFA</link> for more details.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>pdfaiccprofile</literal>
            </term>
            <listitem>
              <para>
                when used in conjunction with <literal>pdfa</literal>,
                specifies the ICC profile to use in the PDF,
                e.g. <literal>default.cmyk</literal>. If left
                unspecified, <literal>sRGB.icc</literal> 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
                <link xlink:href="https://wiki.contextgarden.net/Input_and_compilation/PDF/PDFX#ICC_profiles">ConTeXt
                ICC Profiles</link>.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>pdfaintent</literal>
            </term>
            <listitem>
              <para>
                when used in conjunction with <literal>pdfa</literal>,
                specifies the output intent for the colors,
                e.g. <literal>ISO coated v2 300\letterpercent\space (ECI)</literal>
                If left unspecified,
                <literal>sRGB IEC61966-2.1</literal> is used as default.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>toc</literal>
            </term>
            <listitem>
              <para>
                include table of contents (can also be set using
                <literal>--toc/--table-of-contents</literal>)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>urlstyle</literal>
            </term>
            <listitem>
              <para>
                typeface style for links without link text,
                e.g. <literal>normal</literal>, <literal>bold</literal>,
                <literal>slanted</literal>,
                <literal>boldslanted</literal>, <literal>type</literal>,
                <literal>cap</literal>, <literal>small</literal>
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>whitespace</literal>
            </term>
            <listitem>
              <para>
                spacing between paragraphs,
                e.g. <literal>none</literal>, <literal>small</literal>
                (using
                <link xlink:href="https://wiki.contextgarden.net/Command/setupwhitespace"><literal>setupwhitespace</literal></link>)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>includesource</literal>
            </term>
            <listitem>
              <para>
                include all source documents as file attachments in the
                PDF file
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section xml:id="variables-for-wkhtmltopdf">
        <title>Variables for <literal>wkhtmltopdf</literal></title>
        <para>
          Pandoc uses these variables when
          <link linkend="creating-a-pdf">creating a PDF</link> with
          <link xlink:href="https://wkhtmltopdf.org"><literal>wkhtmltopdf</literal></link>.
          The <literal>--css</literal> option also affects the output.
        </para>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              <literal>footer-html</literal>,
              <literal>header-html</literal>
            </term>
            <listitem>
              <para>
                add information to the header and footer
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>margin-left</literal>,
              <literal>margin-right</literal>,
              <literal>margin-top</literal>,
              <literal>margin-bottom</literal>
            </term>
            <listitem>
              <para>
                set the page margins
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>papersize</literal>
            </term>
            <listitem>
              <para>
                sets the PDF paper size
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section xml:id="variables-for-man-pages">
        <title>Variables for man pages</title>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              <literal>adjusting</literal>
            </term>
            <listitem>
              <para>
                adjusts text to left (<literal>l</literal>), right
                (<literal>r</literal>), center (<literal>c</literal>),
                or both (<literal>b</literal>) margins
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>footer</literal>
            </term>
            <listitem>
              <para>
                footer in man pages
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>header</literal>
            </term>
            <listitem>
              <para>
                header in man pages
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>section</literal>
            </term>
            <listitem>
              <para>
                section number in man pages
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section xml:id="variables-for-texinfo">
        <title>Variables for Texinfo</title>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              <literal>version</literal>
            </term>
            <listitem>
              <para>
                version of software (used in title and title page)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>filename</literal>
            </term>
            <listitem>
              <para>
                name of info file to be generated (defaults to a name
                based on the texi filename)
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section xml:id="variables-for-typst">
        <title>Variables for Typst</title>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              <literal>template</literal>
            </term>
            <listitem>
              <para>
                Typst template to use (relative path only).
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>margin</literal>
            </term>
            <listitem>
              <para>
                A dictionary with the fields defined in the Typst
                documentation: <literal>x</literal>,
                <literal>y</literal>, <literal>top</literal>,
                <literal>bottom</literal>, <literal>left</literal>,
                <literal>right</literal>.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>papersize</literal>
            </term>
            <listitem>
              <para>
                Paper size: <literal>a4</literal>,
                <literal>us-letter</literal>, etc.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>mainfont</literal>
            </term>
            <listitem>
              <para>
                Name of system font to use for the main font.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>fontsize</literal>
            </term>
            <listitem>
              <para>
                Font size (e.g., <literal>12pt</literal>).
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>section-numbering</literal>
            </term>
            <listitem>
              <para>
                Schema to use for numbering sections,
                e.g. <literal>1.A.1</literal>.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>page-numbering</literal>
            </term>
            <listitem>
              <para>
                Schema to use for numbering pages,
                e.g. <literal>1</literal> or <literal>i</literal>, or an
                empty string to omit page numbering.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>columns</literal>
            </term>
            <listitem>
              <para>
                Number of columns for body text.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>thanks</literal>
            </term>
            <listitem>
              <para>
                contents of acknowledgments footnote after document
                title
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>mathfont</literal>, <literal>codefont</literal>
            </term>
            <listitem>
              <para>
                Name of system font to use for math and code,
                respectively.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>linestretch</literal>
            </term>
            <listitem>
              <para>
                adjusts line spacing, e.g. <literal>1.25</literal>,
                <literal>1.5</literal>
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>linkcolor</literal>,
              <literal>filecolor</literal>, <literal>citecolor</literal>
            </term>
            <listitem>
              <para>
                color for external links, internal links, and citation
                links, respectively: expects a hexadecimal color code
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section xml:id="variables-for-ms">
        <title>Variables for ms</title>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              <literal>fontfamily</literal>
            </term>
            <listitem>
              <para>
                <literal>A</literal> (Avant Garde), <literal>B</literal>
                (Bookman), <literal>C</literal> (Helvetica),
                <literal>HN</literal> (Helvetica Narrow),
                <literal>P</literal> (Palatino), or <literal>T</literal>
                (Times New Roman). This setting does not affect source
                code, which is always displayed using monospace Courier.
                These built-in fonts are limited in their coverage of
                characters. Additional fonts may be installed using the
                script
                <link xlink:href="https://www.schaffter.ca/mom/bin/install-font.sh"><literal>install-font.sh</literal></link>
                provided by Peter Schaffter and documented in detail on
                <link xlink:href="https://www.schaffter.ca/mom/momdoc/appendices.html#steps">his
                web site</link>.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>indent</literal>
            </term>
            <listitem>
              <para>
                paragraph indent (e.g. <literal>2m</literal>)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>lineheight</literal>
            </term>
            <listitem>
              <para>
                line height (e.g. <literal>12p</literal>)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>pointsize</literal>
            </term>
            <listitem>
              <para>
                point size (e.g. <literal>10p</literal>)
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section xml:id="variables-set-automatically">
        <title>Variables set automatically</title>
        <para>
          Pandoc sets these variables automatically in response to
          <link linkend="options">options</link> or document contents;
          users can also modify them. These vary depending on the output
          format, and include the following:
        </para>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              <literal>body</literal>
            </term>
            <listitem>
              <para>
                body of document
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>date-meta</literal>
            </term>
            <listitem>
              <para>
                the <literal>date</literal> 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
                <literal>date</literal> are:
                <literal>mm/dd/yyyy</literal>,
                <literal>mm/dd/yy</literal>,
                <literal>yyyy-mm-dd</literal> (ISO 8601),
                <literal>dd MM yyyy</literal> (e.g. either
                <literal>02 Apr 2018</literal> or
                <literal>02 April 2018</literal>),
                <literal>MM dd, yyyy</literal>
                (e.g. <literal>Apr. 02, 2018</literal> or
                <literal>April 02, 2018),</literal>yyyy[mm[dd]]<literal>(e.g.</literal>20180402,
                <literal>201804</literal> or <literal>2018</literal>).
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>header-includes</literal>
            </term>
            <listitem>
              <para>
                contents specified by
                <literal>-H/--include-in-header</literal> (may have
                multiple values)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>include-before</literal>
            </term>
            <listitem>
              <para>
                contents specified by
                <literal>-B/--include-before-body</literal> (may have
                multiple values)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>include-after</literal>
            </term>
            <listitem>
              <para>
                contents specified by
                <literal>-A/--include-after-body</literal> (may have
                multiple values)
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>meta-json</literal>
            </term>
            <listitem>
              <para>
                JSON representation of all of the document’s metadata.
                Field values are transformed to the selected output
                format.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>numbersections</literal>
            </term>
            <listitem>
              <para>
                non-null value if
                <literal>-N/--number-sections</literal> was specified
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>sourcefile</literal>,
              <literal>outputfile</literal>
            </term>
            <listitem>
              <para>
                source and destination filenames, as given on the
                command line. <literal>sourcefile</literal> 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:
              </para>
              <programlisting>
$if(sourcefile)$
$for(sourcefile)$
$sourcefile$
$endfor$
$else$
(stdin)
$endif$
</programlisting>
              <para>
                Similarly, <literal>outputfile</literal> can be
                <literal>-</literal> if output goes to the terminal.
              </para>
              <para>
                If you need absolute paths, use
                e.g. <literal>$curdir$/$sourcefile$</literal>.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>pdf-engine</literal>
            </term>
            <listitem>
              <para>
                name of PDF engine if provided using
                <literal>--pdf-engine</literal>, or the default engine
                for the format if PDF output is requested.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>curdir</literal>
            </term>
            <listitem>
              <para>
                working directory from which pandoc is run.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>pandoc-version</literal>
            </term>
            <listitem>
              <para>
                pandoc version.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>toc</literal>
            </term>
            <listitem>
              <para>
                non-null value if
                <literal>--toc/--table-of-contents</literal> was
                specified
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              <literal>toc-title</literal>
            </term>
            <listitem>
              <para>
                title of table of contents (works only with EPUB, HTML,
                revealjs, opendocument, odt, docx, pptx, beamer, LaTeX).
                Note that in docx and pptx a custom
                <literal>toc-title</literal> will be picked up from
                metadata, but cannot be set as a variable.
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
    </section>
  </section>
  <section xml:id="extensions">
    <title>Extensions</title>
    <para>
      The behavior of some of the readers and writers can be adjusted by
      enabling or disabling various extensions.
    </para>
    <para>
      An extension can be enabled by adding
      <literal>+EXTENSION</literal> to the format name and disabled by
      adding <literal>-EXTENSION</literal>. For example,
      <literal>--from markdown_strict+footnotes</literal> is strict
      Markdown with footnotes enabled, while
      <literal>--from markdown-footnotes-pipe_tables</literal> is
      pandoc’s Markdown without footnotes or pipe tables.
    </para>
    <para>
      The Markdown reader and writer make by far the most use of
      extensions. Extensions only used by them are therefore covered in
      the section <link linkend="pandocs-markdown">Pandoc’s
      Markdown</link> below (see
      <link linkend="markdown-variants">Markdown variants</link> for
      <literal>commonmark</literal> and <literal>gfm</literal>). In the
      following, extensions that also work for other formats are
      covered.
    </para>
    <para>
      Note that Markdown extensions added to the
      <literal>ipynb</literal> format affect Markdown cells in Jupyter
      notebooks (as do command-line options like
      <literal>--markdown-headings</literal>).
    </para>
    <section xml:id="typography">
      <title>Typography</title>
      <section xml:id="extension-smart">
        <title>Extension: <literal>smart</literal></title>
        <para>
          Interpret straight quotes as curly quotes,
          <literal>---</literal> as em-dashes, <literal>--</literal> as
          en-dashes, and <literal>...</literal> as ellipses. Nonbreaking
          spaces are inserted after certain abbreviations, such as
          <quote>Mr.</quote>
        </para>
        <para>
          This extension can be enabled/disabled for the following
          formats:
        </para>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              input formats
            </term>
            <listitem>
              <para>
                <literal>markdown</literal>,
                <literal>commonmark</literal>, <literal>latex</literal>,
                <literal>mediawiki</literal>, <literal>org</literal>,
                <literal>rst</literal>, <literal>twiki</literal>,
                <literal>html</literal>
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              output formats
            </term>
            <listitem>
              <para>
                <literal>markdown</literal>, <literal>latex</literal>,
                <literal>context</literal>, <literal>org</literal>,
                <literal>rst</literal>
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              enabled by default in
            </term>
            <listitem>
              <para>
                <literal>markdown</literal>, <literal>latex</literal>,
                <literal>context</literal> (both input and output)
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
        <para>
          Note: If you are <emphasis>writing</emphasis> Markdown, then
          the <literal>smart</literal> extension has the reverse effect:
          what would have been curly quotes comes out straight.
        </para>
        <para>
          In LaTeX, <literal>smart</literal> means to use the standard
          TeX ligatures for quotation marks (<literal>``</literal> and
          <literal>''</literal> for double quotes, <literal>`</literal>
          and <literal>'</literal> for single quotes) and dashes
          (<literal>--</literal> for en-dash and <literal>---</literal>
          for em-dash). If <literal>smart</literal> is disabled, then in
          reading LaTeX pandoc will parse these characters literally. In
          writing LaTeX, enabling <literal>smart</literal> tells pandoc
          to use the ligatures when possible; if
          <literal>smart</literal> is disabled pandoc will use unicode
          quotation mark and dash characters.
        </para>
      </section>
    </section>
    <section xml:id="headings-and-sections">
      <title>Headings and sections</title>
      <section xml:id="extension-auto_identifiers">
        <title>Extension: <literal>auto_identifiers</literal></title>
        <para>
          A heading without an explicitly specified identifier will be
          automatically assigned a unique identifier based on the
          heading text.
        </para>
        <para>
          This extension can be enabled/disabled for the following
          formats:
        </para>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              input formats
            </term>
            <listitem>
              <para>
                <literal>markdown</literal>, <literal>latex</literal>,
                <literal>rst</literal>, <literal>mediawiki</literal>,
                <literal>textile</literal>
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              output formats
            </term>
            <listitem>
              <para>
                <literal>markdown</literal>, <literal>muse</literal>
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              enabled by default in
            </term>
            <listitem>
              <para>
                <literal>markdown</literal>, <literal>muse</literal>
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
        <para>
          The default algorithm used to derive the identifier from the
          heading text is:
        </para>
        <itemizedlist spacing="compact">
          <listitem>
            <para>
              Remove all formatting, links, etc.
            </para>
          </listitem>
          <listitem>
            <para>
              Remove all footnotes.
            </para>
          </listitem>
          <listitem>
            <para>
              Remove all non-alphanumeric characters, except
              underscores, hyphens, and periods.
            </para>
          </listitem>
          <listitem>
            <para>
              Replace all spaces and newlines with hyphens.
            </para>
          </listitem>
          <listitem>
            <para>
              Convert all alphabetic characters to lowercase.
            </para>
          </listitem>
          <listitem>
            <para>
              Remove everything up to the first letter (identifiers may
              not begin with a number or punctuation mark).
            </para>
          </listitem>
          <listitem>
            <para>
              If nothing is left after this, use the identifier
              <literal>section</literal>.
            </para>
          </listitem>
        </itemizedlist>
        <para>
          Thus, for example,
        </para>
        <informaltable>
          <tgroup cols="2">
            <colspec align="left" />
            <colspec align="left" />
            <thead>
              <row>
                <entry>
                  Heading
                </entry>
                <entry>
                  Identifier
                </entry>
              </row>
            </thead>
            <tbody>
              <row>
                <entry>
                  <literal>Heading identifiers in HTML</literal>
                </entry>
                <entry>
                  <literal>heading-identifiers-in-html</literal>
                </entry>
              </row>
              <row>
                <entry>
                  <literal>Maître d'hôtel</literal>
                </entry>
                <entry>
                  <literal>maître-dhôtel</literal>
                </entry>
              </row>
              <row>
                <entry>
                  <literal>*Dogs*?--in *my* house?</literal>
                </entry>
                <entry>
                  <literal>dogs--in-my-house</literal>
                </entry>
              </row>
              <row>
                <entry>
                  <literal>[HTML], [S5], or [RTF]?</literal>
                </entry>
                <entry>
                  <literal>html-s5-or-rtf</literal>
                </entry>
              </row>
              <row>
                <entry>
                  <literal>3. Applications</literal>
                </entry>
                <entry>
                  <literal>applications</literal>
                </entry>
              </row>
              <row>
                <entry>
                  <literal>33</literal>
                </entry>
                <entry>
                  <literal>section</literal>
                </entry>
              </row>
            </tbody>
          </tgroup>
        </informaltable>
        <para>
          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 <literal>-1</literal> appended; the
          third with <literal>-2</literal>; and so on.
        </para>
        <para>
          (However, a different algorithm is used if
          <literal>gfm_auto_identifiers</literal> is enabled; see
          below.)
        </para>
        <para>
          These identifiers are used to provide link targets in the
          table of contents generated by the
          <literal>--toc|--table-of-contents</literal> 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:
        </para>
        <programlisting>
See the section on
[heading identifiers](#heading-identifiers-in-html-latex-and-context).
</programlisting>
        <para>
          Note, however, that this method of providing links to sections
          works only in HTML, LaTeX, and ConTeXt formats.
        </para>
        <para>
          If the <literal>--section-divs</literal> option is specified,
          then each section will be wrapped in a
          <literal>section</literal> (or a <literal>div</literal>, if
          <literal>html4</literal> was specified), and the identifier
          will be attached to the enclosing
          <literal>&lt;section&gt;</literal> (or
          <literal>&lt;div&gt;</literal>) tag rather than the heading
          itself. This allows entire sections to be manipulated using
          JavaScript or treated differently in CSS.
        </para>
      </section>
      <section xml:id="extension-ascii_identifiers">
        <title>Extension: <literal>ascii_identifiers</literal></title>
        <para>
          Causes the identifiers produced by
          <literal>auto_identifiers</literal> to be pure ASCII. Accents
          are stripped off of accented Latin letters, and non-Latin
          letters are omitted.
        </para>
      </section>
      <section xml:id="extension-gfm_auto_identifiers">
        <title>Extension:
        <literal>gfm_auto_identifiers</literal></title>
        <para>
          Changes the algorithm used by
          <literal>auto_identifiers</literal> to conform to GitHub’s
          method. Spaces are converted to dashes (<literal>-</literal>),
          uppercase characters to lowercase characters, and punctuation
          characters other than <literal>-</literal> and
          <literal>_</literal> are removed. Emojis are replaced by their
          names.
        </para>
      </section>
    </section>
    <section xml:id="math-input">
      <title>Math Input</title>
      <para>
        The extensions
        <link linkend="extension-tex_math_dollars"><literal>tex_math_dollars</literal></link>,
        <link linkend="extension-tex_math_gfm"><literal>tex_math_gfm</literal></link>,
        <link linkend="extension-tex_math_single_backslash"><literal>tex_math_single_backslash</literal></link>,
        and
        <link linkend="extension-tex_math_double_backslash"><literal>tex_math_double_backslash</literal></link>
        are described in the section about Pandoc’s Markdown.
      </para>
      <para>
        However, they can also be used with HTML input. This is handy
        for reading web pages formatted using MathJax, for example.
      </para>
    </section>
    <section xml:id="raw-htmltex">
      <title>Raw HTML/TeX</title>
      <para>
        The following extensions are described in more detail in their
        respective sections of <link linkend="pandocs-markdown">Pandoc’s
        Markdown</link>:
      </para>
      <itemizedlist>
        <listitem>
          <para>
            <link linkend="extension-raw_html"><literal>raw_html</literal></link>
            allows HTML elements which are not representable in pandoc’s
            AST to be parsed as raw HTML. By default, this is disabled
            for HTML input.
          </para>
        </listitem>
        <listitem>
          <para>
            <link linkend="extension-raw_tex"><literal>raw_tex</literal></link>
            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
            <literal>markdown</literal>):
          </para>
          <variablelist spacing="compact">
            <varlistentry>
              <term>
                input formats
              </term>
              <listitem>
                <para>
                  <literal>latex</literal>, <literal>textile</literal>,
                  <literal>html</literal> (environments,
                  <literal>\ref</literal>, and <literal>\eqref</literal>
                  only), <literal>ipynb</literal>
                </para>
              </listitem>
            </varlistentry>
            <varlistentry>
              <term>
                output formats
              </term>
              <listitem>
                <para>
                  <literal>textile</literal>,
                  <literal>commonmark</literal>
                </para>
              </listitem>
            </varlistentry>
          </variablelist>
          <para>
            Note: as applied to <literal>ipynb</literal>,
            <literal>raw_html</literal> and <literal>raw_tex</literal>
            affect not only raw TeX in Markdown cells, but data with
            mime type <literal>text/html</literal> in output cells.
            Since the <literal>ipynb</literal> reader attempts to
            preserve the richest possible outputs when several options
            are given, you will get best results if you disable
            <literal>raw_html</literal> and <literal>raw_tex</literal>
            when converting to formats like <literal>docx</literal>
            which don’t allow raw <literal>html</literal> or
            <literal>tex</literal>.
          </para>
        </listitem>
        <listitem>
          <para>
            <link linkend="extension-native_divs"><literal>native_divs</literal></link>
            causes HTML <literal>div</literal> elements to be parsed as
            native pandoc Div blocks. If you want them to be parsed as
            raw HTML, use
            <literal>-f html-native_divs+raw_html</literal>.
          </para>
        </listitem>
        <listitem>
          <para>
            <link linkend="extension-native_spans"><literal>native_spans</literal></link>
            causes HTML <literal>span</literal> elements to be parsed as
            native pandoc Span inlines. If you want them to be parsed as
            raw HTML, use
            <literal>-f html-native_spans+raw_html</literal>. If you
            want to drop all <literal>div</literal>s and
            <literal>span</literal>s when converting HTML to Markdown,
            you can use
            <literal>pandoc -f html-native_divs-native_spans -t markdown</literal>.
          </para>
        </listitem>
      </itemizedlist>
    </section>
    <section xml:id="literate-haskell-support">
      <title>Literate Haskell support</title>
      <section xml:id="extension-literate_haskell">
        <title>Extension: <literal>literate_haskell</literal></title>
        <para>
          Treat the document as literate Haskell source.
        </para>
        <para>
          This extension can be enabled/disabled for the following
          formats:
        </para>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              input formats
            </term>
            <listitem>
              <para>
                <literal>markdown</literal>, <literal>rst</literal>,
                <literal>latex</literal>
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              output formats
            </term>
            <listitem>
              <para>
                <literal>markdown</literal>, <literal>rst</literal>,
                <literal>latex</literal>, <literal>html</literal>
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
        <para>
          If you append <literal>+lhs</literal> (or
          <literal>+literate_haskell</literal>) to one of the formats
          above, pandoc will treat the document as literate Haskell
          source. This means that
        </para>
        <itemizedlist>
          <listitem>
            <para>
              In Markdown input, <quote>bird track</quote> sections will
              be parsed as Haskell code rather than block quotations.
              Text between <literal>\begin{code}</literal> and
              <literal>\end{code}</literal> will also be treated as
              Haskell code. For ATX-style headings the character
              <quote>=</quote> will be used instead of <quote>#</quote>.
            </para>
          </listitem>
          <listitem>
            <para>
              In Markdown output, code blocks with classes
              <literal>haskell</literal> and <literal>literate</literal>
              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
              <quote>#</quote> characters). (This is because ghc treats
              <quote>#</quote> characters in column 1 as introducing
              line numbers.)
            </para>
          </listitem>
          <listitem>
            <para>
              In restructured text input, <quote>bird track</quote>
              sections will be parsed as Haskell code.
            </para>
          </listitem>
          <listitem>
            <para>
              In restructured text output, code blocks with class
              <literal>haskell</literal> will be rendered using bird
              tracks.
            </para>
          </listitem>
          <listitem>
            <para>
              In LaTeX input, text in <literal>code</literal>
              environments will be parsed as Haskell code.
            </para>
          </listitem>
          <listitem>
            <para>
              In LaTeX output, code blocks with class
              <literal>haskell</literal> will be rendered inside
              <literal>code</literal> environments.
            </para>
          </listitem>
          <listitem>
            <para>
              In HTML output, code blocks with class
              <literal>haskell</literal> will be rendered with class
              <literal>literatehaskell</literal> and bird tracks.
            </para>
          </listitem>
        </itemizedlist>
        <para>
          Examples:
        </para>
        <programlisting>
pandoc -f markdown+lhs -t html
</programlisting>
        <para>
          reads literate Haskell source formatted with Markdown
          conventions and writes ordinary HTML (without bird tracks).
        </para>
        <programlisting>
pandoc -f markdown+lhs -t html+lhs
</programlisting>
        <para>
          writes HTML with the Haskell code in bird tracks, so it can be
          copied and pasted as literate Haskell source.
        </para>
        <para>
          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.
        </para>
      </section>
    </section>
    <section xml:id="other-extensions">
      <title>Other extensions</title>
      <section xml:id="extension-empty_paragraphs">
        <title>Extension: <literal>empty_paragraphs</literal></title>
        <para>
          Allows empty paragraphs. By default empty paragraphs are
          omitted.
        </para>
        <para>
          This extension can be enabled/disabled for the following
          formats:
        </para>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              input formats
            </term>
            <listitem>
              <para>
                <literal>docx</literal>, <literal>html</literal>
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              output formats
            </term>
            <listitem>
              <para>
                <literal>docx</literal>, <literal>odt</literal>,
                <literal>opendocument</literal>,
                <literal>html</literal>, <literal>latex</literal>
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section xml:id="extension-native_numbering">
        <title>Extension: <literal>native_numbering</literal></title>
        <para>
          Enables native numbering of figures and tables. Enumeration
          starts at 1.
        </para>
        <para>
          This extension can be enabled/disabled for the following
          formats:
        </para>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              output formats
            </term>
            <listitem>
              <para>
                <literal>odt</literal>, <literal>opendocument</literal>,
                <literal>docx</literal>
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section xml:id="extension-xrefs_name">
        <title>Extension: <literal>xrefs_name</literal></title>
        <para>
          Links to headings, figures and tables inside the document are
          substituted with cross-references that will use the name or
          caption of the referenced item. The original link text is
          replaced once the generated document is refreshed. This
          extension can be combined with <literal>xrefs_number</literal>
          in which case numbers will appear before the name.
        </para>
        <para>
          Text in cross-references is only made consistent with the
          referenced item once the document has been refreshed.
        </para>
        <para>
          This extension can be enabled/disabled for the following
          formats:
        </para>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              output formats
            </term>
            <listitem>
              <para>
                <literal>odt</literal>, <literal>opendocument</literal>
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section xml:id="extension-xrefs_number">
        <title>Extension: <literal>xrefs_number</literal></title>
        <para>
          Links to headings, figures and tables inside the document are
          substituted with cross-references that will use the number of
          the referenced item. The original link text is discarded. This
          extension can be combined with <literal>xrefs_name</literal>
          in which case the name or caption numbers will appear after
          the number.
        </para>
        <para>
          For the <literal>xrefs_number</literal> to be useful heading
          numbers must be enabled in the generated document, also table
          and figure captions must be enabled using for example the
          <literal>native_numbering</literal> extension.
        </para>
        <para>
          Numbers in cross-references are only visible in the final
          document once it has been refreshed.
        </para>
        <para>
          This extension can be enabled/disabled for the following
          formats:
        </para>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              output formats
            </term>
            <listitem>
              <para>
                <literal>odt</literal>, <literal>opendocument</literal>
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section xml:id="ext-styles">
        <title>Extension: <literal>styles</literal></title>
        <para>
          When converting from docx, add
          <literal>custom-styles</literal> attributes for all docx
          styles, regardless of whether pandoc understands the meanings
          of these styles. Because attributes cannot be added directly
          to paragraphs or text in the pandoc AST, paragraph styles will
          cause Divs to be created and character styles will cause Spans
          to be created to hold the attributes. (Table styles will be
          added to the Table elements directly.) This extension can be
          used with <link linkend="custom-styles">docx custom
          styles</link>.
        </para>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              input formats
            </term>
            <listitem>
              <para>
                <literal>docx</literal>
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
      <section xml:id="extension-amuse">
        <title>Extension: <literal>amuse</literal></title>
        <para>
          In the <literal>muse</literal> input format, this enables
          Text::Amuse extensions to Emacs Muse markup.
        </para>
      </section>
      <section xml:id="extension-raw_markdown">
        <title>Extension: <literal>raw_markdown</literal></title>
        <para>
          In the <literal>ipynb</literal> 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 targeting <literal>ipynb</literal> or a
          Markdown-based output format.
        </para>
      </section>
      <section xml:id="typst-citations">
        <title>Extension: <literal>citations</literal> (typst)</title>
        <para>
          When the <literal>citations</literal> extension is enabled in
          <literal>typst</literal> (as it is by default),
          <literal>typst</literal> citations will be parsed as native
          pandoc citations, and native pandoc citations will be rendered
          as <literal>typst</literal> citations.
        </para>
      </section>
      <section xml:id="org-citations">
        <title>Extension: <literal>citations</literal> (org)</title>
        <para>
          When the <literal>citations</literal> extension is enabled in
          <literal>org</literal>, org-cite and org-ref style citations
          will be parsed as native pandoc citations, and org-cite
          citations will be used to render native pandoc citations.
        </para>
      </section>
      <section xml:id="docx-citations">
        <title>Extension: <literal>citations</literal> (docx)</title>
        <para>
          When <literal>citations</literal> is enabled in
          <literal>docx</literal>, citations inserted by Zotero or
          Mendeley or EndNote plugins will be parsed as native pandoc
          citations. (Otherwise, the formatted citations generated by
          the bibliographic software will be parsed as regular text.)
        </para>
      </section>
      <section xml:id="org-fancy-lists">
        <title>Extension: <literal>fancy_lists</literal> (org)</title>
        <para>
          Some aspects of <link linkend="extension-fancy_lists">Pandoc’s
          Markdown fancy lists</link> are also accepted in
          <literal>org</literal> input, mimicking the option
          <literal>org-list-allow-alphabetical</literal> in Emacs. As in
          Org Mode, enabling this extension allows lowercase and
          uppercase alphabetical markers for ordered lists to be parsed
          in addition to arabic ones. Note that for Org, this does not
          include roman numerals or the <literal>#</literal> placeholder
          that are enabled by the extension in Pandoc’s Markdown.
        </para>
      </section>
      <section xml:id="extension-element_citations">
        <title>Extension: <literal>element_citations</literal></title>
        <para>
          In the <literal>jats</literal> output formats, this causes
          reference items to be replaced with
          <literal>&lt;element-citation&gt;</literal> elements. These
          elements are not influenced by CSL styles, but all information
          on the item is included in tags.
        </para>
      </section>
      <section xml:id="extension-ntb">
        <title>Extension: <literal>ntb</literal></title>
        <para>
          In the <literal>context</literal> output format this enables
          the use of
          <link xlink:href="https://wiki.contextgarden.net/TABLE">Natural
          Tables (TABLE)</link> instead of the default
          <link xlink:href="https://wiki.contextgarden.net/xtables">Extreme
          Tables (xtables)</link>. Natural tables allow more
          fine-grained global customization but come at a performance
          penalty compared to extreme tables.
        </para>
      </section>
      <section xml:id="extension-smart_quotes-org">
        <title>Extension: <literal>smart_quotes</literal> (org)</title>
        <para>
          Interpret straight quotes as curly quotes during parsing. When
          <emphasis>writing</emphasis> Org, then the
          <literal>smart_quotes</literal> extension has the reverse
          effect: what would have been curly quotes comes out straight.
        </para>
        <para>
          This extension is implied if <literal>smart</literal> is
          enabled.
        </para>
      </section>
      <section xml:id="extension-special_strings-org">
        <title>Extension: <literal>special_strings</literal>
        (org)</title>
        <para>
          Interpret <literal>---</literal> as em-dashes,
          <literal>--</literal> as en-dashes, <literal>\-</literal> as
          shy hyphen, and <literal>...</literal> as ellipses.
        </para>
        <para>
          This extension is implied if <literal>smart</literal> is
          enabled.
        </para>
      </section>
      <section xml:id="extension--tagging">
        <title>Extension: <literal>tagging</literal></title>
        <para>
          Enabling this extension with <literal>context</literal> output
          will produce markup suitable for the production of tagged
          PDFs. This includes additional markers for paragraphs and
          alternative markup for emphasized text. The
          <literal>emphasis-command</literal> template variable is set
          if the extension is enabled.
        </para>
      </section>
    </section>
  </section>
  <section xml:id="pandocs-markdown">
    <title>Pandoc’s Markdown</title>
    <para>
      Pandoc understands an extended and slightly revised version of
      John Gruber’s
      <link xlink:href="https://daringfireball.net/projects/markdown/">Markdown</link>
      syntax. This document explains the syntax, noting differences from
      original Markdown. Except where noted, these differences can be
      suppressed by using the <literal>markdown_strict</literal> format
      instead of <literal>markdown</literal>. Extensions can be enabled
      or disabled to specify the behavior more granularly. They are
      described in the following. See also
      <link linkend="extensions">Extensions</link> above, for extensions
      that work also on other formats.
    </para>
    <section xml:id="philosophy">
      <title>Philosophy</title>
      <para>
        Markdown is designed to be easy to write, and, even more
        importantly, easy to read:
      </para>
      <blockquote>
<literallayout>A Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions.
– <link xlink:href="https://daringfireball.net/projects/markdown/syntax#philosophy">John Gruber</link></literallayout>
      </blockquote>
      <para>
        This principle has guided pandoc’s decisions in finding syntax
        for tables, footnotes, and other extensions.
      </para>
      <para>
        There is, however, one respect in which pandoc’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.
      </para>
    </section>
    <section xml:id="paragraphs">
      <title>Paragraphs</title>
      <para>
        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.
      </para>
      <section xml:id="extension-escaped_line_breaks">
        <title>Extension: <literal>escaped_line_breaks</literal></title>
        <para>
          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.
        </para>
      </section>
    </section>
    <section xml:id="headings">
      <title>Headings</title>
      <para>
        There are two kinds of headings: Setext and ATX.
      </para>
      <section xml:id="setext-style-headings">
        <title>Setext-style headings</title>
        <para>
          A setext-style heading is a line of text
          <quote>underlined</quote> with a row of <literal>=</literal>
          signs (for a level-one heading) or <literal>-</literal> signs
          (for a level-two heading):
        </para>
        <programlisting>
A level-one heading
===================

A level-two heading
-------------------
</programlisting>
        <para>
          The heading text can contain inline formatting, such as
          emphasis (see <link linkend="inline-formatting">Inline
          formatting</link>, below).
        </para>
      </section>
      <section xml:id="atx-style-headings">
        <title>ATX-style headings</title>
        <para>
          An ATX-style heading consists of one to six
          <literal>#</literal> signs and a line of text, optionally
          followed by any number of <literal>#</literal> signs. The
          number of <literal>#</literal> signs at the beginning of the
          line is the heading level:
        </para>
        <programlisting>
## A level-two heading

### A level-three heading ###
</programlisting>
        <para>
          As with setext-style headings, the heading text can contain
          formatting:
        </para>
        <programlisting>
# A level-one heading with a [link](/url) and *emphasis*
</programlisting>
      </section>
      <section xml:id="extension-blank_before_header">
        <title>Extension: <literal>blank_before_header</literal></title>
        <para>
          Original 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 <literal>#</literal> to end up
          at the beginning of a line by accident (perhaps through line
          wrapping). Consider, for example:
        </para>
        <programlisting>
I like several of their flavors of ice cream:
#22, for example, and #5.
</programlisting>
      </section>
      <section xml:id="extension-space_in_atx_header">
        <title>Extension: <literal>space_in_atx_header</literal></title>
        <para>
          Many Markdown implementations do not require a space between
          the opening <literal>#</literal>s of an ATX heading and the
          heading text, so that <literal>#5 bolt</literal> and
          <literal>#hashtag</literal> count as headings. With this
          extension, pandoc does require the space.
        </para>
      </section>
      <section xml:id="heading-identifiers">
        <title>Heading identifiers</title>
        <para>
          See also the
          <link linkend="extension-auto_identifiers"><literal>auto_identifiers</literal>
          extension</link> above.
        </para>
      </section>
      <section xml:id="extension-header_attributes">
        <title>Extension: <literal>header_attributes</literal></title>
        <para>
          Headings can be assigned attributes using this syntax at the
          end of the line containing the heading text:
        </para>
        <programlisting>
{#identifier .class .class key=value key=value}
</programlisting>
        <para>
          Thus, for example, the following headings will all be assigned
          the identifier <literal>foo</literal>:
        </para>
        <programlisting>
# My heading {#foo}

## My heading ##    {#foo}

My other heading   {#foo}
---------------
</programlisting>
        <para>
          (This syntax is compatible with
          <link xlink:href="https://michelf.ca/projects/php-markdown/extra/">PHP
          Markdown Extra</link>.)
        </para>
        <para>
          Note that although this syntax allows assignment of classes
          and key/value attributes, writers generally don’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.
        </para>
        <para>
          Headings with the class <literal>unnumbered</literal> will not
          be numbered, even if <literal>--number-sections</literal> is
          specified. A single hyphen (<literal>-</literal>) in an
          attribute context is equivalent to
          <literal>.unnumbered</literal>, and preferable in non-English
          documents. So,
        </para>
        <programlisting>
# My heading {-}
</programlisting>
        <para>
          is just the same as
        </para>
        <programlisting>
# My heading {.unnumbered}
</programlisting>
        <para>
          If the <literal>unlisted</literal> class is present in
          addition to <literal>unnumbered</literal>, 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.)
        </para>
      </section>
      <section xml:id="extension-implicit_header_references">
        <title>Extension:
        <literal>implicit_header_references</literal></title>
        <para>
          Pandoc behaves as if reference links have been defined for
          each heading. So, to link to a heading
        </para>
        <programlisting>
# Heading identifiers in HTML
</programlisting>
        <para>
          you can simply write
        </para>
        <programlisting>
[Heading identifiers in HTML]
</programlisting>
        <para>
          or
        </para>
        <programlisting>
[Heading identifiers in HTML][]
</programlisting>
        <para>
          or
        </para>
        <programlisting>
[the section on heading identifiers][heading identifiers in
HTML]
</programlisting>
        <para>
          instead of giving the identifier explicitly:
        </para>
        <programlisting>
[Heading identifiers in HTML](#heading-identifiers-in-html)
</programlisting>
        <para>
          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.
        </para>
        <para>
          Like regular reference links, these references are
          case-insensitive.
        </para>
        <para>
          Explicit link reference definitions always take priority over
          implicit heading references. So, in the following example, the
          link will point to <literal>bar</literal>, not to
          <literal>#foo</literal>:
        </para>
        <programlisting>
# Foo

[foo]: bar

See [foo]
</programlisting>
      </section>
    </section>
    <section xml:id="block-quotations">
      <title>Block quotations</title>
      <para>
        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 <literal>&gt;</literal> character and an optional space. (The
        <literal>&gt;</literal> need not start at the left margin, but
        it should not be indented more than three spaces.)
      </para>
      <programlisting>
&gt; This is a block quote. This
&gt; paragraph has two lines.
&gt;
&gt; 1. This is a list inside a block quote.
&gt; 2. Second item.
</programlisting>
      <para>
        A <quote>lazy</quote> form, which requires the
        <literal>&gt;</literal> character only on the first line of each
        block, is also allowed:
      </para>
      <programlisting>
&gt; This is a block quote. This
paragraph has two lines.

&gt; 1. This is a list inside a block quote.
2. Second item.
</programlisting>
      <para>
        Among the block elements that can be contained in a block quote
        are other block quotes. That is, block quotes can be nested:
      </para>
      <programlisting>
&gt; This is a block quote.
&gt;
&gt; &gt; A block quote within a block quote.
</programlisting>
      <para>
        If the <literal>&gt;</literal> 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 <literal>&gt;</literal>:
      </para>
      <programlisting>
&gt;     code
</programlisting>
      <section xml:id="extension-blank_before_blockquote">
        <title>Extension:
        <literal>blank_before_blockquote</literal></title>
        <para>
          Original 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 <literal>&gt;</literal> to
          end up at the beginning of a line by accident (perhaps through
          line wrapping). So, unless the
          <literal>markdown_strict</literal> format is used, the
          following does not produce a nested block quote in pandoc:
        </para>
        <programlisting>
&gt; This is a block quote.
&gt;&gt; Not nested, since `blank_before_blockquote` is enabled by default
</programlisting>
      </section>
    </section>
    <section xml:id="verbatim-code-blocks">
      <title>Verbatim (code) blocks</title>
      <section xml:id="indented-code-blocks">
        <title>Indented code blocks</title>
        <para>
          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,
        </para>
        <programlisting>
    if (a &gt; 3) {
      moveShip(5 * gravity, DOWN);
    }
</programlisting>
        <para>
          The initial (four space or one tab) indentation is not
          considered part of the verbatim text, and is removed in the
          output.
        </para>
        <para>
          Note: blank lines in the verbatim text need not begin with
          four spaces.
        </para>
      </section>
      <section xml:id="fenced-code-blocks">
        <title>Fenced code blocks</title>
        <para>
        </para>
      </section>
      <section xml:id="extension-fenced_code_blocks">
        <title>Extension: <literal>fenced_code_blocks</literal></title>
        <para>
          In addition to standard indented code blocks, pandoc supports
          <emphasis>fenced</emphasis> code blocks. These begin with a
          row of three or more tildes (<literal>~</literal>) 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:
        </para>
        <programlisting>
~~~~~~~
if (a &gt; 3) {
  moveShip(5 * gravity, DOWN);
}
~~~~~~~
</programlisting>
        <para>
          Like regular code blocks, fenced code blocks must be separated
          from surrounding text by blank lines.
        </para>
        <para>
          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:
        </para>
        <programlisting>
~~~~~~~~~~~~~~~~
~~~~~~~~~~
code including tildes
~~~~~~~~~~
~~~~~~~~~~~~~~~~
</programlisting>
      </section>
      <section xml:id="extension-backtick_code_blocks">
        <title>Extension:
        <literal>backtick_code_blocks</literal></title>
        <para>
          Same as <literal>fenced_code_blocks</literal>, but uses
          backticks (<literal>`</literal>) instead of tildes
          (<literal>~</literal>).
        </para>
      </section>
      <section xml:id="extension-fenced_code_attributes">
        <title>Extension:
        <literal>fenced_code_attributes</literal></title>
        <para>
          Optionally, you may attach attributes to fenced or backtick
          code block using this syntax:
        </para>
        <programlisting>
~~~~ {#mycode .haskell .numberLines startFrom=&quot;100&quot;}
qsort []     = []
qsort (x:xs) = qsort (filter (&lt; x) xs) ++ [x] ++
               qsort (filter (&gt;= x) xs)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
</programlisting>
        <para>
          Here <literal>mycode</literal> is an identifier,
          <literal>haskell</literal> and <literal>numberLines</literal>
          are classes, and <literal>startFrom</literal> is an attribute
          with value <literal>100</literal>. Some output formats can use
          this information to do syntax highlighting. Currently, the
          only output formats that use 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
          <literal>pandoc --list-highlight-languages</literal>.)
          Otherwise, the code block above will appear as follows:
        </para>
        <programlisting>
&lt;pre id=&quot;mycode&quot; class=&quot;haskell numberLines&quot; startFrom=&quot;100&quot;&gt;
  &lt;code&gt;
  ...
  &lt;/code&gt;
&lt;/pre&gt;
</programlisting>
        <para>
          The <literal>numberLines</literal> (or
          <literal>number-lines</literal>) class will cause the lines of
          the code block to be numbered, starting with
          <literal>1</literal> or the value of the
          <literal>startFrom</literal> attribute. The
          <literal>lineAnchors</literal> (or
          <literal>line-anchors</literal>) class will cause the lines to
          be clickable anchors in HTML output.
        </para>
        <para>
          A shortcut form can also be used for specifying the language
          of the code block:
        </para>
        <programlisting>
```haskell
qsort [] = []
```
</programlisting>
        <para>
          This is equivalent to:
        </para>
        <programlisting>
``` {.haskell}
qsort [] = []
```
</programlisting>
        <para>
          This shortcut form may be combined with attributes:
        </para>
        <programlisting>
```haskell {.numberLines}
qsort [] = []
```
</programlisting>
        <para>
          Which is equivalent to:
        </para>
        <programlisting>
``` {.haskell .numberLines}
qsort [] = []
```
</programlisting>
        <para>
          If the <literal>fenced_code_attributes</literal> 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.
        </para>
        <para>
          To prevent all highlighting, use the
          <literal>--syntax-highlighting=none</literal> option. To set
          the highlighting style or method, use
          <literal>--syntax-highlighting</literal>. For more information
          on highlighting, see
          <link linkend="syntax-highlighting">Syntax
          highlighting</link>, below.
        </para>
      </section>
    </section>
    <section xml:id="line-blocks">
      <title>Line blocks</title>
      <section xml:id="extension-line_blocks">
        <title>Extension: <literal>line_blocks</literal></title>
        <para>
          A line block is a sequence of lines beginning with a vertical
          bar (<literal>|</literal>) 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:
        </para>
        <programlisting>
| The limerick packs laughs anatomical
| In space that is quite economical.
|    But the good ones I've seen
|    So seldom are clean
| And the clean ones so seldom are comical

| 200 Main St.
| Berkeley, CA 94718
</programlisting>
        <para>
          The lines can be hard-wrapped if needed, but the continuation
          line must begin with a space.
        </para>
        <programlisting>
| The Right Honorable Most Venerable and Righteous Samuel L.
  Constable, Jr.
| 200 Main St.
| Berkeley, CA 94718
</programlisting>
        <para>
          Inline formatting (such as emphasis) is allowed in the content
          (though it can’t cross line boundaries). Block-level
          formatting (such as block quotes or lists) is not recognized.
        </para>
        <para>
          This syntax is borrowed from
          <link xlink:href="https://docutils.sourceforge.io/docs/ref/rst/introduction.html">reStructuredText</link>.
        </para>
      </section>
    </section>
    <section xml:id="lists">
      <title>Lists</title>
      <section xml:id="bullet-lists">
        <title>Bullet lists</title>
        <para>
          A bullet list is a list of bulleted list items. A bulleted
          list item begins with a bullet (<literal>*</literal>,
          <literal>+</literal>, or <literal>-</literal>). Here is a
          simple example:
        </para>
        <programlisting>
* one
* two
* three
</programlisting>
        <para>
          This will produce a <quote>compact</quote> list. If you want a
          <quote>loose</quote> list, in which each item is formatted as
          a paragraph, put spaces between the items:
        </para>
        <programlisting>
* one

* two

* three
</programlisting>
        <para>
          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.
        </para>
        <para>
          List items look best if subsequent lines are flush with the
          first line (after the bullet):
        </para>
        <programlisting>
* here is my first
  list item.
* and my second.
</programlisting>
        <para>
          But Markdown also allows a <quote>lazy</quote> format:
        </para>
        <programlisting>
* here is my first
list item.
* and my second.
</programlisting>
      </section>
      <section xml:id="block-content-in-list-items">
        <title>Block content in list items</title>
        <para>
          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.
        </para>
        <programlisting>
  * First paragraph.

    Continued.

  * Second paragraph. With a code block, which must be indented
    eight spaces:

        { code }
</programlisting>
        <para>
          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:
        </para>
        <programlisting>
*     code

  continuation paragraph
</programlisting>
        <para>
          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.
        </para>
        <programlisting>
* fruits
  + apples
    - macintosh
    - red delicious
  + pears
  + peaches
* vegetables
  + broccoli
  + chard
</programlisting>
        <para>
          As noted above, Markdown allows you to write list items
          <quote>lazily,</quote> 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.
        </para>
        <programlisting>
+ A lazy, lazy, list
item.

+ Another one; this looks
bad but is legal.

    Second paragraph of second
list item.
</programlisting>
      </section>
      <section xml:id="ordered-lists">
        <title>Ordered lists</title>
        <para>
          Ordered lists work just like bulleted lists, except that the
          items begin with enumerators rather than bullets.
        </para>
        <para>
          In original 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:
        </para>
        <programlisting>
1.  one
2.  two
3.  three
</programlisting>
        <para>
          and this one:
        </para>
        <programlisting>
5.  one
7.  two
1.  three
</programlisting>
      </section>
      <section xml:id="extension-fancy_lists">
        <title>Extension: <literal>fancy_lists</literal></title>
        <para>
          Unlike original 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-parenthesis 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.<footnote>
            <para>
              The point of this rule is to ensure that normal paragraphs
              starting with people’s initials, like
            </para>
            <programlisting>
B. Russell won a Nobel Prize (but not for &quot;On Denoting&quot;).
</programlisting>
            <para>
              do not get treated as list items.
            </para>
            <para>
              This rule will not prevent
            </para>
            <programlisting>
(C) 2007 Joe Smith
</programlisting>
            <para>
              from being interpreted as a list item. In this case, a
              backslash escape can be used:
            </para>
            <programlisting>
(C\) 2007 Joe Smith
</programlisting>
          </footnote>
        </para>
        <para>
          The <literal>fancy_lists</literal> extension also allows
          <quote><literal>#</literal></quote> to be used as an ordered
          list marker in place of a numeral:
        </para>
        <programlisting>
#. one
#. two
</programlisting>
        <para>
          Note: the <quote><literal>#</literal></quote> ordered list
          marker doesn’t work with <literal>commonmark</literal>.
        </para>
      </section>
      <section xml:id="extension-startnum">
        <title>Extension: <literal>startnum</literal></title>
        <para>
          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:
        </para>
        <programlisting>
 9)  Ninth
10)  Tenth
11)  Eleventh
       i. subone
      ii. subtwo
     iii. subthree
</programlisting>
        <para>
          Pandoc will start a new list each time a different type of
          list marker is used. So, the following will create three
          lists:
        </para>
        <programlisting>
(2) Two
(5) Three
1.  Four
*   Five
</programlisting>
        <para>
          If default list markers are desired, use
          <literal>#.</literal>:
        </para>
        <programlisting>
#.  one
#.  two
#.  three
</programlisting>
      </section>
      <section xml:id="extension-task_lists">
        <title>Extension: <literal>task_lists</literal></title>
        <para>
          Pandoc supports task lists, using the syntax of
          GitHub-Flavored Markdown.
        </para>
        <programlisting>
- [ ] an unchecked task list item
- [x] checked item
</programlisting>
      </section>
      <section xml:id="definition-lists">
        <title>Definition lists</title>
        <para>
        </para>
      </section>
      <section xml:id="extension-definition_lists">
        <title>Extension: <literal>definition_lists</literal></title>
        <para>
          Pandoc supports definition lists, using the syntax of
          <link xlink:href="https://michelf.ca/projects/php-markdown/extra/">PHP
          Markdown Extra</link> with some extensions.<footnote>
            <para>
              I have been influenced by the suggestions of
              <link xlink:href="https://justatheory.com/2009/02/modest-markdown-proposal/">David
              Wheeler</link>.
            </para>
          </footnote>
        </para>
        <programlisting>
Term 1

:   Definition 1

Term 2 with *inline markup*

:   Definition 2

        { some code, part of Definition 2 }

    Third paragraph of definition 2.
</programlisting>
        <para>
          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.
        </para>
        <para>
          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 (not including the first line) should
          be indented four spaces. However, as with other Markdown
          lists, you can <quote>lazily</quote> omit indentation except
          at the beginning of a paragraph or other block element:
        </para>
        <programlisting>
Term 1

:   Definition
with lazy continuation.

    Second paragraph of the definition.
</programlisting>
        <para>
          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:
        </para>
        <programlisting>
Term 1
  ~ Definition 1

Term 2
  ~ Definition 2a
  ~ Definition 2b
</programlisting>
        <para>
          Note that space between items in a definition list is
          required.
        </para>
      </section>
      <section xml:id="numbered-example-lists">
        <title>Numbered example lists</title>
        <para>
        </para>
      </section>
      <section xml:id="extension-example_lists">
        <title>Extension: <literal>example_lists</literal></title>
        <para>
          The special list marker <literal>@</literal> can be used for
          sequentially numbered examples. The first list item with a
          <literal>@</literal> marker will be numbered <quote>1</quote>,
          the next <quote>2</quote>, and so on, throughout the document.
          The numbered examples need not occur in a single list; each
          new list using <literal>@</literal> will take up where the
          last stopped. So, for example:
        </para>
        <programlisting>
(@)  My first example will be numbered (1).
(@)  My second example will be numbered (2).

Explanation of examples.

(@)  My third example will be numbered (3).
</programlisting>
        <para>
          Numbered examples can be labeled and referred to elsewhere in
          the document:
        </para>
        <programlisting>
(@good)  This is a good example.

As (@good) illustrates, ...
</programlisting>
        <para>
          The label can be any string of alphanumeric characters,
          underscores, or hyphens.
        </para>
        <para>
          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
          <literal>four_space_rule</literal> 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.
        </para>
        <para>
          You can repeat an earlier numbered example by re-using its
          label:
        </para>
        <programlisting>
(@foo) Sample sentence.

Intervening text...

This theory can explain the case we saw earlier (repeated):

(@foo) Sample sentence.
</programlisting>
        <para>
          This only works reliably, though, if the repeated item is in a
          list by itself, because each numbered example list will be
          numbered continuously from its starting number.
        </para>
      </section>
      <section xml:id="ending-a-list">
        <title>Ending a list</title>
        <para>
          What if you want to put an indented code block after a list?
        </para>
        <programlisting>
-   item one
-   item two

    { my code block }
</programlisting>
        <para>
          Trouble! Here pandoc (like other Markdown implementations)
          will treat <literal>{ my code block }</literal> as the second
          paragraph of item two, and not as a code block.
        </para>
        <para>
          To <quote>cut off</quote> the list after item two, you can
          insert some non-indented content, like an HTML comment, which
          won’t produce visible output in any format:
        </para>
        <programlisting>
-   item one
-   item two

&lt;!-- end of list --&gt;

    { my code block }
</programlisting>
        <para>
          You can use the same trick if you want two consecutive lists
          instead of one big list:
        </para>
        <programlisting>
1.  one
2.  two
3.  three

&lt;!-- --&gt;

1.  uno
2.  dos
3.  tres
</programlisting>
      </section>
    </section>
    <section xml:id="horizontal-rules">
      <title>Horizontal rules</title>
      <para>
        A line containing a row of three or more <literal>*</literal>,
        <literal>-</literal>, or <literal>_</literal> characters
        (optionally separated by spaces) produces a horizontal rule:
      </para>
      <programlisting>
*  *  *  *

---------------
</programlisting>
      <para>
        We strongly recommend that horizontal rules be separated from
        surrounding text by blank lines. If a horizontal rule is not
        followed by a blank line, pandoc may try to interpret the lines
        that follow as a YAML metadata block or a table.
      </para>
    </section>
    <section xml:id="tables">
      <title>Tables</title>
      <para>
        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.
      </para>
      <section xml:id="extension-table_captions">
        <title>Extension: <literal>table_captions</literal></title>
        <para>
          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 <literal>Table:</literal>
          (or <literal>table:</literal> or just <literal>:</literal>),
          which will be stripped off. It may appear either before or
          after the table.
        </para>
      </section>
      <section xml:id="extension-simple_tables">
        <title>Extension: <literal>simple_tables</literal></title>
        <para>
          Simple tables look like this:
        </para>
        <programlisting>
  Right     Left     Center     Default
-------     ------ ----------   -------
     12     12        12            12
    123     123       123          123
      1     1          1             1

Table:  Demonstration of simple table syntax.
</programlisting>
        <para>
          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:<footnote>
            <para>
              This scheme is due to Michel Fortin, who proposed it on
              the
              <link xlink:href="http://six.pairlist.net/pipermail/markdown-discuss/2005-March/001097.html">Markdown
              discussion list</link>.
            </para>
          </footnote>
        </para>
        <itemizedlist spacing="compact">
          <listitem>
            <para>
              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.
            </para>
          </listitem>
          <listitem>
            <para>
              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.
            </para>
          </listitem>
          <listitem>
            <para>
              If the dashed line extends beyond the header text on both
              sides, the column is centered.
            </para>
          </listitem>
          <listitem>
            <para>
              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).
            </para>
          </listitem>
        </itemizedlist>
        <para>
          The table must end with a blank line, or a line of dashes
          followed by a blank line.
        </para>
        <para>
          The column header row may be omitted, provided a dashed line
          is used to end the table. For example:
        </para>
        <programlisting>
-------     ------ ----------   -------
     12     12        12             12
    123     123       123           123
      1     1          1              1
-------     ------ ----------   -------
</programlisting>
        <para>
          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.
        </para>
      </section>
      <section xml:id="extension-multiline_tables">
        <title>Extension: <literal>multiline_tables</literal></title>
        <para>
          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:
        </para>
        <programlisting>
-------------------------------------------------------------
 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's another one. Note
                                    the blank line between
                                    rows.
-------------------------------------------------------------

Table: Here's the caption. It, too, may span
multiple lines.
</programlisting>
        <para>
          These work like simple tables, but with the following
          differences:
        </para>
        <itemizedlist spacing="compact">
          <listitem>
            <para>
              They must begin with a row of dashes, before the header
              text (unless the header row is omitted).
            </para>
          </listitem>
          <listitem>
            <para>
              They must end with a row of dashes, then a blank line.
            </para>
          </listitem>
          <listitem>
            <para>
              The rows must be separated by blank lines.
            </para>
          </listitem>
        </itemizedlist>
        <para>
          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.
        </para>
        <para>
          The header may be omitted in multiline tables as well as
          simple tables:
        </para>
        <programlisting>
----------- ------- --------------- -------------------------
   First    row                12.0 Example of a row that
                                    spans multiple lines.

  Second    row                 5.0 Here's another one. Note
                                    the blank line between
                                    rows.
----------- ------- --------------- -------------------------

: Here's a multiline table without a header.
</programlisting>
        <para>
          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.
        </para>
      </section>
      <section xml:id="extension-grid_tables">
        <title>Extension: <literal>grid_tables</literal></title>
        <para>
          Grid tables look like this:
        </para>
        <programlisting>
: Sample grid table.

+---------------+---------------+--------------------+
| Fruit         | Price         | Advantages         |
+===============+===============+====================+
| Bananas       | $1.34         | - built-in wrapper |
|               |               | - bright color     |
+---------------+---------------+--------------------+
| Oranges       | $2.10         | - cures scurvy     |
|               |               | - tasty            |
+---------------+---------------+--------------------+
</programlisting>
        <para>
          The row of <literal>=</literal>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.).
        </para>
        <para>
          Cells can span multiple columns or rows:
        </para>
        <programlisting>
+---------------------+----------+
| Property            | Earth    |
+=============+=======+==========+
|             | min   | -89.2 °C |
| Temperature +-------+----------+
| 1961-1990   | mean  | 14 °C    |
|             +-------+----------+
|             | max   | 56.7 °C  |
+-------------+-------+----------+
</programlisting>
        <para>
          A table header may contain more than one row:
        </para>
        <programlisting>
+---------------------+-----------------------+
| Location            | Temperature 1961-1990 |
|                     | in degree Celsius     |
|                     +-------+-------+-------+
|                     | min   | mean  | max   |
+=====================+=======+=======+=======+
| Antarctica          | -89.2 | N/A   | 19.8  |
+---------------------+-------+-------+-------+
| Earth               | -89.2 | 14    | 56.7  |
+---------------------+-------+-------+-------+
</programlisting>
        <para>
          Alignments can be specified as with pipe tables, by putting
          colons at the boundaries of the separator line after the
          header:
        </para>
        <programlisting>
+---------------+---------------+--------------------+
| Right         | Left          | Centered           |
+==============:+:==============+:==================:+
| Bananas       | $1.34         | built-in wrapper   |
+---------------+---------------+--------------------+
</programlisting>
        <para>
          For headerless tables, the colons go on the top line instead:
        </para>
        <programlisting>
+--------------:+:--------------+:------------------:+
| Right         | Left          | Centered           |
+---------------+---------------+--------------------+
</programlisting>
        <para>
          A table foot can be defined by enclosing it with separator
          lines that use <literal>=</literal> instead of
          <literal>-</literal>:
        </para>
        <programlisting>
 +---------------+---------------+
 | Fruit         | Price         |
 +===============+===============+
 | Bananas       | $1.34         |
 +---------------+---------------+
 | Oranges       | $2.10         |
 +===============+===============+
 | Sum           | $3.44         |
 +===============+===============+
</programlisting>
        <para>
          The foot must always be placed at the very bottom of the
          table.
        </para>
        <para>
          Grid tables can be created easily using Emacs’ table-mode
          (<literal>M-x table-insert</literal>).
        </para>
      </section>
      <section xml:id="extension-pipe_tables">
        <title>Extension: <literal>pipe_tables</literal></title>
        <para>
          Pipe tables look like this:
        </para>
        <programlisting>
| Right | Left | Default | Center |
|------:|:-----|---------|:------:|
|   12  |  12  |    12   |    12  |
|  123  |  123 |   123   |   123  |
|    1  |    1 |     1   |     1  |

  : Demonstration of pipe table syntax.
</programlisting>
        <para>
          The syntax is identical to
          <link xlink:href="https://michelf.ca/projects/php-markdown/extra/#table">PHP
          Markdown Extra tables</link>. 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.
        </para>
        <para>
          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:
        </para>
        <programlisting>
fruit| price
-----|-----:
apple|2.05
pear|1.37
orange|3.09
</programlisting>
        <para>
          The cells of pipe tables cannot contain block elements like
          paragraphs and lists, and cannot span multiple lines. If any
          line of the Markdown source is longer than the column width
          (see <literal>--columns</literal>), 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 <literal>---|-</literal> 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.
        </para>
        <para>
          Note: pandoc also recognizes pipe tables of the following
          form, as can be produced by Emacs’ orgtbl-mode:
        </para>
        <programlisting>
| One | Two   |
|-----+-------|
| my  | table |
| is  | nice  |
</programlisting>
        <para>
          The difference is that <literal>+</literal> is used instead of
          <literal>|</literal>. Other orgtbl features are not supported.
          In particular, to get non-default column alignment, you’ll
          need to add colons as above.
        </para>
      </section>
      <section xml:id="extension-table_attributes">
        <title>Extension: <literal>table_attributes</literal></title>
        <para>
          Attributes may be attached to tables by including them at the
          end of the caption. (For the syntax, see
          <link linkend="extension-header_attributes"><literal>header_attributes</literal></link>.)
        </para>
        <programlisting>
  : Here's the caption. {#ident .class key=&quot;value&quot;}
</programlisting>
      </section>
    </section>
    <section xml:id="metadata-blocks">
      <title>Metadata blocks</title>
      <section xml:id="extension-pandoc_title_block">
        <title>Extension: <literal>pandoc_title_block</literal></title>
        <para>
          If the file begins with a title block
        </para>
        <programlisting>
% title
% author(s) (separated by semicolons)
% date
</programlisting>
        <para>
          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 date 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:
        </para>
        <programlisting>
%
% Author
</programlisting>
        <programlisting>
% My title
%
% June 15, 2006
</programlisting>
        <para>
          The title may occupy multiple lines, but continuation lines
          must begin with leading space, thus:
        </para>
        <programlisting>
% My title
  on multiple lines
</programlisting>
        <para>
          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:
        </para>
        <programlisting>
% Author One
  Author Two
</programlisting>
        <programlisting>
% Author One; Author Two
</programlisting>
        <programlisting>
% Author One;
  Author Two
</programlisting>
        <para>
          The date must fit on one line.
        </para>
        <para>
          All three metadata fields may contain standard inline
          formatting (italics, links, footnotes, etc.).
        </para>
        <para>
          Title blocks will always be parsed, but they will affect the
          output only when the <literal>--standalone</literal>
          (<literal>-s</literal>) 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 (<literal>--title-prefix</literal> or
          <literal>-T</literal> option). The title in the body appears
          as an H1 element with class <quote>title</quote>, so it can be
          suppressed or reformatted with CSS. If a title prefix is
          specified with <literal>-T</literal> and no title block
          appears in the document, the title prefix will be used by
          itself as the HTML title.
        </para>
        <para>
          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
          (<literal>|</literal>) should be used to separate the footer
          text from the header text. Thus,
        </para>
        <programlisting>
% PANDOC(1)
</programlisting>
        <para>
          will yield a man page with the title <literal>PANDOC</literal>
          and section 1.
        </para>
        <programlisting>
% PANDOC(1) Pandoc User Manuals
</programlisting>
        <para>
          will also have <quote>Pandoc User Manuals</quote> in the
          footer.
        </para>
        <programlisting>
% PANDOC(1) Pandoc User Manuals | Version 4.0
</programlisting>
        <para>
          will also have <quote>Version 4.0</quote> in the header.
        </para>
      </section>
      <section xml:id="extension-yaml_metadata_block">
        <title>Extension: <literal>yaml_metadata_block</literal></title>
        <para>
          A
          <link xlink:href="https://yaml.org/spec/1.2/spec.html">YAML</link>
          metadata block is a valid YAML object, delimited by a line of
          three hyphens (<literal>---</literal>) at the top and a line
          of three hyphens (<literal>---</literal>) or three dots
          (<literal>...</literal>) at the bottom. The initial line
          <literal>---</literal> must not be followed by a blank line. 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.
        </para>
        <para>
          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:
        </para>
        <programlisting>
pandoc chap1.md chap2.md chap3.md metadata.yaml -s -o book.html
</programlisting>
        <para>
          Just be sure that the YAML file begins with
          <literal>---</literal> and ends with <literal>---</literal> or
          <literal>...</literal>. Alternatively, you can use the
          <literal>--metadata-file</literal> option. Using that approach
          however, you cannot reference content (like footnotes) from
          the main Markdown input document.
        </para>
        <para>
          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, <literal>yes</literal>, <literal>True</literal>, and
          <literal>15</literal> cannot be used as field names).
        </para>
        <para>
          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.
        </para>
        <para>
          Each metadata block is handled internally as an independent
          YAML document. This means, for example, that any YAML anchors
          defined in a block cannot be referenced in another block.
        </para>
        <para>
          When pandoc is used with <literal>-t markdown</literal> to
          create a Markdown document, a YAML metadata block will be
          produced only if the <literal>-s/--standalone</literal> option
          is used. All of the metadata will appear in a single block at
          the beginning of the document.
        </para>
        <para>
          Note that
          <link xlink:href="https://yaml.org/spec/1.2/spec.html">YAML</link>
          escaping rules must be followed. Thus, for example, if a title
          contains a colon, it must be quoted, and if it contains a
          backslash escape, then it must be ensured that it is not
          treated as a
          <link xlink:href="https://yaml.org/spec/1.2/spec.html#id2776092">YAML
          escape sequence</link>. The pipe character
          (<literal>|</literal>) 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:
        </para>
        <programlisting>
---
title:  'This is the title: it contains a colon'
author:
- Author One
- Author Two
keywords: [nothing, nothingness]
abstract: |
  This is the abstract.

  It consists of two paragraphs.
...
</programlisting>
        <para>
          The literal block after the <literal>|</literal> must be
          indented relative to the line containing the
          <literal>|</literal>. If it is not, the YAML will be invalid
          and pandoc will not interpret it as metadata. For an overview
          of the complex rules governing YAML, see the
          <link xlink:href="https://en.wikipedia.org/wiki/YAML#Syntax">Wikipedia
          entry on YAML syntax</link>.
        </para>
        <para>
          Template variables will be set automatically from the
          metadata. Thus, for example, in writing HTML, the variable
          <literal>abstract</literal> will be set to the HTML equivalent
          of the Markdown in the <literal>abstract</literal> field:
        </para>
        <programlisting>
&lt;p&gt;This is the abstract.&lt;/p&gt;
&lt;p&gt;It consists of two paragraphs.&lt;/p&gt;
</programlisting>
        <para>
          Variables can contain arbitrary YAML structures, but the
          template must match this structure. The
          <literal>author</literal> 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:
        </para>
        <programlisting>
---
title: The document title
author:
- name: Author One
  affiliation: University of Somewhere
- name: Author Two
  affiliation: University of Nowhere
...
</programlisting>
        <para>
          To use the structured authors in the example above, you would
          need a custom template:
        </para>
        <programlisting>
$for(author)$
$if(author.name)$
$author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$
$else$
$author$
$endif$
$endfor$
</programlisting>
        <para>
          Raw content to include in the document’s header may be
          specified using <literal>header-includes</literal>; however,
          it is important to mark up this content as raw code for a
          particular output format, using the
          <link linkend="extension-raw_attribute"><literal>raw_attribute</literal>
          extension</link>, or it will be interpreted as Markdown. For
          example:
        </para>
        <programlisting>
header-includes:
- |
  ```{=latex}
  \let\oldsection\section
  \renewcommand{\section}[1]{\clearpage\oldsection{#1}}
  ```
</programlisting>
        <para>
          Note: the <literal>yaml_metadata_block</literal> extension
          works with <literal>commonmark</literal> as well as
          <literal>markdown</literal> (and it is enabled by default in
          <literal>gfm</literal> and <literal>commonmark_x</literal>).
          However, in these formats the following restrictions apply:
        </para>
        <itemizedlist>
          <listitem>
            <para>
              The YAML metadata block must occur at the beginning of the
              document (and there can be only one). If multiple files
              are given as arguments to pandoc, only the first can be a
              YAML metadata block.
            </para>
          </listitem>
          <listitem>
            <para>
              The leaf nodes of the YAML structure are parsed in
              isolation from each other and from the rest of the
              document. So, for example, you can’t use a reference link
              in these contexts if the link definition is somewhere else
              in the document.
            </para>
          </listitem>
        </itemizedlist>
      </section>
    </section>
    <section xml:id="backslash-escapes">
      <title>Backslash escapes</title>
      <section xml:id="extension-all_symbols_escapable">
        <title>Extension:
        <literal>all_symbols_escapable</literal></title>
        <para>
          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
        </para>
        <programlisting>
*\*hello\**
</programlisting>
        <para>
          one will get
        </para>
        <programlisting>
&lt;em&gt;*hello*&lt;/em&gt;
</programlisting>
        <para>
          instead of
        </para>
        <programlisting>
&lt;strong&gt;hello&lt;/strong&gt;
</programlisting>
        <para>
          This rule is easier to remember than original Markdown’s rule,
          which allows only the following characters to be
          backslash-escaped:
        </para>
        <programlisting>
\`*_{}[]()&gt;#+-.!
</programlisting>
        <para>
          (However, if the <literal>markdown_strict</literal> format is
          used, the original Markdown rule will be used.)
        </para>
        <para>
          A backslash-escaped space is parsed as a nonbreaking space. In
          TeX output, it will appear as <literal>~</literal>. In HTML
          and XML output, it will appear as a literal unicode
          nonbreaking space character (note that it will thus actually
          look <quote>invisible</quote> in the generated HTML source;
          you can still use the <literal>--ascii</literal> command-line
          option to make it appear as an explicit entity).
        </para>
        <para>
          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 <literal>\\</literal> and in HTML as
          <literal>&lt;br /&gt;</literal>. This is a nice alternative to
          Markdown’s <quote>invisible</quote> way of indicating hard
          line breaks using two trailing spaces on a line.
        </para>
        <para>
          Backslash escapes do not work in verbatim contexts.
        </para>
      </section>
    </section>
    <section xml:id="inline-formatting">
      <title>Inline formatting</title>
      <section xml:id="emphasis">
        <title>Emphasis</title>
        <para>
          To <emphasis>emphasize</emphasis> some text, surround it with
          <literal>*</literal>s or <literal>_</literal>, like this:
        </para>
        <programlisting>
This text is _emphasized with underscores_, and this
is *emphasized with asterisks*.
</programlisting>
        <para>
          Double <literal>*</literal> or <literal>_</literal> produces
          <emphasis role="strong">strong emphasis</emphasis>:
        </para>
        <programlisting>
This is **strong emphasis** and __with underscores__.
</programlisting>
        <para>
          A <literal>*</literal> or <literal>_</literal> character
          surrounded by spaces, or backslash-escaped, will not trigger
          emphasis:
        </para>
        <programlisting>
This is * not emphasized *, and \*neither is this\*.
</programlisting>
      </section>
      <section xml:id="extension-intraword_underscores">
        <title>Extension:
        <literal>intraword_underscores</literal></title>
        <para>
          Because <literal>_</literal> is sometimes used inside words
          and identifiers, pandoc does not interpret a
          <literal>_</literal> surrounded by alphanumeric characters as
          an emphasis marker. If you want to emphasize just part of a
          word, use <literal>*</literal>:
        </para>
        <programlisting>
feas*ible*, not feas*able*.
</programlisting>
      </section>
      <section xml:id="strikeout">
        <title>Strikeout</title>
        <para>
        </para>
      </section>
      <section xml:id="extension-strikeout">
        <title>Extension: <literal>strikeout</literal></title>
        <para>
          To strike out a section of text with a horizontal line, begin
          and end it with <literal>~~</literal>. Thus, for example,
        </para>
        <programlisting>
This ~~is deleted text.~~
</programlisting>
      </section>
      <section xml:id="superscripts-and-subscripts">
        <title>Superscripts and subscripts</title>
        <para>
        </para>
      </section>
      <section xml:id="extension-superscript-subscript">
        <title>Extension: <literal>superscript</literal>,
        <literal>subscript</literal></title>
        <para>
          Superscripts may be written by surrounding the superscripted
          text by <literal>^</literal> characters; subscripts may be
          written by surrounding the subscripted text by
          <literal>~</literal> characters. Thus, for example,
        </para>
        <programlisting>
H~2~O is a liquid.  2^10^ is 1024.
</programlisting>
        <para>
          The text between <literal>^...^</literal> or
          <literal>~...~</literal> 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 <literal>~</literal> and <literal>^</literal>,
          and also bad interactions with footnotes.) Thus, if you want
          the letter P with <quote>a cat</quote> in subscripts, use
          <literal>P~a\ cat~</literal>, not <literal>P~a cat~</literal>.
        </para>
      </section>
      <section xml:id="verbatim">
        <title>Verbatim</title>
        <para>
          To make a short span of text verbatim, put it inside
          backticks:
        </para>
        <programlisting>
What is the difference between `&gt;&gt;=` and `&gt;&gt;`?
</programlisting>
        <para>
          If the verbatim text includes a backtick, use double
          backticks:
        </para>
        <programlisting>
Here is a literal backtick `` ` ``.
</programlisting>
        <para>
          (The spaces after the opening backticks and before the closing
          backticks will be ignored.)
        </para>
        <para>
          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).
        </para>
        <para>
          Note that backslash-escapes (and other Markdown constructs) do
          not work in verbatim contexts:
        </para>
        <programlisting>
This is a backslash followed by an asterisk: `\*`.
</programlisting>
      </section>
      <section xml:id="extension-inline_code_attributes">
        <title>Extension:
        <literal>inline_code_attributes</literal></title>
        <para>
          Attributes can be attached to verbatim text, just as with
          <link linkend="fenced-code-blocks">fenced code blocks</link>:
        </para>
        <programlisting>
`&lt;$&gt;`{.haskell}
</programlisting>
      </section>
      <section xml:id="underline">
        <title>Underline</title>
        <para>
          To underline text, use the <literal>underline</literal> class:
        </para>
        <programlisting>
[Underline]{.underline}
</programlisting>
        <para>
          Or, without the <literal>bracketed_spans</literal> extension
          (but with <literal>native_spans</literal>):
        </para>
        <programlisting>
&lt;span class=&quot;underline&quot;&gt;Underline&lt;/span&gt;
</programlisting>
        <para>
          This will work in all output formats that support underline.
        </para>
      </section>
      <section xml:id="small-caps">
        <title>Small caps</title>
        <para>
          To write small caps, use the <literal>smallcaps</literal>
          class:
        </para>
        <programlisting>
[Small caps]{.smallcaps}
</programlisting>
        <para>
          Or, without the <literal>bracketed_spans</literal> extension:
        </para>
        <programlisting>
&lt;span class=&quot;smallcaps&quot;&gt;Small caps&lt;/span&gt;
</programlisting>
        <para>
          For compatibility with other Markdown flavors, CSS is also
          supported:
        </para>
        <programlisting>
&lt;span style=&quot;font-variant:small-caps;&quot;&gt;Small caps&lt;/span&gt;
</programlisting>
        <para>
          This will work in all output formats that support small caps.
        </para>
      </section>
      <section xml:id="highlighting">
        <title>Highlighting</title>
        <para>
          To highlight text, use the <literal>mark</literal> class:
        </para>
        <programlisting>
[Mark]{.mark}
</programlisting>
        <para>
          Or, without the <literal>bracketed_spans</literal> extension
          (but with <literal>native_spans</literal>):
        </para>
        <programlisting>
&lt;span class=&quot;mark&quot;&gt;Mark&lt;/span&gt;
</programlisting>
        <para>
          This will work in all output formats that support
          highlighting.
        </para>
      </section>
    </section>
    <section xml:id="math">
      <title>Math</title>
      <section xml:id="extension-tex_math_dollars">
        <title>Extension: <literal>tex_math_dollars</literal></title>
        <para>
          Anything between two <literal>$</literal> characters will be
          treated as TeX math. The opening <literal>$</literal> must
          have a non-space character immediately to its right, while the
          closing <literal>$</literal> must have a non-space character
          immediately to its left, and must not be followed immediately
          by a digit. Thus, <literal>$20,000 and $30,000</literal> won’t
          parse as math. If for some reason you need to enclose text in
          literal <literal>$</literal> characters, backslash-escape them
          and they won’t be treated as math delimiters.
        </para>
        <para>
          For display math, use <literal>$$</literal> delimiters. (In
          this case, the delimiters may be separated from the formula by
          whitespace. However, there can be no blank lines between the
          opening and closing <literal>$$</literal> delimiters.)
        </para>
        <para>
          TeX math will be printed in all output formats. How it is
          rendered depends on the output format:
        </para>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              LaTeX
            </term>
            <listitem>
              <para>
                It will appear verbatim surrounded by
                <literal>\(...\)</literal> (for inline math) or
                <literal>\[...\]</literal> (for display math).
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              Markdown, Emacs Org mode, ConTeXt, ZimWiki
            </term>
            <listitem>
              <para>
                It will appear verbatim surrounded by
                <literal>$...$</literal> (for inline math) or
                <literal>$$...$$</literal> (for display math).
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              XWiki
            </term>
            <listitem>
              <para>
                It will appear verbatim surrounded by
                <literal>{{formula}}..{{/formula}}</literal>.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              reStructuredText
            </term>
            <listitem>
              <para>
                It will be rendered using an
                <link xlink:href="https://docutils.sourceforge.io/docs/ref/rst/roles.html#math">interpreted
                text role <literal>:math:</literal></link>.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              AsciiDoc
            </term>
            <listitem>
              <para>
                For AsciiDoc output math will appear verbatim surrounded
                by <literal>latexmath:[...]</literal>. For
                <literal>asciidoc_legacy</literal> the bracketed
                material will also include inline or display math
                delimiters.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              Texinfo
            </term>
            <listitem>
              <para>
                It will be rendered inside a <literal>@math</literal>
                command.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              roff man, Jira markup
            </term>
            <listitem>
              <para>
                It will be rendered verbatim without
                <literal>$</literal>’s.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              MediaWiki, DokuWiki
            </term>
            <listitem>
              <para>
                It will be rendered inside
                <literal>&lt;math&gt;</literal> tags.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              Textile
            </term>
            <listitem>
              <para>
                It will be rendered inside
                <literal>&lt;span class=&quot;math&quot;&gt;</literal>
                tags.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              RTF, OpenDocument
            </term>
            <listitem>
              <para>
                It will be rendered, if possible, using Unicode
                characters, and will otherwise appear verbatim.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              ODT
            </term>
            <listitem>
              <para>
                It will be rendered, if possible, using MathML.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              DocBook
            </term>
            <listitem>
              <para>
                If the <literal>--mathml</literal> flag is used, it will
                be rendered using MathML in an
                <literal>inlineequation</literal> or
                <literal>informalequation</literal> tag. Otherwise it
                will be rendered, if possible, using Unicode characters.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              Docx and PowerPoint
            </term>
            <listitem>
              <para>
                It will be rendered using OMML math markup.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              FictionBook2
            </term>
            <listitem>
              <para>
                If the <literal>--webtex</literal> 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.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              HTML, Slidy, DZSlides, S5, EPUB
            </term>
            <listitem>
              <para>
                The way math is rendered in HTML will depend on the
                command-line options selected. Therefore see
                <link linkend="math-rendering-in-html">Math rendering in
                HTML</link> above.
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
      </section>
    </section>
    <section xml:id="raw-html">
      <title>Raw HTML</title>
      <section xml:id="extension-raw_html">
        <title>Extension: <literal>raw_html</literal></title>
        <para>
          Markdown allows you to insert raw HTML (or DocBook) anywhere
          in a document (except verbatim contexts, where
          <literal>&lt;</literal>, <literal>&gt;</literal>, and
          <literal>&amp;</literal> 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.)
        </para>
        <para>
          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.
        </para>
        <para>
          For a more explicit way of including raw HTML in a Markdown
          document, see the
          <link linkend="extension-raw_attribute"><literal>raw_attribute</literal>
          extension</link>.
        </para>
        <para>
          In the CommonMark format, if <literal>raw_html</literal> is
          enabled, superscripts, subscripts, strikeouts and small
          capitals will be represented as HTML. Otherwise, plain-text
          fallbacks will be used. Note that even if
          <literal>raw_html</literal> is disabled, tables will be
          rendered with HTML syntax if they cannot use pipe syntax.
        </para>
      </section>
      <section xml:id="extension-markdown_in_html_blocks">
        <title>Extension:
        <literal>markdown_in_html_blocks</literal></title>
        <para>
          Original Markdown allows you to include HTML
          <quote>blocks</quote>: 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), <literal>*</literal> does not signify emphasis.
        </para>
        <para>
          Pandoc behaves this way when the
          <literal>markdown_strict</literal> format is used; but by
          default, pandoc interprets material between HTML block tags as
          Markdown. Thus, for example, pandoc will turn
        </para>
        <programlisting>
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;*one*&lt;/td&gt;
&lt;td&gt;[a link](https://google.com)&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
</programlisting>
        <para>
          into
        </para>
        <programlisting>
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;&lt;em&gt;one&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;https://google.com&quot;&gt;a link&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
</programlisting>
        <para>
          whereas <literal>Markdown.pl</literal> will preserve it as is.
        </para>
        <para>
          There is one exception to this rule: text between
          <literal>&lt;script&gt;</literal>,
          <literal>&lt;style&gt;</literal>,
          <literal>&lt;pre&gt;</literal>, and
          <literal>&lt;textarea&gt;</literal> tags is not interpreted as
          Markdown.
        </para>
        <para>
          This departure from original Markdown should make it easier to
          mix Markdown with HTML block elements. For example, one can
          surround a block of Markdown text with
          <literal>&lt;div&gt;</literal> tags without preventing it from
          being interpreted as Markdown.
        </para>
      </section>
      <section xml:id="extension-native_divs">
        <title>Extension: <literal>native_divs</literal></title>
        <para>
          Use native pandoc <literal>Div</literal> blocks for content
          inside <literal>&lt;div&gt;</literal> tags. For the most part
          this should give the same output as
          <literal>markdown_in_html_blocks</literal>, but it makes it
          easier to write pandoc filters to manipulate groups of blocks.
        </para>
      </section>
      <section xml:id="extension-native_spans">
        <title>Extension: <literal>native_spans</literal></title>
        <para>
          Use native pandoc <literal>Span</literal> blocks for content
          inside <literal>&lt;span&gt;</literal> tags. For the most part
          this should give the same output as
          <literal>raw_html</literal>, but it makes it easier to write
          pandoc filters to manipulate groups of inlines.
        </para>
      </section>
      <section xml:id="extension-raw_tex">
        <title>Extension: <literal>raw_tex</literal></title>
        <para>
          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:
        </para>
        <programlisting>
This result was proved in \cite{jones.1967}.
</programlisting>
        <para>
          Note that in LaTeX environments, like
        </para>
        <programlisting>
\begin{tabular}{|l|l|}\hline
Age &amp; Frequency \\ \hline
18--25  &amp; 15 \\
26--35  &amp; 33 \\
36--45  &amp; 22 \\ \hline
\end{tabular}
</programlisting>
        <para>
          the material between the begin and end tags will be
          interpreted as raw LaTeX, not as Markdown.
        </para>
        <para>
          For a more explicit and flexible way of including raw TeX in a
          Markdown document, see the
          <link linkend="extension-raw_attribute"><literal>raw_attribute</literal>
          extension</link>.
        </para>
        <para>
          Inline LaTeX is ignored in output formats other than Markdown,
          LaTeX, Emacs Org mode, and ConTeXt.
        </para>
      </section>
      <section xml:id="generic-raw-attribute">
        <title>Generic raw attribute</title>
        <para>
        </para>
      </section>
      <section xml:id="extension-raw_attribute">
        <title>Extension: <literal>raw_attribute</literal></title>
        <para>
          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
          <literal>ms</literal> block:
        </para>
        <programlisting>
```{=ms}
.MYMACRO
blah blah
```
</programlisting>
        <para>
          And the following produces a raw <literal>html</literal>
          inline element:
        </para>
        <programlisting>
This is `&lt;a&gt;html&lt;/a&gt;`{=html}
</programlisting>
        <para>
          This can be useful to insert raw xml into
          <literal>docx</literal> documents, e.g. a pagebreak:
        </para>
        <programlisting>
```{=openxml}
&lt;w:p&gt;
  &lt;w:r&gt;
    &lt;w:br w:type=&quot;page&quot;/&gt;
  &lt;/w:r&gt;
&lt;/w:p&gt;
```
</programlisting>
        <para>
          The format name should match the target format name (see
          <literal>-t/--to</literal>, above, for a list, or use
          <literal>pandoc --list-output-formats</literal>). Use
          <literal>openxml</literal> for <literal>docx</literal> output,
          <literal>opendocument</literal> for <literal>odt</literal>
          output, <literal>html5</literal> for <literal>epub3</literal>
          output, <literal>html4</literal> for <literal>epub2</literal>
          output, and <literal>latex</literal>,
          <literal>beamer</literal>, <literal>ms</literal>, or
          <literal>html5</literal> for <literal>pdf</literal> output
          (depending on what you use for
          <literal>--pdf-engine</literal>).
        </para>
        <para>
          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,
          <literal>backtick_code_blocks</literal> must be enabled.
        </para>
        <para>
          The raw attribute cannot be combined with regular attributes.
        </para>
      </section>
    </section>
    <section xml:id="latex-macros">
      <title>LaTeX macros</title>
      <section xml:id="extension-latex_macros">
        <title>Extension: <literal>latex_macros</literal></title>
        <para>
          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:
        </para>
        <programlisting>
\newcommand{\tuple}[1]{\langle #1 \rangle}

$\tuple{a, b, c}$
</programlisting>
        <para>
          Note that LaTeX macros will not be applied if they occur
          inside a raw span or block marked with the
          <link linkend="extension-raw_attribute"><literal>raw_attribute</literal>
          extension</link>.
        </para>
        <para>
          When <literal>latex_macros</literal> 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.
        </para>
        <para>
          Macro definitions in LaTeX will be passed through as raw LaTeX
          only if <literal>latex_macros</literal> is not enabled. Macro
          definitions in Markdown source (or other formats allowing
          <literal>raw_tex</literal>) will be passed through regardless
          of whether <literal>latex_macros</literal> is enabled.
        </para>
      </section>
    </section>
    <section xml:id="links-1">
      <title>Links</title>
      <para>
        Markdown allows links to be specified in several ways.
      </para>
      <section xml:id="automatic-links">
        <title>Automatic links</title>
        <para>
          If you enclose a URL or email address in pointy brackets, it
          will become a link:
        </para>
        <programlisting>
&lt;https://google.com&gt;
&lt;sam@green.eggs.ham&gt;
</programlisting>
      </section>
      <section xml:id="inline-links">
        <title>Inline links</title>
        <para>
          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.)
        </para>
        <programlisting>
This is an [inline link](/url), and here's [one with
a title](https://fsf.org &quot;click here for a good time!&quot;).
</programlisting>
        <para>
          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.
        </para>
        <para>
          Email addresses in inline links are not autodetected, so they
          have to be prefixed with <literal>mailto</literal>:
        </para>
        <programlisting>
[Write me!](mailto:sam@green.eggs.ham)
</programlisting>
      </section>
      <section xml:id="reference-links">
        <title>Reference links</title>
        <para>
          An <emphasis>explicit</emphasis> 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).
        </para>
        <para>
          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 <literal>spaced_reference_links</literal>
          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 <literal>citations</literal> extension
          is enabled): citations take precedence over link labels.
        </para>
        <para>
          Here are some examples:
        </para>
        <programlisting>
[my label 1]: /foo/bar.html  &quot;My title, optional&quot;
[my label 2]: /foo
[my label 3]: https://fsf.org (The Free Software Foundation)
[my label 4]: /bar#special  'A title in single quotes'
</programlisting>
        <para>
          The URL may optionally be surrounded by angle brackets:
        </para>
        <programlisting>
[my label 5]: &lt;http://foo.bar.baz&gt;
</programlisting>
        <para>
          The title may go on the next line:
        </para>
        <programlisting>
[my label 3]: https://fsf.org
  &quot;The Free Software Foundation&quot;
</programlisting>
        <para>
          Note that link labels are not case sensitive. So, this will
          work:
        </para>
        <programlisting>
Here is [my link][FOO]

[Foo]: /bar/baz
</programlisting>
        <para>
          In an <emphasis>implicit</emphasis> reference link, the second
          pair of brackets is empty:
        </para>
        <programlisting>
See [my website][].

[my website]: http://foo.bar.baz
</programlisting>
        <para>
          Note: In <literal>Markdown.pl</literal> 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:
        </para>
        <programlisting>
&gt; My block [quote].
&gt;
&gt; [quote]: /foo
</programlisting>
      </section>
      <section xml:id="extension-shortcut_reference_links">
        <title>Extension:
        <literal>shortcut_reference_links</literal></title>
        <para>
          In a <emphasis>shortcut</emphasis> reference link, the second
          pair of brackets may be omitted entirely:
        </para>
        <programlisting>
See [my website].

[my website]: http://foo.bar.baz
</programlisting>
      </section>
      <section xml:id="internal-links">
        <title>Internal links</title>
        <para>
          To link to another section of the same document, use the
          automatically generated identifier (see
          <link linkend="heading-identifiers">Heading
          identifiers</link>). For example:
        </para>
        <programlisting>
See the [Introduction](#introduction).
</programlisting>
        <para>
          or
        </para>
        <programlisting>
See the [Introduction].

[Introduction]: #introduction
</programlisting>
        <para>
          Internal links are currently supported for HTML formats
          (including HTML slide shows and EPUB), LaTeX, and ConTeXt.
        </para>
      </section>
    </section>
    <section xml:id="images">
      <title>Images</title>
      <para>
        A link immediately preceded by a <literal>!</literal> will be
        treated as an image. The link text will be used as the image’s
        alt text:
      </para>
      <programlisting>
![la lune](lalune.jpg &quot;Voyage to the moon&quot;)

![movie reel]

[movie reel]: movie.gif
</programlisting>
      <section xml:id="extension-implicit_figures">
        <title>Extension: <literal>implicit_figures</literal></title>
        <para>
          An image with nonempty alt text, occurring by itself in a
          paragraph, will be rendered as a figure with a caption. The
          image’s alt text will be used as the caption.
        </para>
        <programlisting>
![This is the caption](/url/of/image.png)
</programlisting>
        <para>
          How this is rendered depends on the output format. Some output
          formats (e.g. RTF) do not yet support figures. In those
          formats, you’ll just get an image in a paragraph by itself,
          with no caption. For LaTeX output, you can specify a
          <link xlink:href="https://www.overleaf.com/learn/latex/Positioning_images_and_tables#The_figure_environment">figure’s
          positioning</link> by adding the
          <literal>latex-placement</literal> attribute.
        </para>
        <programlisting>
![This is the caption](/url/of/image.png){latex-placement=&quot;ht&quot;}
</programlisting>
        <para>
          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:
        </para>
        <programlisting>
![This image won't be a figure](/url/of/image.png)\
</programlisting>
        <para>
          Note that in reveal.js slide shows, an image in a paragraph by
          itself that has the <literal>r-stretch</literal> class will
          fill the screen, and the caption and figure tags will be
          omitted.
        </para>
      </section>
      <section xml:id="extension-link_attributes">
        <title>Extension: <literal>link_attributes</literal></title>
        <para>
          Attributes can be set on links and images:
        </para>
        <programlisting>
An inline ![image](foo.jpg){#id .class width=30 height=20px}
and a reference ![image][ref] with attributes.

[ref]: foo.jpg &quot;optional title&quot; {#id .class key=val key2=&quot;val 2&quot;}
</programlisting>
        <para>
          (This syntax is compatible with
          <link xlink:href="https://michelf.ca/projects/php-markdown/extra/">PHP
          Markdown Extra</link> when only <literal>#id</literal> and
          <literal>.class</literal> are used.)
        </para>
        <para>
          For HTML and EPUB, all known HTML5 attributes except
          <literal>width</literal> and <literal>height</literal> (but
          including <literal>srcset</literal> and
          <literal>sizes</literal>) are passed through as is. Unknown
          attributes are passed through as custom attributes, with
          <literal>data-</literal> prepended. The other writers ignore
          attributes that are not specifically supported by their output
          format.
        </para>
        <para>
          The <literal>width</literal> and <literal>height</literal>
          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: <literal>px</literal>,
          <literal>cm</literal>, <literal>mm</literal>,
          <literal>in</literal>, <literal>inch</literal> and
          <literal>%</literal>. There must not be any spaces between the
          number and the unit. For example:
        </para>
        <programlisting>
![](file.jpg){ width=50% }
</programlisting>
        <itemizedlist spacing="compact">
          <listitem>
            <para>
              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 <literal>--dpi</literal>
              option (by default, 96 dpi is assumed, unless the image
              itself contains dpi information).
            </para>
          </listitem>
          <listitem>
            <para>
              The <literal>%</literal> unit is generally relative to
              some available space. For example the above example will
              render to the following.
            </para>
            <itemizedlist spacing="compact">
              <listitem>
                <para>
                  HTML:
                  <literal>&lt;img href=&quot;file.jpg&quot; style=&quot;width: 50%;&quot; /&gt;</literal>
                </para>
              </listitem>
              <listitem>
                <para>
                  LaTeX:
                  <literal>\includegraphics[width=0.5\textwidth,height=\textheight]{file.jpg}</literal>
                  (If you’re using a custom template, you need to
                  configure <literal>graphicx</literal> as in the
                  default template.)
                </para>
              </listitem>
              <listitem>
                <para>
                  ConTeXt:
                  <literal>\externalfigure[file.jpg][width=0.5\textwidth]</literal>
                </para>
              </listitem>
            </itemizedlist>
          </listitem>
          <listitem>
            <para>
              Some output formats have a notion of a class
              (<link xlink:href="https://wiki.contextgarden.net/Using_Graphics#Multiple_Image_Settings">ConTeXt</link>)
              or a unique identifier (LaTeX
              <literal>\caption</literal>), or both (HTML).
            </para>
          </listitem>
          <listitem>
            <para>
              When no <literal>width</literal> or
              <literal>height</literal> attributes are specified, the
              fallback is to look at the image resolution and the dpi
              metadata embedded in the image file.
            </para>
          </listitem>
        </itemizedlist>
      </section>
    </section>
    <section xml:id="divs-and-spans">
      <title>Divs and Spans</title>
      <para>
        Using the <literal>native_divs</literal> and
        <literal>native_spans</literal> extensions (see
        <link linkend="extension-native_divs">above</link>), HTML syntax
        can be used as part of Markdown to create native
        <literal>Div</literal> and <literal>Span</literal> elements in
        the pandoc AST (as opposed to raw HTML). However, there is also
        nicer syntax available:
      </para>
      <section xml:id="extension-fenced_divs">
        <title>Extension: <literal>fenced_divs</literal></title>
        <para>
          Allow special fenced syntax for native <literal>Div</literal>
          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.
        </para>
        <para>
          Note: the <literal>commonmark</literal> parser doesn’t permit
          colons after the attributes.
        </para>
        <para>
          The attribute syntax is exactly as in fenced code blocks (see
          <link linkend="extension-fenced_code_attributes">Extension:
          <literal>fenced_code_attributes</literal></link>). 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.
        </para>
        <para>
          Example:
        </para>
        <programlisting>
::::: {#special .sidebar}
Here is a paragraph.

And another.
:::::
</programlisting>
        <para>
          Fenced divs can be nested. Opening fences are distinguished
          because they <emphasis>must</emphasis> have attributes:
        </para>
        <programlisting>
::: Warning ::::::
This is a warning.

::: Danger
This is a warning within a warning.
:::
::::::::::::::::::
</programlisting>
        <para>
          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.
        </para>
      </section>
      <section xml:id="extension-bracketed_spans">
        <title>Extension: <literal>bracketed_spans</literal></title>
        <para>
          A bracketed sequence of inlines, as one would use to begin a
          link, will be treated as a <literal>Span</literal> with
          attributes if it is followed immediately by attributes:
        </para>
        <programlisting>
[This is *some text*]{.class key=&quot;val&quot;}
</programlisting>
      </section>
    </section>
    <section xml:id="footnotes">
      <title>Footnotes</title>
      <section xml:id="extension-footnotes">
        <title>Extension: <literal>footnotes</literal></title>
        <para>
          Pandoc’s Markdown allows footnotes, using the following
          syntax:
        </para>
        <programlisting>
Here is a footnote reference,[^1] and another.[^longnote]

[^1]: Here is the footnote.

[^longnote]: Here'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't be part of the note, because it
isn't indented.
</programlisting>
        <para>
          The identifiers in footnote references may not contain spaces,
          tabs, newlines, or the characters <literal>^</literal>,
          <literal>[</literal>, or <literal>]</literal>. These
          identifiers are used only to correlate the footnote reference
          with the note itself; in the output, footnotes will be
          numbered sequentially.
        </para>
        <para>
          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.
        </para>
      </section>
      <section xml:id="extension-inline_notes">
        <title>Extension: <literal>inline_notes</literal></title>
        <para>
          Inline footnotes are also allowed (though, unlike regular
          notes, they cannot contain multiple paragraphs). The syntax is
          as follows:
        </para>
        <programlisting>
Here is an inline note.^[Inline notes are easier to write, since
you don't have to pick an identifier and move down to type the
note.]
</programlisting>
        <para>
          Inline and regular footnotes may be mixed freely.
        </para>
      </section>
    </section>
    <section xml:id="citation-syntax">
      <title>Citation syntax</title>
      <section xml:id="extension-citations">
        <title>Extension: <literal>citations</literal></title>
        <para>
          To cite a bibliographic item with an identifier foo, use the
          syntax <literal>@foo</literal>. Normal citations should be
          included in square brackets, with semicolons separating
          distinct items:
        </para>
        <programlisting>
Blah blah [@doe99; @smith2000; @smith2004].
</programlisting>
        <para>
          How this is rendered depends on the citation style. In an
          author-date style, it might render as
        </para>
        <programlisting>
Blah blah (Doe 1999, Smith 2000, 2004).
</programlisting>
        <para>
          In a footnote style, it might render as
        </para>
        <programlisting>
Blah blah.[^1]

[^1]:  John Doe, &quot;Frogs,&quot; *Journal of Amphibians* 44 (1999);
Susan Smith, &quot;Flies,&quot; *Journal of Insects* (2000);
Susan Smith, &quot;Bees,&quot; *Journal of Insects* (2004).
</programlisting>
        <para>
          See the
          <link xlink:href="https://citationstyles.org/authors/">CSL
          user documentation</link> for more information about CSL
          styles and how they affect rendering.
        </para>
        <para>
          Unless a citation key starts with a letter, digit, or
          <literal>_</literal>, and contains only alphanumerics and
          single internal punctuation characters
          (<literal>:.#$%&amp;-+?&lt;&gt;~/</literal>), it must be
          surrounded by curly braces, which are not considered part of
          the key. In <literal>@Foo_bar.baz.</literal>, the key is
          <literal>Foo_bar.baz</literal> because the final period is not
          <emphasis>internal</emphasis> punctuation, so it is not
          included in the key. In <literal>@{Foo_bar.baz.}</literal>,
          the key is <literal>Foo_bar.baz.</literal>, including the
          final period. In <literal>@Foo_bar--baz</literal>, the key is
          <literal>Foo_bar</literal> because the repeated internal
          punctuation characters terminate the key. The curly braces are
          recommended if you use URLs as keys:
          <literal>[@{https://example.com/bib?name=foobar&amp;date=2000}, p.  33]</literal>.
        </para>
        <para>
          Citation items may optionally include a prefix, a locator, and
          a suffix. In
        </para>
        <programlisting>
Blah blah [see @doe99, pp. 33-35 and *passim*; @smith04, chap. 1].
</programlisting>
        <para>
          the first item (<literal>doe99</literal>) has prefix
          <literal>see</literal>, locator <literal>pp.  33-35</literal>,
          and suffix <literal>and *passim*</literal>. The second item
          (<literal>smith04</literal>) has locator
          <literal>chap. 1</literal> and no prefix or suffix.
        </para>
        <para>
          Pandoc uses some heuristics to separate the locator from the
          rest of the subject. It is sensitive to the locator terms
          defined in the
          <link xlink:href="https://github.com/citation-style-language/locales">CSL
          locale files</link>. Either abbreviated or unabbreviated forms
          are accepted. In the <literal>en-US</literal> locale, locator
          terms can be written in either singular or plural forms, as
          <literal>book</literal>,
          <literal>bk.</literal>/<literal>bks.</literal>;
          <literal>chapter</literal>,
          <literal>chap.</literal>/<literal>chaps.</literal>;
          <literal>column</literal>,
          <literal>col.</literal>/<literal>cols.</literal>;
          <literal>figure</literal>,
          <literal>fig.</literal>/<literal>figs.</literal>;
          <literal>folio</literal>,
          <literal>fol.</literal>/<literal>fols.</literal>;
          <literal>number</literal>,
          <literal>no.</literal>/<literal>nos.</literal>;
          <literal>line</literal>,
          <literal>l.</literal>/<literal>ll.</literal>;
          <literal>note</literal>,
          <literal>n.</literal>/<literal>nn.</literal>;
          <literal>opus</literal>,
          <literal>op.</literal>/<literal>opp.</literal>;
          <literal>page</literal>,
          <literal>p.</literal>/<literal>pp.</literal>;
          <literal>paragraph</literal>,
          <literal>para.</literal>/<literal>paras.</literal>;
          <literal>part</literal>,
          <literal>pt.</literal>/<literal>pts.</literal>;
          <literal>section</literal>,
          <literal>sec.</literal>/<literal>secs.</literal>;
          <literal>sub verbo</literal>,
          <literal>s.v.</literal>/<literal>s.vv.</literal>;
          <literal>verse</literal>,
          <literal>v.</literal>/<literal>vv.</literal>;
          <literal>volume</literal>,
          <literal>vol.</literal>/<literal>vols.</literal>;
          <literal>¶</literal>/<literal>¶¶</literal>;
          <literal>§</literal>/<literal>§§</literal>. If no locator term
          is used, <quote>page</quote> is assumed.
        </para>
        <para>
          In complex cases, you can force something to be treated as a
          locator by enclosing it in curly braces or prevent parsing the
          suffix as locator by prepending curly braces:
        </para>
        <programlisting>
[@smith{ii, A, D-Z}, with a suffix]
[@smith, {pp. iv, vi-xi, (xv)-(xvii)} with suffix here]
[@smith{}, 99 years later]
</programlisting>
        <para>
          A minus sign (<literal>-</literal>) before the
          <literal>@</literal> will suppress mention of the author in
          the citation. This can be useful when the author is already
          mentioned in the text:
        </para>
        <programlisting>
Smith says blah [-@smith04].
</programlisting>
        <para>
          You can also write an author-in-text citation, by omitting the
          square brackets:
        </para>
        <programlisting>
@smith04 says blah.

@smith04 [p. 33] says blah.
</programlisting>
        <para>
          This will cause the author’s name to be rendered, followed by
          the bibliographical details. Use this form when you want to
          make the citation the subject of a sentence.
        </para>
        <para>
          When you are using a note style, it is usually better to let
          citeproc create the footnotes from citations rather than
          writing an explicit note. If you do write an explicit note
          that contains a citation, note that normal citations will be
          put in parentheses, while author-in-text citations will not.
          For this reason, it is sometimes preferable to use the
          author-in-text style inside notes when using a note style.
        </para>
      </section>
    </section>
    <section xml:id="non-default-extensions">
      <title>Non-default extensions</title>
      <para>
        The following Markdown syntax extensions are not enabled by
        default in pandoc, but may be enabled by adding
        <literal>+EXTENSION</literal> to the format name, where
        <literal>EXTENSION</literal> is the name of the extension. Thus,
        for example, <literal>markdown+hard_line_breaks</literal> is
        Markdown with hard line breaks.
      </para>
      <section xml:id="extension-rebase_relative_paths">
        <title>Extension:
        <literal>rebase_relative_paths</literal></title>
        <para>
          Rewrite relative paths for Markdown links and images,
          depending on the path of the file containing the link or image
          link. For each link or image, pandoc will compute the
          directory of the containing file, relative to the working
          directory, and prepend the resulting path to the link or image
          path.
        </para>
        <para>
          The use of this extension is best understood by example.
          Suppose you have a subdirectory for each chapter of a book,
          <literal>chap1</literal>, <literal>chap2</literal>,
          <literal>chap3</literal>. Each contains a file
          <literal>text.md</literal> and a number of images used in the
          chapter. You would like to have
          <literal>![image](spider.jpg)</literal> in
          <literal>chap1/text.md</literal> refer to
          <literal>chap1/spider.jpg</literal> and
          <literal>![image](spider.jpg)</literal> in
          <literal>chap2/text.md</literal> refer to
          <literal>chap2/spider.jpg</literal>. To do this, use
        </para>
        <programlisting>
pandoc chap*/*.md -f markdown+rebase_relative_paths
</programlisting>
        <para>
          Without this extension, you would have to use
          <literal>![image](chap1/spider.jpg)</literal> in
          <literal>chap1/text.md</literal> and
          <literal>![image](chap2/spider.jpg)</literal> in
          <literal>chap2/text.md</literal>. Links with relative paths
          will be rewritten in the same way as images.
        </para>
        <para>
          Absolute paths and URLs are not changed. Neither are empty
          paths or paths consisting entirely of a fragment, e.g.,
          <literal>#foo</literal>.
        </para>
        <para>
          Note that relative paths in reference links and images will be
          rewritten relative to the file containing the link reference
          definition, not the file containing the reference link or
          image itself, if these differ.
        </para>
      </section>
      <section xml:id="extension-mark">
        <title>Extension: <literal>mark</literal></title>
        <para>
          To highlight out a section of text, begin and end it with with
          <literal>==</literal>. Thus, for example,
        </para>
        <programlisting>
This ==is deleted text.==
</programlisting>
      </section>
      <section xml:id="extension-attributes">
        <title>Extension: <literal>attributes</literal></title>
        <para>
          Allows attributes to be attached to any inline or block-level
          element when parsing <literal>commonmark</literal>. The syntax
          for the attributes is the same as that used in
          <link linkend="extension-header_attributes"><literal>header_attributes</literal></link>.
        </para>
        <itemizedlist spacing="compact">
          <listitem>
            <para>
              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
              <literal>inline_code_attributes</literal> and
              <literal>link_attributes</literal>.)
            </para>
          </listitem>
          <listitem>
            <para>
              Attributes that occur immediately before a block element,
              on a line by themselves, affect that element.
            </para>
          </listitem>
          <listitem>
            <para>
              Consecutive attribute specifiers may be used, either for
              blocks or for inlines. Their attributes will be combined.
            </para>
          </listitem>
          <listitem>
            <para>
              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
              <literal>header_attributes</literal>.)
            </para>
          </listitem>
          <listitem>
            <para>
              Attributes that occur after the opening fence in a fenced
              code block affect the code block element. (Hence, this
              option subsumes
              <literal>fenced_code_attributes</literal>.)
            </para>
          </listitem>
          <listitem>
            <para>
              Attributes that occur at the end of a reference link
              definition affect links that refer to that definition.
            </para>
          </listitem>
        </itemizedlist>
        <para>
          Note that pandoc’s AST does not currently allow attributes to
          be attached to arbitrary elements. Hence a Span or Div
          container will be added if needed.
        </para>
      </section>
      <section xml:id="extension-old_dashes">
        <title>Extension: <literal>old_dashes</literal></title>
        <para>
          Selects the pandoc &lt;= 1.8.2.1 behavior for parsing smart
          dashes: <literal>-</literal> before a numeral is an en-dash,
          and <literal>--</literal> is an em-dash. This option only has
          an effect if <literal>smart</literal> is enabled. It is
          selected automatically for <literal>textile</literal> input.
        </para>
      </section>
      <section xml:id="extension-angle_brackets_escapable">
        <title>Extension:
        <literal>angle_brackets_escapable</literal></title>
        <para>
          Allow <literal>&lt;</literal> and <literal>&gt;</literal> to
          be backslash-escaped, as they can be in GitHub flavored
          Markdown but not original Markdown. This is implied by
          pandoc’s default <literal>all_symbols_escapable</literal>.
        </para>
      </section>
      <section xml:id="extension-lists_without_preceding_blankline">
        <title>Extension:
        <literal>lists_without_preceding_blankline</literal></title>
        <para>
          Allow a list to occur right after a paragraph, with no
          intervening blank space.
        </para>
      </section>
      <section xml:id="extension-four_space_rule">
        <title>Extension: <literal>four_space_rule</literal></title>
        <para>
          Selects the pandoc &lt;= 2.0 behavior for parsing lists, so
          that four spaces indent are needed for list item continuation
          paragraphs.
        </para>
      </section>
      <section xml:id="extension-spaced_reference_links">
        <title>Extension:
        <literal>spaced_reference_links</literal></title>
        <para>
          Allow whitespace between the two components of a reference
          link, for example,
        </para>
        <programlisting>
[foo] [bar].
</programlisting>
      </section>
      <section xml:id="extension-hard_line_breaks">
        <title>Extension: <literal>hard_line_breaks</literal></title>
        <para>
          Causes all newlines within a paragraph to be interpreted as
          hard line breaks instead of spaces.
        </para>
      </section>
      <section xml:id="extension-ignore_line_breaks">
        <title>Extension: <literal>ignore_line_breaks</literal></title>
        <para>
          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.
        </para>
      </section>
      <section xml:id="extension-east_asian_line_breaks">
        <title>Extension:
        <literal>east_asian_line_breaks</literal></title>
        <para>
          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 <literal>ignore_line_breaks</literal> for texts
          that include a mix of East Asian wide characters and other
          characters.
        </para>
      </section>
      <section xml:id="extension-emoji">
        <title>Extension: <literal>emoji</literal></title>
        <para>
          Parses textual emojis like <literal>:smile:</literal> as
          Unicode emoticons.
        </para>
      </section>
      <section xml:id="extension-tex_math_gfm">
        <title>Extension: <literal>tex_math_gfm</literal></title>
        <para>
          Supports two GitHub-specific formats for math. Inline math:
          <literal>$`e=mc^2`$</literal>.
        </para>
        <para>
          Display math:
        </para>
        <programlisting>
``` math
e=mc^2
```
</programlisting>
      </section>
      <section xml:id="extension-tex_math_single_backslash">
        <title>Extension:
        <literal>tex_math_single_backslash</literal></title>
        <para>
          Causes anything between <literal>\(</literal> and
          <literal>\)</literal> to be interpreted as inline TeX math,
          and anything between <literal>\[</literal> and
          <literal>\]</literal> to be interpreted as display TeX math.
          Note: a drawback of this extension is that it precludes
          escaping <literal>(</literal> and <literal>[</literal>.
        </para>
      </section>
      <section xml:id="extension-tex_math_double_backslash">
        <title>Extension:
        <literal>tex_math_double_backslash</literal></title>
        <para>
          Causes anything between <literal>\\(</literal> and
          <literal>\\)</literal> to be interpreted as inline TeX math,
          and anything between <literal>\\[</literal> and
          <literal>\\]</literal> to be interpreted as display TeX math.
        </para>
      </section>
      <section xml:id="extension-markdown_attribute">
        <title>Extension: <literal>markdown_attribute</literal></title>
        <para>
          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 <literal>markdown=1</literal>.
        </para>
      </section>
      <section xml:id="extension-mmd_title_block">
        <title>Extension: <literal>mmd_title_block</literal></title>
        <para>
          Enables a
          <link xlink:href="https://fletcherpenney.net/multimarkdown/">MultiMarkdown</link>
          style title block at the top of the document, for example:
        </para>
        <programlisting>
Title:   My title
Author:  John Doe
Date:    September 1, 2008
Comment: This is a sample mmd title block, with
         a field spanning multiple lines.
</programlisting>
        <para>
          See the MultiMarkdown documentation for details. If
          <literal>pandoc_title_block</literal> or
          <literal>yaml_metadata_block</literal> is enabled, it will
          take precedence over <literal>mmd_title_block</literal>.
        </para>
      </section>
      <section xml:id="extension-abbreviations">
        <title>Extension: <literal>abbreviations</literal></title>
        <para>
          Parses PHP Markdown Extra abbreviation keys, like
        </para>
        <programlisting>
*[HTML]: Hypertext Markup Language
</programlisting>
        <para>
          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).
        </para>
      </section>
      <section xml:id="extension-alerts">
        <title>Extension: <literal>alerts</literal></title>
        <para>
          Supports
          <link xlink:href="https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts">GitHub-style
          Markdown alerts</link>, like
        </para>
        <programlisting>
&gt; [!TIP]
&gt; Helpful advice for doing things better or more easily.
</programlisting>
        <para>
          Note: This extension currently only works with commonmark:
          <literal>commonmark</literal>, <literal>gfm</literal>,
          <literal>commonmark_x</literal>.
        </para>
      </section>
      <section xml:id="extension-autolink_bare_uris">
        <title>Extension: <literal>autolink_bare_uris</literal></title>
        <para>
          Makes all absolute URIs into links, even when not surrounded
          by pointy braces <literal>&lt;...&gt;</literal>.
        </para>
      </section>
      <section xml:id="extension-mmd_link_attributes">
        <title>Extension: <literal>mmd_link_attributes</literal></title>
        <para>
          Parses MultiMarkdown-style key-value attributes on link and
          image references. This extension should not be confused with
          the
          <link linkend="extension-link_attributes"><literal>link_attributes</literal></link>
          extension.
        </para>
        <programlisting>
This is a reference ![image][ref] with MultiMarkdown attributes.

[ref]: https://path.to/image &quot;Image title&quot; width=20px height=30px
       id=myId class=&quot;myClass1 myClass2&quot;
</programlisting>
      </section>
      <section xml:id="extension-mmd_header_identifiers">
        <title>Extension:
        <literal>mmd_header_identifiers</literal></title>
        <para>
          Parses MultiMarkdown-style heading identifiers (in square
          brackets, after the heading but before any trailing
          <literal>#</literal>s in an ATX heading).
        </para>
      </section>
      <section xml:id="extension-gutenberg">
        <title>Extension: <literal>gutenberg</literal></title>
        <para>
          Use <link xlink:href="https://www.gutenberg.org">Project
          Gutenberg</link> conventions for <literal>plain</literal>
          output: all-caps for strong emphasis, surround by underscores
          for regular emphasis, add extra blank space around headings.
        </para>
      </section>
      <section xml:id="extension-sourcepos">
        <title>Extension: <literal>sourcepos</literal></title>
        <para>
          Include source position attributes when parsing
          <literal>commonmark</literal>. For elements that accept
          attributes, a <literal>data-pos</literal> attribute is added;
          other elements are placed in a surrounding Div or Span element
          with a <literal>data-pos</literal> attribute.
        </para>
      </section>
      <section xml:id="extension-short_subsuperscripts">
        <title>Extension:
        <literal>short_subsuperscripts</literal></title>
        <para>
          Parse MultiMarkdown-style subscripts and superscripts, which
          start with a <quote>~</quote> or <quote>^</quote> character,
          respectively, and include the alphanumeric sequence that
          follows. For example:
        </para>
        <programlisting>
x^2 = 4
</programlisting>
        <para>
          or
        </para>
        <programlisting>
Oxygen is O~2.
</programlisting>
      </section>
      <section xml:id="extension-wikilinks_title_after_pipe">
        <title>Extension:
        <literal>wikilinks_title_after_pipe</literal></title>
        <para>
          Pandoc supports multiple Markdown wikilink syntaxes,
          regardless of whether the title is before or after the pipe.
        </para>
        <para>
          Using
          <literal>--from=markdown+wikilinks_title_after_pipe</literal>
          results in
        </para>
        <programlisting>
[[URL|title]]
</programlisting>
        <para>
          while using
          <literal>--from=markdown+wikilinks_title_before_pipe</literal>
          results in
        </para>
        <programlisting>
[[title|URL]]
</programlisting>
      </section>
    </section>
    <section xml:id="markdown-variants">
      <title>Markdown variants</title>
      <para>
        In addition to pandoc’s extended Markdown, the following
        Markdown variants are supported:
      </para>
      <itemizedlist spacing="compact">
        <listitem>
          <para>
            <literal>markdown_phpextra</literal> (PHP Markdown Extra)
          </para>
        </listitem>
        <listitem>
          <para>
            <literal>markdown_github</literal> (deprecated
            GitHub-Flavored Markdown)
          </para>
        </listitem>
        <listitem>
          <para>
            <literal>markdown_mmd</literal> (MultiMarkdown)
          </para>
        </listitem>
        <listitem>
          <para>
            <literal>markdown_strict</literal> (Markdown.pl)
          </para>
        </listitem>
        <listitem>
          <para>
            <literal>commonmark</literal> (CommonMark)
          </para>
        </listitem>
        <listitem>
          <para>
            <literal>gfm</literal> (Github-Flavored Markdown)
          </para>
        </listitem>
        <listitem>
          <para>
            <literal>commonmark_x</literal> (CommonMark with many pandoc
            extensions)
          </para>
        </listitem>
      </itemizedlist>
      <para>
        To see which extensions are supported for a given format, and
        which are enabled by default, you can use the command
      </para>
      <programlisting>
pandoc --list-extensions=FORMAT
</programlisting>
      <para>
        where <literal>FORMAT</literal> is replaced with the name of the
        format.
      </para>
      <para>
        Note that the list of extensions for
        <literal>commonmark</literal>, <literal>gfm</literal>, and
        <literal>commonmark_x</literal> are defined relative to default
        commonmark. So, for example,
        <literal>backtick_code_blocks</literal> does not appear as an
        extension, since it is enabled by default and cannot be
        disabled.
      </para>
    </section>
  </section>
  <section xml:id="citations">
    <title>Citations</title>
    <para>
      When the <literal>--citeproc</literal> option is used, pandoc can
      automatically generate citations and a bibliography in a number of
      styles. Basic usage is
    </para>
    <programlisting>
pandoc --citeproc myinput.txt
</programlisting>
    <para>
      To use this feature, you will need to have
    </para>
    <itemizedlist spacing="compact">
      <listitem>
        <para>
          a document containing citations (see
          <link linkend="citation-syntax">Citation syntax</link>);
        </para>
      </listitem>
      <listitem>
        <para>
          a source of bibliographic data: either an external
          bibliography file or a list of <literal>references</literal>
          in the document’s YAML metadata;
        </para>
      </listitem>
      <listitem>
        <para>
          optionally, a
          <link xlink:href="https://docs.citationstyles.org/en/stable/specification.html">CSL</link>
          citation style.
        </para>
      </listitem>
    </itemizedlist>
    <section xml:id="specifying-bibliographic-data">
      <title>Specifying bibliographic data</title>
      <para>
        You can specify an external bibliography using the
        <literal>bibliography</literal> metadata field in a YAML
        metadata section or the <literal>--bibliography</literal>
        command line argument. If you want to use multiple bibliography
        files, you can supply multiple <literal>--bibliography</literal>
        arguments or set <literal>bibliography</literal> metadata field
        to YAML array. A bibliography may have any of these formats:
      </para>
      <informaltable>
        <tgroup cols="2">
          <colspec align="left" />
          <colspec align="left" />
          <thead>
            <row>
              <entry>
                Format
              </entry>
              <entry>
                File extension
              </entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>
                BibLaTeX
              </entry>
              <entry>
                .bib
              </entry>
            </row>
            <row>
              <entry>
                BibTeX
              </entry>
              <entry>
                .bibtex
              </entry>
            </row>
            <row>
              <entry>
                CSL JSON
              </entry>
              <entry>
                .json
              </entry>
            </row>
            <row>
              <entry>
                CSL YAML
              </entry>
              <entry>
                .yaml
              </entry>
            </row>
            <row>
              <entry>
                RIS
              </entry>
              <entry>
                .ris
              </entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
      <para>
        Note that <literal>.bib</literal> can be used with both BibTeX
        and BibLaTeX files; use the extension <literal>.bibtex</literal>
        to force interpretation as BibTeX.
      </para>
      <para>
        In BibTeX and BibLaTeX databases, pandoc parses LaTeX markup
        inside fields such as <literal>title</literal>; in CSL YAML
        databases, pandoc Markdown; and in CSL JSON databases, an
        <link xlink:href="https://citeproc-js.readthedocs.io/en/latest/csl-json/markup.html#html-like-formatting-tags">HTML-like
        markup</link>:
      </para>
      <variablelist spacing="compact">
        <varlistentry>
          <term>
            <literal>&lt;i&gt;...&lt;/i&gt;</literal>
          </term>
          <listitem>
            <para>
              italics
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>&lt;b&gt;...&lt;/b&gt;</literal>
          </term>
          <listitem>
            <para>
              bold
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>&lt;span style=&quot;font-variant:small-caps;&quot;&gt;...&lt;/span&gt;</literal>
            or <literal>&lt;sc&gt;...&lt;/sc&gt;</literal>
          </term>
          <listitem>
            <para>
              small capitals
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>&lt;sub&gt;...&lt;/sub&gt;</literal>
          </term>
          <listitem>
            <para>
              subscript
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>&lt;sup&gt;...&lt;/sup&gt;</literal>
          </term>
          <listitem>
            <para>
              superscript
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>&lt;span class=&quot;nocase&quot;&gt;...&lt;/span&gt;</literal>
          </term>
          <listitem>
            <para>
              prevent a phrase from being capitalized as title case
            </para>
          </listitem>
        </varlistentry>
      </variablelist>
      <para>
        As an alternative to specifying a bibliography file using
        <literal>--bibliography</literal> or the YAML metadata field
        <literal>bibliography</literal>, you can include the citation
        data directly in the <literal>references</literal> field of the
        document’s YAML metadata. The field should contain an array of
        YAML-encoded references, for example:
      </para>
      <programlisting>
---
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
...
</programlisting>
      <para>
        If both an external bibliography and inline (YAML metadata)
        references are provided, both will be used. In case of
        conflicting <literal>id</literal>s, the inline references will
        take precedence.
      </para>
      <para>
        Note that pandoc can be used to produce such a YAML metadata
        section from a BibTeX, BibLaTeX, or CSL JSON bibliography:
      </para>
      <programlisting>
pandoc chem.bib -s -f biblatex -t markdown
pandoc chem.json -s -f csljson -t markdown
</programlisting>
      <para>
        Indeed, pandoc can convert between any of these citation
        formats:
      </para>
      <programlisting>
pandoc chem.bib -s -f biblatex -t csljson
pandoc chem.yaml -s -f markdown -t biblatex
</programlisting>
      <para>
        Running pandoc on a bibliography file with the
        <literal>--citeproc</literal> option will create a formatted
        bibliography in the format of your choice:
      </para>
      <programlisting>
pandoc chem.bib -s --citeproc -o chem.html
pandoc chem.bib -s --citeproc -o chem.pdf
</programlisting>
      <section xml:id="capitalization-in-titles">
        <title>Capitalization in titles</title>
        <para>
          If you are using a bibtex or biblatex bibliography, then
          observe the following rules:
        </para>
        <itemizedlist>
          <listitem>
            <para>
              English titles should be in title case. Non-English titles
              should be in sentence case, and the
              <literal>langid</literal> field in biblatex should be set
              to the relevant language. (The following values are
              treated as English: <literal>american</literal>,
              <literal>british</literal>, <literal>canadian</literal>,
              <literal>english</literal>, <literal>australian</literal>,
              <literal>newzealand</literal>,
              <literal>USenglish</literal>, or
              <literal>UKenglish</literal>.)
            </para>
          </listitem>
          <listitem>
            <para>
              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:
            </para>
            <programlisting>
title = {My Dinner with {Andre}}
</programlisting>
          </listitem>
          <listitem>
            <para>
              In addition, words that should remain lowercase (or
              camelCase) should be protected:
            </para>
            <programlisting>
title = {Spin Wave Dispersion on the {nm} Scale}
</programlisting>
            <para>
              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 <quote>nm</quote> so that it
              doesn’t get converted to <quote>Nm</quote> at this stage.
            </para>
          </listitem>
        </itemizedlist>
        <para>
          If you are using a CSL bibliography (either JSON or YAML),
          then observe the following rules:
        </para>
        <itemizedlist>
          <listitem>
            <para>
              All titles should be in sentence case.
            </para>
          </listitem>
          <listitem>
            <para>
              Use the <literal>language</literal> field for non-English
              titles to prevent their conversion to title case in styles
              that call for this. (Conversion happens only if
              <literal>language</literal> begins with
              <literal>en</literal> or is left empty.)
            </para>
          </listitem>
          <listitem>
            <para>
              Protect words that should not be converted to title case
              using this syntax:
            </para>
            <programlisting>
Spin wave dispersion on the &lt;span class=&quot;nocase&quot;&gt;nm&lt;/span&gt; scale
</programlisting>
          </listitem>
        </itemizedlist>
      </section>
      <section xml:id="conference-papers-published-vs.-unpublished">
        <title>Conference Papers, Published vs. Unpublished</title>
        <para>
          For a formally published conference paper, use the biblatex
          entry type <literal>inproceedings</literal> (which will be
          mapped to CSL <literal>paper-conference</literal>).
        </para>
        <para>
          For an unpublished manuscript, use the biblatex entry type
          <literal>unpublished</literal> without an
          <literal>eventtitle</literal> field (this entry type will be
          mapped to CSL <literal>manuscript</literal>).
        </para>
        <para>
          For a talk, an unpublished conference paper, or a poster
          presentation, use the biblatex entry type
          <literal>unpublished</literal> with an
          <literal>eventtitle</literal> field (this entry type will be
          mapped to CSL <literal>speech</literal>). Use the biblatex
          <literal>type</literal> field to indicate the type,
          e.g. <quote>Paper</quote>, or <quote>Poster</quote>.
          <literal>venue</literal> and <literal>eventdate</literal> may
          be useful too, though <literal>eventdate</literal> will not be
          rendered by most CSL styles. Note that
          <literal>venue</literal> is for the event’s venue, unlike
          <literal>location</literal> which describes the publisher’s
          location; do not use the latter for an unpublished conference
          paper.
        </para>
      </section>
    </section>
    <section xml:id="specifying-a-citation-style">
      <title>Specifying a citation style</title>
      <para>
        Citations and references can be formatted using any style
        supported by the
        <link xlink:href="https://citationstyles.org">Citation Style
        Language</link>, listed in the
        <link xlink:href="https://www.zotero.org/styles">Zotero Style
        Repository</link>. These files are specified using the
        <literal>--csl</literal> option or the <literal>csl</literal>
        (or <literal>citation-style</literal>) metadata field. By
        default, pandoc will use the
        <link xlink:href="https://chicagomanualofstyle.org">Chicago
        Manual of Style</link> author-date format. (You can override
        this default by copying a CSL style of your choice to
        <literal>default.csl</literal> in your user data directory.) The
        CSL project provides further information on
        <link xlink:href="https://citationstyles.org/authors/">finding
        and editing styles</link>.
      </para>
      <para>
        The <literal>--citation-abbreviations</literal> option (or the
        <literal>citation-abbreviations</literal> metadata field) may be
        used to specify a JSON file containing abbreviations of journals
        that should be used in formatted bibliographies when
        <literal>form=&quot;short&quot;</literal> is specified. The
        format of the file can be illustrated with an example:
      </para>
      <programlisting>
{ &quot;default&quot;: {
    &quot;container-title&quot;: {
            &quot;Lloyd's Law Reports&quot;: &quot;Lloyd's Rep&quot;,
            &quot;Estates Gazette&quot;: &quot;EG&quot;,
            &quot;Scots Law Times&quot;: &quot;SLT&quot;
    }
  }
}
</programlisting>
    </section>
    <section xml:id="citations-in-note-styles">
      <title>Citations in note styles</title>
      <para>
        Pandoc’s citation processing is designed to allow you to move
        between author-date, numerical, and note styles without
        modifying the Markdown source. When you’re using a note style,
        avoid inserting footnotes manually. Instead, insert citations
        just as you would in an author-date style—for example,
      </para>
      <programlisting>
Blah blah [@foo, p. 33].
</programlisting>
      <para>
        The footnote will be created automatically. Pandoc will take
        care of removing the space and moving the note before or after
        the period, depending on the setting of
        <literal>notes-after-punctuation</literal>, as described below
        in <link linkend="other-relevant-metadata-fields">Other relevant
        metadata fields</link>.
      </para>
      <para>
        In some cases you may need to put a citation inside a regular
        footnote. Normal citations in footnotes (such as
        <literal>[@foo, p. 33]</literal>) will be rendered in
        parentheses. In-text citations (such as
        <literal>@foo [p. 33]</literal>) will be rendered without
        parentheses. (A comma will be added if appropriate.) Thus:
      </para>
      <programlisting>
[^1]:  Some studies [@foo; @bar, p. 33] show that
frubulicious zoosnaps are quantical.  For a survey
of the literature, see @baz [chap. 1].
</programlisting>
    </section>
    <section xml:id="placement-of-the-bibliography">
      <title>Placement of the bibliography</title>
      <para>
        If the style calls for a list of works cited, it will be placed
        in a div with id <literal>refs</literal>, if one
        exists:<footnote>
          <para>
            Note that if <literal>--file-scope</literal> is used, a div
            written this way will be given an identifier of the form
            <literal>FILE__refs</literal>, to avoid duplicate
            identifiers (see <literal>--file-scope</literal>). In view
            of this possibility, pandoc will place the bibliography in
            any div whose identifier is <literal>refs</literal>
            <emphasis>or</emphasis> ends with <literal>__refs</literal>.
          </para>
        </footnote>
      </para>
      <programlisting>
::: {#refs}
:::
</programlisting>
      <para>
        Otherwise, it will be placed at the end of the document.
        Generation of the bibliography can be suppressed by setting
        <literal>suppress-bibliography: true</literal> in the YAML
        metadata.
      </para>
      <para>
        If you wish the bibliography to have a section heading, you can
        set <literal>reference-section-title</literal> in the metadata,
        or put the heading at the beginning of the div with id
        <literal>refs</literal> (if you are using it) or at the end of
        your document:
      </para>
      <programlisting>
last paragraph...

# References
</programlisting>
      <para>
        The bibliography will be inserted after this heading. Note that
        the <literal>unnumbered</literal> class will be added to this
        heading, so that the section will not be numbered.
      </para>
      <para>
        If you want to put the bibliography into a variable in your
        template, one way to do that is to put the div with id
        <literal>refs</literal> into a metadata field, e.g.
      </para>
      <programlisting>
---
refs: |
   ::: {#refs}
   :::
...
</programlisting>
      <para>
        You can then put the variable <literal>$refs$</literal> into
        your template where you want the bibliography to be placed.
      </para>
    </section>
    <section xml:id="including-uncited-items-in-the-bibliography">
      <title>Including uncited items in the bibliography</title>
      <para>
        If you want to include items in the bibliography without
        actually citing them in the body text, you can define a dummy
        <literal>nocite</literal> metadata field and put the citations
        there:
      </para>
      <programlisting>
---
nocite: |
  @item1, @item2
...

@item3
</programlisting>
      <para>
        In this example, the document will contain a citation for
        <literal>item3</literal> only, but the bibliography will contain
        entries for <literal>item1</literal>, <literal>item2</literal>,
        and <literal>item3</literal>.
      </para>
      <para>
        It is possible to create a bibliography with all the citations,
        whether or not they appear in the document, by using a wildcard:
      </para>
      <programlisting>
---
nocite: |
  @*
...
</programlisting>
      <para>
        For LaTeX output, you can also use
        <link xlink:href="https://ctan.org/pkg/natbib"><literal>natbib</literal></link>
        or
        <link xlink:href="https://ctan.org/pkg/biblatex"><literal>biblatex</literal></link>
        to render the bibliography. In order to do so, specify
        bibliography files as outlined above, and add
        <literal>--natbib</literal> or <literal>--biblatex</literal>
        argument to pandoc invocation. Bear in mind that bibliography
        files have to be in either BibTeX (for
        <literal>--natbib</literal>) or BibLaTeX (for
        <literal>--biblatex</literal>) format.
      </para>
    </section>
    <section xml:id="other-relevant-metadata-fields">
      <title>Other relevant metadata fields</title>
      <para>
        A few other metadata fields affect bibliography formatting:
      </para>
      <variablelist spacing="compact">
        <varlistentry>
          <term>
            <literal>link-citations</literal>
          </term>
          <listitem>
            <para>
              If true, citations will be hyperlinked to the
              corresponding bibliography entries (for author-date and
              numerical styles only). Defaults to false.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>link-bibliography</literal>
          </term>
          <listitem>
            <para>
              If true, DOIs, PMCIDs, PMID, and URLs in bibliographies
              will be rendered as hyperlinks. (If an entry contains a
              DOI, PMCID, PMID, or URL, but none of these fields are
              rendered by the style, then the title, or in the absence
              of a title the whole entry, will be hyperlinked.) Defaults
              to true.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>lang</literal>
          </term>
          <listitem>
            <para>
              The <literal>lang</literal> field will affect how the
              style is localized, for example in the translation of
              labels, the use of quotation marks, and the way items are
              sorted. (For backwards compatibility,
              <literal>locale</literal> may be used instead of
              <literal>lang</literal>, but this use is deprecated.)
            </para>
            <para>
              A BCP 47 language tag is expected: for example,
              <literal>en</literal>, <literal>de</literal>,
              <literal>en-US</literal>, <literal>fr-CA</literal>,
              <literal>ug-Cyrl</literal>. The unicode extension syntax
              (after <literal>-u-</literal>) may be used to specify
              options for collation (sorting) more precisely. Here are
              some examples:
            </para>
            <itemizedlist spacing="compact">
              <listitem>
                <para>
                  <literal>zh-u-co-pinyin</literal>: Chinese with the
                  Pinyin collation.
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>es-u-co-trad</literal>: Spanish with the
                  traditional collation (with <literal>Ch</literal>
                  sorting after <literal>C</literal>).
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>fr-u-kb</literal>: French with
                  <quote>backwards</quote> accent sorting (with
                  <literal>coté</literal> sorting after
                  <literal>côte</literal>).
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>en-US-u-kf-upper</literal>: English with
                  uppercase letters sorting before lower (default is
                  lower before upper).
                </para>
              </listitem>
            </itemizedlist>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>notes-after-punctuation</literal>
          </term>
          <listitem>
            <para>
              If true (the default for note styles), pandoc will put
              footnote references or superscripted numerical citations
              after following punctuation. For example, if the source
              contains <literal>blah blah [@jones99].</literal>, the
              result will look like <literal>blah blah.[^1]</literal>,
              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.
              The option may also be used in numerical styles that use
              superscripts for citation numbers (but for these styles
              the default is not to move the citation).
            </para>
          </listitem>
        </varlistentry>
      </variablelist>
    </section>
  </section>
  <section xml:id="slide-shows">
    <title>Slide shows</title>
    <para>
      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
      <link xlink:href="https://meyerweb.com/eric/tools/s5/">S5</link>,
      <link xlink:href="https://paulrouget.com/dzslides/">DZSlides</link>,
      <link xlink:href="https://www.w3.org/Talks/Tools/Slidy2/">Slidy</link>,
      <link xlink:href="https://goessner.net/articles/slideous/">Slideous</link>,
      or <link xlink:href="https://revealjs.com/">reveal.js</link>. You
      can also produce a PDF slide show using LaTeX
      <link xlink:href="https://ctan.org/pkg/beamer"><literal>beamer</literal></link>,
      or slide shows in Microsoft
      <link xlink:href="https://en.wikipedia.org/wiki/Microsoft_PowerPoint">PowerPoint</link>
      format.
    </para>
    <para>
      Here’s the Markdown source for a simple slide show,
      <literal>habits.txt</literal>:
    </para>
    <programlisting>
% 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
</programlisting>
    <para>
      To produce an HTML/JavaScript slide show, simply type
    </para>
    <programlisting>
pandoc -t FORMAT -s habits.txt -o habits.html
</programlisting>
    <para>
      where <literal>FORMAT</literal> is either <literal>s5</literal>,
      <literal>slidy</literal>, <literal>slideous</literal>,
      <literal>dzslides</literal>, or <literal>revealjs</literal>.
    </para>
    <para>
      For Slidy, Slideous, reveal.js, and S5, the file produced by
      pandoc with the <literal>-s/--standalone</literal> option embeds a
      link to JavaScript and CSS files, which are assumed to be
      available at the relative path <literal>s5/default</literal> (for
      S5), <literal>slideous</literal> (for Slideous),
      <literal>reveal.js</literal> (for reveal.js), or at the Slidy
      website at <literal>w3.org</literal> (for Slidy). (These paths can
      be changed by setting the <literal>slidy-url</literal>,
      <literal>slideous-url</literal>, <literal>revealjs-url</literal>,
      or <literal>s5-url</literal> variables; see
      <link linkend="variables-for-html-slides">Variables for HTML
      slides</link>, above.) For DZSlides, the (relatively short)
      JavaScript and CSS are included in the file by default.
    </para>
    <para>
      With all HTML slide formats, the
      <literal>--self-contained</literal> 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.
    </para>
    <para>
      To produce a PDF slide show using beamer, type
    </para>
    <programlisting>
pandoc -t beamer habits.txt -o habits.pdf
</programlisting>
    <para>
      Note that a reveal.js slide show can also be converted to a PDF by
      printing it to a file from the browser.
    </para>
    <para>
      To produce a PowerPoint slide show, type
    </para>
    <programlisting>
pandoc habits.txt -o habits.pptx
</programlisting>
    <section xml:id="structuring-the-slide-show">
      <title>Structuring the slide show</title>
      <para>
        By default, the <emphasis>slide level</emphasis> 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
        <literal>--slide-level</literal> option.
      </para>
      <para>
        The document is carved up into slides according to the following
        rules:
      </para>
      <itemizedlist>
        <listitem>
          <para>
            A horizontal rule always starts a new slide.
          </para>
        </listitem>
        <listitem>
          <para>
            A heading at the slide level always starts a new slide.
          </para>
        </listitem>
        <listitem>
          <para>
            Headings <emphasis>below</emphasis> the slide level in the
            hierarchy create headings <emphasis>within</emphasis> a
            slide. (In beamer, a <quote>block</quote> will be created.
            If the heading has the class <literal>example</literal>, an
            <literal>exampleblock</literal> environment will be used; if
            it has the class <literal>alert</literal>, an
            <literal>alertblock</literal> will be used; otherwise a
            regular <literal>block</literal> will be used.)
          </para>
        </listitem>
        <listitem>
          <para>
            Headings <emphasis>above</emphasis> the slide level in the
            hierarchy create <quote>title slides,</quote> 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).
          </para>
        </listitem>
        <listitem>
          <para>
            A title page is constructed automatically from the
            document’s title block, if present. (In the case of beamer,
            this can be disabled by commenting out some lines in the
            default template.)
          </para>
        </listitem>
      </itemizedlist>
      <para>
        These rules are designed to support many different styles of
        slide show. If you don’t care about structuring your slides into
        sections and subsections, you can either just use level-1
        headings for all slides (in that case, level 1 will be the slide
        level) or you can set <literal>--slide-level=0</literal>.
      </para>
      <para>
        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 unless you set
        <literal>--slide-level=0</literal> (which lets reveal.js produce
        a one-dimensional layout and only interprets horizontal rules as
        slide boundaries).
      </para>
      <section xml:id="powerpoint-layout-choice">
        <title>PowerPoint layout choice</title>
        <para>
          When creating slides, the pptx writer chooses from a number of
          pre-defined layouts, based on the content of the slide:
        </para>
        <variablelist spacing="compact">
          <varlistentry>
            <term>
              Title Slide
            </term>
            <listitem>
              <para>
                This layout is used for the initial slide, which is
                generated and filled from the metadata fields
                <literal>date</literal>, <literal>author</literal>, and
                <literal>title</literal>, if they are present.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              Section Header
            </term>
            <listitem>
              <para>
                This layout is used for what pandoc calls “title
                slides”, i.e. slides which start with a header which is
                above the slide level in the hierarchy.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              Two Content
            </term>
            <listitem>
              <para>
                This layout is used for two-column slides, i.e. slides
                containing a div with class <literal>columns</literal>
                which contains at least two divs with class
                <literal>column</literal>.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              Comparison
            </term>
            <listitem>
              <para>
                This layout is used instead of “Two Content” for any
                two-column slides in which at least one column contains
                text followed by non-text (e.g. an image or a table).
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              Content with Caption
            </term>
            <listitem>
              <para>
                This layout is used for any non-two-column slides which
                contain text followed by non-text (e.g. an image or a
                table).
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              Blank
            </term>
            <listitem>
              <para>
                This layout is used for any slides which only contain
                blank content, e.g. a slide containing only speaker
                notes, or a slide containing only a non-breaking space.
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>
              Title and Content
            </term>
            <listitem>
              <para>
                This layout is used for all slides which do not match
                the criteria for another layout.
              </para>
            </listitem>
          </varlistentry>
        </variablelist>
        <para>
          These layouts are chosen from the default pptx reference doc
          included with pandoc, unless an alternative reference doc is
          specified using <literal>--reference-doc</literal>.
        </para>
      </section>
    </section>
    <section xml:id="incremental-lists">
      <title>Incremental lists</title>
      <para>
        By default, these writers produce lists that display <quote>all
        at once.</quote> If you want your lists to display incrementally
        (one item at a time), use the <literal>-i</literal> option. If
        you want a particular list to depart from the default, put it in
        a <literal>div</literal> block with class
        <literal>incremental</literal> or
        <literal>nonincremental</literal>. So, for example, using the
        <literal>fenced div</literal> syntax, the following would be
        incremental regardless of the document default:
      </para>
      <programlisting>
::: incremental

- Eat spaghetti
- Drink wine

:::
</programlisting>
      <para>
        or
      </para>
      <programlisting>
::: nonincremental

- Eat spaghetti
- Drink wine

:::
</programlisting>
      <para>
        While using <literal>incremental</literal> and
        <literal>nonincremental</literal> divs is 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 <literal>-i</literal> option and all
        at once with the <literal>-i</literal> option):
      </para>
      <programlisting>
&gt; - Eat spaghetti
&gt; - Drink wine
</programlisting>
      <para>
        Both methods allow incremental and nonincremental lists to be
        mixed in a single document.
      </para>
      <para>
        If you want to include a block-quoted list, you can work around
        this behavior by putting the list inside a fenced div, so that
        it is not the direct child of the block quote:
      </para>
      <programlisting>
&gt; ::: wrapper
&gt; - a
&gt; - list in a quote
&gt; :::
</programlisting>
    </section>
    <section xml:id="inserting-pauses">
      <title>Inserting pauses</title>
      <para>
        You can add <quote>pauses</quote> within a slide by including a
        paragraph containing three dots, separated by spaces:
      </para>
      <programlisting>
# Slide with a pause

content before the pause

. . .

content after the pause
</programlisting>
      <para>
        Note: this feature is not yet implemented for PowerPoint output.
      </para>
    </section>
    <section xml:id="styling-the-slides">
      <title>Styling the slides</title>
      <para>
        You can change the style of HTML slides by putting customized
        CSS files in <literal>$DATADIR/s5/default</literal> (for S5),
        <literal>$DATADIR/slidy</literal> (for Slidy), or
        <literal>$DATADIR/slideous</literal> (for Slideous), where
        <literal>$DATADIR</literal> is the user data directory (see
        <literal>--data-dir</literal>, above). The originals may be
        found in pandoc’s system data directory (generally
        <literal>$CABALDIR/pandoc-VERSION/s5/default</literal>). Pandoc
        will look there for any files it does not find in the user data
        directory.
      </para>
      <para>
        For dzslides, the CSS is included in the HTML file itself, and
        may be modified there.
      </para>
      <para>
        All <link xlink:href="https://revealjs.com/config/">reveal.js
        configuration options</link> can be set through variables. For
        example, themes can be used by setting the
        <literal>theme</literal> variable:
      </para>
      <programlisting>
-V theme=moon
</programlisting>
      <para>
        Or you can specify a custom stylesheet using the
        <literal>--css</literal> option.
      </para>
      <para>
        To style beamer slides, you can specify a
        <literal>theme</literal>, <literal>colortheme</literal>,
        <literal>fonttheme</literal>, <literal>innertheme</literal>, and
        <literal>outertheme</literal>, using the <literal>-V</literal>
        option:
      </para>
      <programlisting>
pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf
</programlisting>
      <para>
        Note that heading attributes will turn into slide attributes (on
        a <literal>&lt;div&gt;</literal> or
        <literal>&lt;section&gt;</literal>) in HTML slide formats,
        allowing you to style individual slides. In beamer, a number of
        heading classes and attributes are recognized as frame options
        and will be passed through as options to the frame: see
        <link linkend="frame-attributes-in-beamer">Frame attributes in
        beamer</link>, below.
      </para>
    </section>
    <section xml:id="speaker-notes">
      <title>Speaker notes</title>
      <para>
        Speaker notes are supported in reveal.js, PowerPoint (pptx), and
        beamer output. You can add notes to your Markdown document thus:
      </para>
      <programlisting>
::: notes

This is my note.

- It can contain Markdown
- like this list

:::
</programlisting>
      <para>
        To show the notes window in reveal.js, press
        <literal>s</literal> while viewing the presentation. Speaker
        notes in PowerPoint will be available, as usual, in handouts and
        presenter view.
      </para>
      <para>
        Notes are not yet supported for other slide formats, but the
        notes will not appear on the slides themselves.
      </para>
    </section>
    <section xml:id="columns">
      <title>Columns</title>
      <para>
        To put material in side by side columns, you can use a native
        div container with class <literal>columns</literal>, containing
        two or more div containers with class <literal>column</literal>
        and a <literal>width</literal> attribute:
      </para>
      <programlisting>
:::::::::::::: {.columns}
::: {.column width=&quot;40%&quot;}
contents...
:::
::: {.column width=&quot;60%&quot;}
contents...
:::
::::::::::::::
</programlisting>
      <para>
        Note: Specifying column widths does not currently work for
        PowerPoint.
      </para>
      <section xml:id="additional-columns-attributes-in-beamer">
        <title>Additional columns attributes in beamer</title>
        <para>
          The div containers with classes <literal>columns</literal> and
          <literal>column</literal> can optionally have an
          <literal>align</literal> attribute. The class
          <literal>columns</literal> can optionally have a
          <literal>totalwidth</literal> attribute or an
          <literal>onlytextwidth</literal> class.
        </para>
        <programlisting>
:::::::::::::: {.columns align=center totalwidth=8em}
::: {.column width=&quot;40%&quot;}
contents...
:::
::: {.column width=&quot;60%&quot; align=bottom}
contents...
:::
::::::::::::::
</programlisting>
        <para>
          The <literal>align</literal> attributes on
          <literal>columns</literal> and <literal>column</literal> can
          be used with the values <literal>top</literal>,
          <literal>top-baseline</literal>, <literal>center</literal> and
          <literal>bottom</literal> to vertically align the columns. It
          defaults to <literal>top</literal> in
          <literal>columns</literal>.
        </para>
        <para>
          The <literal>totalwidth</literal> attribute limits the width
          of the columns to the given value.
        </para>
        <programlisting>
:::::::::::::: {.columns align=top .onlytextwidth}
::: {.column width=&quot;40%&quot; align=center}
contents...
:::
::: {.column width=&quot;60%&quot;}
contents...
:::
::::::::::::::
</programlisting>
        <para>
          The class <literal>onlytextwidth</literal> sets the
          <literal>totalwidth</literal> to
          <literal>\textwidth</literal>.
        </para>
        <para>
          See Section 12.7 of the
          <link xlink:href="http://mirrors.ctan.org/macros/latex/contrib/beamer/doc/beameruserguide.pdf">Beamer
          User’s Guide</link> for more details.
        </para>
      </section>
    </section>
    <section xml:id="frame-attributes-in-beamer">
      <title>Frame attributes in beamer</title>
      <para>
        Sometimes it is necessary to add the LaTeX
        <literal>[fragile]</literal> option to a frame in beamer (for
        example, when using the <literal>minted</literal> environment).
        This can be forced by adding the <literal>fragile</literal>
        class to the heading introducing the slide:
      </para>
      <programlisting>
# Fragile slide {.fragile}
</programlisting>
      <para>
        All of the other frame attributes described in Section 8.1 of
        the
        <link xlink:href="http://mirrors.ctan.org/macros/latex/contrib/beamer/doc/beameruserguide.pdf">Beamer
        User’s Guide</link> may also be used:
        <literal>allowdisplaybreaks</literal>,
        <literal>allowframebreaks</literal>, <literal>b</literal>,
        <literal>c</literal>, <literal>s</literal>,
        <literal>t</literal>, <literal>environment</literal>,
        <literal>label</literal>, <literal>plain</literal>,
        <literal>shrink</literal>, <literal>standout</literal>,
        <literal>noframenumbering</literal>, <literal>squeeze</literal>.
        <literal>allowframebreaks</literal> is recommended especially
        for bibliographies, as it allows multiple slides to be created
        if the content overfills the frame:
      </para>
      <programlisting>
# References {.allowframebreaks}
</programlisting>
      <para>
        In addition, the <literal>frameoptions</literal> attribute may
        be used to pass arbitrary frame options to a beamer slide:
      </para>
      <programlisting>
# Heading {frameoptions=&quot;squeeze,shrink,customoption=foobar&quot;}
</programlisting>
    </section>
    <section xml:id="background-in-reveal.js-beamer-and-pptx">
      <title>Background in reveal.js, beamer, and pptx</title>
      <para>
        Background images can be added to self-contained reveal.js slide
        shows, beamer slide shows, and pptx slide shows.
      </para>
      <section xml:id="on-all-slides-beamer-reveal.js-pptx">
        <title>On all slides (beamer, reveal.js, pptx)</title>
        <para>
          With beamer and reveal.js, the configuration option
          <literal>background-image</literal> can be used either in the
          YAML metadata block or as a command-line variable to get the
          same image on every slide.
        </para>
        <para>
          Note that for reveal.js, the
          <literal>background-image</literal> will be used as a
          <literal>parallaxBackgroundImage</literal> (see below).
        </para>
        <para>
          For pptx, you can use a <literal>--reference-doc</literal> in
          which background images have been set on the
          <link linkend="powerpoint-layout-choice">relevant
          layouts</link>.
        </para>
        <section xml:id="parallaxbackgroundimage-reveal.js">
          <title><literal>parallaxBackgroundImage</literal>
          (reveal.js)</title>
          <para>
            For reveal.js, there is also the reveal.js-native option
            <literal>parallaxBackgroundImage</literal>, which produces a
            parallax scrolling background. You must also set
            <literal>parallaxBackgroundSize</literal>, and can
            optionally set
            <literal>parallaxBackgroundHorizontal</literal> and
            <literal>parallaxBackgroundVertical</literal> to configure
            the scrolling behaviour. See the
            <link xlink:href="https://revealjs.com/backgrounds/#parallax-background">reveal.js
            documentation</link> for more details about the meaning of
            these options.
          </para>
          <para>
            In reveal.js’s overview mode, the parallaxBackgroundImage
            will show up only on the first slide.
          </para>
        </section>
      </section>
      <section xml:id="on-individual-slides-reveal.js-pptx">
        <title>On individual slides (reveal.js, pptx)</title>
        <para>
          To set an image for a particular reveal.js or pptx slide, add
          <literal>{background-image=&quot;/path/to/image&quot;}</literal>
          to the first slide-level heading on the slide (which may even
          be empty).
        </para>
        <para>
          As the <link linkend="extension-link_attributes">HTML writers
          pass unknown attributes through</link>, other reveal.js
          background settings also work on individual slides, including
          <literal>background-size</literal>,
          <literal>background-repeat</literal>,
          <literal>background-color</literal>,
          <literal>transition</literal>, and
          <literal>transition-speed</literal>. (The
          <literal>data-</literal> prefix will automatically be added.)
        </para>
        <para>
          Note: <literal>data-background-image</literal> is also
          supported in pptx for consistency with reveal.js – if
          <literal>background-image</literal> isn’t found,
          <literal>data-background-image</literal> will be checked.
        </para>
      </section>
      <section xml:id="on-the-title-slide-reveal.js-pptx">
        <title>On the title slide (reveal.js, pptx)</title>
        <para>
          To add a background image to the automatically generated title
          slide for reveal.js, use the
          <literal>title-slide-attributes</literal> variable in the YAML
          metadata block. It must contain a map of attribute names and
          values. (Note that the <literal>data-</literal> prefix is
          required here, as it isn’t added automatically.)
        </para>
        <para>
          For pptx, pass a <literal>--reference-doc</literal> with the
          background image set on the “Title Slide” layout.
        </para>
      </section>
      <section xml:id="example-reveal.js">
        <title>Example (reveal.js)</title>
        <programlisting>
---
title: My Slide Show
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.

## {background-image=&quot;/path/to/special_image.jpg&quot;}

Slide 2 has a special image for its background, even though the heading has no content.
</programlisting>
      </section>
    </section>
  </section>
  <section xml:id="epubs">
    <title>EPUBs</title>
    <section xml:id="epub-metadata">
      <title>EPUB Metadata</title>
      <para>
        There are two ways to specify metadata for an EPUB. The first is
        to use the <literal>--epub-metadata</literal> option, which
        takes as its argument an XML file with
        <link xlink:href="https://www.dublincore.org/specifications/dublin-core/dces/">Dublin
        Core elements</link>.
      </para>
      <para>
        The second way is to use YAML, either in a
        <link linkend="extension-yaml_metadata_block">YAML metadata
        block</link> in a Markdown document, or in a separate YAML file
        specified with <literal>--metadata-file</literal>. Here is an
        example of a YAML metadata block with EPUB metadata:
      </para>
      <programlisting>
---
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: © 2007 John Smith, CC BY-NC
ibooks:
  version: 1.3.4
...
</programlisting>
      <para>
        The following fields are recognized:
      </para>
      <variablelist spacing="compact">
        <varlistentry>
          <term>
            <literal>identifier</literal>
          </term>
          <listitem>
            <para>
              Either a string value or an object with fields
              <literal>text</literal> and <literal>scheme</literal>.
              Valid values for <literal>scheme</literal> are
              <literal>ISBN-10</literal>, <literal>GTIN-13</literal>,
              <literal>UPC</literal>, <literal>ISMN-10</literal>,
              <literal>DOI</literal>, <literal>LCCN</literal>,
              <literal>GTIN-14</literal>, <literal>ISBN-13</literal>,
              <literal>Legal deposit number</literal>,
              <literal>URN</literal>, <literal>OCLC</literal>,
              <literal>ISMN-13</literal>, <literal>ISBN-A</literal>,
              <literal>JP</literal>, <literal>OLCC</literal>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>title</literal>
          </term>
          <listitem>
            <para>
              Either a string value, or an object with fields
              <literal>file-as</literal> and <literal>type</literal>, or
              a list of such objects. Valid values for
              <literal>type</literal> are <literal>main</literal>,
              <literal>subtitle</literal>, <literal>short</literal>,
              <literal>collection</literal>, <literal>edition</literal>,
              <literal>extended</literal>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>creator</literal>
          </term>
          <listitem>
            <para>
              Either a string value, or an object with fields
              <literal>role</literal>, <literal>file-as</literal>, and
              <literal>text</literal>, or a list of such objects. Valid
              values for <literal>role</literal> are
              <link xlink:href="https://loc.gov/marc/relators/relaterm.html">MARC
              relators</link>, but pandoc will attempt to translate the
              human-readable versions (like <quote>author</quote> and
              <quote>editor</quote>) to the appropriate marc relators.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>contributor</literal>
          </term>
          <listitem>
            <para>
              Same format as <literal>creator</literal>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>date</literal>
          </term>
          <listitem>
            <para>
              A string value in <literal>YYYY-MM-DD</literal> format.
              (Only the year is necessary.) Pandoc will attempt to
              convert other common date formats.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>lang</literal> (or legacy:
            <literal>language</literal>)
          </term>
          <listitem>
            <para>
              A string value in
              <link xlink:href="https://tools.ietf.org/html/bcp47">BCP
              47</link> format. Pandoc will default to the local
              language if nothing is specified.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>subject</literal>
          </term>
          <listitem>
            <para>
              Either a string value, or an object with fields
              <literal>text</literal>, <literal>authority</literal>, and
              <literal>term</literal>, or a list of such objects. Valid
              values for <literal>authority</literal> are either a
              <link xlink:href="https://idpf.github.io/epub-registries/authorities/">reserved
              authority value</link> (currently <literal>AAT</literal>,
              <literal>BIC</literal>, <literal>BISAC</literal>,
              <literal>CLC</literal>, <literal>DDC</literal>,
              <literal>CLIL</literal>, <literal>EuroVoc</literal>,
              <literal>MEDTOP</literal>, <literal>LCSH</literal>,
              <literal>NDC</literal>, <literal>Thema</literal>,
              <literal>UDC</literal>, and <literal>WGS</literal>) or an
              absolute IRI identifying a custom scheme. Valid values for
              <literal>term</literal> are defined by the scheme.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>description</literal>
          </term>
          <listitem>
            <para>
              A string value.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>type</literal>
          </term>
          <listitem>
            <para>
              A string value.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>format</literal>
          </term>
          <listitem>
            <para>
              A string value.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>relation</literal>
          </term>
          <listitem>
            <para>
              A string value.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>coverage</literal>
          </term>
          <listitem>
            <para>
              A string value.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>rights</literal>
          </term>
          <listitem>
            <para>
              A string value.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>belongs-to-collection</literal>
          </term>
          <listitem>
            <para>
              A string value. Identifies the name of a collection to
              which the EPUB Publication belongs.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>group-position</literal>
          </term>
          <listitem>
            <para>
              The <literal>group-position</literal> field indicates the
              numeric position in which the EPUB Publication belongs
              relative to other works belonging to the same
              <literal>belongs-to-collection</literal> field.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>cover-image</literal>
          </term>
          <listitem>
            <para>
              A string value (path to cover image).
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>css</literal> (or legacy:
            <literal>stylesheet</literal>)
          </term>
          <listitem>
            <para>
              A string value (path to CSS stylesheet).
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>page-progression-direction</literal>
          </term>
          <listitem>
            <para>
              Either <literal>ltr</literal> or <literal>rtl</literal>.
              Specifies the
              <literal>page-progression-direction</literal> attribute
              for the
              <link xlink:href="http://idpf.org/epub/301/spec/epub-publications.html#sec-spine-elem"><literal>spine</literal>
              element</link>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>accessModes</literal>
          </term>
          <listitem>
            <para>
              An array of strings
              (<link xlink:href="https://kb.daisy.org/publishing/docs/metadata/schema.org/index.html">schema</link>).
              Defaults to <literal>[&quot;textual&quot;]</literal>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>accessModeSufficient</literal>
          </term>
          <listitem>
            <para>
              An array of strings
              (<link xlink:href="https://kb.daisy.org/publishing/docs/metadata/schema.org/index.html">schema</link>).
              Defaults to <literal>[&quot;textual&quot;]</literal>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>accessibilityHazards</literal>
          </term>
          <listitem>
            <para>
              An array of strings
              (<link xlink:href="https://kb.daisy.org/publishing/docs/metadata/schema.org/index.html">schema</link>).
              Defaults to <literal>[&quot;none&quot;]</literal>.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>accessibilityFeatures</literal>
          </term>
          <listitem>
            <para>
              An array of strings
              (<link xlink:href="https://kb.daisy.org/publishing/docs/metadata/schema.org/index.html">schema</link>).
              Defaults to
            </para>
            <programlisting>
- &quot;alternativeText&quot;
- &quot;readingOrder&quot;
- &quot;structuralNavigation&quot;
- &quot;tableOfContents&quot;
</programlisting>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>accessibilitySummary</literal>
          </term>
          <listitem>
            <para>
              A string value.
            </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>
            <literal>ibooks</literal>
          </term>
          <listitem>
            <para>
              iBooks-specific metadata, with the following fields:
            </para>
            <itemizedlist spacing="compact">
              <listitem>
                <para>
                  <literal>version</literal>: (string)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>specified-fonts</literal>:
                  <literal>true</literal>|<literal>false</literal>
                  (default <literal>false</literal>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>ipad-orientation-lock</literal>:
                  <literal>portrait-only</literal>|<literal>landscape-only</literal>
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>iphone-orientation-lock</literal>:
                  <literal>portrait-only</literal>|<literal>landscape-only</literal>
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>binding</literal>:
                  <literal>true</literal>|<literal>false</literal>
                  (default <literal>true</literal>)
                </para>
              </listitem>
              <listitem>
                <para>
                  <literal>scroll-axis</literal>:
                  <literal>vertical</literal>|<literal>horizontal</literal>|<literal>default</literal>
                </para>
              </listitem>
            </itemizedlist>
          </listitem>
        </varlistentry>
      </variablelist>
    </section>
    <section xml:id="the-epubtype-attribute">
      <title>The <literal>epub:type</literal> attribute</title>
      <para>
        For <literal>epub3</literal> output, you can mark up the heading
        that corresponds to an EPUB chapter using the
        <link xlink:href="http://www.idpf.org/epub/31/spec/epub-contentdocs.html#sec-epub-type-attribute"><literal>epub:type</literal>
        attribute</link>. For example, to set the attribute to the value
        <literal>prologue</literal>, use this Markdown:
      </para>
      <programlisting>
# My chapter {epub:type=prologue}
</programlisting>
      <para>
        Which will result in:
      </para>
      <programlisting>
&lt;body epub:type=&quot;frontmatter&quot;&gt;
  &lt;section epub:type=&quot;prologue&quot;&gt;
    &lt;h1&gt;My chapter&lt;/h1&gt;
</programlisting>
      <para>
        Pandoc will output
        <literal>&lt;body epub:type=&quot;bodymatter&quot;&gt;</literal>,
        unless you use one of the following values, in which case either
        <literal>frontmatter</literal> or <literal>backmatter</literal>
        will be output.
      </para>
      <informaltable>
        <tgroup cols="2">
          <colspec align="left" />
          <colspec align="left" />
          <thead>
            <row>
              <entry>
                <literal>epub:type</literal> of first section
              </entry>
              <entry>
                <literal>epub:type</literal> of body
              </entry>
            </row>
          </thead>
          <tbody>
            <row>
              <entry>
                prologue
              </entry>
              <entry>
                frontmatter
              </entry>
            </row>
            <row>
              <entry>
                abstract
              </entry>
              <entry>
                frontmatter
              </entry>
            </row>
            <row>
              <entry>
                acknowledgments
              </entry>
              <entry>
                frontmatter
              </entry>
            </row>
            <row>
              <entry>
                copyright-page
              </entry>
              <entry>
                frontmatter
              </entry>
            </row>
            <row>
              <entry>
                dedication
              </entry>
              <entry>
                frontmatter
              </entry>
            </row>
            <row>
              <entry>
                credits
              </entry>
              <entry>
                frontmatter
              </entry>
            </row>
            <row>
              <entry>
                keywords
              </entry>
              <entry>
                frontmatter
              </entry>
            </row>
            <row>
              <entry>
                imprint
              </entry>
              <entry>
                frontmatter
              </entry>
            </row>
            <row>
              <entry>
                contributors
              </entry>
              <entry>
                frontmatter
              </entry>
            </row>
            <row>
              <entry>
                other-credits
              </entry>
              <entry>
                frontmatter
              </entry>
            </row>
            <row>
              <entry>
                errata
              </entry>
              <entry>
                frontmatter
              </entry>
            </row>
            <row>
              <entry>
                revision-history
              </entry>
              <entry>
                frontmatter
              </entry>
            </row>
            <row>
              <entry>
                titlepage
              </entry>
              <entry>
                frontmatter
              </entry>
            </row>
            <row>
              <entry>
                halftitlepage
              </entry>
              <entry>
                frontmatter
              </entry>
            </row>
            <row>
              <entry>
                seriespage
              </entry>
              <entry>
                frontmatter
              </entry>
            </row>
            <row>
              <entry>
                foreword
              </entry>
              <entry>
                frontmatter
              </entry>
            </row>
            <row>
              <entry>
                preface
              </entry>
              <entry>
                frontmatter
              </entry>
            </row>
            <row>
              <entry>
                frontispiece
              </entry>
              <entry>
                frontmatter
              </entry>
            </row>
            <row>
              <entry>
                appendix
              </entry>
              <entry>
                backmatter
              </entry>
            </row>
            <row>
              <entry>
                colophon
              </entry>
              <entry>
                backmatter
              </entry>
            </row>
            <row>
              <entry>
                bibliography
              </entry>
              <entry>
                backmatter
              </entry>
            </row>
            <row>
              <entry>
                index
              </entry>
              <entry>
                backmatter
              </entry>
            </row>
          </tbody>
        </tgroup>
      </informaltable>
    </section>
    <section xml:id="linked-media">
      <title>Linked media</title>
      <para>
        By default, pandoc will download media referenced from any
        <literal>&lt;img&gt;</literal>,
        <literal>&lt;audio&gt;</literal>,
        <literal>&lt;video&gt;</literal> or
        <literal>&lt;source&gt;</literal> 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
        <literal>data-external=&quot;1&quot;</literal> to the tag with
        the <literal>src</literal> attribute. For example:
      </para>
      <programlisting>
&lt;audio controls=&quot;1&quot;&gt;
  &lt;source src=&quot;https://example.com/music/toccata.mp3&quot;
          data-external=&quot;1&quot; type=&quot;audio/mpeg&quot;&gt;
  &lt;/source&gt;
&lt;/audio&gt;
</programlisting>
      <para>
        If the input format already is HTML then
        <literal>data-external=&quot;1&quot;</literal> will work as
        expected for <literal>&lt;img&gt;</literal> elements. Similarly,
        for Markdown, external images can be declared with
        <literal>![img](url){external=1}</literal>. Note that this only
        works for images; the other media elements have no native
        representation in pandoc’s AST and require the use of raw HTML.
      </para>
    </section>
    <section xml:id="epub-styling">
      <title>EPUB styling</title>
      <para>
        By default, pandoc will include some basic styling contained in
        its <literal>epub.css</literal> data file. (To see this, use
        <literal>pandoc --print-default-data-file epub.css</literal>.)
        To use a different CSS file, just use the
        <literal>--css</literal> command line option. A few inline
        styles are defined in addition; these are essential for correct
        formatting of pandoc’s HTML output.
      </para>
      <para>
        The <literal>document-css</literal> variable may be set if the
        more opinionated styling of pandoc’s default HTML templates is
        desired (and in that case the variables defined in
        <link linkend="variables-for-html">Variables for HTML</link> may
        be used to fine-tune the style).
      </para>
    </section>
  </section>
  <section xml:id="chunked-html">
    <title>Chunked HTML</title>
    <para>
      <literal>pandoc -t chunkedhtml</literal> will produce a zip
      archive of linked HTML files, one for each section of the original
      document. Internal links will automatically be adjusted to point
      to the right place, images linked to under the working directory
      will be incorporated, and navigation links will be added. In
      addition, a JSON file <literal>sitemap.json</literal> will be
      included describing the hierarchical structure of the files.
    </para>
    <para>
      If an output file without an extension is specified, then it will
      be interpreted as a directory and the zip archive will be
      automatically unpacked into it (unless it already exists, in which
      case an error will be raised). Otherwise a <literal>.zip</literal>
      file will be produced.
    </para>
    <para>
      The navigation links can be customized by adjusting the template.
      By default, a table of contents is included only on the top page.
      To include it on every page, set the <literal>toc</literal>
      variable manually.
    </para>
  </section>
  <section xml:id="jupyter-notebooks">
    <title>Jupyter notebooks</title>
    <para>
      When creating a
      <link xlink:href="https://nbformat.readthedocs.io/en/latest/">Jupyter
      notebook</link>, pandoc will try to infer the notebook structure.
      Code blocks with the class <literal>code</literal> 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
      <literal>jupyter</literal> metadata field. For example:
    </para>
    <programlisting>
---
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: &quot;.py&quot;
     mimetype: &quot;text/x-python&quot;
     name: &quot;python&quot;
     nbconvert_exporter: &quot;python&quot;
     pygments_lexer: &quot;ipython2&quot;
     version: &quot;2.7.15&quot;
---

# Lorem ipsum

**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus
bibendum felis dictum sodales.

``` code
print(&quot;hello&quot;)
```

## Pyout

``` code
from IPython.display import HTML
HTML(&quot;&quot;&quot;
&lt;script&gt;
console.log(&quot;hello&quot;);
&lt;/script&gt;
&lt;b&gt;HTML&lt;/b&gt;
&quot;&quot;&quot;)
```

## Image

This image ![image](myimage.png) will be
included as a cell attachment.
</programlisting>
    <para>
      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
      <link linkend="extension-fenced_divs">fenced divs</link> or
      <link linkend="extension-native_divs">native divs</link> for this.
      Here is an example:
    </para>
    <programlisting>
:::::: {.cell .markdown}
# Lorem

**Lorem ipsum** dolor sit amet, consectetur adipiscing elit. Nunc luctus
bibendum felis dictum sodales.
::::::

:::::: {.cell .code execution_count=1}
``` {.python}
print(&quot;hello&quot;)
```

::: {.output .stream .stdout}
```
hello
```
:::
::::::

:::::: {.cell .code execution_count=2}
``` {.python}
from IPython.display import HTML
HTML(&quot;&quot;&quot;
&lt;script&gt;
console.log(&quot;hello&quot;);
&lt;/script&gt;
&lt;b&gt;HTML&lt;/b&gt;
&quot;&quot;&quot;)
```

::: {.output .execute_result execution_count=2}
```{=html}
&lt;script&gt;
console.log(&quot;hello&quot;);
&lt;/script&gt;
&lt;b&gt;HTML&lt;/b&gt;
hello
```
:::
::::::
</programlisting>
    <para>
      If you include raw HTML or TeX in an output cell, use the
      <link linkend="extension-raw_attribute">raw attribute</link>, as
      shown in the last cell of the example above. Although pandoc can
      process <quote>bare</quote> 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
      <literal>-raw_html-raw_tex+raw_attribute</literal> when
      translating between Markdown and ipynb notebooks.
    </para>
    <para>
      Note that options and extensions that affect reading and writing
      of Markdown will also affect Markdown cells in ipynb notebooks.
      For example, <literal>--wrap=preserve</literal> will preserve soft
      line breaks in Markdown cells;
      <literal>--markdown-headings=setext</literal> will cause
      Setext-style headings to be used; and
      <literal>--preserve-tabs</literal> will prevent tabs from being
      turned to spaces.
    </para>
  </section>
  <section xml:id="vimdoc">
    <title>Vimdoc</title>
    <para>
      Vimdoc writer generates Vim help files and makes use of the
      following metadata variables:
    </para>
    <programlisting language="yaml">
abstract: &quot;A short description&quot;
author: Author
title: Title

# Vimdoc-specific
filename: &quot;definition-lists.txt&quot;
vimdoc-prefix: pandoc
</programlisting>
    <para>
      Complete header requires <literal>abstract</literal>,
      <literal>author</literal>, <literal>title</literal> and
      <literal>filename</literal> to be set. Compiling file with such
      metadata produces the following file (assumes
      <literal>--standalone</literal>, see
      <link linkend="templates">Templates</link>):
    </para>
    <programlisting>
*definition-lists.txt*  A short description

                            Title by Author


                                 Type |gO| to see the table of contents.

[...]

 vim:tw=72:sw=4:ts=4:ft=help:norl:et:
</programlisting>
    <para>
      If <literal>vimdoc-prefix</literal> is set, all non-command tags
      are prefixed with its value, it is used to prevent tag collision:
      all headers have a tag (either inferred or explicit) and multiple
      help pages can have the same header names, therefore collision is
      to be expected. Let our input be the following markdown file:
    </para>
    <programlisting language="markdown">
## Header

`:[range]Fnl {expr}`{#:Fnl}
:   Evaluates {expr} or range

`vim.b`{#vim.b}
:   Buffer-scoped (`:h b:`) variables for the current buffer. Invalid or unset
    key returns `nil`. Can be indexed with an integer to access variables for a
    specific buffer.

[Span]{#span}
:   generic inline container for phrasing content, which does not inherently
    represent anything.
</programlisting>
    <para>
      Convert it to vimdoc:
    </para>
    <programlisting>
------------------------------------------------------------------------
Header                                                            *header*

:[range]Fnl {expr}                                                  *:Fnl*
    Evaluates {expr} or range
`vim.b`                                                            *vim.b*
    Buffer-scoped (|b:|) variables for the current buffer. Invalid or
    unset key returns `nil`. Can be indexed with an integer to access
    variables for a specific buffer.
Span                                                                *span*
    generic inline container for phrasing content, which does not
    inherently represent anything.
</programlisting>
    <para>
      Convert it to vimdoc with metadata variable set (e.g. with
      <literal>-M vimdoc-prefix=pandoc</literal>)
    </para>
    <programlisting>
------------------------------------------------------------------------
Header                                                     *pandoc-header*

:[range]Fnl {expr}                                                  *:Fnl*
    Evaluates {expr} or range
`vim.b`                                                     *pandoc-vim.b*
    Buffer-scoped (|b:|) variables for the current buffer. Invalid or
    unset key returns `nil`. Can be indexed with an integer to access
    variables for a specific buffer.
Span                                                         *pandoc-span*
    generic inline container for phrasing content, which does not
    inherently represent anything.
</programlisting>
    <para>
      <literal>vim.b</literal> and <literal>Span</literal> got their
      prefixes but not <literal>:Fnl</literal> because ex-commands
      (those starting with <literal>:</literal>) don’t get a prefix,
      since they are considered unique across help pages.
    </para>
    <para>
      In both cases <literal>:help b:</literal> became reference
      <literal>|b:|</literal> (also works with
      <literal>:h b:</literal>). Links pointing to either
      <link xlink:href="https://vimhelp.org/" role="uri">https://vimhelp.org/</link>
      or
      <link xlink:href="https://neovim.io/doc/user" role="uri">https://neovim.io/doc/user</link>
      become references too.
    </para>
    <para>
      Vim traditionally wraps at 78, but Pandoc defaults to 72. Use
      <literal>--columns 78</literal> to match Vim.
    </para>
  </section>
  <section xml:id="syntax-highlighting">
    <title>Syntax highlighting</title>
    <para>
      Pandoc will automatically highlight syntax in
      <link linkend="fenced-code-blocks">fenced code blocks</link> that
      are marked with a language name. The Haskell library
      <link xlink:href="https://github.com/jgm/skylighting">skylighting</link>
      is used for highlighting. Currently highlighting is supported only
      for HTML, EPUB, Docx, Ms, Man, Typst, and LaTeX/PDF output. To see
      a list of language names that pandoc will recognize, type
      <literal>pandoc --list-highlight-languages</literal>.
    </para>
    <para>
      The color scheme can be selected using the
      <literal>--syntax-highlighting</literal> option. The default color
      scheme is <literal>pygments</literal>, 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
      <literal>pandoc --list-highlight-styles</literal>.
    </para>
    <para>
      If you are not satisfied with the predefined styles, you can use
      <literal>--print-highlight-style</literal> to generate a JSON
      <literal>.theme</literal> file which can be modified and used as
      the argument to <literal>--syntax-highlighting</literal>. To get a
      JSON version of the <literal>pygments</literal> style, for
      example:
    </para>
    <programlisting>
pandoc -o my.theme --print-highlight-style pygments
</programlisting>
    <para>
      Then edit <literal>my.theme</literal> and use it like this:
    </para>
    <programlisting>
pandoc --syntax-highlighting my.theme
</programlisting>
    <para>
      If you are not satisfied with the built-in highlighting, or you
      want to highlight a language that isn’t supported, you can use the
      <literal>--syntax-definition</literal> option to load a
      <link xlink:href="https://docs.kde.org/stable5/en/kate/katepart/highlight.html">KDE-style
      XML syntax definition file</link>. Before writing your own, have a
      look at KDE’s
      <link xlink:href="https://github.com/KDE/syntax-highlighting/tree/master/data/syntax">repository
      of syntax definitions</link>.
    </para>
    <para>
      If you receive an error that pandoc <quote>Could not read
      highlighting theme</quote>, check that the JSON file is encoded
      with UTF-8 and has no Byte-Order Mark (BOM).
    </para>
    <para>
      To disable highlighting, use
      <literal>--syntax-highlighting=none</literal>.
    </para>
  </section>
  <section xml:id="custom-styles">
    <title>Custom Styles</title>
    <para>
      Custom styles can be used in the docx, odt and ICML formats.
    </para>
    <section xml:id="output">
      <title>Output</title>
      <para>
        By default, pandoc’s odt, 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 <link linkend="option--reference-doc">reference doc</link>
        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
        <literal>div</literal>s and <literal>span</literal>s,
        respectively.
      </para>
      <para>
        If you define a Div, Span, or Table with the attribute
        <literal>custom-style</literal>, 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
        <literal>bracketed_spans</literal> syntax,
      </para>
      <programlisting>
[Get out]{custom-style=&quot;Emphatically&quot;}, he said.
</programlisting>
      <para>
        would produce a file with <quote>Get out</quote> styled with
        character style <literal>Emphatically</literal>. Similarly,
        using the <literal>fenced_divs</literal> syntax,
      </para>
      <programlisting>
Dickinson starts the poem simply:

::: {custom-style=&quot;Poetry&quot;}
| A Bird came down the Walk---
| He did not know I saw---
:::
</programlisting>
      <para>
        would style the two contained lines with the
        <literal>Poetry</literal> paragraph style.
      </para>
      <para>
        Styles will be defined in the output file as inheriting from
        normal text (docx) or Default Paragraph Style (odt), if the
        styles are not yet in your
        <link linkend="option--reference-doc">reference doc</link>. If
        they are already defined, pandoc will not alter the definition.
      </para>
      <para>
        This feature allows for greatest customization in conjunction
        with <link xlink:href="https://pandoc.org/filters.html">pandoc
        filters</link>. 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
        <literal>Emphasis</literal> character style (perhaps to change
        their color), you can write a filter which will transform all
        italicized inlines to inlines within an
        <literal>Emphasis</literal> custom-style
        <literal>span</literal>.
      </para>
      <para>
        For docx or odt output, you don’t need to enable any extensions
        for custom styles to work.
      </para>
    </section>
    <section xml:id="input">
      <title>Input</title>
      <para>
        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’s styles.
      </para>
      <para>
        By enabling the
        <link linkend="ext-styles"><literal>styles</literal>
        extension</link> in the docx reader
        (<literal>-f docx+styles</literal>), you can produce output that
        maintains the styles of the input document, using the
        <literal>custom-style</literal> class. A
        <literal>custom-style</literal> attribute will be added for each
        style. Divs will be created to hold the paragraph styles, and
        Spans to hold the character styles. Table styles will be applied
        directly to the Table.
      </para>
      <para>
        For example, using the
        <literal>custom-style-reference.docx</literal> file in the test
        directory, we have the following different outputs:
      </para>
      <para>
        Without the <literal>+styles</literal> extension:
      </para>
      <programlisting>
$ 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.

&gt; Here is a styled paragraph that inherits from Block Text.
</programlisting>
      <para>
        And with the extension:
      </para>
      <programlisting>
$ pandoc test/docx/custom-style-reference.docx -f docx+styles -t markdown

::: {custom-style=&quot;First Paragraph&quot;}
This is some text.
:::

::: {custom-style=&quot;Body Text&quot;}
This is text with an [emphasized]{custom-style=&quot;Emphatic&quot;} text style.
And this is text with a [strengthened]{custom-style=&quot;Strengthened&quot;}
text style.
:::

::: {custom-style=&quot;My Block Style&quot;}
&gt; Here is a styled paragraph that inherits from Block Text.
:::
</programlisting>
      <para>
        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.
      </para>
    </section>
  </section>
  <section xml:id="custom-readers-and-writers">
    <title>Custom readers and writers</title>
    <para>
      Pandoc can be extended with custom readers and writers written in
      <link xlink:href="https://www.lua.org">Lua</link>. (Pandoc
      includes a Lua interpreter, so Lua need not be installed
      separately.)
    </para>
    <para>
      To use a custom reader or writer, simply specify the path to the
      Lua script in place of the input or output format. For example:
    </para>
    <programlisting>
pandoc -t data/sample.lua
pandoc -f my_custom_markup_language.lua -t latex -s
</programlisting>
    <para>
      If the script is not found relative to the working directory, it
      will be sought in the <literal>custom</literal> subdirectory of
      the user data directory (see <literal>--data-dir</literal>).
    </para>
    <para>
      A custom reader is a Lua script that defines one function, Reader,
      which takes a string as input and returns a Pandoc AST. See the
      <link xlink:href="https://pandoc.org/lua-filters.html">Lua filters
      documentation</link> for documentation of the functions that are
      available for creating pandoc AST elements. For parsing, the
      <link xlink:href="http://www.inf.puc-rio.br/~roberto/lpeg/">lpeg</link>
      parsing library is available by default. To see a sample custom
      reader:
    </para>
    <programlisting>
pandoc --print-default-data-file creole.lua
</programlisting>
    <para>
      If you want your custom reader to have access to reader options
      (e.g. the tab stop setting), you give your Reader function a
      second <literal>options</literal> parameter.
    </para>
    <para>
      A custom writer is a Lua script that defines a function that
      specifies how to render each element in a Pandoc AST. See the
      <link xlink:href="https://github.com/jgm/djot.lua/blob/main/djot-writer.lua">djot-writer.lua</link>
      for a full-featured example.
    </para>
    <para>
      Note that custom writers have no default template. If you want to
      use <literal>--standalone</literal> with a custom writer, you will
      need to specify a template manually using
      <literal>--template</literal> or add a new default template with
      the name <literal>default.NAME_OF_CUSTOM_WRITER.lua</literal> to
      the <literal>templates</literal> subdirectory of your user data
      directory (see <link linkend="templates">Templates</link>).
    </para>
  </section>
  <section xml:id="reproducible-builds">
    <title>Reproducible builds</title>
    <para>
      Some of the document formats pandoc targets (such as EPUB, docx,
      and ODT) include build timestamps in the generated document. That
      means that the files generated on successive builds will differ,
      even if the source does not. To avoid this, set the
      <literal>SOURCE_DATE_EPOCH</literal> environment variable, and the
      timestamp will be taken from it instead of the current time.
      <literal>SOURCE_DATE_EPOCH</literal> should contain an integer
      unix timestamp (specifying the number of seconds since midnight
      UTC January 1, 1970).
    </para>
    <para>
      For reproducible builds with LaTeX, you can either specify the
      <literal>pdf-trailer-id</literal> in the metadata or leave it
      undefined, in which case pandoc will create a trailer-id based on
      a hash of the <literal>SOURCE_DATE_EPOCH</literal> and the
      document’s contents.
    </para>
    <para>
      Some document formats also include a unique identifier. For EPUB,
      this can be set explicitly by setting the
      <literal>identifier</literal> metadata field (see
      <link linkend="epub-metadata">EPUB Metadata</link>, above).
    </para>
  </section>
  <section xml:id="accessible-pdfs-and-pdf-archiving-standards">
    <title>Accessible PDFs and PDF archiving standards</title>
    <para>
      PDF is a flexible format, and using PDF in certain contexts
      requires additional conventions. For example, PDFs are not
      accessible by default; they define how characters are placed on a
      page but do not contain semantic information on the content.
      However, it is possible to generate accessible PDFs, which use
      tagging to add semantic information to the document.
    </para>
    <para>
      Pandoc defaults to LaTeX to generate PDF. Tagging support in LaTeX
      is in development and not readily available, so PDFs generated in
      this way will always be untagged and not accessible. This means
      that alternative engines must be used to generate accessible PDFs.
    </para>
    <para>
      The PDF standards PDF/A and PDF/UA define further restrictions
      intended to optimize PDFs for archiving and accessibility. Tagging
      is commonly used in combination with these standards to ensure
      best results.
    </para>
    <para>
      Note, however, that standard compliance depends on many things,
      including the colorspace of embedded images. Pandoc cannot check
      this, and external programs must be used to ensure that generated
      PDFs are in compliance.
    </para>
    <section xml:id="context">
      <title>ConTeXt</title>
      <para>
        ConTeXt always produces tagged PDFs, but the quality depends on
        the input. The default ConTeXt markup generated by pandoc is
        optimized for readability and reuse, not tagging. Enable the
        <link linkend="extension--tagging"><literal>tagging</literal></link>
        format extension to force markup that is optimized for tagging.
        For example:
      </para>
      <programlisting>
pandoc -t context+tagging doc.md -o doc.pdf
</programlisting>
      <para>
        A recent <literal>context</literal> version should be used, as
        older versions contained a bug that lead to invalid PDF
        metadata.
      </para>
    </section>
    <section xml:id="weasyprint">
      <title>WeasyPrint</title>
      <para>
        The HTML-based engine WeasyPrint includes experimental support
        for PDF/A and PDF/UA since version 57. Tagged PDFs can created
        with
      </para>
      <programlisting>
pandoc --pdf-engine=weasyprint \
       --pdf-engine-opt=--pdf-variant=pdf/ua-1 ...
</programlisting>
      <para>
        The feature is experimental and standard compliance should not
        be assumed.
      </para>
    </section>
    <section xml:id="prince-xml">
      <title>Prince XML</title>
      <para>
        The non-free HTML-to-PDF converter <literal>prince</literal> has
        extensive support for various PDF standards as well as tagging.
        E.g.:
      </para>
      <programlisting>
pandoc --pdf-engine=prince \
       --pdf-engine-opt=--tagged-pdf ...
</programlisting>
      <para>
        See the prince documentation for more info.
      </para>
    </section>
    <section xml:id="typst">
      <title>Typst</title>
      <para>
        Typst 0.12 can produce PDF/A-2b:
      </para>
      <programlisting>
pandoc --pdf-engine=typst --pdf-engine-opt=--pdf-standard=a-2b ...
</programlisting>
    </section>
    <section xml:id="word-processors">
      <title>Word Processors</title>
      <para>
        Word processors like LibreOffice and MS Word can also be used to
        generate standardized and tagged PDF output. Pandoc does not
        support direct conversions via these tools. However, pandoc can
        convert a document to a <literal>docx</literal> or
        <literal>odt</literal> file, which can then be opened and
        converted to PDF with the respective word processor. See the
        documentation for
        <link xlink:href="https://support.microsoft.com/en-us/office/create-accessible-pdfs-064625e0-56ea-4e16-ad71-3aa33bb4b7ed">Word</link>
        and
        <link xlink:href="https://help.libreoffice.org/latest/en-US/text/shared/01/ref_pdf_export_general.html">LibreOffice</link>.
      </para>
    </section>
  </section>
  <section xml:id="running-pandoc-as-a-web-server">
    <title>Running pandoc as a web server</title>
    <para>
      If you rename (or symlink) the pandoc executable to
      <literal>pandoc-server</literal>, or if you call pandoc with
      <literal>server</literal> as the first argument, it will start up
      a web server with a JSON API. This server exposes most of the
      conversion functionality of pandoc. For full documentation, see
      the
      <link xlink:href="https://github.com/jgm/pandoc/blob/master/doc/pandoc-server.md">pandoc-server</link>
      man page.
    </para>
    <para>
      If you rename (or symlink) the pandoc executable to
      <literal>pandoc-server.cgi</literal>, it will function as a CGI
      program exposing the same API as <literal>pandoc-server</literal>.
    </para>
    <para>
      <literal>pandoc-server</literal> is designed to be maximally
      secure; it uses Haskell’s type system to provide strong guarantees
      that no I/O will be performed on the server during pandoc
      conversions.
    </para>
  </section>
  <section xml:id="running-pandoc-as-a-lua-interpreter">
    <title>Running pandoc as a Lua interpreter</title>
    <para>
      Calling the pandoc executable under the name
      <literal>pandoc-lua</literal> or with <literal>lua</literal> as
      the first argument will make it function as a standalone Lua
      interpreter. The behavior is mostly identical to that of the
      <link xlink:href="https://www.lua.org/manual/5.4/manual.html#7">standalone
      <literal>lua</literal> executable</link>, version 5.4. All
      <literal>pandoc.*</literal> packages, as well as the packages
      <literal>re</literal> and <literal>lpeg</literal>, are available
      via global variables. Furthermore, the globals
      <literal>PANDOC_VERSION</literal>,
      <literal>PANDOC_STATE</literal>, and
      <literal>PANDOC_API_VERSION</literal> are set at startup. For full
      documentation, see the
      <link xlink:href="https://github.com/jgm/pandoc/blob/master/doc/pandoc-lua.md">pandoc-lua</link>
      man page.
    </para>
  </section>
  <section xml:id="a-note-on-security">
    <title>A note on security</title>
    <orderedlist numeration="arabic">
      <listitem>
        <para>
          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.
        </para>
      </listitem>
      <listitem>
        <para>
          Several input formats (including LaTeX, Org, RST, and Typst)
          support <literal>include</literal> directives that allow the
          contents of a file to be included in the output. An untrusted
          attacker could use these to view the contents of files on the
          file system. (Using the <literal>--sandbox</literal> option
          can protect against this threat.)
        </para>
      </listitem>
      <listitem>
        <para>
          Several output formats (including RTF, FB2, HTML with
          <literal>--self-contained</literal>, EPUB, Docx, and ODT) will
          embed encoded or raw images into the output file. An untrusted
          attacker could exploit this to view the contents of non-image
          files on the file system. (Using the
          <literal>--sandbox</literal> option can protect against this
          threat, but will also prevent including images in these
          formats.)
        </para>
      </listitem>
      <listitem>
        <para>
          In reading HTML files, pandoc will attempt to include the
          contents of <literal>iframe</literal> elements by fetching
          content from the local file or URL specified by
          <literal>src</literal>. If untrusted HTML is processed on a
          server, this has the potential to reveal anything readable by
          the process running the server. Using the
          <literal>-f html+raw_html</literal> will mitigate this threat
          by causing the whole <literal>iframe</literal> to be parsed as
          a raw HTML block. Using <literal>--sandbox</literal> will also
          protect against the threat.
        </para>
      </listitem>
      <listitem>
        <para>
          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
          <literal>PandocPure</literal> monad. See the document
          <link xlink:href="https://pandoc.org/using-the-pandoc-api.html">Using
          the pandoc API</link> for more details. (This corresponds to
          the use of the <literal>--sandbox</literal> option on the
          command line.)
        </para>
      </listitem>
      <listitem>
        <para>
          Pandoc’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 <literal>+RTS -M512M -RTS</literal> (for example)
          to limit the heap size to 512MB. Note that the
          <literal>commonmark</literal> parser (including
          <literal>commonmark_x</literal> and <literal>gfm</literal>) is
          much less vulnerable to pathological performance than the
          <literal>markdown</literal> parser, so it is a better choice
          when processing untrusted input.
        </para>
      </listitem>
      <listitem>
        <para>
          The HTML generated by pandoc is not guaranteed to be safe. If
          <literal>raw_html</literal> is enabled for the Markdown input,
          users can inject arbitrary HTML. Even if
          <literal>raw_html</literal> is disabled, users can include
          dangerous content in URLs and attributes. To be safe, you
          should run all HTML generated from untrusted user input
          through an HTML sanitizer.
        </para>
      </listitem>
    </orderedlist>
  </section>
  <section xml:id="authors">
    <title>Authors</title>
    <para>
      Copyright 2006–2024 John MacFarlane (jgm@berkeley.edu). Released
      under the
      <link xlink:href="https://www.gnu.org/copyleft/gpl.html">GPL</link>,
      version 2 or greater. This software carries no warranty of any
      kind. (See COPYRIGHT for full copyright and warranty notices.) For
      a full list of contributors, see the file AUTHORS.md in the pandoc
      source code.
    </para>
  </section>
</article>
