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

Creating Jupyter notebooks with pandoc

When creating a Jupyter notebook, pandoc will try to infer the notebook structure. Code blocks with the class code 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 jupyter metadata field. For example:

---
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: ".py"
     mimetype: "text/x-python"
     name: "python"
     nbconvert_exporter: "python"
     pygments_lexer: "ipython2"
     version: "2.7.15"
---

# Lorem ipsum

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

``` code
print("hello")
```

## Pyout

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

## Image

This image ![image](myimage.png) will be
included as a cell attachment.

If you want to add cell attributes, group cells differently, or add output to code cells, then you need to include divs to indicate the structure. You can use either fenced divs or native divs for this. Here is an example:

:::::: {.cell .markdown}
# Lorem

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

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

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

:::::: {.cell .code execution_count=2}
``` {.python}
from IPython.display import HTML
HTML("""
<script>
console.log("hello");
</script>
<b>HTML</b>
""")
```

::: {.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.

Note that options and extensions that affect reading and writing of Markdown will also affect Markdown cells in ipynb notebooks. For example, --wrap=preserve will preserve soft line breaks in Markdown cells; --atx-headers will cause ATX-style headings to be used; and --preserve-tabs will prevent tabs from being turned to spaces.

volver

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