Closed sebi5361 closed 4 years ago
Hi @sebi5361.
I never heard of AsciiMath. Thanks for asking.
From what I see about AsciiMath, the delimiter has to be ` ie backticks, but that's already used by StrapDown.js's MarkDown parser, which renders MarkDown to HTML before latting MathJax render maths equations.
In this example file (might take a while to be updated, it's using GitHub pages which is not instantaneous, see this page for a preview from my website), I tried to write a couple of equations in AsciiMath syntax like \Delta = b^2-4ac
but it is rendered as code (code
<-- like here in this comment), not Math.
Apparently one can change the delimiters of AsciiMath to $...$ instead of backticks. (from the MathJax documentation) I'll try this.
I updated my example, by adding the suggested configuration line
<script type="text/javascript">
window.MathJax = { loader: { load: ['input/asciimath'] }, asciimath: { delimiters: [['$','$'], ['`','`']] } });
</script>
and trying to write math using AsciiMath notation between $dollars$ or `backticks`, but both of them do not work.
Sorry, I don't know what to try more.
I guess making AsciiMath work with StrapDown.js would take too much effort as this straightaway approach failed... Too bad )-: Thanks anyway
Yes sorry I don't know what else to try. But honestly, from what I just read about AsciiMath, I don't see the advantages it could have over plain LaTeX.
I understand your argument as you are familiar with Latex, but as I don't have a lot of experience with it I am seduced by the much cleaner syntax of AsciiMath.
`$H_2O$`
Maybe mixed delimiters could do the job if parsed in a right order?
This notation is used in some advanced Markdown + mathematical markup language parsers:
Inline AsciiMath equation: `@(1/2[1-(1/2)^n])/(1-(1/2))=s_n@`
or:
```AsciiMath
oint_Cx^3 dx+4y^2 dy
2=(((3-x)xx2)/(3-x))
sum_(m=1)^oosum_(n=1)^oo(m^2 n)/(3^m(m3^n+n3^m)
Maybe it can give us some hints...
Oh smart. Escaping backticks works, for inline AsciiMath only! See this example. All the other things I tried fails (dollar signs for inline, double dollars for display, three backticks or escaped backticks with AsciiMath code block, etc)
I also added your four examples, which can fail if the are not escaped with a backslash: same issue as using LaTeX with MathJax, as the Markdown parser converts to HTML before loading MathJax, it interprets ` text surrounded by underscores _` as italic!
It's great to have inline equations already!
I really have no clue how the parser(s) work(s), but maybe we could try some nested Markdown code blocks similar to `` ` ``
that displays `
once rendered:
As StrapDown.js is using MathJax that can parse natively AsciiMath is there an easy way to render AsciiMath notation formulas in StrapDown.js?