Write
- Text formatting
- Figures
- Citations
- Equations
- Tables
- Verbatim code
- Live results
- Multiple files documents
- Comments
- And more
Check our demo to have a practical example of the formatting possibilities of Pandemics.
Text formatting
You can format text (eg. titles, italics, lists, etc.) using the Markdown syntax. You can find a lot of resources on the web to learn Markdown, like this tutorial. Don’t worry, it will only take you a couple of minutes.
Example
manuscript.md
# A section title
Lorem ipsum.
## A subsection title
- An item in *italic*
- A **bold** item
manuscript.pdf
A section title
Lorem ipsum.
A subsection title
- An item in italic
- A bold item
Figures
You can integrate images in your document using the classic Markdown syntax:

The path should be given relative to your document.
You can also associate the image with a label. You can then refer to this label, and Pandemics will replace all the references with the correct numbering.
{#fig:my-label}
See figure @fig:my-label.
Some output formats also accept the specification of image attributes, eg.:
{width=60%}
Citations
You can insert references in your markdown document using the markdown citation syntax. By default, Pandemics will look for a bibliography.bib
bib file in the source folder to parse the references. You can however override this default by specifying the relative path to you .bib files in the front-matter:
---
bibliography: myReferences.bib
---
You can also provide multiple .bib files if needed:
---
bibliography:
- myReferences.bib
- ../shared/references.bib
---
Example
manuscript.md
As demonstrated by @doe2018, ...
# References
bibliography.bib
@article{doe2018,
author={Doe, John},
year={2018},
title={A fantastic paper}
}
manuscript.pdf
As demonstrated by Doe (2018), …
References
Doe, John. 2018. “A Fantastic Paper.”
Equations
You can write equations using the LaTeX syntax. You would just need to enclose your mathematical expression either between $
… $
(inline mode) or $$
… $$
(bloc mode).
As for images, you associate a label to your equation so you can them refer to it and generate an automatic equation numbering:
Example
manuscript.md
$$ \beta = a^2 $${#eq:my-equation}
See equation @eq:my-equation.
manuscript.pdf
See equation 1.
Tables
The best way to include a table is to import it from an external file in .csv format. Of course, you can also enter your table manually using the markdown syntax. Either way, you can add after your table a caption and a label for cross referencing.
Example
manuscript.md
<!-- #csv my-table.csv -->
: A dynamically loaded table {#tbl:dynamic}
See table @tbl:dynamic.
my-table.csv
, Header 1, Header 2
Variable 1, Value A, Value B
Variable 2, Value C, Value D
manuscript.pdf
Header 1 Header 2 Variable 1 Value A Value B Variable 2 Value C Value D Table 1. A dynamically loaded table
See table 1.
Verbatim code
Like for tables, you can either load your code directly from its source file or type it directly in your manuscript between single (' … ', inline) or triple (''' … ''', bloc) fences. With the right recipe, you can have some nice syntax highlighting adapted to the language (automatically detected for dynamically loaded code).
Example
manuscript.md
```js
console.log('Hello World!')
```
<!-- #code some-code.py -->
some-code.py
print("I am Py.")
manuscript.pdf
console.log('Hello World!')
print("I am Py.")
Live results
You can integrate values or elements that have been generated by an external software using Mustache templating templating in your document. This way, you can be sure that you compiled document will always be up-to-date.
To do so, you simply need to specify one or multiple .json or .yaml files which contain the data to be parsed, and Pandemics will automatically take care of it.
By default, Pandemics will also look for a results.json
file in the same directory as the compiled document and try to mustache it. You can however override this default in the front-matter of your document:
---
mustache: myResults.json
---
or
---
mustache:
- myResultsA.yaml
- myResultsB.json
---
Example
manuscript.md
There was an effect ($\beta$ = {{ exp1.beta }}, p = {{ exp1.pvalue }}).
results.json
{
"exp1": {
"beta": 2.80,
"pvalue": 0.036
}
}
manuscript.pdf
There was an effect of treatment (β = 2.80, p = 0.036).
Multiple files documents
If your working on a large project, you might want to split your manuscript in multiple files (eg. chapters). As for tables and code, you can include those file in your main document in a single line, Pandemics will take care of merging everithing
Example
manuscript.md
<!-- #include chapters/*.md -->
chapters/chapter-1.md
# A title
A paragraph.
chapters/chapter-2.md
# Another title
Another paragraph.
manuscript.pdf
A title
A paragraph.
Another title
Another paragraph.
Comments
You can prevent any part of your manuscript from being displayed in the compiled document by wrapping it in in the special <!--
… -->
markup. This allows you eg. to write comments that the authors can read but will not appear in the published version.
Example
manuscript.md
A short sentence, <!-- We need to be more specific here --> and another one.
manuscript.pdf
A short sentence, and another one.
And more
Pandemics can also interpret other formatting tricks, like footnotes (^[This is a footnote]
), links ([inline link](url)
), format specific markup (eg. HTML spans and divs with associated class), etc. Checkout the pandocs markdown documentation for an exhaustive list of all the features supported by Pandemics.