Download as:
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Language:EN
Pages: 154

Here example cell markdown lorem ipsum dolor sit amet

Synopsis 1

Description 3

Reading from the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Options 7

Citation rendering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

Math rendering in HTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

Reader options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

General writer options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

Templates 35

Template syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

For loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

Partials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

Contents

Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Metadata variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Language variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 44 Variables for HTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Pandoc’s Markdown 61 Philosophy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Paragraphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Headings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Setext-style headings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 ATX-style headings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 63 Heading identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Block quotations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 Verbatim (code) blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Indented code blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Fenced code blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Line blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 69 Bullet lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Strikeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

Superscripts and subscripts . . . . . . . . . . . . . . . . . . . . . . . . . . 87

Raw HTML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

Generic raw attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

Reference links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

Internal links . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

Non-default extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

Markdown variants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

Specifying a citation style . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112

Citations in note styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112

Slide shows 117

Structuring the slide show . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

Speaker notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

Columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

On individual slides (reveal.js, pptx) . . . . . . . . . . . . . . . . . . . . . 125

On the title slide (reveal.js, pptx) . . . . . . . . . . . . . . . . . . . . . . . . 125

EPUB Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127

The epub:type attribute . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

Custom Styles 137

Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137

Authors 147

vi

Pandoc is a library for converting from one markup format to another, and a command-line tool that uses this library.

Pandoc can convert between numerous markup and word processing formats, including, but not limited to, various flavors of , , and . For the full lists of input and output formats, see the --from and --to options below. Pandoc can also produce output: see creating a PDF, below.

If no input-files are specified, input is read from stdin. Output goes to stdout by default. For output to a file, use the -o option:

pandoc -o output.html input.txt

For more information on how standalone documents are produced, see Templates below.

If multiple input files are given, pandoc will concatenate them all (with blank lines between them) before parsing. (Use --file-scope to parse files individually.)

pandoc -f html -t markdown hello.html

Supported input and output formats are listed below under Options (see -f for input for-mats and -t for output formats). You can also use pandoc --list-input-formats and pandoc --list-output-formats to print lists of supported formats.

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 :

iconv -t utf-8 input.txt | pandoc | iconv -f utf-8

To produce a PDF, specify an output file with a .pdf extension:

pandoc test.txt -o test.pdf

When using LaTeX, the following packages need to be available (they are included with all recent versions of ): , , , , , (if the --listings option is used), , , , (if the doc-ument contains images), , , , (with the geometry variable set), (with linestretch), and (with lang). If CJKmainfont is set, is needed. The use of xelatex or lualatex as the PDF engine requires . lualatex uses . xelatex uses (with the dir variable set). If the mathspec variable is set, xelatex will use instead of . The and packages are used if available, and will be used for typography if the csquotes variable or metadata field is set to a true value. The , , , and packages can optionally be used for citation rendering. The following packages will be used to im-prove output quality if present, but pandoc does not require them to be present: (for straight quotes in verbatim environments), (for better spacing adjustments), (for better inter-paragraph spaces), (for better line breaks in URLs), (for better PDF bookmarks), and or (to allow footnotes in tables).

Reading from the Web

It is possible to supply a custom User-Agent string or other header when requesting a doc-

ument from a URL:

General options

-f FORMAT, -r FORMAT, --from=FORMAT, --read=FORMAT Specify input format. FOR- MAT can be:

• native (native Haskell)
• odt ()
• opml ()
• org ()
• ris ( bibliography)
• rtf ()
• rst ()
• t2t ()
• textile ()
• tikiwiki ()
• twiki ()
• vimwiki ()
• the path of a custom Lua reader, see Custom readers and writers below

Extensions can be individually enabled or disabled by appending +EXTENSION or -EXTENSION to the format name. See Extensions below, for a list of extensions and their names. See --list-input-formats and --list-extensions, below.

General options

• jats_articleauthoring ( XML, Article Authoring Tag Set)• jats_publishing ( XML, Journal Publishing Tag Set)
• jats (alias for jats_archiving)
• jira (/Confluence wiki markup)
• json (JSON version of native AST)
• latex ()
• man ()
• markdown (Pandoc’s Markdown)
• markdown_mmd ()
• markdown_phpextra ()
• markdown_strict (original unextended )
• markua ()
• mediawiki ()
• ms ()
• muse (),
• native (native Haskell),
• odt ()
• opml ()
• opendocument ()
• org ()
• pdf ()
• plain (plain text),
• pptx ( slide show)
• rst ()
• rtf ()
• texinfo ()
• textile ()
• slideous ( HTML and JavaScript slide show)
• slidy ( HTML and JavaScript slide show)
• dzslides ( HTML5 + JavaScript slide show),
• revealjs ( HTML5 + JavaScript slide show)
• s5 ( HTML and JavaScript slide show)
• tei ()
• xwiki ()
• zimwiki ()
• the path of a custom Lua writer, see Custom readers and writers below

Options

to stdout, even if a non-textual format (docx, odt, epub2, epub3) is specified.

--verbose Give verbose debugging output.

--quiet Suppress warning messages.

--list-extensions[=FORMAT] List supported extensions for FORMAT, one per line, pre-ceded by a + or - indicating whether it is enabled by default in FORMAT. If FORMAT is not specified, defaults for pandoc’s Markdown are given.

--list-highlight-languages List supported languages for syntax highlighting, one per line.

-h, --help Show usage message.

Reader options

--default-image-extension=EXTENSION 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 Mark-down and LaTeX readers.

--file-scope 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 --file-scope.

is equivalent to

pandoc -t json | ./caps.py latex | pandoc -f json -t latex

2. $DATADIR/filters (executable or non-executable) where $DATADIR is the user data directory (see --data-dir, above).

3. $PATH (executable only)

In order of preference, pandoc will look for Lua filters in

1. a specified full or relative path

-M KEY[=VAL], --metadata=KEY[:VAL] Set the metadata field KEY to the value VAL. A value specified on the command line overrides a value specified in the document us-ing YAML metadata blocks. Values will be parsed as YAML boolean or string values. If no value is specified, the value will be treated as Boolean true. Like --variable,--metadata causes template variables to be set. But unlike --variable, --metadata 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.

