![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
![[site community profile]](https://www.dreamwidth.org/img/comm_staff.png)
Support MathJax in Entries
Title:
Support MathJax in Entries
Area:
MathJax JavaScript support at site level
Summary:
I suggest that (in due time!) dw support MathJax <a href="http://www.mathjax.org/">MathJax</a> for mathematical/technical formatting in dw entries.
Description:
This suggestion is intended to make it easy for dw people to write beautiful and useful mathematical/technical content in our entries. MathJax is now a mature and well-supported FOSS extension of html via javascript, with healthy user and developer communities. We've been experimenting with MathJax for the Stanford Encyclopedia of Philosophy, and we've been very pleased with it so far. (This is not an official SEP endorsement.) Code can be written or displayed rendered or in TeX or MathML. This makes it useful also for gacking and modifying, and even for learning more about those markup languages. Anyone who has tried to do serious mathematical or technical typesetting in html will agree, I think, that html is *not* a typesetting language. MathJax goes a long way toward allowing decent technical typesetting in an html context.
If MathJax can be permitted as a tightly controlled JavaScript layer at the dw site level, which I think it can, then users will be able to write mathematical and technical fragments into their journal entries as easily as any other html. I don't envision putting MathJax support into the rich text editor -- I anticipate that anyone who wants to use MathJax will be comfortable editing their own markup. This is rather an extension of html markup into a wider domain.
It is possible that I'm overestimating the ease of implementing this suggestion, but I've experimented with MathJax support in my personal webpages and at the SEP site, and it looks as though MathJax makes this as easy as possible. Furthermore, the social/political aspects look promising, insofar as the MathJax user and developer communities look like just the sorts of folks dw wants to make alliance with, as far as I can tell.
This suggestion:
Should be implemented as-is.
15 (31.9%)
Should be implemented with changes. (please comment)
1 (2.1%)
Shouldn't be implemented.
3 (6.4%)
(I have no opinion)
26 (55.3%)
(Other: please comment)
2 (4.3%)
no subject
AIUI this would mean that some journals (those with MathJax markup) would require Javascript in order to display correctly. I don't think there's a way around this if we want to be able to display maths. And I think that being able to display maths is an excellent idea. Maybe we need to make sure that it fails to a polite message about how we can't display the maths without JS?
(I don't know how MathML is used, and whether that requires JS, and so whether direct MathML support would be an alternative, but AIUI browsers that support MathML are rather rare at the moment)
Re the "not in the RTE" part of the suggestion: Ideally I would like to see a way to put maths markup in the RTE. I wouldn't expect it to display as WYSIWYG, but it would be nice to be able to use maths without having to type raw HTML for everything else.
no subject
no subject
no subject
Displaying math markup is a lot messier than that. I don't know anything about the particular app/library we're talking about here. But I assume it would have to be allowed to display arbitrary things all through the post in order to be useful. And that potentially leaves my reading page vulnerable to bad actors (maliciously or incompetently) displaying their garbage over my entire reading page. Does anyone but me remember the "feature" that let people display full-page ads over someone's MySpace page through a comment?
I really like the very very conservative nature of DW's approach to outside scripting. I think a richer math markup environment would be cool, but not at the expense of security from harmful or just plain annoying scripts.
no subject
Perhaps there could be an option to display a placeholder, and execute the script that renders the technical material only upon explicit request?
no subject
MathML includes the ability to include hyperlinks within your mathematics, and such links could be made to javascript: URL’s. [...] Similarly, MathJax provides an HTML extension for the TeX language that allows you to include hyperlinks in your TeX formulas. [...] Both MathML and the HTML extension for TeX allow you to add CSS styles, classes, and id’s to your math elements as well. These features can be used to produce interactive mathematical expressions to help your exposition, improve student learning, and so on.
If you are using MathJax in a community setting, however, like a question-and-answer forum, a wiki, a blog with user comments, or other situations where your readers can enter mathematics, then your readers would be able to use such powerful tools to corrupt the page, or fool other readers into giving away sensitive information, or interrupt their reading experience in other ways. In such environments, you may want to limit these abilities so that your readers are protected form these kinds of malicious actions.
MathJax provides a Safe extension to help you limit your contributors’ powers.
http://docs.mathjax.org/en/latest/safe-mode.html
http://docs.mathjax.org/en/latest/options/Safe.html
So, it does appear that it can be locked down so it can only be used as a rendering engine and not a tool to "corrupt" the experience of people reading the page.
no subject
That said, is there any way for MathJax to generate readable HTML (even if ugly) as an alternate view for those without JavaScript? It seems like Stanford and all institutions would need that kind of accessibility.
no subject
no subject
no subject
So, it actually seems like it (deliberately) has excellent accessibility support. I can't vouch for it though as I do not currently use those sorts of software features.
http://www.mathjax.org/resources/articles-and-presentations/accessible-pages-with-mathjax/
no subject
no subject
no subject
no subject
1. Will MathJax work without JS? I can't answer authoratatively, but it seems unlikely given that the big headline text on www.mathjax.org is "MathJax is an open source JavaScript display engine for mathematics that works in all modern browsers".
2. This page on accessibility is worth a skim. http://www.mathjax.org/resources/articles-and-presentations/accessible-pages-with-mathjax/
3. As is this one on browser compatibility: http://www.mathjax.org/resources/browser-compatibility/
Wondering about other ways to implement maths support, some other means of editing MathML might be useful in the future, but it appears that browser support for MathML is not sufficiently widespread yet. See https://en.wikipedia.org/wiki/MathML#Web_browsers.
So it looks as though MathJax is still about the only widely-accessible cross-browser way of doing this, but it probably requires JS.
no subject
no subject
Accessibility for mathematical text and other text containing special symbols would seem to be a difficult problem for any implementation method -- think of how many ways there are of reading logic, mathematics, computer science, and technical matter generally aloud. But I know much less about accessibility than I would like to. I hope the experts among us regarding accessibility will weigh in on this aspect of the proposal.
no subject
no subject
MathML includes the ability to include hyperlinks within your mathematics, and such links could be made to javascript: URL’s. [...] Similarly, MathJax provides an HTML extension for the TeX language that allows you to include hyperlinks in your TeX formulas. [...] Both MathML and the HTML extension for TeX allow you to add CSS styles, classes, and id’s to your math elements as well. These features can be used to produce interactive mathematical expressions to help your exposition, improve student learning, and so on.
If you are using MathJax in a community setting, however, like a question-and-answer forum, a wiki, a blog with user comments, or other situations where your readers can enter mathematics, then your readers would be able to use such powerful tools to corrupt the page, or fool other readers into giving away sensitive information, or interrupt their reading experience in other ways. In such environments, you may want to limit these abilities so that your readers are protected form these kinds of malicious actions.
MathJax provides a Safe extension to help you limit your contributors’ powers.
http://docs.mathjax.org/en/latest/safe-mode.html
http://docs.mathjax.org/en/latest/options/Safe.html
I personally would not need any support in the editor (I use HTML anyway), but it would probably be nice for some if there was a button that allowed the insertion of the raw LaTeX or MathML code into an entry without having to switch back and forth between rich and HTML modes (it could display in the rich editor as the raw text of the math code in a fixed-width font or something... again, just having the support in general would be wonderful even without any sort of editor support).
Keep up the great work!
no subject
BTW, I am now going to subscribe to your journal!
no subject
In fact, what we might desire, is just the installation of cgi-bin script on DW, so people can simply include LaTeX like this:
Installation instructions are here.
no subject
no subject
no subject
For an example of a post that needs math formatting, see https://11011110.github.io/blog/2011/10/13/linear-probing-made.html — this was formerly on my LJ with embedded image files of the formulas, but when I moved it to the new location I was able to update the formatting to use MathJax. I think it looks better that way, but it's also a lot easier to make new posts with math.
But seeing as you appear to be a logician, you may be more interested in https://11011110.github.io/blog/2014/08/27/brief-introduction-to.html and https://11011110.github.io/blog/2015/09/19/toughness-in-logic.html
no subject