1

I have some mathematical expression that I would like to reuse in my asciidoc document:

:stem: latexmath

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

In order to get equations that are easier to read I would like to use a shortcut, e.g.

:stem: latexmath

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

or

:stem: latexmath

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

=> How can I use asciidoc imports inside mathematical expressions or

=> How can I define mathjax macros inside asciidoc (is it possible to adapt the mathjax configuration with some special commands) ?

Related questions:

Stefan
  • 10,010
  • 7
  • 61
  • 117

1 Answers1

4

Try

:stem: latexmath

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

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

You only need to define the symbol once, then can use it from then on.

Davide Cervone
  • 11,211
  • 1
  • 28
  • 48
  • Note that this indeed works fine with asciidoctor, but not asciidoctor-pdf (with asciidoctor-mathematical). I couldn't find any way to make it also work for the latter so far, unfortunately. – VZ. May 21 '23 at 16:42