Authoring dynamic scientific documents with Quarto
Marie-Hélène Burle
April 11, 2023
Example: Tex—often with macro package LaTeX—to create pdfs
Example: HTML—often with css/scss files—to create webpages
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>My title</title>
<address class="author">My name</address>
<input type="date" value="2022-11-24" />
</head>
<h1>First section</h1>
<body>
Some text in the first section.
</body>
</html>
Pandoc (free and open-source markup formats converter) supports an extended Markdown syntax with functionality for figures, tables, callout blocks, LaTeX equations, citations…
Remains as readable as basic Markdown, but can be rendered in any format (pdf, books, entire websites, Word documents…)
Previous example using Pandoc’s Markdown:
Literate programming is a methodology that combines snippets of code and written text.
First introduced in 1984, this approach to the creation of documents has truly exploded in popularity in recent years thanks to the development of new tools such as R Markdown and, later, Jupyter notebooks
Code blocks are executed by Jupyter (Python or Julia) or knitr (R), then pandoc renders the document into any format
Code blocks are executed by Jupyter (Python or Julia) or knitr (R), then pandoc renders the document into any format
Can be used from .qmd
text files or directly from RStudio or Jupyter notebooks.
Syntax highlighting in pretty much any language
Executable code blocks in Python, R, Julia, Observable JS
Output formats
- HTML
- PDF
- MS Word
- OpenOffice
- ePub
- Revealjs
- PowerPoint
- Beamer
- GitHub Markdown
- CommonMark
- Hugo
- Docusaurus
- Markua
- MediaWiki
- DokuWiki
- ZimWiki
- Jira Wiki
- XWiki
- JATS
- Jupyter
- ConTeXt
- RTF
- reST
- AsciiDoc
- Org-Mode
- Muse
- GNU
- Groff
Written in YAML
Sets the options for the document. Let’s see a few examples.
Written in YAML
Sets the options for the document. Let’s see a few examples.
Or more sophisticated:
Written in Pandoc’s extended Markdown
Syntax highlighting only:
{.language} code
Two commands:
Website
Repo
Documentation index
You can find information in the Quarto documentation or in our previous workshop on Quarto
You can find several examples in our previous workshop on Quarto