logo izquierdo de la pagina

PANDOC MANUAL

logo de la pagina

[<][<=][=>]Pandoc User's Guide

Synopsis
Description
    Using pandoc
    Specifying formats
    Character encoding
    Creating a PDF
    Reading from the Web
Options
    General options
    Reader options
    General writer options
    Options affecting specific writers
    Citation rendering
    Math rendering in HTML
    Options for wrapper scripts
Templates
    Metadata variables
    Language variables
    Variables for HTML slides
    Variables for Beamer slides
    Variables for LaTeX
        Layout
        Fonts
        Links
        Front matter
        BibLaTeX Bibliographies
    Variables for ConTeXt
    Variables for wkhtmltopdf
    Variables for man pages
    Variables for ms
    Structural variables
    Using variables in templates
Extensions
    Typography
            Extension: smart
    Headings and sections
            Extension: auto_identifiers
            Extension: ascii_identifiers
            Extension: gfm_auto_identifiers
    Math Input
    Raw HTML/TeX
            Extension: raw_html
            Extension: raw_tex
            Extension: native_divs
            Extension: native_spans
    Literate Haskell support
            Extension: literate_haskell
    Other extensions
            Extension: empty_paragraphs
            Extension: styles
            Extension: amuse
            Extension: citations
            Extension: ntb
Pandoc’s Markdown
    Philosophy
    Paragraphs
            Extension: escaped_line_breaks
    Headings
        Setext-style headings
        ATX-style headings
            Extension: blank_before_header
            Extension: space_in_atx_header
        Heading identifiers
            Extension: header_attributes
            Extension: implicit_header_references
    Block quotations
            Extension: blank_before_blockquote
    Verbatim (code) blocks
        Indented code blocks
        Fenced code blocks
            Extension: fenced_code_blocks
            Extension: backtick_code_blocks
            Extension: fenced_code_attributes
    Line blocks
            Extension: line_blocks
    Lists
        Bullet lists
        Block content in list items
        Ordered lists
            Extension: fancy_lists
            Extension: startnum
            Extension: task_lists
        Definition lists
            Extension: definition_lists
        Numbered example lists
            Extension: example_lists
        Compact and loose lists
        Ending a list
    Horizontal rules
    Tables
            Extension: table_captions
            Extension: simple_tables
            Extension: multiline_tables
            Extension: grid_tables
                Grid Table Limitations
            Extension: pipe_tables
    Metadata blocks
            Extension: pandoc_title_block
            Extension: yaml_metadata_block
    Backslash escapes
            Extension: all_symbols_escapable
    Inline formatting
        Emphasis
            Extension: intraword_underscores
        Strikeout
            Extension: strikeout
        Superscripts and subscripts
            Extension: superscript, subscript
        Verbatim
            Extension: inline_code_attributes
        Small caps
    Math
            Extension: tex_math_dollars
    Raw HTML
            Extension: raw_html
            Extension: markdown_in_html_blocks
            Extension: native_divs
            Extension: native_spans
            Extension: raw_tex
        Generic raw attribute
            Extension: raw_attribute
    LaTeX macros
            Extension: latex_macros
    Links
        Automatic links
        Inline links
        Reference links
            Extension: shortcut_reference_links
        Internal links
    Images
            Extension: implicit_figures
            Extension: link_attributes
    Divs and Spans
            Extension: fenced_divs
            Extension: bracketed_spans
    Footnotes
            Extension: footnotes
            Extension: inline_notes
    Citations
            Extension: citations
    Non-pandoc extensions
            Extension: old_dashes
            Extension: angle_brackets_escapable
            Extension: lists_without_preceding_blankline
            Extension: four_space_rule
            Extension: spaced_reference_links
            Extension: hard_line_breaks
            Extension: ignore_line_breaks
            Extension: east_asian_line_breaks
            Extension: emoji
            Extension: tex_math_single_backslash
            Extension: tex_math_double_backslash
            Extension: markdown_attribute
            Extension: mmd_title_block
            Extension: abbreviations
            Extension: autolink_bare_uris
            Extension: mmd_link_attributes
            Extension: mmd_header_identifiers
            Extension: compact_definition_lists
    Markdown variants
Producing slide shows with pandoc
    Structuring the slide show
    Incremental lists
    Inserting pauses
    Styling the slides
    Speaker notes
    Columns
    Frame attributes in beamer
    Background in reveal.js and beamer
