6 Adding multimedia
6.1 Image
The basic markdown syntax for adding an image is as follows:
![Image title](link/to/the/image.png)
The image can be located locally (in that case the link is the full path to the image file), or online (in that case the link is a URL to that picture).
For image positioning, styling, and more options, please check out Quarto’s documentation about figures.
6.2 Video
In Quarto, the basic syntax for embedding a video is as follows:
{{< video link/to/video >}}
The video can be located locally (in that case the link is the full path to the video file), or online (in that case the link is a URL to the video).
For video options such as height, width, start time, etc. please check out Quarto’s documentation about videos.
6.3 Diagram
It’s possible to create diagrams with markdown through the use of mermaid
and other packages that are in-built in Quarto. See the Quarto documentation and the mermaid website for how to make this work.
Here is a simple diagram
that was created as follows:
```{mermaid}
flowchart LR
A(Point A) --> B[Point B]
```
6.4 Audio
To be figured out. Audio players do not seem to be supported, this guy found some sort of workaround: https://forum.posit.co/t/embed-sound-player-in-quarto-book/164739/7
6.5 Maths equation
For equations, please refer to the Quarto markdown documentation.
inline math: $E = mc^{2}$
inline math: \(E = mc^{2}\)
6.6 Graph/plot
In Quarto you can also generate graphs using a programming language. Quarto can work with R, Python, Julia, Bash, and more. A plot created with code will actually be inserted as an image in Quarto, but you can provide some image metadata (like the caption and the layout) in the code chunk itself.
You can see examples and explanation in the Quarto Figures documentation.