a modern ecosystem for typesetting and publishing
Office
Pros:
Cons:
LaTeX
Pros:
Cons:
Latex
\textbf{Bold text} \textit{Italic text} \verb?Verbatim?
\begin{itemize}
\item Item 1
\item Item 2
\end{itemize}
\begin{enumerate}
\item Item 1
\item Item 2
\end{enumerate}
\section{First header}
\subsection{Second header}
\subsubsection{Third header}
\href{https://julien-vitay.net}{My website}
\url{https://julien-vitay.net}
Latex
See https://www.tablesgenerator.com/markdown_tables for easier design of tables.
Latex
\begin{lstlisting}
import numpy as np
import ANNarchy as ann
P = ann.Population(geometry=1000, neuron=ann.Izhikevich)
E = P[:800] ; I = P[800:]
EI = ann.Projection(pre=E, post=P, target='exc')
EI.connect_all_to_all(weights=ann.Uniform(0.0, 0.5))
IE = ann.Projection(pre=I, post=P, target='inh')
IE.connect_all_to_all(weights=ann.Uniform(0.0, 1.0))
ann.compile()
ann.simulate(1000.0, measure_time=True)
\end{lstlisting}
Markdown
```python
import numpy as np
import ANNarchy as ann
P = ann.Population(geometry=1000, neuron=ann.Izhikevich)
E = P[:800] ; I = P[800:]
EI = ann.Projection(pre=E, post=P, target='exc')
EI.connect_all_to_all(weights=ann.Uniform(0.0, 0.5))
IE = ann.Projection(pre=I, post=P, target='inh')
IE.connect_all_to_all(weights=ann.Uniform(0.0, 1.0))
ann.compile()
ann.simulate(1000.0, measure_time=True)
```
Code blocks with syntax highlighting are available for many languages: python, cpp, latex, java, html, etc.
$$
environment:The firing rate $r_j (t)$ of the $j$-th neuron in the population follows the following equation:
$$
\tau \, \dfrac{d r_j(t)}{dt} + r_j(t) = \sum_{i=1}^N w_{i, j} \, r_i (t)^+ + B_j
$$
The firing rate r_j (t) of the j-th neuron in the population follows the following equation:
\tau \, \dfrac{d r_j(t)}{dt} + r_j(t) = \sum_{i=1}^N w_{i, j} \, r_i (t)^+ + B_j \tag{1}
Many tools are available to produce documents (html, pdf) from Markdown files, sometimes using modifications of the syntax (e.g. Github-flavoured Markdown).
Pandoc is an amazing converter from Markdown to many other formats (html, latex, docx, odt, wiki) and back, with its own extension of the Markdown syntax and templates.
As \label{}
and \ref{}
in LaTeX, Pandoc’s markdown allows the use of cross-references in documents.
The label must be preceded by the type of the object, e.g. sec-
, fig-
, eq-
, tbl-
.
#
is for the label, @
for the call, including the prefix (Figure, Equation).
# Introduction {#sec-introduction}
![The logo of the lab.](img/ai.webp){#fig-logolab width=50%}
$$
\tau \, \dfrac{d r_j(t)}{dt} + r_j(t) = \sum_{i=1}^N w_{i, j} \, r_i (t)^+ + B_j
$$ {#eq-neuron}
@sec-introduction, @fig-logolab, @eq-neuron
renders the refs as:
Section 1, Figure 1, Equation 1
Pandoc can use bibtex files to generate the bibliography automatically.
The path to the bib file and the CSL style can be declared as a variable in the CLI or in the YAML preamble of the file:
---
title: Markdown, Pandoc and Quarto
subtitle: a modern ecosystem for typesetting and publishing
author: Julien Vitay
bibliography: references.bib
csl: frontiers.csl
---
@Vitay2015 introduced ANNarchy [@Scholl2022]
Vitay et al. (2015) introduced ANNarchy (Scholl et al., 2022)
Any citation style can be used when available at https://citationstyles.org.
The references are automatically added at the end of the document.
Divs allow to apply a CSS class or a LaTeX environment on some content.
Three colons (:::
) start and stop the div, using curly braces or directly the tag if there is only one.
Examples with callouts:
Note
Content
Warning
Content
pandoc
can convert any .md
file into any format, but writing the right template can be quite cumbersome.
Quarto is a publishing platform based on pandoc that allows to quickly get beautiful websites / books / articles / presentations (reveal.js) …
Jupyter notebooks can even be used to generate (live) html pages and pdfs. The quarto file format is .qmd
.
```{python}
#| label: fig-polar
#| fig-cap: "A line plot on a polar axis"
import numpy as np
import matplotlib.pyplot as plt
r = np.arange(0, 2, 0.01)
theta = 2 * np.pi * r
fig, ax = plt.subplots(
subplot_kw = {'projection': 'polar'}
)
ax.plot(theta, r)
ax.set_rticks([0.5, 1, 1.5, 2])
ax.grid(True)
plt.show()
```
.qmd
file, or at the project-level in the _quarto.yml
file:project:
type: website
output-dir: ../docs
website:
title: "Website"
navbar:
background: black
pinned: true
right:
- text: "Slides"
file: slides/presentation.html
- icon: github
href: https://github.com/vitay/quarto-website
aria-label: GitHub
sidebar:
style: "docked"
logo: img/tuc.png
search: true
contents:
- text: "About"
file: index.qmd
- section: "Tutorial"
contents:
- Test.qmd
page-footer:
center: |
Copyright Julien Vitay <julien.vitay@informatik.tu-chemnitz.de> - Chemnitz University of Technology
format:
html:
theme: [sandstone, ../assets/webpage.scss]
page-layout: full
smooth-scroll: true
html-math-method: katex
bibliography: references.bib
csl: ../assets/frontiers.csl
highlight-style: github
code-line-numbers: false
Reveal.js
(https://revealjs.com/) is a javascript library allowing to create a slide deck in html+css+js.
pandoc/quarto
is able to generate reveal.js slides from Markdown files.
Template at https://github.com/vitay/quarto-presentation
Websites are only in html and can comprise multiple pages, with a sidebar and topbar for navigation.
Template at https://github.com/vitay/quarto-website
Example at https://github.com/ANNarchy/ANNarchy.github.io and https://annarchy.github.io/
Books are websites with a focus on generating a nice pdf, such as a textbook or a thesis.
Template at https://github.com/vitay/quarto-thesis
Demo at https://julien-vitay.net/quarto-thesis and https://julien-vitay.net/habilitation
Articles / reports are single documents that can be exported to html and pdf (through LaTeX).
With the right LaTeX pandoc template, you can submit to any journal and have a html version of it.
Template at https://github.com/vitay/quarto-report
quarto
is html-centric, it generates html files in the docs/
directory (or anywhere).
The html pages can be hosted on github for free.
To visualize a preview:
Tutorial on Markdown, Pandoc and Quarto