1 Introduction
1.1 About this document
This document, accompanied with the hopefully finely tuned git repos, provides a template for writing contributions to Computo (Computo Team 2020).
This document provides only the key formatting principles. For a detailed, step-by-step guide on preparing your article and submitting it to Computo, please consult the guidelines for authors.
1.2 Quarto
Quarto is a versatile formatting system for authoring documents integrating markdown, LaTeX and code blocks interpreted either via Jupyter or Knitr (thus supporting Python, R and Julia). It relies on the Pandoc document converter.
1.3 Requirements
You need quarto installed on your system and the Computo extension to prepare your document. For the latter, once quarto is installed, run the following to install the extension in the current directory (it creates a _extension
directory which is ignored by git thanks to .gitignore
by default):
quarto add computorg/computo-quarto-extension
2 Formatting
This section covers basic formatting guidelines for quarto documents.
To render a document, run quarto render
. By default, both PDF and HTML documents are generated:
quarto render # will render both to html and PDF
To check the syntax of the formatting below, you can use the </> source
button at the top left of this document.
2.1 Basic markdown formatting
Bold text or italic
- This is a list
- With more elements
- It isn’t numbered.
But we can also do a numbered list
- This is my first item
- This is my second item
- This is my third item
2.2 Mathematics
2.2.1 Mathematical formulae
LaTeX code is natively supported1, which makes it possible to use mathematical formulae:
f(x_1, \dots, x_n; \mu, \sigma^2) = \frac{1}{\sigma \sqrt{2\pi}} \exp{\left(- \frac{1}{2\sigma^2}\sum_{i=1}^n(x_i - \mu)^2\right)}
It is also posible to cross-reference an equation, see Equation 1:
\begin{aligned} D_{x_N} & = \frac12 \left[\begin{array}{cc} x_L^\top & x_N^\top \end{array}\right] \, \left[\begin{array}{cc} L_L & B \\ B^\top & L_N \end{array}\right] \, \left[\begin{array}{c} x_L \\ x_N \end{array}\right] \\ & = \frac12 (x_L^\top L_L x_L + 2 x_N^\top B^\top x_L + x_N^\top L_N x_N), \end{aligned} \tag{1}
2.2.2 Theorems and other amsthem-like environments
Quarto includes a nice support for theorems, with predefined prefix labels for theorems, lemmas, proposition, etc. see this page. Here is a simple example:
Theorem 1 (Strong law of large numbers) The sample average converges almost surely to the expected value:
\overline{X}_n\ \xrightarrow{\text{a.s.}}\ \mu \qquad\textrm{when}\ n \to \infty.
See Theorem 1.
2.3 Julia Code
Quarto uses either Jupyter or knitr to render code chunks. This can be triggered in the yaml header. In this tutorial, we use Jupyter
, (Julia
and Jupyter
must be installed on your computer)
---
title: "My Document"
author "Jane Doe"
jupyter: julia-1.10
---
julia
code chunks may be embedded as follows:
using Random
rng = MersenneTwister(1234)
x = randn(rng, ComplexF32, (10,1))
x
2.4 Figures
Plots can be generated as follows:
#| label: fig-parametric
#| fig-cap: "Parametric Plots"
using Plots
plot(sin,
x->sin(2x),
0,
2π,
leg=false,
fill=(0,:lavender))
It is also possible to create figures from static images:

Note: Until Quarto version 1.3+ is released, including a remote image (from a web URL) in a document (like the image above) will work in the rendered HTML document but will generate an error when building the PDF document (c.f. related bug report).
2.5 Tables
Tables (with label: @tbl-mylabel
renders Table 1) can be generated with markdown as follows
Tables | Are | Cool |
---|---|---|
col 1 is | left-aligned | $1600 |
col 2 is | centered | $12 |
col 3 is | right-aligned | $1 |
2.6 Handling references
2.6.1 Bibliographic references
References are displayed as footnotes using BibTeX, e.g. [@computo]
will be displayed as (Computo Team 2020), where computo
is the bibtex key for this specific entry. The bibliographic information is automatically retrieved from the .bib
file specified in the header of this document (here: references.bib
).
2.6.2 Other cross-references
As already (partially) seen, Quarto includes a mechanism similar to the bibliographic references for sections, equations, theorems, figures, lists, etc. Have a look at this page.
2.7 Advanced formatting
Advanced formatting features are possible and documented (including interactive plots, pseudo-code, (Tikz) diagrams, Lua filters, mixing R + Python in the same document), but are beyond the scope of this simple introduction. We point several entries in this direction.
The Quarto web site for comprehensive documentation, including:
The template distributed with the Computo Quarto extension, which uses such advanced features.
Our mock version of the t-SNE paper, a full and advanced example using Python and the Jupyter kernel.
The previously published papers in Computo can be used as references.