Skip to content

Markdown and Citations

Sebastian Skov Nielsen edited this page Aug 1, 2026 · 1 revision

Markdown and Citations

Leafmark reads Pandoc Markdown. Standard Markdown works as expected, while Pandoc adds citations, attributes, footnotes, definition lists, tables, raw LaTeX, and other publishing features.

Headings

# Chapter title

## Section

### Subsection

When number-sections: true, Pandoc numbers headings. toc: true adds them to the table of contents up to toc-depth.

Emphasis, links, and lists

Use *emphasis*, **strong text**, and [links](https://example.com).

- Unordered item
- Another item

1. First step
2. Second step

Images

![System architecture](images/architecture.png)

Paths are resolved through the active project and resource roots. Pandoc image attributes may be used:

![A narrower image](images/chart.png){width=70%}

Tables

| Item | Result |
| --- | ---: |
| Alpha | 18 |
| Beta | 24 |

Theme behavior can differ for wide or multipage tables. The multicolumn theme includes a PDF-specific table filter.

Code

```ts
const title = "Leafmark";
```

Leafmark asks Pandoc for Kate syntax highlighting when supported by the installed Pandoc version.

Footnotes

This statement needs a note.[^detail]

[^detail]: Additional context belongs here.

Citations

Create sources.bib:

@book{doe2024,
  author    = {Doe, Jane},
  title     = {Writing Reproducible Reports},
  year      = {2024},
  publisher = {Example Press}
}

Reference the key in Markdown:

Reproducible publishing improves review workflows [@doe2024].

Doe describes the workflow in detail [-@doe2024, pp. 40-42].

Enable or select the bibliography in metadata:

bibliography:
  - sources.bib
references-title: References

When sources.bib exists and no explicit setting disables it, Leafmark uses it by default. Multiple bibliography files are accepted. Set bibliography: false or bibliography: [] to disable citation processing.

Leafmark runs Pandoc citeproc with its bundled APA CSL and inserts the generated references at the end. A PDF page break is added before references by the bundled filter.

Raw LaTeX

Pandoc raw TeX is enabled for PDF-oriented content:

\newpage

Raw LaTeX is format-specific and will not produce equivalent HTML or DOCX content. Prefer Markdown or HTML and CSS when output portability matters.

Inline HTML

Simple inline tags remain HTML in HTML output. For PDF, Leafmark has limited mapping for tags such as <big> and <small>; unknown paired inline tags retain their content but not their browser styling. Use a block when exact CSS rendering is required.

Chapter boundaries

Leafmark concatenates chapter contents with blank lines. It does not automatically add a page break between every chapter. Themes, raw LaTeX, or filters can provide custom chapter-boundary behavior.

Clone this wiki locally