Pandoc Types Quick Reference
General Notes
Most common elements are listed here, but not all.
Quarto has some custom node types too: Callout, Tabset, ConditionalBlock, FloatRefTarget
The syntax
[, arg]indicates an optional argumentAll types have a
t/tagfield to access the type as a string (e.g.pandoc.Space().treturnsSpace)Any type with the
attrfield also has shortcuts for:identifier,classes, andattributesattris anAttrobject. Create one withpandoc.Attr():pandoc.Attr( "my-id", --identifier {"class-one", "class-two"}, --classes {key="value", key2="value2"} --attributes )
Document Structure
| Type | Constructor | Fields |
|---|---|---|
| Pandoc | pandoc.Pandoc(blocks, meta) |
blocks, meta |
| Meta | pandoc.Meta(table) |
key-value pairs of document metadata |
Block Elements
Paragraphs and Headings
content is an Inlines object (a list of Inline elements)
| Type | Constructor | Fields |
|---|---|---|
| Para | pandoc.Para(content) content: Inlines |
content |
| Plain | pandoc.Plain(content) content: Inlines |
content |
| Header | pandoc.Header (level, content[, attr])) content: Inlines level: integer |
level, content, attr |
Lists
content is a list of Blocks, or for DefinitionList something complicated.
| Type | Constructor | Fields |
|---|---|---|
| BulletList | pandoc.BulletList(items) items: {Blocks, ... } |
content |
| OrderedList | pandoc.OrderedList(items[, listAttributes]) items: {Blocks, ... } |
content, listAttributes, start, style, delimiter |
| DefinitionList | pandoc.DefinitionList(content) content: {Inlines, {Blocks, ...}, ...} |
content (list of definition pairs) |
Code and raw blocks
text is a simple Lua string (not a Str)
| Type | Constructor | Fields |
|---|---|---|
| CodeBlock | pandoc.CodeBlock(text[, attr]) text: string |
text, attr |
| RawBlock | pandoc.RawBlock(format, text) text: string |
format, text |
Divs, BlockQuotes, Figures
content is a Blocks object (a list of Block elements)
| Type | Constructor | Fields |
|---|---|---|
| Div | pandoc.Div(content[, attr]) content: Blocks |
content, attr |
| BlockQuote | pandoc.BlockQuote(content) content: Blocks |
content |
| Figure | pandoc.Figure(content[, caption[, attr]]) content: Blocks |
content, caption, attr |
Other
| Type | Constructor | Fields |
|---|---|---|
| Table | pandoc.Table(caption, colspecs, head, bodies, foot[, attr]) |
caption, colspecs, head, bodies, foot, attr |
| LineBlock | pandoc.LineBlock(content) content: {Inlines, ...} |
content |
Inline Elements
Whitespace
Takes no arguments, has no fields.
| Type | Constructor |
|---|---|
| Space | pandoc.Space() |
| SoftBreak | pandoc.SoftBreak() |
| LineBreak | pandoc.LineBreak() |
Basic Elements
text is a simple Lua string (not a Str)
| Type | Constructor | Fields |
|---|---|---|
| Str | pandoc.Str(text) |
text |
| Code | pandoc.Code(code[, attr]) |
text, attr |
| Math | pandoc.Math(mathtype, text) mathtype: 'InlineMath' or 'DisplayMath' |
mathtype, text |
| RawInline | pandoc.RawInline(format, text) format: 'html', 'latex' etc. |
format, text |
Text Formatting
content is an Inlines object (a list of Inline elements).
| Type | Constructor | Fields |
|---|---|---|
| Emph | pandoc.Emph(content) |
content |
| SmallCaps | pandoc.SmallCaps(content) |
content |
| Strikeout | pandoc.Strikeout(content) |
content |
| Strong | pandoc.Strong(content) |
content |
| Subscript | pandoc.Subscript(content) |
content |
| Superscript | pandoc.Superscript(content) |
content |
| Underline | pandoc.Underline(content) |
content |
| Quoted | pandoc.Quoted(quotetype, content) quotetype: 'SingleQuote' or 'DoubleQuote' |
quotetype, content |
Other
content and title are Inlines unless otherwise noted.
src, target are simple Lua strings.
attr is an Attr object.
| Type | Constructor | Fields |
|---|---|---|
| Span | pandoc.Span(content[, attr]) |
content, attr |
| Image | pandoc.Image(caption, src[, title[, attr]]) |
caption, src, title, attr |
| Link | pandoc.Link(content, target[, title[, attr]]) |
content, target, title, attr |
| Cite | pandoc.Cite(content, citations) |
content, citations |
| Note | pandoc.Note(content) content: Blocks |
content |