-
Notifications
You must be signed in to change notification settings - Fork 50
Open
Description
For html (and odf and epub) it would be nice to be able to produce MathML as mentioned in fletcher/peg-multimarkdown#39
I.e. as an option, instead of wrapping TeX math for MathJax in
Lines 334 to 352 in f2a0b9c
| case MATHSPAN: | |
| temp = strdup(n->str); | |
| if (temp[0] == '$') { | |
| temp[strlen(temp)-1] = '\0'; | |
| if (temp[1] == '$') { | |
| temp[strlen(temp)-1] = '\0'; | |
| g_string_append_printf(out, "<span class=\"math\">\\[%s\\]</span>",&temp[2]); | |
| } else { | |
| g_string_append_printf(out, "<span class=\"math\">\\(%s\\)</span>",&temp[1]); | |
| } | |
| } else if (temp[strlen(temp) - 1] == ']') { | |
| temp[strlen(temp) - 3] = '\0'; | |
| g_string_append_printf(out, "<span class=\"math\">%s\\]</span>",temp); | |
| } else { | |
| temp[strlen(temp) - 3] = '\0'; | |
| g_string_append_printf(out, "<span class=\"math\">%s\\)</span>",temp); | |
| } | |
| free(temp); | |
| break; |
In the original issue blahtex is mentioned, but doesn’t seem very active.
One very simple alternative might be to use amath, a peg-based AsciiMath to MathML converter. It’s only AsciiMath, so it might not be a good alternative for text that are based on TeX-like syntax, but the amath c/peg-code seem rather readable.
mtex2MML, which is a active fork of itex2MML, might be another alternative. It tries to be compatible with MathJax.
Metadata
Metadata
Assignees
Labels
No labels