codidact / docs

87 stars 7 forks source link

Document Mathjax escaping #26

Open cellio opened 4 years ago

cellio commented 4 years ago

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?

pjt33 commented 4 years ago

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 \\{.

superplane39 commented 4 years ago

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

MoshiKoi commented 3 years ago

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).