-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathexample.qmd
45 lines (34 loc) · 1.36 KB
/
example.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
title: LaTeX Environment
format:
pdf:
include-in-header:
text: |
\usepackage{mhchem}
keep-tex: true
html: default
filters:
- latex-environment
environments: [center, enumerate]
commands: [ce, item, colorbox, fcolorbox]
---
## LaTeX Environments
::: {.center}
The contents of this div will be output in a `center`
LaTeX environment, but will appear in HTML (and any other output
format as a simple div with the class `center`)
:::
## LaTeX Commands
Will replace spans of class `ce` with the `\ce{}` command for LaTeX output, but leave the spans intact for HTML output. So `[H2SO4]{.ce}` becomes [H2SO4]{.ce}.
## Advanced Environments and Commands
You can also combine environments and commands (with options) to address more complex scenarios. Usually with LaTeX:
* `[opts]` is used for optional arguments
* `{args}` for mandatory arguments
Both environments and commands can accept an `options` and `arguments` attributes which will be properly applied in LaTeX and will be available as an attribute in HTML output.
:::{.enumerate}
[]{.item options="--"} Question 1
[]{.item options="--"} Question 2
:::
[This text is in a orange background]{.colorbox arguments="BurntOrange"}
If you have multiple arguments or options to pass to a command, use comma separated string
[This one will have a black border]{.fcolorbox arguments="black,red"}