--metadata-file=FILE Read metadata from the supplied YAML (or JSON) file. This op-tion can be used with every input format, but string scalars in the YAML 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. Meta-data values specified inside the document, or by using -M, overwrite values specified with this option. The file will be searched for first in the working directory, and then in the metadata subdirectory of the user data directory (see --data-dir).

--abbreviations=FILE Specifies a custom abbreviations file, with abbreviations one to a line. If this option is not specified, pandoc will read the data file abbreviations from

13

-s, --standalone 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 pdf, epub, epub3, fb2, docx, and odt output. For native output, this option causes metadata to be included; otherwise, metadata is suppressed.

--template=FILE|URL Use the specified file as a custom template for the generated doc-ument. Implies --standalone. See Templates, below, for a description of template syntax. If no extension is specified, an extension corresponding to the writer will be added, so that --template=special looks for special.html for HTML output. If the template is not found, pandoc will search for it in the templates subdirectory of the user data directory (see --data-dir). If this option is not used, a default template appropriate for the output format will be used (see -D/--print-default-template).

14

General writer options

--wrap=auto|none|preserve Determine how text is wrapped in the output (the source code, not the rendered version). With auto (the default), pandoc will attempt to wrap lines to the column width specified by --columns (default 72). With none, pandoc will not wrap lines at all. With preserve, 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 ipynb output, this option affects wrapping of the contents of markdown cells.

--columns=NUMBER Specify length of lines in characters. This affects text wrapping in the generated source code (see --wrap). It also affects calculation of column widths for plain text tables (see Tables below).

--no-highlight Disables syntax highlighting for code blocks and inlines, even when a language attribute is given.

15

--print-highlight-style=STYLE|FILE Prints a JSON version of a highlighting style, which can be modified, saved with a .theme extension, and used with --highlight-style. This option may be used with -o/--output to redirect output to a file, but-o/--output must come before --print-highlight-style on the command line.

--syntax-definition=FILE 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.

16

Options affecting specific writers

--html-q-tags Use <q> tags for quotes in HTML. (This option only has an effect if the smart extension is enabled for the input format used.)

--ascii 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), Common-Mark, gfm, and Markdown (which use entities), roff ms (which use hexadecimal es-capes), and to a limited degree LaTeX (which uses standard commands for accented characters when possible). roff man output uses ASCII by default.

Options

default is atx.) ATX-style headings are always used for levels 3+. This option also affects Markdown cells in ipynb output.

--listings Use the package for LaTeX code blocks. The package does not sup-port multi-byte encoding for source code. To handle UTF-8 you would need to use a custom template. This issue is fully documented here: .

-i, --incremental Make list items in slide shows display incrementally (one by one). The default is for lists to be displayed all at once.

--email-obfuscation=none|javascript|references Specify a method for

obfuscat-

ing mailto: links in HTML documents.

-c URL, --css=URL Link to a CSS style sheet. This option can be used repeatedly to include multiple files. They will be included in the order specified.

A stylesheet is required for generating EPUB. If none is provided using this option (or the css or stylesheet metadata fields), pandoc will look for a file epub.css in the user data directory (see --data-dir). If it is not found there, sensible defaults will be used.

• Normal
• Body Text
• First Paragraph
• Compact
• Title
• Subtitle
• Author

19

Table style:

• Table

Options affecting specific writers

PowerPoint Templates included with Microsoft PowerPoint 2013 (either with .pptx or .potx extension) are known to work, as are most templates derived from these.

You can also modify the default reference.pptx: first run pandoc -o custom-reference.pptx --print-default-data-file reference.pptx, and then mod-ify custom-reference.pptx in MS PowerPoint (pandoc will use the layouts with the names listed above).

--epub-cover-image=FILE 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 cover-image in a YAML metadata block (see EPUB Metadata, below).

21

Options

Wildcards can also be used:

@font-face {
font-family: DejaVuSans;
font-style: normal;
font-weight: normal;
src:url("DejaVuSans-Regular.ttf");
}
@font-face {
font-family: DejaVuSans;
font-style: normal;
font-weight: bold;
src:url("DejaVuSans-Bold.ttf");
}
@font-face {
font-family: DejaVuSans;
font-style: italic;
font-weight: normal;
src:url("DejaVuSans-Oblique.ttf");
}
@font-face {
font-family: DejaVuSans;
font-style: italic;
font-weight: bold;
src:url("DejaVuSans-BoldOblique.ttf");
}
body { font-family: "DejaVuSans"; }

--epub-chapter-level=NUMBER Specify the heading level at which to split the EPUB into separate “chapter” files. The default is to split into chapters at level-1 headings. This option only affects the internal composition of the EPUB, not the way chapters and sections are displayed to users. Some readers may be slow if the chapter files are too large, so for large documents with few level-1 headings, one might want to use a chapter level of 2 or 3.

means that all of the data formats included in the original are preserved. none means that the contents of data cells are omitted. best causes pandoc to try to pick the richest data block in each output cell that is compatible with the output format. The default is best.

--pdf-engine=PROGRAM Use the specified engine when producing PDF output. Valid values are pdflatex, lualatex, xelatex, latexmk, tectonic, wkhtmltopdf, weasyprint, pagedjs-cli, prince, context, and pdfroff. 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-t/--to:

--bibliography=FILE Set the bibliography field in the document’s metadata to FILE, overriding any value set in the metadata. If you supply this argument multiple times, each FILE will be added to bibliography. If FILE is a URL, it will be fetched via HTTP. If FILE is not found relative to the working directory, it will be sought in the resource path (see --resource-path).

23

--biblatex Use for citations in LaTeX output. This option is not for use with the--citeproc option or with PDF output. It is intended for use in producing a LaTeX file that can be processed with or .

Math rendering in HTML

24

Options for wrapper scripts

# produces myfile.html and images in image_dir

Options for wrapper scripts

pandoc -o foo.html -s

25

Fields that are omitted will just have their regular default values. So a defaults file can be as simple as one line:

verbosity: INFO

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

29

Defaults files

defaults file

input-file: foo.md
input-files:

- foo.md

--from markdown+emoji

--verbose
--quiet
--fail-if-warnings--sandbox
--log=FILE

output-file:
data-dir: dir
defaults:
- file
verbosity: INFO
verbosity: ERROR
fail-if-warnings: true
sandbox: true
log-file: FILE

