ID:1973402
 
Applies to:Website
Status: Open

Issue hasn't been assigned a status value.
I am considering doing further tutorials on math topics—for example, linear algebra and matrices or trigonometry in games. But from what little I have written so far in helping explain some of these things to others, the lack of a truly suitable system of typesetting for them is going to make these sorts of things a pain in the ass, possibly enough to dissuade me from doing them.

To that end, would it be possible to allow the inclusion of Javascript from trusted sources in certain forums, such as in the Tutorials & Snippets forum. Something like MathJax would be a godsend in writing a tutorial, and would come out looking significantly more professional and readable. Trying to use <pre> or <dm> tags for this has shown itself to be atrocious, quite honestly: it's a pain to type and format, and very ugly to read.

Perhaps even going a step further, allowing for Javascript or a more-liberal use of available HTML tags in selected forums would be a great boon, subject to being allowed by mods before being displayed, or possibly only from trusted users. For example, an interactive canvas element that a reader can play around with to see how inputs affect outputs or something similar would be a boon to understanding.
why cant you just take pictures of the math symbols
While I did do that here, there are a few reasons I would rather not do that over and over again for something like a linear algebra tutorial:

  1. It is a pain to do, and not as flexible as in-line typesetting.
  2. I have to host it on 3rd party sites, and if the image gets pruned that information is now lost for all future readers.
  3. A static image can not be as readily resized without loss of clarity or formatting like text can, and thus on different resolutions it will appear different, and potentially unreadable.
  4. It is no longer 1998.
  5. The typeset equations will fit the style of the surrounding elements, as they are specially-formatted portions of the surrounding text.
  6. It opens up the possibility of others using such an available feature, making the display of mathematical formula clearer.

MathJax itself is hardly suspect. It's managed by the American Mathematical Society, which is one of the most respected mathematical organizations in the United States and helped make Tex and LaTeX so popular (and the input for MathJax is LaTeX), and it's used on, e.g., StackExchange (extremely regularly so, on some networks).
I'd be open to considering inclusion of a fixed set of libraries on an as-needed basis, with jQuery being an obvious exception (as it'd conflict with the jQuery lib currently in use). I'll have to think about it some more and look into any libs that are proposed, but in principle a very well-known third-party lib that should be totally innocuous seems reasonable to me.

[edit]
Of course it occurs to me that special tags interpreted by a lib like that would have to be explicitly whitelisted in some of our filters. But that's sort of a separate consideration.
For MathJax, I'm not sure if that would be necessary. Filtering of tags occurs server-side, right? All processing from MathJax occurs client-side, so the server never needs to worry about it unless you use CSS to 'kill' the tags as an extra measure.
If it was done in one of Mathjax's tagless formats like AsciiMath, that'd probably be ideal.
Yes, I'd personally set it up for AsciiMath or LaTeX mode. LaTeX mode is actually what I'd prefer as I'm far more familiar with it due to, e.g., writing my real analysis homework and research work in LaTeX. I'm not intimately familiar with actually setting up MathJax, but I wouldn't be surprised if you can set it up for both.

And honestly, MathML is absurdly bulky anyways.
That was my take on MathML too. I get that arranging expressions in an XML-like way is entirely sensible, but when it comes to writing them, not so much.
Any news on this? Next week is fall break, and if something like this is implemented I could write a tutorial in my free time then
Truthfully I haven't touched this at all yet; the web code is not on my immediate agenda, though I do have some nearer-term things I'd like to accomplish.

Probably the minimal path to what you want would be for me to include some kind of signal in a post that it contains math markup, and then include the library in the page JS if so. The problem with that is I'd still have to do some web work on that and test it, and changing gears from software to web stuff is a time-expensive proposition.