Hey, this is probably an issue on my end but I have no idea what. I installed Asciidoctor Mathematical like the instructions said, I wrote :stem: at the top of my document and then I wrote stem:[sqrt(2)] at some point but when I run asciidoctor-pdf -r asciidoctor-mathematical -a mathematical-format=svg erg.adoc the pdf just has sqrt(2)
Any ideas on what I might be missing on doing wrong?
Update: I tried to write a stem block by doing this:
[stem]
++++
sqrt(2)
++++
And this worked just fine. So is it not possible to get inline stem or something like that?
Update 2:
Apparently explicitly writing asciimath:[sqrt(2)] works, but I can't get inline stem:[] to work even if I write :stem: asciimath at the top
The implicit value for the stem attribute when it is set is latexmath, not asciimath. So if you want to use the stem style or macro, you need to set the stem attribute accordingly.
:stem: asciimath
[stem]
++++
sqrt(2)
++++
That's not what the use manual says. https://asciidoctor.org/docs/user-manual/#activating-stem-support
So is this wrong?
And in any case, I did try to set it explicitly to asciimath but inline would still not work if I wrote stem:[]
My mistake. You are correct. The implicit value is, indeed, asciimath. However, it doesn't hurt to be explicit so that it's clear to the author of the document (perhaps yourself in the future).
That fact that inline stem is not working seems to be a bug in asciidoctor-mathematical (or the version of asciidoctor-mathematical is too old). The PDF converter does not do anything with stem other than to embed the image that asciidoctor-mathematical generates.
Wow, where is my brain today? Asciidoctor Mathematical does not support AsciiMath. It only processes LaTeX math. See https://github.com/asciidoctor/asciidoctor-mathematical/issues/87
Huh that's really weird though, because writing asciimath:[sqrt(2)] or
[asciimath]
++++
sqrt(2)
++++
Both work fine. Does that sound normal?
According to my tests, that does not work. It shows the original source in monospaced text (at least when generating a PDF).
However, there is hope. The AsciiMath gem can convert AsciiMath to LaTeX, which Asciidoctor Mathematical can then process. I commented on the referenced issue.
That's probably it, I have installed the asciimath gem so my guess is it does some magic behind the scenes and that's why it works for me?
It was me who was using an outdated version of asciidoctor-mathematical (from the Docker container). It turns out, AsciiMath integration was already implemented. So it does, in fact, support AsciiMath. The issue was just never closed.
However, it wasn't implemented correctly. So my first statement was accurate after all. I left a comment on that issue stating the problem. See https://github.com/asciidoctor/asciidoctor-mathematical/issues/87#issuecomment-731651350
Thank you! I doubt I could have traced this to its source on my own
Please follow that issue in Asciidoctor Mathematical to monitor when it gets fixed.