30

General writer options

--file-scope file-scope: true

--filter pandoc-citeproc \ filters:

--metadata key=value \ metadata:

--metadata key2 key: value

--preserve-tabs preserve-tabs: true

--tab-stop 8 tab-stop: 8

trace: true

Filters will be assumed to be Lua filters if they have the .lua extension, and JSON filters otherwise. But the filter type can also be specified explicitly, as shown. Filters are run in the order specified. To include the built-in citeproc filter, use either citeproc or {type: citeproc}.

General writer options

key2: true--eol nl eol: nl

31

dpi: 300
wrap: 60
columns: 72
table-of-contents: true
toc: true
toc-depth: 3

--strip-comments
--no-highlight
--highlight-style kate
--syntax-definition mylang.xml

--no-check-certificate

strip-comments: true highlight-style: null highlight-style: kate syntax-definitions: - mylang.xml

self-contained: true
html-q-tags: true

--ascii ascii: true

--slide-level 2 slide-level: 2

--section-divs
--email-obfuscation references

defaults file

--id-prefix ch1

--css styles/screen.css

css:

--epub-embed-font headline.otf - special.otf

--epub-chapter-level 2
--epub-subdirectory=""
--ipynb-output best
--pdf-engine xelatex
--pdf-engine-opt=--shell-escape

citation-abbreviations: ab.json

Defaults files

Math rendering in HTML

defaults file
html-math-method:

method: gladtex

defaults file

--dump-args
--ignore-args

dump-args: true
ignore-args: true

where FORMAT is the name of the output format. A custom template can be specified using the --template option. You can also override the system default templates for a given output format FORMAT by putting a file templates/default.*FORMAT* in the user data directory (see --data-dir, above). Exceptions:

• For odt output, customize the default.opendocument template.

Template syntax

Comments

To mark variables and control structures in the template, either $…$ or ${…} may be used as delimiters. The styles may also be mixed in the same template, but the opening and closing delimiter must match in each case. The opening delimiter may be followed by one or more spaces or tabs, which will be ignored. The closing delimiter may be followed by one or more spaces or tabs, which will be ignored.

To include a literal $ in the document, use $$.

Variable names with periods are used to get at structured variable values. So, for example, employee.salary will return the value of the salary field of the object that is the value of the employee field.

• If the value of the variable is simple value, it will be rendered verbatim. (Note that no escaping is done; the assumption is that the calling program will escape the strings appropriately for the output format.)
• If the value is a list, the values will be concatenated.

36

Template syntax

${if(foo)}
${foo}
${endif}

${if(foo)}
${ foo.bar }
${else}
no foo!

A for loop begins with for(variable) (enclosed in matched delimiters) and ends with endfor (enclosed in matched delimiters.

• If variable is an array, the material inside the loop will be evaluated repeatedly, with variable being set to each value of the array in turn, and concatenated.

Examples:

$for(foo)$$foo$$sep$, $endfor$

${ for(foo) }${ foo }${ sep }, ${ endfor }

Instead of using variable inside the loop, the special anaphoric keyword it may be used.

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:

${ styles.html() }

${ date:fancy() }

${ articles:bibentry() }

Note that the anaphoric keyword it must be used when iterating over partials. In the above examples, the bibentry partial should contain it.title (and so on) instead of ar-ticles.title.

Final newlines are omitted from included partials.

The separator in this case is literal and (unlike with sep in an explicit for loop) cannot contain interpolated variables or other template directives.

Nesting

Templates

00123 A fine bottle of 18-year old
Oban whiskey. ($148)

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.

Breakable spaces

$for(name)$
$name/uppercase$
$endfor$

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

$for(employees/pairs)$
$it.key/alpha/uppercase$. $it.name$
$endfor$

Some pipes take parameters:

• lowercase: Converts text to lowercase.

• length: Returns the length of the value: number of characters for a textual value, number of elements for a map or array.

• chomp: Removes trailing newlines (and breakable space).

• nowrap: Disables line wrapping on breakable spaces.

• left n "leftborder" "rightborder": Renders a textual value in a block of width n, 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 " and \ characters must be backslash-escaped.

• right n "leftborder" "rightborder": Renders a textual value in a block of width n, aligned to the right, and has no effect on other values.

---

author:

subtitle document subtitle, included in HTML, EPUB, LaTeX, ConTeXt, and docx docu- ments

abstract document summary, included in LaTeX, ConTeXt, AsciiDoc, and docx docu- ments

subject document subject, included in ODT, PDF, docx, EPUB, and pptx metadata

description document description, included in ODT, docx and pptx metadata. Some ap- plications show this as Comments metadata.

will include title, author and description as standard document properties and subti-tle as a custom property when converting to docx, ODT or pptx.

Language variables

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

:::

For bidirectional documents, native pandoc spans and divs with the dir attribute (value rtl or ltr) 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 gener-ating HTML) supports the .

When using LaTeX for bidirectional documents, only the xelatex engine is fully sup-ported (use --pdf-engine=xelatex).

fontcolor sets the CSS color property on the html element.

linkcolor sets the CSS color property on all links.

padding properties on the body element.

