/
在编写 TeX 公式 时,你可能会想要使用自定义宏。
.texmacro {name} {content} 文档 ↗ 函数定义了一个可用于方程中的新宏。
.texmacro {\gradient} {\nabla}
$ \gradient f $与每一个 Quarkdown 函数一样,你可以使用最后一个参数作为主体参数。
.texmacro {\gradient}
\nabla宏可以拥有数量可变的参数,这些参数在宏内容内部以 #1、#2 等形式被引用。
.texmacro {\sumlim}
\sum_{#1}^{#2}
$ \sumlim{i=1}{n} a_i $你可以定义多个宏并将它们组合,就像在 LaTeX 中那样:
.texmacro {\hello}
\text {Hello, \textit {world}}
.texmacro {\highlight}
\colorbox{blue}{#1}
$ \highlight{\hello} $你也可以在其他宏的基础上进行组合:
.texmacro {\hello}
\text {Hello, \textit {world}}
.texmacro {\highlighthello}
\colorbox{blue}{\hello}
$ \highlighthello $