Quarto

— Creating documents —

Why html documents?

  • Easy to share and host online (for instance through GitHub)
  • Better accessibility than PDF
  • Fast with little extra hassle
  • Basic interactivity possible

css and filters

  • Style documents with css (cascading style sheets)

  • Particularly useful with divs and spans for special styling (see Quarto documentation for more information)

  • See the Pandoc documentation on Divs and Spans for additional details.

Yaml

  • Most html options can be controlled via yaml

  • Most options come under the html format tag

  • be careful of indentation, it matters!

---
title: "My document"
author: "My name"
date: 2022-10-26
format:
  html:
    toc: true
    toc-depth: 2
    toc-title: Contents
    html-math-method: katex
    css: styles.css
    anchor-sections: true
    smooth-scroll: true
    code-fold: true
    code-summary: "Show the code"
    code-overflow: wrap
    css: styles.css
---

Go to RStudio

Exercise

  • Change the title of the Table of Contents.

  • Change the location of the Table of Contents.

  • Turn on Anchored sections, what did that do?

  • Turn on smooth-scroll, what did that do?

10:00

Go to RStudio

Exercise

  • Add a section with a tip about your favorite drink

  • Add a horizontal rule

  • Add a comment. What does that look like?

10:00

Break

05:00

Cross-references

Cross-references

Type Label Prefix
Figures fig-
Tables tbl-
Equations eq-
Sections sec-
Code listing lst-
Theorem thm-

Go to RStudio

Exercise

  • Take a screenshot of something on your screen, and add the image to your document.

  • Give the image a caption, and reference it in a piece of text.

10:00

Citation

Adding citations

  • Can be added via insert -> citation

    • Brings up the UI
    • The UI can help you find refs, in addition to adding them to the doc.
  • Can also be added directly with @

  • References are stored in bibtex files in your project

Citation control

Markdown Format Output (author-date format)
Blip blop bloop [see @biswal2010, pp. 33-35;
also @ggseg, chap. 1]
Blip blop bloop [see Biswal et al. (2010), pp. 33-35; also , chap. 1]
Blip blop bloop [@biswal2010, pp. 33-35,
38-39 and passim]
Blip blop bloop (Biswal et al. 2010, 33–35, 38–39 and passim)
Blip blop bloop [@ggseg; @biswal2010].
Blip blop bloop (Mowinckel and Vidal-Piñeiro 2019; Biswal et al. 2010).
Mowinckel says blah [-@ggseg]
Mowinckel says blah (2019)
@biswal2010 says bloop.
Biswal et al. (2010) says bloop.

yaml settings

---
bibliography: references.bib
csl: nature.csl
---

Currently, only Zotero is supported as a connected reference manager.

Redirect reference generation


::: {#refs}
:::


References

Biswal, Bharat B., Maarten Mennes, Xi-Nian Nian Zuo, Suril Gohel, Clare Kelly, Stephen M. Smith, Christian F. Beckmann, et al. 2010. “Toward Discovery Science of Human Brain Function.” Proceedings of the National Academy of Sciences of the United States of America 107 (10): 4734–39. https://doi.org/0911855107 [pii];10.1073/pnas.0911855107 [doi].
Mowinckel, Athanasia M., and Didac Vidal-Piñeiro. 2019. “Visualisation of Brain Statistics with r-Packages Ggseg and Ggseg3d.”

Go to RStudio

Exercise

  • Add a citation to an important paper in your field searching for its DOI
  • Cite it in text using three different ways of controlling citation appearance (1. standard, 2. name & year in parentheses, 3. year only)
  • Redirect the reference generation to a specific spot in your document
10:00

PDF

Very controlled by yaml

---
title: "My document"
format:
  pdf:
    toc: true
    toc-depth: 2
    toc-title: Contents
    number-sections: true
    colorlinks: true
    keep-tex: true
---

Go to RStudio

Exercise

  • Add some headers, what does that do?
  • Add section numbering, what does that do?
  • Download the csl-file from a journal you like, and try changing the citation style.
10:00

Break

05:00

Getting more help