blockquote {

font-style: italic;

td, th {

44

border-bottom: none;

}

Variables for HTML slides

These affect HTML output when [producing slide shows with pandoc].

aspectratio slide aspect ratio (43 for 4:3 [default], 169 for 16:9, 1610 for 16:10, 149 for 14:9, 141 for 1.41:1, 54 for 5:4, 32 for 3:2)
‘beameroption add extra beamer option with \setbeameroption{}
institute author affiliations: can be a list when there are multiple authors
logo logo image for slides
navigation controls navigation symbols (default is empty for no navigation symbols; other valid values are frame, vertical, and horizontal)
section-titles enables “title pages” for new sections (default is true)
theme, colortheme, fonttheme, innertheme, outertheme beamer themes
themeoptions options for LaTeX beamer themes (a list).

titlegraphic image for title slide

monofont font to use for code.

Variables for LaTeX

classoption option for document class, e.g. oneside; repeat for multiple options:

---
classoption:
- twocolumn
- landscape
...

---
geometry:
- top=30mm
- left=20mm
- heightrounded
...

hyperrefoptions option for package, e.g. linktoc=all; repeat for multiple op- tions:

pagestyle control \pagestyle{}: the default article class supports plain (default), empty (no running heads or page numbers), and headings (section titles in running heads)

papersize paper size, e.g. letter, a4

fontfamily font package for use with pdflatex: includes many options, docu- mented in the . The default is .

fontfamilyoptions options for package used as fontfamily; repeat for multiple options. For example, to use the Libertine font with proportional lowercase (old-style) figures through the package:

mainfont, sansfont, monofont, mathfont, CJKmainfont font families for use with xelatex or lualatex: take the name of any system font, using the package. CJK-mainfont uses the package.

mainfontoptions, sansfontoptions, monofontoptions, mathfontoptions, CJKoptions options to use with mainfont, sansfont, monofont, mathfont, CJKmainfont in xelatex and lualatex. Allow for any choices available through ; repeat for multiple options. For example, to use the version of Palatino with lowercase figures:

Front matter

lof, lot include list of figures, list of tables
thanks contents of acknowledgments footnote after document title
toc include table of contents (can also be set using --toc/--table-of-contents) toc-depth level of section to include in table of contents

biblatexoptions list of options for biblatex
biblio-style bibliography style, when used with --natbib and --biblatex. biblio-title bibliography title, when used with --natbib and --biblatex.

bibliography bibliography to use for resolving references natbiboptions list of options for natbib

If no type is specified (i.e. the value is set to True, by e.g.

--

metadata=pdfa or pdfa: true in a YAML metadata block), 1b:2005 will be used as default, for reasons of backwards compatibility. Using --variable=pdfa 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

pdfaintent when used in conjunction with pdfa, specifies the output intent for the col-ors, e.g. ISO coated v2 300\letterpercent\space (ECI) If left unspecified, sRGB IEC61966-2.1 is used as default.

toc include table of contents (can also be set using --toc/--table-of-contents) whitespace spacing between paragraphs, e.g. none, small (using ) includesource include all source documents as file attachments in the PDF file

adjusting adjusts text to left (l), right (r), center (c), or both (b) margins footer footer in man pages
header header in man pages
hyphenate if true (the default), hyphenation will be used
section section number in man pages

Variables for ms

Variables

body body of document
date-meta the date 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 date are: mm/dd/yyyy, mm/dd/yy, yyyy-mm-dd (ISO 8601), dd MM yyyy (e.g. either 02 Apr 2018 or 02 April 2018), MM dd, yyyy (e.g. Apr. 02, 2018 or April 02, 2018),yyyy[mm[dd]]](e.g.20180402, 201804 or 2018).

Similarly, outputfile can be - if output goes to the terminal.

If you need absolute paths, use e.g. $curdir$/$sourcefile$.

The behavior of some of the readers and writers can be adjusted by enabling or disabling

various extensions.

The markdown reader and writer make by far the most use of extensions. Extensions only used by them are therefore covered in the section Pandoc’s Markdown below (See Mark-down variants for commonmark and gfm.) In the following, extensions that also work for other formats are covered.

Note that markdown extensions added to the ipynb format affect Markdown cells in Jupyter notebooks (as do command-line options like --atx-headers).

input formats markdown, commonmark, latex, mediawiki, org, rst, twiki, html output formats markdown, latex, context, rst
enabled by default in markdown, latex, context (both input and output)

Note: If you are writing Markdown, then the smart extension has the reverse effect: what would have been curly quotes comes out straight.

Extension: auto_identifiers

A heading without an explicitly specified identifier will be automatically assigned a unique identifier based on the heading text.

• Remove all footnotes.

• Remove all non-alphanumeric characters, except underscores, hyphens, and periods.• Replace all spaces and newlines with hyphens.

3. Applications 33

applications
section

Math Input

See the section on

Causes the identifiers produced by auto_identifiers to be pure ASCII. Accents are stripped off of accented Latin letters, and non-Latin letters are omitted.

Extension: gfm_auto_identifiers

Raw HTML/TeX

The following extensions are described in more detail in their respective sections of Pan-doc’s Markdown:

Extensions

output formats textile, commonmark

Extension: literate_haskell

Treat the document as literate Haskell source.

