首页 > 解决方案 > 如何在 asciidoc 中为 mathjax 表达式定义自定义宏?

问题描述

我想在我的 asciidoc 文档中重用一些数学表达式:

:stem: latexmath

[latexmath]
++++        
E^{\unicode{x2307}\unicode{x2307}\unicode{x2307}}       
++++

为了获得更易于阅读的方程式,我想使用快捷方式,例如

:stem: latexmath

[latexmath]
++++        
E^{\myCustomSymbol}       
++++

或者

:stem: latexmath

[latexmath]
++++        
E^{include::myCustomSymbol.ad}       
++++

=> 如何在数学表达式中使用 asciidoc 导入或

=> 如何在 asciidoc 中定义 mathjax 宏(是否可以使用一些特殊命令调整 mathjax 配置)?

相关问题:

标签: mathjaxasciidoc

解决方案


尝试

:stem: latexmath

[latexmath]
++++        
\newcommand{\myCustomSymbol}{{\unicode{x2307}\unicode{x2307}\unicode{x2307}}}
E^{\myCustomSymbol}       
++++

[latexmath]
++++
E^{\myCustomSymbol}       
++++

您只需要定义一次符号,然后就可以使用它。


推荐阅读