logotip esquerre

PANDOC MANUAL

logotip de la pàgina

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

Synopsis
Description
    Using pandoc
    Creating a PDF
    hsmarkdown
Options
    General options
    Reader options
    General writer options
    Options affecting specific writers
    Citations
    Math rendering in HTML
    Options for wrapper scripts
Templates
Pandoc’s markdown
    Philosophy
    Paragraphs
    Headers
        Setext-style headers
        Atx-style headers
        Header identifiers in HTML, LaTeX, and ConTeXt
    Block quotations
    Verbatim (code) blocks
        Indented code blocks
        Delimited code blocks
    Lists
        Bullet lists
        The four-space rule
        Ordered lists
        Definition lists
        Numbered example lists
        Compact and loose lists
        Ending a list
    Horizontal rules
    Tables
    Title block
    Backslash escapes
    Smart punctuation
    Inline formatting
        Emphasis
        Strikeout
        Superscripts and subscripts
        Verbatim
    Math
    Raw HTML
    Raw TeX
        Macros
    Links
        Automatic links
        Inline links
        Reference links
        Internal links
    Images
        Pictures with captions
    Footnotes
    Citations
Producing slide shows with Pandoc
    Structuring the slide show
    Incremental lists
    Styling the slides
Literate Haskell support
Authors

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


W adorn

Tables

Pandoc extension.

Three kinds of tables may be used. All three kinds presuppose the use of a fixed-width font, such as Courier.

Simple tables look like this:

  Right     Left     Center     Default
-------     ------ ----------   -------
     12     12        12            12
    123     123       123          123
      1     1          1             1

Table:  Demonstration of simple table syntax.

The headers 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.
  • 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.
  • If the dashed line extends beyond the header text on both sides, the column is centered.
  • 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).

The table must end with a blank line, or a line of dashes followed by a blank line. A caption may optionally be provided (as illustrated in the example above). A caption is a paragraph beginning with the string Table: (or just :), which will be stripped off. It may appear either before or after the table.

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

-------     ------ ----------   -------
     12     12        12             12
    123     123       123           123
      1     1          1              1
-------     ------ ----------   -------

When headers are 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.

Multiline tables allow headers 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:

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

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

  • They must begin with a row of dashes, before the header text (unless the headers are omitted).
  • They must end with a row of dashes, then a blank line.
  • The rows must be separated by blank lines.

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.

Headers may be omitted in multiline tables as well as simple tables:

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

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.

Grid tables look like this:

: Sample grid table.

+---------------+---------------+--------------------+
| Fruit         | Price         | Advantages         |
+===============+===============+====================+
| Bananas       | $1.34         | - built-in wrapper |
|               |               | - bright color     |
+---------------+---------------+--------------------+
| Oranges       | $2.10         | - cures scurvy     |
|               |               | - tasty            |
+---------------+---------------+--------------------+

The row of =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.). Alignments are not supported, nor are cells that span multiple columns or rows. Grid tables can be created easily using Emacs table mode.

tornar

© Servei d'Informática, Universitat de Valencia. email SIUV Mod: 23 febrero 2021 20:25  documentació wiki traça de la pàgina Modificar