Add LaTeX support (I mean inline LaTeX, not this thing).
EDIT: Based on comments below, I think I misused the word “inline”. What I meant was simply the ability to type LaTeX directly into comments and posts. How it gets rendered doesn’t matter much to me; some legitimate objections have been raised, but I don’t feel like hard math gets used enough on the site that this would get out of hand. Restricting its use to posts rather than comments might be a good compromise.
Yes, definitely. MathJax gives really nice-looking output, scales with screen resolution, and can be added to the site without much effort. The only downside is that it’s a bit of a large download, but that’s what caches are for. If you include the JavaScript file at the end of the HTML body, rather than in the head, it will download after the page is rendered, so the loading time shouldn’t be noticeable.
If you include the JavaScript file at the end of the HTML body, rather than in the head, it will download after the page is rendered, so the loading time shouldn’t be noticeable.
I am skeptical of this claim.
Does your browser never become unresponsive at unpredictable times? Mine (Firefox 3.6) does.(Firefox 4 is much worse, BTW.) Since I use Flashblock, I tend to believe that the main cause of these lapses is javascript though I am willing to listen to arguments to the contrary.
MathJax requires memory for one thing (after it has been running a while, Firefox uses about 500 megs of my memory) which would tend to cause delays when something needs to be paged out or in. And can you assure me that all of the memory leaks in Firefox have been plugged?
I do know that (about 2.5 years ago) when this community was on Overcoming Bias, which at the time was hosted on Typepad, its responsiveness improved drastically on my admittedly very slow (P III) machine when I started using Adblock Plus to prevent Google Analytics’s JavaScript from running.
I am also concerned about the administrative demands of MathJax since what technical talent Less Wrong had available to it has not always responded quickly to spam on the site and has not implemented simple uncontroversial changes that have very broad support (such as a place to put meetup announcement to keep them off the front page).
I do welcome more math here, but I am skeptical that the benefits of MathJax or similar solutions would outweigh the negatives on this site. I know that a lot of the web is heavy with JavaScript, but then a lot of the web kinda sucks, and I get the impression that JavaScript is a big part of the cause of the suckiness.
ADDED. Those in favor of MathJax: do you want it for comments or just for top-level posts?
Alright, let me qualify my statement. The HTTP request/response time to fetch the .js file will happen after the page is loaded, as will the parsing and execution of it. This is an improvement over putting it in the head of the page.
The time you’re concerned about is the time for actually running the math typesetting code. Because the browser’s JavaScript execution model is blocking and single-threaded (at least until we get web workers widely supported), a non-trivial computation can cause a hiccup in initial page performance.
This is mitigated somewhat if you tend to open new pages in a background tab and look at them later (as I do), and you use a browser like Chrome which runs a separate process per tab, since by the time you look at the page it will have settled down.
On my machine, the MathJax web site loads very quickly, and the math is processed almost instantly after the script is in the browser cache. This does not noticeably affect the site’s speed or responsiveness.
As for memory usage, according to my informal benchmarks, the memory cost of loading some JavaScript code is actually very small. It’s dwarfed by the memory cost of rendering the HTML and images and such.
Yesterday I found myself composing a reply to LW in one tab while using 2 other tabs to look up text and URLs so I could paste them into my reply. If I understand what you want correctly, MathJax would have run in all 3 of the tabs (even with Chrome’s process-per-tab architecture) and the delays and pauses in things like scrolling would have had a chance to interrupt my train of thought.
Also, some of us have tried Chrome and after consideration, decided it is worse than what we are currently using. Google’s motive in introducing Chrome was to neutralize the threat to its revenue stream posed by Microsoft’s Bing and other Microsoft initiatives by undermining Office and desktop software sales in general, which is very different from my main motivation for using a web browser, which is to have a quick and reliable and non-glitchy and non-crash-prone way read words (and math symbols) written by many others and write words (and math symbols) that will be read by many others.
according to my informal benchmarks, the memory cost of loading some JavaScript code is actually very small
There is no upper bound on the memory cost or time cost of loading a file of JavaScript, as is true of any Turing-complete programming language. With this particular JavaScript file, I worry about time cost more than memory cost because I can imagine that it converts LaTeX to images in the browser and doing that conversion in an interpreted language seems time-intensive.
In summary, what you write leads me to believe that although a few LWers might like MathJax here, you do not really know whether it will have adverse effects on the majority of LWers.
Note that these adverse effects might be diffuse (meaning they worsen the user experience of many people just a little) and difficult for the average LWer to attribute to MathJax—just as it was difficult for me to attribute my frustration to Google Analytics’s JavaScript until I made the experiment of preventing it from loading.
ADDED.
I would be interested in your answer to my question bottom of grandparent.
Moreover, I am curious as to the source or cause of your enthusiasm for LaTeX on Less Wrong. A lot of people here are in the habit of reading the output of LaTeX (printed on paper) since it is used for most math papers and many (most?) science papers. I suppose you are one of them; aren’t you? Are you also in the habit of writing LaTeX?
Also, I should warn you that as a general rule, I tend not to continue threads that consists of just 2 people replying back and forth more than 3 reply-counterreply cycles deep unless the thread gets upvoted a lot. I mention this so that you do not write a long reply to this and then get disappointed when I do not reply or reply with just a summary of my position.
Yesterday I found myself composing a reply to LW in one tab while using 2 other tabs to look up text and URLs so I could paste them into my reply. Under your proposal, MathJax would run in all 3 of the tabs even with Chrome’s process-per-tab architecture, and when I needed a page, I needed it now and having to wait for it would have interrupted my train of thought.
How old is your machine? My computer is aging and creaky, and it can easily handle MathJax running in several tabs without any slowdown that I’ve been able to notice. In particular, any slowdown on page load is so slight that I haven’t been able to see it.
There is no upper bound on the memory cost of loading a file of JavaScript, as is true of any Turing-complete programming language.
I was referring to the memory cost of loading the code itself, not of the heap memory which the program may allocate, which obviously will vary from minuscule to infinite depending on the program.
Does this particular JavaScript file not convert LaTex code into images?
No, it doesn’t produce images. It generates HTML and CSS, which looks better and is a lot nicer for people wanting to increase the font size.
I notice you have not answered the direct question at the bottom of grandparent.
You mean this one? It must have slipped my mind:
ADDED. Those in favor of MathJax: do you want it for comments or just for top-level posts?
I want it for both comments and top-level posts. Why not?
I am using a first-gen MacBook, the model that was introduced May 2006, with 1 gig RAM.
When someone else wrote yesterday that Math Overflow “has LaTeX support” I went there and looked at a random page with math on it—but maybe MO does not use MathJax, so it would help the conversation for you to provide URL of a page that uses MathJax.
It looks like you’ve expanded your post after I replied, so here’s an addendum.
Moreover, I am curious as to the source or cause of your enthusiasm for LaTeX on Less Wrong. A lot of people here are in the habit of reading the output of LaTeX (printed on paper) since it is used for most math papers and many (most?) science papers. I suppose you are one of them; aren’t you? Are you also in the habit of writing LaTeX?
I’m used to reading and writing LaTeX, yes. The source of my enthusiasm for it comes in two parts:
Because occasionally I want to be able to write math in comments, and the LaTeX syntax for this is the least horrible (and most widely known) that I know of. Simple ASCII formatting is better than nothing, but only goes so far.
I’m sure other people would also like to be able to write math in comments, with formatting that doesn’t suck. For my part, I would like to be able to read their math with decent formatting.
We have that hack for when someone needs it, and in actuality, people don’t write any significant amount of math here. If it was needed, I expect there would be some use of the hack. Since there is almost no use made of it, I conclude that it’s not particularly needed.
So it’s a nice thing to have, but very low priority.
Though it’s possible people don’t use much math because the hack isn’t very well known. Perhaps the best idea is to not add MathJax or anything, but just to make more prominent in the help section how to do this. If people then actually make use of it, then perhaps we should add MathJax or something.
Does LaTeX support mean using LaTeX to generate images which are “transcluded” (inlined) into the text? This is better than using Unicode’s math symbols? Really? Does Math Overflow have LaTeX support?
This is better than using Unicode’s math symbols? Really?
Almost certainly not for small things. If we do add this we should also add notes telling people not to abuse it, and point out the existence of http://unicodelookup.com/ . (Unfortunately, one can’t use HTML entities in comments...)
(Unfortunately, one can’t use HTML entities in comments...)
I though you conceded two and a half hours ago that HTML entities are unecessary. “Nevermind; this is unecessary after all,” is pretty unambiguous, or so it seemed until I saw parent.
Haha, good point. They are unnecessary, because of the existence of tools like unicodelookup. I guess I was still thinking in terms of “people are familiar with HTML entities so we could just stick a note telling people to use those if possible” (and thus they would be convienient, but not necessary). Of course if we go ahead and actually link to unicodelookup this is even easier for those who aren’t familiar with them! I guess I didn’t think that through; linking to unicodelookup does seem to be the better solution. In any case, the point is that if we implement a LaTeX thing we should stick in a note providing an alternative for when such power isn’t needed.
EDIT: Also there’s a good chance I wasn’t much thinking at all and just mimicking MO/math.se/WP which all do suggest using HTML entities as simpler system...
I should clarify that I am not opposed to HTML entities. They’ve been around long enough for the bugs to have been ironed out, and unlike JavaScript, they do not cause memory leaks or infinite loops or other challenges to the efficient management of computational resources if the people who maintain my browser did not do everything exactly right.
Right—to be explicit, then, I agree they are not strictly necessary, still think they would be convenient as things are currently, but also that if the help included a link to unicodelookup or a similar utility (which, if LaTeX is implemented, it should do as part of a “please don’t abuse this feature” note), this advantage mostly goes away and they become pointless after all.
Add LaTeX support (I mean inline LaTeX, not this thing).
EDIT: Based on comments below, I think I misused the word “inline”. What I meant was simply the ability to type LaTeX directly into comments and posts. How it gets rendered doesn’t matter much to me; some legitimate objections have been raised, but I don’t feel like hard math gets used enough on the site that this would get out of hand. Restricting its use to posts rather than comments might be a good compromise.
MathJax is one good option for implementing that.
Yes, definitely. MathJax gives really nice-looking output, scales with screen resolution, and can be added to the site without much effort. The only downside is that it’s a bit of a large download, but that’s what caches are for. If you include the JavaScript file at the end of the HTML body, rather than in the head, it will download after the page is rendered, so the loading time shouldn’t be noticeable.
I’m pretty excited about this.
I am skeptical of this claim.
Does your browser never become unresponsive at unpredictable times? Mine (Firefox 3.6) does.(Firefox 4 is much worse, BTW.) Since I use Flashblock, I tend to believe that the main cause of these lapses is javascript though I am willing to listen to arguments to the contrary.
MathJax requires memory for one thing (after it has been running a while, Firefox uses about 500 megs of my memory) which would tend to cause delays when something needs to be paged out or in. And can you assure me that all of the memory leaks in Firefox have been plugged?
I do know that (about 2.5 years ago) when this community was on Overcoming Bias, which at the time was hosted on Typepad, its responsiveness improved drastically on my admittedly very slow (P III) machine when I started using Adblock Plus to prevent Google Analytics’s JavaScript from running.
I am also concerned about the administrative demands of MathJax since what technical talent Less Wrong had available to it has not always responded quickly to spam on the site and has not implemented simple uncontroversial changes that have very broad support (such as a place to put meetup announcement to keep them off the front page).
I do welcome more math here, but I am skeptical that the benefits of MathJax or similar solutions would outweigh the negatives on this site. I know that a lot of the web is heavy with JavaScript, but then a lot of the web kinda sucks, and I get the impression that JavaScript is a big part of the cause of the suckiness.
ADDED. Those in favor of MathJax: do you want it for comments or just for top-level posts?
Alright, let me qualify my statement. The HTTP request/response time to fetch the .js file will happen after the page is loaded, as will the parsing and execution of it. This is an improvement over putting it in the head of the page.
The time you’re concerned about is the time for actually running the math typesetting code. Because the browser’s JavaScript execution model is blocking and single-threaded (at least until we get web workers widely supported), a non-trivial computation can cause a hiccup in initial page performance.
This is mitigated somewhat if you tend to open new pages in a background tab and look at them later (as I do), and you use a browser like Chrome which runs a separate process per tab, since by the time you look at the page it will have settled down.
On my machine, the MathJax web site loads very quickly, and the math is processed almost instantly after the script is in the browser cache. This does not noticeably affect the site’s speed or responsiveness.
As for memory usage, according to my informal benchmarks, the memory cost of loading some JavaScript code is actually very small. It’s dwarfed by the memory cost of rendering the HTML and images and such.
Yesterday I found myself composing a reply to LW in one tab while using 2 other tabs to look up text and URLs so I could paste them into my reply. If I understand what you want correctly, MathJax would have run in all 3 of the tabs (even with Chrome’s process-per-tab architecture) and the delays and pauses in things like scrolling would have had a chance to interrupt my train of thought.
Also, some of us have tried Chrome and after consideration, decided it is worse than what we are currently using. Google’s motive in introducing Chrome was to neutralize the threat to its revenue stream posed by Microsoft’s Bing and other Microsoft initiatives by undermining Office and desktop software sales in general, which is very different from my main motivation for using a web browser, which is to have a quick and reliable and non-glitchy and non-crash-prone way read words (and math symbols) written by many others and write words (and math symbols) that will be read by many others.
There is no upper bound on the memory cost or time cost of loading a file of JavaScript, as is true of any Turing-complete programming language. With this particular JavaScript file, I worry about time cost more than memory cost because I can imagine that it converts LaTeX to images in the browser and doing that conversion in an interpreted language seems time-intensive.
In summary, what you write leads me to believe that although a few LWers might like MathJax here, you do not really know whether it will have adverse effects on the majority of LWers. Note that these adverse effects might be diffuse (meaning they worsen the user experience of many people just a little) and difficult for the average LWer to attribute to MathJax—just as it was difficult for me to attribute my frustration to Google Analytics’s JavaScript until I made the experiment of preventing it from loading.
ADDED.
I would be interested in your answer to my question bottom of grandparent.
Moreover, I am curious as to the source or cause of your enthusiasm for LaTeX on Less Wrong. A lot of people here are in the habit of reading the output of LaTeX (printed on paper) since it is used for most math papers and many (most?) science papers. I suppose you are one of them; aren’t you? Are you also in the habit of writing LaTeX?
Also, I should warn you that as a general rule, I tend not to continue threads that consists of just 2 people replying back and forth more than 3 reply-counterreply cycles deep unless the thread gets upvoted a lot. I mention this so that you do not write a long reply to this and then get disappointed when I do not reply or reply with just a summary of my position.
How old is your machine? My computer is aging and creaky, and it can easily handle MathJax running in several tabs without any slowdown that I’ve been able to notice. In particular, any slowdown on page load is so slight that I haven’t been able to see it.
I was referring to the memory cost of loading the code itself, not of the heap memory which the program may allocate, which obviously will vary from minuscule to infinite depending on the program.
No, it doesn’t produce images. It generates HTML and CSS, which looks better and is a lot nicer for people wanting to increase the font size.
You mean this one? It must have slipped my mind:
I want it for both comments and top-level posts. Why not?
I am guessing that you, sketerpot, are in the habit of reading a lot of formulae produced by LaTeX and writing a lot of LaTeX. Is that so?
I am using a first-gen MacBook, the model that was introduced May 2006, with 1 gig RAM.
When someone else wrote yesterday that Math Overflow “has LaTeX support” I went there and looked at a random page with math on it—but maybe MO does not use MathJax, so it would help the conversation for you to provide URL of a page that uses MathJax.
MathOverflow does use MathJax, actually; math.stackexchange as well.
For a specific example, try this question on Math Overflow. It has quite a bit of LaTeX math.
It looks like you’ve expanded your post after I replied, so here’s an addendum.
I’m used to reading and writing LaTeX, yes. The source of my enthusiasm for it comes in two parts:
Because occasionally I want to be able to write math in comments, and the LaTeX syntax for this is the least horrible (and most widely known) that I know of. Simple ASCII formatting is better than nothing, but only goes so far.
I’m sure other people would also like to be able to write math in comments, with formatting that doesn’t suck. For my part, I would like to be able to read their math with decent formatting.
Pretty straightforward motives, I would think.
This, this, a thousand times this.
We have that hack for when someone needs it, and in actuality, people don’t write any significant amount of math here. If it was needed, I expect there would be some use of the hack. Since there is almost no use made of it, I conclude that it’s not particularly needed.
So it’s a nice thing to have, but very low priority.
Though it’s possible people don’t use much math because the hack isn’t very well known. Perhaps the best idea is to not add MathJax or anything, but just to make more prominent in the help section how to do this. If people then actually make use of it, then perhaps we should add MathJax or something.
Does LaTeX support mean using LaTeX to generate images which are “transcluded” (inlined) into the text? This is better than using Unicode’s math symbols? Really? Does Math Overflow have LaTeX support?
Yes; so do math.stackexchange and Wikipedia.
Almost certainly not for small things. If we do add this we should also add notes telling people not to abuse it, and point out the existence of http://unicodelookup.com/ . (Unfortunately, one can’t use HTML entities in comments...)
I though you conceded two and a half hours ago that HTML entities are unecessary. “Nevermind; this is unecessary after all,” is pretty unambiguous, or so it seemed until I saw parent.
Haha, good point. They are unnecessary, because of the existence of tools like unicodelookup. I guess I was still thinking in terms of “people are familiar with HTML entities so we could just stick a note telling people to use those if possible” (and thus they would be convienient, but not necessary). Of course if we go ahead and actually link to unicodelookup this is even easier for those who aren’t familiar with them! I guess I didn’t think that through; linking to unicodelookup does seem to be the better solution. In any case, the point is that if we implement a LaTeX thing we should stick in a note providing an alternative for when such power isn’t needed.
EDIT: Also there’s a good chance I wasn’t much thinking at all and just mimicking MO/math.se/WP which all do suggest using HTML entities as simpler system...
I should clarify that I am not opposed to HTML entities. They’ve been around long enough for the bugs to have been ironed out, and unlike JavaScript, they do not cause memory leaks or infinite loops or other challenges to the efficient management of computational resources if the people who maintain my browser did not do everything exactly right.
Just trying to understand your position.
Right—to be explicit, then, I agree they are not strictly necessary, still think they would be convenient as things are currently, but also that if the help included a link to unicodelookup or a similar utility (which, if LaTeX is implemented, it should do as part of a “please don’t abuse this feature” note), this advantage mostly goes away and they become pointless after all.
I don’t really care how it renders, I mainly just want to be able to type LaTeX code directly into comments and posts.
That’s a good point. Images would not be an improvement.
If only I had the ability to upvote about 10x…