• In Markdown output, code blocks with classes haskell and literate will be ren-dered using bird tracks, and block quotations will be indented one space, so they will not be treated as Haskell code. In addition, headings will be rendered setext-style (with underlines) rather than ATX-style (with ‘#’ characters). (This is because ghc treats ‘#’ characters in column 1 as introducing line numbers.)

• In restructured text input, “bird track” sections will be parsed as Haskell code.

• In LaTeX output, code blocks with class haskell will be rendered inside code envi- ronments.

• In HTML output, code blocks with class haskell will be rendered with class liter- atehaskell and bird tracks.

writes HTML with the Haskell code in bird tracks, so it can be copied and pasted as literate Haskell source.

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.

input formats docx, html
output formats docx, odt, opendocument, html

Extension: native_numbering

Extensions

Extension: xrefs_name

Extension: xrefs_number

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 xrefs_name in which case the name or caption numbers will appear after the number.

Extension: styles

When converting from docx, read all docx styles as divs (for paragraph styles) and spans (for character styles) regardless of whether pandoc understands the meaning of these styles. This can be used with docx custom styles. Disabled by default.

Other extensions

Extension: raw_markdown

Extension: fancy_lists

Some aspects of Pandoc’s Markdown fancy lists are also accepted in org input, mimicking the option org-list-allow-alphabetical in Emacs. As in Org Mode, enabling this exten-sion 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 # placeholder that are enabled by the extension in Pandoc’s Markdown.

59

Pandoc’s Markdown

This principle has guided pandoc’s decisions in finding syntax for tables, footnotes, and other extensions.

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.

Extension: escaped_line_breaks

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.

A level-one heading
===================

A level-two heading
-------------------

### A level-three heading ###

As with setext-style headings, the heading text can contain formatting:

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 re-quirement is that it is all too easy for a # to end up at the beginning of a line by accident (perhaps through line wrapping). Consider, for example:

I like several of their flavors of ice cream:

See also the auto_identifiers extension above.

Extension: header_attributes

## My heading ## {#foo}

My other heading {#foo}

Pandoc’s Markdown

for labels and link anchors in the LaTeX, ConTeXt, Textile, Jira markup, and AsciiDoc writ-

# My heading {-}

is just the same as

Extension: implicit_header_references

Pandoc behaves as if reference links have been defined for each heading. So, to link to a

or

[Heading identifiers in HTML][]

[Heading identifiers in HTML](#heading-identifiers-in-html)

64

# Foo

[foo]: bar

>
> 1. This is a list inside a block quote.
> 2. Second item.

A “lazy” form, which requires the > character only on the first line of each block, is also allowed:

>
> > A block quote within a block quote.

65

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 > to end up at the beginning of a line by accident (perhaps through line wrapping). So, unless the markdown_strict format is used, the following does not produce a nested block quote in pandoc:

> This is a block quote.

For example,

if (a > 3) {

66

Verbatim (code) blocks

Like regular code blocks, fenced code blocks must be separated from surrounding text by blank lines.

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:

Optionally, you may attach attributes to fenced or backtick code block using this syntax:

~~~~ {#mycode .haskell .numberLines startFrom="100"} qsort [] = []
qsort (x:xs) = qsort (filter (< x) xs) ++ [x] ++ qsort (filter (>= x) xs)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<code>

...

```haskell

qsort [] = []

```

If the fenced_code_attributes 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.

Extension: line_blocks

A line block is a sequence of lines beginning with a vertical bar (|) 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:

The lines can be hard-wrapped if needed, but the continuation line must begin with a space.

| The Right Honorable Most Venerable and Righteous Samuel L. Constable, Jr.

Lists

Bullet lists

This will produce a “compact” list. If you want a “loose” list, in which each item is format-ted as a paragraph, put spaces between the items:

* one

* here is my first
list item.

* and my second.

A list item may contain multiple paragraphs and other block-level content. However, sub-sequent paragraphs must be preceded by a blank line and indented to line up with the first non-space content after the list marker.

* First paragraph.

70

Lists

As noted above, Markdown allows you to write list items “lazily,” 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.

+ A lazy, lazy, list
item.

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:

1. one
2. two
3. three

Extension: fancy_lists

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-parentheses or period. They must be separated from the text that follows by at least one space, and, if the list marker is a capital letter with a period, by at least two spaces.1

9) Ninth
10) Tenth
11) Eleventh
i. subone
ii. subtwo
iii. subthree

1The point of this rule is to ensure that normal paragraphs starting with people’s initials, like

(C\) 2007 Joe Smith

72

(5) Three

1. Four

#. three

Extension: task_lists

Extension: definition_lists

Pandoc supports definition lists, using the syntax of with some ex-

: Definition 2

{ some code, part of Definition 2 }

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.

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 “lazily” omit indentation except at the beginning of a paragraph or other block element:

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:

Term 1

Note that space between items in a definition list is required. (A variant that loosens this requirement, but disallows “lazy” hard wrapping, can be activated with com-pact_definition_lists: see Non-default extensions, below.)

Numbered example lists

(@) My first example will be numbered (1).

(@) My second example will be numbered (2).

As (@good) illustrates, ...

The label can be any string of alphanumeric characters, underscores, or hyphens.

Ending a list

What if you want to put an indented code block after a list?

} as the second paragraph of item two, and not as a code block.

To “cut off” the list after item two, you can insert some non-indented content, like an HTML

{ my code block }

You can use the same trick if you want two consecutive lists instead of one big list:

3. three

<!-- -->

A line containing a row of three or more *, -, or _ characters (optionally separated by spaces)

produces a horizontal rule:

font, such as Courier. The fourth kind can be used with proportionally spaced fonts, as it

does not require lining up columns.

Extension: simple_tables

Simple tables look like this:

Right Left
-------
12 12 12

12

123 123 123

123

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:3

• 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.

The column header row may be omitted, provided a dashed line is used to end the table. For example:

-------

12 12 12
123 123 123
1 1 1

1

-------

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:

-------------------------------------------------------------

First

3This scheme is due to Michel Fortin, who proposed it on the .

77

Table: Here's the caption. It, too, may span multiple lines.

These work like simple tables, but with the following differences:

----------- ------- --------------- -------------------------

First

row

----------- ------- --------------- -------------------------

: Here's a multiline table without a header.

Tables

: Sample grid table.

| Price | Advantages

+---------------+---------------+--------------------+

|

|

Alignments can be specified as with pipe tables, by putting colons at the boundaries of the separator line after the header:

+---------------+---------------+--------------------+

| built-in wrapper

|

+---------------+---------------+--------------------+

Grid Table Limitations Pandoc does not support grid tables with row spans or column spans. This means that neither variable numbers of columns across rows nor variable num-bers of rows across columns are supported by Pandoc. All grid tables must have the same number of columns in each row, and the same number of rows in each column. For exam-ple, the Docutils will not render as expected with Pandoc.

| Right | Left | Default | Center |
|------:|:-----|---------|:------:|

| 12 | 12 | 12 | 12

|

| 123 | 123 | 123 | 123
| 1 | 1 | 1 | 1

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:

fruit| price
-----|-----:
apple|2.05
pear|1.37
orange|3.09

80

Metadata blocks

it will be parsed as bibliographic information, not regular text. (It will be used, for example, in the title of standalone LaTeX or HTML output.) The block may contain just a title, a title and an author, or all three elements. If you want to include an author but no title, or a title and a date but no author, you need a blank line:

%
% Author

% Author One
Author Two

% Author One; Author Two

All three metadata fields may contain standard inline formatting (italics, links, footnotes, etc.).

Title blocks will always be parsed, but they will affect the output only when the --standalone (-s) 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 (--title-prefix or -T option). The title in the body appears as an H1 element with class “title”, so it can be suppressed or reformatted with CSS. If a title prefix is specified with -T and no title block appears in the document, the title prefix will be used by itself as the HTML title.

will also have “Pandoc User Manuals” in the footer.

% PANDOC(1) Pandoc User Manuals | Version 4.0

82

Metadata blocks

When pandoc is used with -t markdown to create a Markdown document, a YAML meta-data block will be produced only if the -s/--standalone option is used. All of the metadata will appear in a single block at the beginning of the document.

Note that 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 . The pipe character (|) 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:

Template variables will be set automatically from the metadata. Thus, for example, in writ-ing HTML, the variable abstract will be set to the HTML equivalent of the Markdown in the abstract field:

83

To use the structured authors in the example above, you would need a custom template:

$for(author)$
$if(author.name)$
$author.name$$if(author.affiliation)$ ($author.affiliation$)$endif$ $else$
$author$
$endif$
$endfor$

Backslash escapes

• 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.

*\*hello\**

one will get

\`*_{}[]()>#+-.!

(However, if the markdown_strict format is used, the original Markdown rule will be used.)

Pandoc’s Markdown

Inline formatting

Double * or _ produces strong emphasis:

This is **strong emphasis** and __with underscores__.

surrounded by alphanumeric characters as an emphasis marker. If you want to emphasize

just part of a word, use *:

example,

This ~~is deleted text.~~

Superscripts may be written by surrounding the superscripted text by ^ characters; sub-scripts may be written by surrounding the subscripted text by ~ characters. Thus, for ex-ample,

H~2~O is a liquid. 2^10^ is 1024.

If the verbatim text includes a backtick, use double backticks:

Here is a literal backtick `` ` ``.

Extension: inline_code_attributes

Attributes can be attached to verbatim text, just as with fenced code blocks:

To underline text, use the underline class:

[Underline]{.underline}

To write small caps, use the smallcaps class:

[Small caps]{.smallcaps}

This will work in all output formats that support small caps.

Math

Raw HTML

TeX math will be printed in all output formats. How it is rendered depends on the output format:

AsciiDoc For AsciiDoc output format (-t asciidoc) it will appear verbatim surrounded by latexmath:[$...$] (for inline math) or [latexmath]++++\[...\]+++ (for display math). For AsciiDoctor output format (-t asciidoctor) the LaTex delimiters ($..$ and \[..\]) are omitted.

Texinfo It will be rendered inside a @math command.

ODT It will be rendered, if possible, using MathML.

DocBook If the --mathml flag is used, it will be rendered using MathML in an inlinee-quation or informalequation tag. Otherwise it will be rendered, if possible, using Unicode characters.

Extension: raw_html

Markdown allows you to insert raw HTML (or DocBook) anywhere in a document (except verbatim contexts, where <, >, and & 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.)

In the CommonMark format, if raw_html is enabled, superscripts, subscripts, strikeouts and small capitals will be represented as HTML. Otherwise, plain-text fallbacks will be used. Note that even if raw_html is disabled, tables will be rendered with HTML syntax if they cannot use pipe syntax.

Extension: markdown_in_html_blocks

<table>
<tr>
<td><em>one</em></td>
<td><a href="https://google.com">a link</a></td> </tr>
</table>

whereas Markdown.pl will preserve it as is.

Extension: native_divs

Use native pandoc Div blocks for content inside <div> tags. For the most part this should give the same output as markdown_in_html_blocks, but it makes it easier to write pandoc filters to manipulate groups of blocks.

This result was proved in \cite{jones.1967}.

Note that in LaTeX environments, like

91

Pandoc’s Markdown

And the following produces a raw html inline element:

This is `<a>html</a>`{=html}

The raw attribute cannot be combined with regular attributes.

92

\newcommand{\tuple}[1]{\langle #1 \rangle}

$\tuple{a, b, c}$

Markdown allows links to be specified in several ways.

Automatic links

An inline link consists of the link text in square brackets, followed by the URL in parenthe-ses. (Optionally, the URL can be followed by a link title, in quotes.)

This is an [inline link](/url), and here's [one with

Email addresses in inline links are not autodetected, so they have to be prefixed with mailto:

[Write me!](mailto:sam@green.eggs.ham)

[my label 1]: /foo/bar.html [my label 2]: /foo

"My title, optional"

The title may go on the next line:

[my label 3]: https://fsf.org

In an implicit reference link, the second pair of brackets is empty:

94

tions 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

Extension: shortcut_reference_links

In a shortcut reference link, the second pair of brackets may be omitted entirely:

(see Heading identifiers). For example:

See the [Introduction](#introduction).

and EPUB), LaTeX, and ConTeXt.

95

![movie reel]

[movie reel]: movie.gif

If you just want a regular inline image, just make sure it is not the only thing in the para-graph. One way to do this is to insert a nonbreaking space after the image:

![This image won't be a figure](/url/of/image.png)\

and a reference ![image][ref] with attributes.

[ref]: foo.jpg "optional title" {#id .class key=val key2="val 2"}

The width and height 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: px, cm, mm, in, inch and %. There must not be any spaces between the number and the unit.

For example:

• Some output formats have a notion of a class () or a unique identifier (LaTeX \caption), or both (HTML).

• When no width or height attributes are specified, the fallback is to look at the image resolution and the dpi metadata embedded in the image file.

97

Pandoc’s Markdown

And another.

:::::

This is a warning within a warning.

:::

[This is *some text*]{.class key="val"}

98

Here is a footnote reference,[^1] and another.[^longnote]

[^1]: Here is the footnote.

The whole paragraph can be indented, or just the first

line. In this way, multi-paragraph footnotes work like

identifiers are used only to correlate the footnote reference with the note itself; in the output,

footnotes will be numbered sequentially.

Inline footnotes are also allowed (though, unlike regular notes, they cannot contain multi-

ple paragraphs). The syntax is as follows:

99

Pandoc’s Markdown

How this is rendered depends on the citation style. In an author-date style, it might render as

Blah blah (Doe 1999, Smith 2000, 2004).

Susan Smith, "Bees," *Journal of Insects* (2004).

See the for more information about CSL styles and how they affect rendering.

Pandoc uses some heuristics to separate the locator from the rest of the subject. It is sen-sitive to the locator terms defined in the . Either abbreviated or unabbrevi-ated forms are accepted. In the en-US locale, locator terms can be written in either singular

100

[@smith, {pp. iv, vi-xi, (xv)-(xvii)} with suffix here]

[@smith{}, 99 years later]

@smith04 [p. 33] says blah.

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.

Pandoc’s Markdown

Extension: rebase_relative_paths

Absolute paths and URLs are not changed. Neither are empty paths or paths consisting entirely of a fragment, e.g., #foo.

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.

• 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 header_attributes.)
• Attributes that occur after the opening fence in a fenced code block affect the code block element. (Hence, this option subsumes fenced_code_attributes.)
• Attributes that occur at the end of a reference link definition affect links that refer to that definition.

102

Extension: angle_brackets_escapable

Allow < and > to be backslash-escaped, as they can be in GitHub flavored Markdown but not original Markdown. This is implied by pandoc’s default all_symbols_escapable.

Extension: spaced_reference_links

Allow whitespace between the two components of a reference link, for example,

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.

103

choice than ignore_line_breaks for texts that include a mix of East Asian wide characters

and other characters.

tween \[ and \] to be interpreted as display TeX math. Note: a drawback of this extension

is that it precludes escaping ( and [.

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

Author: John Doe

Date: September 1, 2008

yaml_metadata_block is enabled, it will take precedence over mmd_title_block.

104

Note that the pandoc document model does not support abbreviations, so if this exten-sion is enabled, abbreviation keys are simply skipped (as opposed to being parsed as para-graphs).

Extension: autolink_bare_uris

[ref]: https://path.to/image "Image title" width=20px height=30px id=myId class="myClass1 myClass2"

Extension: mmd_header_identifiers

• To get a “tight” or “compact” list, omit space between consecutive items; the space between a term and its definition does not affect anything.

105

Use conventions for plain output: all-caps for strong emphasis, sur-

round by underscores for regular emphasis, add extra blank space around headings.

Extension: short_subsuperscripts

Parse multimarkdown style subscripts and superscripts, which start with a ‘~’ or ‘^’ char-

4To see why laziness is incompatible with relaxing the requirement of a blank line between items, consider

the following example:

Is this a single list item with two definitions of “bar,” the first of which is lazily wrapped, or two list

items? To remove the ambiguity we must either disallow lazy wrapping or require a blank line between

In addition to pandoc’s extended Markdown, the following Markdown variants are sup-ported:

• markdown_phpextra (PHP Markdown Extra)
• markdown_github (deprecated GitHub-Flavored Markdown)• markdown_mmd (MultiMarkdown)
• markdown_strict (Markdown.pl)
• commonmark (CommonMark)
• gfm (Github-Flavored Markdown)
• commonmark_x (CommonMark with many pandoc extensions)

107

Citations

Specifying bibliographic data

You can specify an external bibliography using the bibliography metadata field in a YAML metadata section or the --bibliography command line argument. If you want to use mul-tiple bibliography files, you can supply multiple --bibliography arguments or set bibli-ography metadata field to YAML array. A bibliography may have any of these formats:

Note that .bib can be used with both BibTeX and BibLaTeX files; use the extension .bibtex to force interpretation as BibTeX.

In BibTeX and BibLaTeX databases, pandoc parses LaTeX markup inside fields such as ti-tle; in CSL YAML databases, pandoc Markdown; and in CSL JSON databases, an :

As an alternative to specifying a bibliography file using --bibliography or the YAML meta-data field bibliography, you can include the citation data directly in the references field of the document’s YAML metadata. The field should contain an array of YAML-encoded references, for example:

---
references:
- type: article-journal
id: WatsonCrick1953
author:
- family: Watson
given: J. D.

pandoc chem.bib -s -f biblatex -t markdown

110

Running pandoc on a bibliography file with the --citeproc option will create a formatted bibliography in the format of your choice:

pandoc chem.bib -s --citeproc -o chem.html pandoc chem.bib -s --citeproc -o chem.pdf

title = {My Dinner with {Andre}}

• In addition, words that should remain lowercase (or camelCase) should be protected:

• Use the language field for non-English titles to prevent their conversion to title case in styles that call for this. (Conversion happens only if language begins with en or is left empty.)

• Protect words that should not be converted to title case using this syntax:

For a formally published conference paper, use the biblatex entry type inproceedings (which will be mapped to CSL paper-conference).

For an unpublished manuscript, use the biblatex entry type unpublished without an eventtitle field (this entry type will be mapped to CSL manuscript).

{ "default": {

"container-title": {

}

}

note style, avoid inserting footnotes manually. Instead, insert citations just as you would in an author-date style—for example,

Blah blah [@foo, p. 33].

[^1]: Some studies [@foo; @bar, p. 33] show that frubulicious zoosnaps are quantical. For a survey of the literature, see @baz [chap. 1].

Raw content in a style

Placement of the bibliography

If the style calls for a list of works cited, it will be placed in a div with id refs, if one exists:

If you wish the bibliography to have a section heading, you can set reference-section-title in the metadata, or put the heading at the beginning of the div with id refs (if you are using it) or at the end of your document:

last paragraph...

You can then put the variable $refs$ into your template where you want the bibliography to be placed.

Including uncited items in the bibliography

It is possible to create a bibliography with all the citations, whether or not they appear in the document, by using a wildcard:

114

A few other metadata fields affect bibliography formatting:

link-citations If true, citations will be hyperlinked to the corresponding bibliography entries (for author-date and numerical styles only). Defaults to false.

• es-u-co-trad – Spanish with the traditional collation (with Ch sorting after C).• fr-u-kb – French with “backwards” accent sorting (with coté sorting after côte).

• en-US-u-kf-upper – English with uppercase letters sorting before lower (default is lower before upper).

via a web browser. There are five ways to do this, using , , , , or

. You can also produce a PDF slide show using LaTeX , or slides shows in

% March 22, 2005

# In the morning

- Eat eggs

- Drink coffee

------------------

![picture of spaghetti](images/spaghetti.jpg)

To produce an HTML/JavaScript slide show, simply type

pandoc -t FORMAT -s habits.txt -o habits.html

pandoc -t beamer habits.txt -o habits.pdf

Note that a reveal.js slide show can also be converted to a PDF by printing it to a file from the browser.

The document is carved up into slides according to the following rules:

• A horizontal rule always starts a new slide.

• Headings above the slide level in the hierarchy create “title slides,” 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).

• 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.)

Title Slide This layout is used for the initial slide, which is generated and filled from the metadata fields date, author, and title, if they are present.

Section Header 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.

119

Slide shows

- Eat spaghetti

- Drink wine

- Drink wine

:::

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:

120

# Slide with a pause

content before the pause

You can change the style of HTML slides by putting customized CSS files in $DATADIR/s5/default (for S5), $DATADIR/slidy (for Slidy), or $DATADIR/slideous (for Slideous), where $DATADIR is the user data directory (see --data-dir, above). The originals may be found in pandoc’s system data directory (generally $CABALDIR/pandoc-VERSION/s5/default). Pandoc will look there for any files it does not find in the user data directory.

For dzslides, the CSS is included in the HTML file itself, and may be modified there.

pandoc -t beamer habits.txt -V theme:Warsaw -o habits.pdf

121

::: notes

This is my note.

Columns

To put material in side by side columns, you can use a native div container with class columns, containing two or more div containers with class column and a width attribute:

Frame attributes in beamer

Additional columns attributes in beamer

The align attributes on columns and column can be used with the values top, top-baseline, center and bottom to vertically align the columns. It defaults to top in columns.

The totalwidth attribute limits the width of the columns to the given value.

See Section 12.7 of the for more details.

Frame attributes in beamer

All of the other frame attributes described in Section 8.1 of the may also be used: allowdisplaybreaks, allowframebreaks, b, c, s, t, environment, label, plain, shrink, standout, noframenumbering, squeeze. allowframebreaks is recommended especially for bibliographies, as it allows multiple slides to be created if the content overfills the frame:

# References {.allowframebreaks}

On all slides (beamer, reveal.js, pptx)

With beamer and reveal.js, the configuration option background-image can be used either in the YAML metadata block or as a command-line variable to get the same image on every slide.

124

Background in reveal.js, beamer, and pptx

On the title slide (reveal.js, pptx)

To add a background image to the automatically generated title slide for reveal.js, use the title-slide-attributes variable in the YAML metadata block. It must contain a map of attribute names and values. (Note that the data- prefix is required here, as it isn’t added automatically.)

## Slide One

Slide 1 has background_image.png as its background.

EPUB Metadata

EPUB metadata may be specified using the --epub-metadata option, but if the source doc-ument is Markdown, it is better to use a YAML metadata block. Here is an example:

127

EPUBs

subject Either a string value, or an object with fields text, authority, and term, or a list of such objects. Valid values for authority are either a (currently AAT, BIC, BISAC, CLC, DDC, CLIL, EuroVoc, MEDTOP, LCSH, NDC, Thema, UDC, and WGS) or an absolute IRI identifying a custom scheme. Valid values for term are defined by the scheme.

description A string value.

rights A string value.

belongs-to-collection A string value. identifies the name of a collection to which the EPUB Publication belongs.

Specifies the page-progression-

ibooks iBooks-specific metadata, with the following fields:

The epub:type attribute

For epub3 output, you can mark up the heading that corresponds to an EPUB chapter using the . For example, to set the attribute to the value prologue, use this markdown:

<h1>My chapter</h1>

Pandoc will output <body epub:type="bodymatter">, unless you use one of the following values, in which case either frontmatter or backmatter will be output.

frontmatter frontmatter frontmatter frontmatter frontmatter frontmatter frontmatter frontmatter frontmatter frontmatter frontmatter frontmatter frontmatter frontmatter frontmatter frontmatter frontmatter frontmatter backmatter backmatter backmatter backmatter

EPUBs

Linked media

By default, pandoc will include some basic styling contained in its epub.css data file. (To see this, use pandoc --print-default-data-file epub.css.) To use a different CSS file, just use the --css command line option. A few inline styles are defined in addition; these are essential for correct formatting of pandoc’s HTML output.

The document-css 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 Variables for HTML may be used to fine-tune the style).

# Lorem ipsum

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

``` code
from IPython.display import HTML
HTML("""
<script>
console.log("hello");
</script>
<b>HTML</b>
""")
```

## Image

::::::

:::::: {.cell .code execution_count=1}
``` {.python}
print("hello")
```

::: {.output .execute_result execution_count=2} ```{=html}
<script>
console.log("hello");
</script>
<b>HTML</b>
hello
```
:::
::::::

If you include raw HTML or TeX in an output cell, use the [raw attribute][Extension: fenced_attribute], as shown in the last cell of the example above. Although pandoc can process “bare” 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 -raw_html-raw_tex+raw_attribute when translating between Markdown and ipynb notebooks.

The color scheme can be selected using the --highlight-style option. The default color scheme is pygments, 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 pandoc --list-highlight-styles.

If you are not satisfied with the predefined styles, you can use --print-highlight-style to generate a JSON .theme file which can be modified and used as the argument to --highlight-style. To get a JSON version of the pygments style, for example:

To disable highlighting, use the --no-highlight option.

135

If you define a div or span with the attribute custom-style, pandoc will apply your spec-ified style to the contained elements (with the exception of elements whose function de-pends on a style, like headings, code blocks, block quotes, or links). So, for example, using the bracketed_spans syntax,

[Get out]{custom-style="Emphatically"}, he said.

| He did not know I saw---

:::

This feature allows for greatest customization in conjunction with . 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 Emphasis character style (perhaps to change their color), you can write a filter which will transform all italicized inlines to inlines within an Emphasis custom-style span.

For docx output, you don’t need to enable any extensions for custom styles to work.

Without the +styles extension:

$ pandoc test/docx/custom-style-reference.docx -f docx -t markdown

And with the extension:

$ pandoc test/docx/custom-style-reference.docx -f docx+styles -t markdown

This is text with an [emphasized]{custom-style="Emphatic"} text style.

And this is text with a [strengthened]{custom-style="Strengthened"}

::: {custom-style="My Block Style"}
> Here is a styled paragraph that inherits from Block Text.

:::

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:

pandoc -t data/sample.lua
pandoc -f my_custom_markup_language.lua -t latex -s

pandoc --print-default-data-file sample.lua

Note that custom writers have no default template. If you want to use --standalone with a custom writer, you will need to specify a template manually using --template or add a new default template with the name default.NAME_OF_CUSTOM_WRITER.lua to the templates subdirectory of your user data directory (see Templates).

143

A note on security

5. 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 ex-ploit these issues. If you are using the pandoc executable, you can add the command line options +RTS -M512M -RTS (for example) to limit the heap size to 512MB. Note that the commonmark parser (including commonmark_x and gfm) is much less vulnerable to pathological performance than the markdown parser, so it is a better choice when processing untrusted input.

6. The HTML generated by pandoc is not guaranteed to be safe. If raw_html is enabled for the Markdown input, users can inject arbitrary HTML. Even if raw_html is dis-abled, 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 sani-tizer.

Copyright © 2009-2023 UrgentHomework.com, All right reserved.