加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
example.qmd 1.36 KB
一键复制 编辑 原始数据 按行查看 历史
---
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"}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化