docs icon indicating copy to clipboard operation
docs copied to clipboard

Document Mathjax escaping

Open cellio opened this issue 4 years ago • 3 comments

https://math.codidact.com/questions/278763 reports a problem where somebody tried to use \ to create a newline in mathjax, which failed. It failed because \ needs to be escaped in markdown, so you have to write \\. See also https://math.codidact.com/questions/278270.

I don't know if there are other special cases besides .

Could we find a place in the mathjax help topic to cover this?

cellio avatar Nov 05 '20 03:11 cellio

Correction: the standard MathJax (well, TeX) markup for a newline is \\, which has to be escaped to \\\\ at present.

There are various other escapes in TeX which begin \, and I think that some of them are passed through by Markdown and others not. E.g. \pi is fine, but \{ needs to be double-escaped to \\{.

pjt33 avatar Nov 06 '20 11:11 pjt33

Instead of trying to document every edge case, would it be simpler to make a code change so that the renderer doesn't try to process Markdown inside of a MathJax element? cc @ArtOfCode- @luap42

superplane39 avatar Nov 06 '20 12:11 superplane39

This has come up again (https://math.codidact.com/posts/280742) so I'm bumping this thread. Like @superplane39 said, it's better to actually fix the renderer to be compatible with standard LaTeX, since we shouldn't expect people to have to go through a ton of effort to convert their LaTeX code into Codidact code (especially since the latex rendering is already painful enough).

MoshiKoi avatar Feb 10 '21 00:02 MoshiKoi