Creating EPUBs with pandoc
    EPUB Metadata
    The epub:type attribute
    Linked media
Creating Jupyter notebooks with pandoc
Syntax highlighting
Custom Styles
    Output
    Input
Custom writers
A note on security
Authors

[<][<=][=>][*]


W adorno

Reader options

--base-header-level=NUMBER

Specify the base level for headings (defaults to 1).

--strip-empty-paragraphs

Deprecated. Use the +empty_paragraphs extension instead. Ignore paragraphs with no content. This option is useful for converting word processing documents where users have used empty paragraphs to create inter-paragraph space.

--indented-code-classes=CLASSES

Specify classes to use for indented code blocksâ€'for example, perl,numberLines or haskell. Multiple classes may be separated by spaces or commas.

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

-F PROGRAM, --filter=PROGRAM

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,

pandoc --filter ./caps.py -t latex

is equivalent to

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

The latter form may be useful for debugging filters.

Filters may be written in any language. Text.Pandoc.JSON exports toJSONFilter to facilitate writing filters in Haskell. Those who would prefer to write filters in python can use the module pandocfilters, installable from PyPI. There are also pandoc filter libraries in PHP, perl, and JavaScript/node.js.

In order of preference, pandoc will look for filters in

  1. a specified full or relative path (executable or non-executable)

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

  3. $PATH (executable only)

Filters and lua-filters are applied in the order specified on the command line.

--lua-filter=SCRIPT

Transform the document in a similar fashion as JSON filters (see --filter), but use pandoc’s build-in lua filtering system. The given lua script is expected to return a list of lua filters which will be applied in order. Each lua filter must contain element-transforming functions indexed by the name of the AST element on which the filter function should be applied.

The pandoc lua module provides helper functions for element creation. It is always loaded into the script’s lua environment.

The following is an example lua script for macro-expansion:

function expand_hello_world(inline)
  if inline.c == '{{helloworld}}' then
    return pandoc.Emph{ pandoc.Str "Hello, World" }
  else
    return inline
  end
end

return {{Str = expand_hello_world}}

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

  1. a specified full or relative path (executable or non-executable)

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

-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 using YAML metadata blocks. Values will be parsed as YAML boolean or string values. If no value is specified, the value will be treated as Boolean true. Like --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 option can be used with every input format, but string scalars in the YAML file will always be parsed as Markdown. Generally, the input will be handled the same as in YAML metadata blocks. Metadata values specified inside the document, or by using -M, overwrite values specified with this option.

-p, --preserve-tabs

Preserve tabs instead of converting them to spaces (the default). Note that this will only affect tabs in literal code spans and code blocks; tabs in regular text will be treated as spaces.

--tab-stop=NUMBER

Specify the number of spaces per tab (default is 4).

--track-changes=accept|reject|all

Specifies what to do with insertions, deletions, and comments produced by the MS Word “Track Changes” feature. accept (the default), inserts all insertions, and ignores all deletions. reject inserts all deletions and ignores insertions. Both accept and reject ignore comments. all puts in insertions, deletions, and comments, wrapped in spans with insertion, deletion, comment-start, and comment-end classes, respectively. The author and time of change is included. all is useful for scripting: only accepting changes from a certain reviewer, say, or before a certain date. If a paragraph is inserted or deleted, track-changes=all produces a span with the class paragraph-insertion/paragraph-deletion before the affected paragraph break. This option only affects the docx reader.

--extract-media=DIR

Extract images and other media contained in or linked from the source document to the path DIR, creating it if necessary, and adjust the images references in the document so they point to the extracted files. If the source format is a binary container (docx, epub, or odt), the media is extracted from the container and the original filenames are used. Otherwise the media is read from the file system or downloaded, and new filenames are constructed based on SHA1 hashes of the contents.

--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 the user data directory or fall back on a system default. To see the system default, use pandoc --print-default-data-file=abbreviations. The only use pandoc makes of this list is in the Markdown reader. Strings ending in a period that are found in this list will be followed by a nonbreaking space, so that the period will not produce sentence-ending space in formats like LaTeX.

volver

© Servei d'Informática, Universitat de Valencia. email SIUV Mod: 12 diciembre 2019 02:38  documentacion wiki traza de la pagina Editar