Join 3,512 readers in helping fund MetaFilter (Hide)

Tags:

Metafilter would look so pretty with MathML!
September 28, 2011 11:51 AM   Subscribe

Is there any interest in allowing MathML in posts and comments? We could use MathJax on another site like mathoverflow.net to convert a readable LaTeX equation into a MathML for the comment here.
posted by jeffburdges to Feature Requests at 11:51 AM (124 comments total) 5 users marked this as a favorite

I'm leaning towards no by default, since it's rarely requested (yours is first), likely wouldn't be used often and might possibly open us up to weird upper ascii exploits/jokes?
posted by mathowie (staff) at 11:54 AM on September 28, 2011 [1 favorite]


Yeah, I can't see any compelling reason to go this route, much as I can appreciate a love for advanced markup languages.
posted by cortex (staff) at 11:55 AM on September 28, 2011


Seriously? Other than as a replacement for the img tag for inline jokes, why do this?
posted by tommasz at 11:59 AM on September 28, 2011


Alternatively, could we use LaTeX as an ML for text entry?

I'm actually kinda serious here. Some sort of text escaping mechanism to do inline math and symbols would make discussing some technical stuff a lot more user-friendly. HTML is pretty rough around the edges when trying to do equations and what not.

Of course, we'd need to mail out copy of Lamport to each new user.
posted by bonehead at 12:01 PM on September 28, 2011


I am good with math but I don't even totally understand the question. This seems like a wheel-reinvention to me. What's the pastebin for math stuff?
posted by jessamyn (staff) at 12:02 PM on September 28, 2011


Imagine how much better the times table thread would have gone had we been able to use "$\times$"!
posted by Philosopher Dirtbike at 12:03 PM on September 28, 2011 [2 favorites]


I've often (e.g., here) wished for some good way to display mathematical formulae in answering math-related AskMes—something like the <math> markup available on Wikipedia. That said, I don't know enough about MathML to know if that would be a good solution—is it simple enough to learn to do by hand? Or is there some applet that could convert an equation to MathML? Does some sort of plug-in have to be installed on the reader's browswer for it to display correctly? (If so, the idea is probably a non-starter.)
posted by DevilsAdvocate at 12:04 PM on September 28, 2011 [1 favorite]


How many math questions are there? Further, how many math questions are asked by people who can read the symbols you want to use?

It reminds me a bit of when people answer word questions with IPA responses, that the original asker probably doesn't even understand.
posted by smackfu at 12:08 PM on September 28, 2011


...had we been able to use "$\times$"!

We can use &times; (×) but: (1) it took a few minutes searching the HTML entities tables to confirm that was the correct code, as opposed to, say, &mult; or something; and (2) the preview code doesn't always transmit entities transparently, in my experience.
posted by bonehead at 12:11 PM on September 28, 2011 [1 favorite]


As a rule, math symbols should not look too much like ordinary letters, making fictitious urls difficult. I cannot however tell you exactly which symbols MathJax uses either off the top of my head.

There was a reason that I did not suggest full MathJax support, i.e. proper LaTeX markup, Philosopher Dirtbike, namely that MathJax consumes considerable resources. I simply suggested that users might cut & paste the MathML created by MathJax elsewhere for use here, but that doesn't work unless MathML is supported, and some additional characters are allowed.
posted by jeffburdges at 12:12 PM on September 28, 2011


HTML is pretty rough around the edges when trying to do equations and what not.

It's pretty rough around the edges for lots of specialist markup needs, and that's even allowing for a full unfiltered set of tags. In practice, specialist markup needs mean using an external solution for your markup, because trying to accommodate that stuff on the site would be a huge amount of work for minimal overall benefit to the userbase.

The general plan for this stuff is mark up elsewhere, post or screenshot elsewhere, link that in a thread. I know it's not as fun as having the site natively handle whatever advanced stuff you have in mind, but it's far, far more practical.
posted by cortex (staff) at 12:14 PM on September 28, 2011


Well, you do know how we all love a good weird upper ascii joke.
posted by crunchland at 12:17 PM on September 28, 2011 [2 favorites]


how many math questions are asked by people who can read the symbols you want to use

I expect that more people can read math in its traditional written form than in "flat" text. For example, there are no unfamiliar symbols in the quadratic formula, which is an example of something that might reasonably come up in a math-related question. I can't begin to give a readable version of it on this site. Is "-b +/- sqrt(b^2-4ac) / (2a)" readable? In the past, I've wanted to answer probability questions with a summation - again, difficult to express in flat text.

MathML is rendered natively by the browser itself - at least for recent versions of Firefox and Safari; I'm not sure which others at this point. Visit this page and you will likely see lovely rendered equations without ever having installed anything.

Examine the source code for that page to see how it's done. I think that all MetaFilter would have to do is allow the math tag. See also here (wikipedia) for an explanation. It's possible but tedious to write the code by hand, so typically one uses a tool somewhere (such as the one that jeffburdges linked in his post) to generate the code, and then pastes it in wherever it's going.

I'd suggest giving this more consideration than a preemptive "no, it might be evil?"
posted by Wolfdog at 12:24 PM on September 28, 2011 [14 favorites]


I expect that more people can read math in its traditional written form than in "flat" text.

I expect so too. How that comes into the balance of how much it would actually be used (which is a question of the number of commenters fluent in and inclined to use MathML, not the number of people who might prefer to read nicely marked up math if given the option) vs. what would be involved in supporting it and handling user education etc. is not clear to me.

That's where it doesn't seem to make sense. Not because it might be evil, but because there's no indication that it's actually something that should be anywhere on our priority list as nice as it would be for the sliver of the userbase who would use it now and then if it were available.
posted by cortex (staff) at 12:27 PM on September 28, 2011


My experience is that it's difficult to predict how much (or how little) a new tool like this will be used when nothing like it has been available before. Available tools sometimes suggest opportunities for their use. The part that bears consideration is how much work it would be to enable. But, with that, I'll weigh out on the subject.
posted by Wolfdog at 12:33 PM on September 28, 2011 [3 favorites]


I'd love this, but it seems of relatively low benefit and quite a bit of investment to implement.

Poor pony. Poor pretty, pretty pony.

*somberly pulls rifle down offa the gun rack*
posted by Eideteker at 12:34 PM on September 28, 2011 [5 favorites]


Eideteker: “I'd love this, but it seems of relatively low benefit and quite a bit of investment to implement.”

Why? It sounds like it would be relatively simple, if Wolfdog's estimation is correct. I guess now I'm wondering, too.
posted by koeselitz at 12:36 PM on September 28, 2011 [1 favorite]


I'm a sliver of the userbase! Awesome! (Also, now I have my next sockpuppet name.)
posted by DevilsAdvocate at 12:39 PM on September 28, 2011 [2 favorites]


Metafilter would be a far richer place with more definite integrals.
posted by backseatpilot at 12:39 PM on September 28, 2011 [1 favorite]


Before this pony gets sent to the γλυε factory....

Speaking of subsets of the userbase, if anybody ever stated MathFilter -- a spin-off site full of interesting Metafilter-like math posts (which would presumably have lots more uses for MathML) for a general* audience, I would be all over that.

(As a reader, obviously... otherwise I'd just start it myself. )

* average Metafilter intelligence but not a whole lot of formal post-Calc I math education

posted by MCMikeNamara at 12:46 PM on September 28, 2011 [3 favorites]


I will ask more math questions if we get this. Pinky promise.
posted by shothotbot at 12:51 PM on September 28, 2011 [1 favorite]


There is only one problem with the MathML tags themselves, namely that mathowie would need to figure out whether he trusted them.

We are talking about more than simply the <math> tag, of course. I'm seeing six other <m...> tags when I run the following equation through mathoverflow.net's MathJax, but maybe double that exist.

$\frac{\partial V}{\partial t}+\frac{1}{2}\sigma^{2}S^{2}\frac{\partial^{2} V}{\partial S^{2}}+rS\frac{\partial V}{\partial S}-rV=0$

There is however a more serious problem that MathJax generates equations using some odd encoding characters. For example, &part; refers as ∂ happily, but MathJax writes x2202; instead, which fails.

We'd need some list of safe vs. unsafe symbols coded as x...; characters, maybe that exists already, not sure.
posted by jeffburdges at 1:01 PM on September 28, 2011


I wish this were something I would have a use for, even as a spectator.
posted by OmieWise at 1:01 PM on September 28, 2011


MathML is rendered natively by the browser itself - at least for recent versions of Firefox and Safari; I'm not sure which others at this point.

It does not work in Chrome, any version of IE, or Safari before 5.1. That seems like a fairly large audience to show junk HTML to. Math specific sites tend to use MathJax or similar to provide rendering to those browsers, but I don't know that MeFi wants to add that overhead.
posted by smackfu at 1:03 PM on September 28, 2011 [1 favorite]


For example, ∂ refers as ∂ happily, but MathJax writes x2202; instead, which fails.

The HTML filer on the comment box seems to strip numeric codes, but seems to pass some(?), all(?) named entities. For example, &times; emits ×, but the numeric 215; does not.
posted by bonehead at 1:14 PM on September 28, 2011 [1 favorite]


"Why? It sounds like it would be relatively simple, if Wolfdog's estimation is correct. I guess now I'm wondering, too."

Really? You're going to do this while I'm holding a rifle? Is that wise, you think?
posted by Eideteker at 1:15 PM on September 28, 2011


It's hard to even talk about this properly! The numeric code "215;" produces the mistake above.
posted by bonehead at 1:15 PM on September 28, 2011


I swear that worked on preview. Crap. That should be ampersand hashmark 215 semicolon.
posted by bonehead at 1:16 PM on September 28, 2011


Eideteker: “Really? You're going to do this while I'm holding a rifle? Is that wise, you think?”

If you're going to keep waving that gun around, I'm going to hop on this pony and ride away into the sunset where we both can be happy and free.
posted by koeselitz at 1:18 PM on September 28, 2011


I like this idea for at least AskMe. For example, here's a question I asked that got ugly because responders didn't have access to math markup features.
posted by painquale at 1:32 PM on September 28, 2011 [1 favorite]


TeX the World is probably the most useful solution, with the caveat that it is not a well-known addon on this site, and would only work for Firefox and Chrome people. It is what they use on /r/math, and it seems to do a very good job. For example, rendering the quadratic equation can be done as

[; x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} ;].

The only issue is that on reddit, they seem to have had to implement some sort of fix to not cook their servers. That might also be an issue for MeFi if there was widespread adoption.
posted by TypographicalError at 1:41 PM on September 28, 2011


An upper ascii walks into a ¦...
posted by It's Raining Florence Henderson at 1:42 PM on September 28, 2011 [1 favorite]


Of course, as soon as less than's or greater than's start appearing in comments, things would probably go to hell. Have to pre those things.
posted by TypographicalError at 1:43 PM on September 28, 2011


I would absolutely love this. I think the technical side should be reconsidered, even though this would only be used sporadically. The couple of questions that do require it - it would be absolutely great - and it would prevent these questions from being useless in in the future by avoiding reliance on third-party image-hosting sites.
posted by odinsdream at 1:54 PM on September 28, 2011 [2 favorites]


The general plan for this stuff is mark up elsewhere, post or screenshot elsewhere, link that in a thread. I know it's not as fun as having the site natively handle whatever advanced stuff you have in mind, but it's far, far more practical.

I dunno - that's an annoying to post, plus susceptible to link rot. I think it's rare that that's better than just pasting in a crude ASCII art version, even with the pain of formatting and escaping errors.
posted by aubilenon at 1:59 PM on September 28, 2011


This doesn't really get you symbols, but for crude ASCIIunicode-math art you can copy and paste from sympy:

In [1]: Integral(exp(-x**2)*erf(x), x)
Out[1]: 
⌠               
⎮    2          
⎮  -x           
⎮ ℯ   ⋅erf(x) dx
⌡              
 
In [2]: integrate(exp(-x**2)*erf(x), x)
Out[2]: 
  ⎽⎽⎽    2   
╲╱ π ⋅erf (x)
─────────────
      4      
posted by floam at 2:22 PM on September 28, 2011 [1 favorite]


Even that is showing up "what's that unicode symbol" boxes.
posted by smackfu at 2:24 PM on September 28, 2011


Heh. Looks like this here. Probably safer to use it with a non-unicode terminal or get the pretty printer to just use ASCII.
posted by floam at 2:26 PM on September 28, 2011


I approve of this pony, but I would also like the image tag back too - or rather uploading of images to avoid link rot.
posted by Brent Parker at 2:27 PM on September 28, 2011


How that comes into the balance of how much it would actually be used (which is a question of the number of commenters fluent in and inclined to use MathML, not the number of people who might prefer to read nicely marked up math if given the option) vs. what would be involved in supporting it and handling user education etc. is not clear to me.

Mod syntax fascinates me. I notice these complex sentence structures all the time when you guys are trying to capture the nuances of moderation. There's probably a linguistics paper in there somewhere.

</derail>
posted by twirlip at 2:30 PM on September 28, 2011 [1 favorite]


If you have a problem that requires showing a well-formatted equation, and you have the skills to express it in LaTEX/MATHML/whatever, is AskMe really the best place to seek an answer? Surely there are better places for that, no?

Wolfdog: "I'd suggest giving this more consideration than a preemptive "no, it might be evil?""

Wolfdog: "My experience is that it's difficult to predict how much (or how little) a new tool like this will be used when nothing like it has been available before. Available tools sometimes suggest opportunities for their use. The part that bears consideration is how much work it would be to enable."

I love when customers tell devs how to think.
posted by mkultra at 3:09 PM on September 28, 2011


I donno if you'd see ask.mefi questions with formatted equations, but you'd see answers for sure. FPPs too, no doubt. And MathML appears more complex than I realized.
posted by jeffburdges at 3:24 PM on September 28, 2011


I just got MeMail a few days ago (from someone who hasn't commented in this thread yet) asking how I got the symbols in this comment (answer: Unicode).

MathML itself seems to be too low level to be worth learning, but being able to copy and paste blahtexml output would be quite nice. Unicode math ranges from perfect (the \nabla and \partial symbols in my example) to lousy (is that vector arrow even recognizable or does it just obscure the letter below it?) to impossible (anything with large or multiline symbols).
posted by roystgnr at 3:37 PM on September 28, 2011


It doesn't strike me that this is a very common problem. Just how much does it come up, anyway?
posted by Chocolate Pickle at 3:37 PM on September 28, 2011


I love when customers tell devs how to think.
I love when devs tell customers how to think, which is far more common in my experience.
posted by dg at 3:48 PM on September 28, 2011 [9 favorites]


There should really be a site that accepts equations and encodes them as shortened urls for later rendering using MathJax. It could make the equation appear as unprocessed latex by giving you back not merely the latex, but a full anchor link popup tag like :

<a href="...url..." target="...">
\begin{align}
\dot{x} & = \sigma(y-x) \\
\dot{y} & = \rho x - y - xz \\
\dot{z} & = -\beta z + xy
\end{align}
</a>

We'd first build a Huffman code from looking at equations written in LaTeX. Next, create a simple page that encodes the equation and displays the desired anchor tag. Third, create a simple page that decodes the equation from it's url and passes it to MathJax.
posted by jeffburdges at 4:00 PM on September 28, 2011


Is there any interest in allowing MathML in posts and comments?

YES SO MUCH INTEREST PLEASE NOW WHERE IS IT
posted by DU at 4:52 PM on September 28, 2011


I think it's a fantastic idea! Seriously!
posted by facetious at 5:02 PM on September 28, 2011


I'm sure I'd dig this if I had the foggiest idea what you all are talking about.
posted by jonmc at 5:12 PM on September 28, 2011


I love it when customers take it upon themselves to tell other customers...
posted by floam at 5:12 PM on September 28, 2011


My experience is that it's difficult to predict how much (or how little) a new tool like this will be used when nothing like it has been available before.

"I think there is a world market for maybe five computersone modality of human communication."
posted by DU at 5:23 PM on September 28, 2011


mkultra: "I love when customers tell devs how to think."

The solipsism in this comment would be incredible, if it wasn't so common.

Compare with:
"I love it when homebuyers tell relators what to show them."
"I love it when shoppers tell cashiers what items they want to buy."
"I love it when riders tell horses where they want to go."
"I love it when architects tell contractors what to build."

etc.
posted by danny the boy at 5:27 PM on September 28, 2011 [3 favorites]


I think this would be great. It would be used not-so-often, but it would be very useful when it came into play. Some thoughts:

1) If it can be implemented without introducing security issues, why not a test run?

2) If the test run implementation is heavy on the resources, who cares if its use is as limited (but helpful!) as we seem to agree it would be? The actual impact on site resources would be negligible.

3) If the implementation is heavy on the resources, and it becomes used extensively, isn't that a sign it's worth optimizing for?

I get that you're busy, but this particular pony seems worth experimenting on. Changes to favorites, flagging, wording, subsites, etc. are Big Deals with lots of potential side effects; this is just a matter of helping people post smarter, clearer, more helpful comments. If you think posts are or should be about communication and discussion above the "lol wtf? /hamburger" level, this could be an important tool to add to the communal tool box.
posted by jsturgill at 5:37 PM on September 28, 2011 [4 favorites]


I would also love to see this, especially for math questions in AskMe.
posted by dialetheia at 6:47 PM on September 28, 2011


I get that you're busy, but this particular pony seems worth experimenting on.

There does seem to be a core group of people who are very excited about it. I wonder if the experiment has to take place at MetaFilter, though. Maybe there's enough momentum from this thread that someone could set up a test site for discussion with MathML. Many other sites have spun off of MetaFilter when some particular thing wasn't quite right for the entire community. There could be a way to take the excitement here and make something interesting.
posted by pb (staff) at 7:31 PM on September 28, 2011


I think simply allowing more HTML entities would be a good start, particularly allowing the numbered ones which have no corresponding names. Perhaps this could be limited to a certain few to avoid some of the worst of the "bad high ascii jokes". This list or this one would be good starting points.

As has been pointed out above, IE and Chrome both don't display MathML at all, so I can't see that as a general purpose solution yet.

Linking to an offsite image/pastebin/whatever is very unsatisfactory as typically you want to refer to the equation/entity as part of a sentence. My editor once told me that every equation is part of sentence, and should be treated as a part of speech. I'd hate to have to write half a sentence on mefi then a link to its continuation elsewhere.

I don't think there is a great solution to this yet, not until browsers improve. Being able to at least use the proper symbols though, would be a positive, small step forward, IMO.
posted by bonehead at 8:52 PM on September 28, 2011 [1 favorite]


Named entities should work fine: Α Β Γ Δ Ε Ζ. If there are any on those lists that don't work we can take a look and find out why.
posted by pb (staff) at 8:57 PM on September 28, 2011


I totally get that this is a pain in the ass, but it's not an abstract pain in the ass. It's totally relevant. I see an AskMe question about Serious Math that would benefit from this maybe every other month (usually statistics questions). My instinctive feeling is that everyone interested in answering those questions seriously would quickly pick up on the notation system and use it productively.

BUT THAT'S NOT THE ONLY USE CASE!

(Apologies for the all caps.)

I can truly, easily, sincerely imagine one of the many threads about, for example, "How much should I tip?" that would be improved by being able to give visually rich equations. Text reads as text; algebra is something different, and comes across much better when presented as such.

This isn't something that needs to spin off from Metafilter to thrive. I think the present community, right here and now, would benefit from some sort of complex math notation display system, whatever it might be.
posted by jsturgill at 9:34 PM on September 28, 2011 [5 favorites]


Metafilter: "weird upper ascii joke."
posted by Mitheral at 9:54 PM on September 28, 2011


With <sup> and <sub> + named entities, don't you have what it takes to sort-of deal with most equations, except for integral boundaries, levels of parentheses and divisions like x/6 which would be much nicer if rendered with x on top of 6?
posted by Monday, stony Monday at 10:46 PM on September 28, 2011 [1 favorite]


e.g.: ∫e-x2⋅erf(x)dx
posted by Monday, stony Monday at 10:50 PM on September 28, 2011 [1 favorite]


Can one do the quadratic this way? Is there even a square root named entity?
posted by Mitheral at 10:53 PM on September 28, 2011


mathowie is already enabled and rendered natively on Metafilter, no plug-in required. I don't think you'll be able to convert mathowie into a more readable format, and only a small sliver of the userbase would actually use him, even though there does seem to be a core group of people who are very excited about him.
posted by BurnChao at 12:48 AM on September 29, 2011


"How much should I tip?" that would be improved by being able to give visually rich equations.

I think this is in fact the main objection to it. Similar to the "every equation a book has cuts the readership in half" factoid. It's OK if MeFi is full of literary, artistic, musical, or beanological eggheads but math eggheads are verboten.
posted by DU at 5:46 AM on September 29, 2011


Sort of:

-b +/- sqrt(b^2-4ac) / (2a)

-b ± [√(b2-4ac) / (2a)]

No good way to do an overline to complete &radic;, though.
posted by Monday, stony Monday at 5:55 AM on September 29, 2011


Expanded permutations/combinations are similarly not nice, nor are differential equations, and matrices are quite difficult too. The entities are part of it, but not all.

Named entities should work fine

They do, it's the numeric ones that don't. That is one of the main reasons the proposed solution won't work: MathJax produces numeric entities rather than named ones. Given that the math entities are in a restricted range, it would appear to be a very limited risk to allow numeric math entities to be displayed.

The more I look at MathJax, the better it looks, anyway. It does everything people are asking for here. It's already in use by stack/mathoverflow. It is sponsored by every almost every professional math-using organization under the sun. It works with almost every browser in common use, even smartphones and IE6.

Using it on a web page seems to be as complicated as adding a single line to pull the MathJax stylesheet. The hard work is all done in JS on the client browser; there should be little effect on the server. Of course, I know nothing about the practicalities of this, but it does seem to work well on stackoverflow.

Looks like it might be worth testing at least, and doesn't seem like a huge effort. It appears we'd need two things: numerical math entities and the ability to link to the mathjax css. Maybe a math button on the entry box? I don't know. I'm only a user. I have no idea how much work would actually be involved here.
posted by bonehead at 6:35 AM on September 29, 2011 [1 favorite]


One of the things that makes Ask MetaFilter special is that there are experts across many different fields answering questions here. There are also many small groups of people who have a particular interest in some of the topics that are covered. One of the more frequently discussed topics is recipes. The recipe posts are extremely popular and come up very frequently.

If we had a facility for entering recipes, it would help these folks. We could list ingredients separately from the process, format them in a unique way, provide a more precise search by ingredient, and offer a separate "cookbook" that separated recipes from threads. Just because sharing recipes is one of the activities that happens here doesn't mean it makes sense to change the site specifically for it. Ask MetaFilter is a general interest site. Math Overflow is built specifically for discussing math. They are two different sites with two different purposes.

Having a general interest focus is both a strength and a weakness. At some point, experts in a particular domain are going to need to go elsewhere to have expert-focused discussions. Beginners in a particular domain aren't going to be comfortable at an expert site, so they need places to go to gain knowledge. As they move up the amateur-expert chain, they will naturally migrate where they need to be.

I'm sorry to say we can't add features for every interest community, it won't scale. But there are other places for experts with more precise tools to communicate.
posted by pb (staff) at 7:38 AM on September 29, 2011 [1 favorite]


Would it be possible to fix the numerical entiy display bugs at least? I find those quite annoying.
posted by bonehead at 7:47 AM on September 29, 2011


What's the bug? They don't render by design. We've been burned by numeric entity goofing around in the past so we disabled them.
posted by pb (staff) at 7:57 AM on September 29, 2011


From 2006, mathowie said: "I block all instances of ampersand-poundsign and hex values because someone showed me quite effectively how you could encode nasty XSS javascript using entities and get it to pass into MeFi and do things like send your password cookies to remote servers and whatnot."
posted by smackfu at 8:14 AM on September 29, 2011 [2 favorites]


Well, if RecipeML existed, then why not? If you have an option to allow the userbase to communicate better with each other, and are being given a tool does this, at no cost and almost zero effort, with no strain added to the servers.

Isn't there Unicode support? That's useful to just a subset of the userbase, no sense in changing the whole site to support it. Why do you support it?
posted by BurnChao at 8:25 AM on September 29, 2011 [1 favorite]


Thanks for the explination smackfu. I couldn't understand why the ability to write swears in non-English symbols was such a terrible thing.
posted by bonehead at 8:28 AM on September 29, 2011


As has been stated in the thread, MathML alone will not work. It's only supported in a few bleeding edge browsers. We'd need to use some other JavaScript/CSS solution to display things. It would be a bit like offering a music player + MP3 upload for comments and we're not willing to do that.

And fwiw, RecipeML.
posted by pb (staff) at 8:33 AM on September 29, 2011


That's exactly what MathJax is, your premade MathML "player."
posted by bonehead at 8:34 AM on September 29, 2011


Right, so where do we stop adding players? Every component we add has a cost. It costs us in site maintenance time, bandwidth, and support. We have a small team. We have a modest tech setup. We could add "players" for many different special interests here.
posted by pb (staff) at 8:39 AM on September 29, 2011


Incidentally, I couldn't actually figure out what the attack vector was for using numeric entities, after a bit of Google searching. My guess is that there are cases where you use an entity that is outside of the page encoding, and the browser helpfully converts it to something that is in the encoding, which happens to be something you were trying to block.
posted by smackfu at 8:43 AM on September 29, 2011


Well, if RecipeML existed, then why not?

Because we end up going down a rabbit hole of bloat, creating a maintenance and user education nightmare from a collection of good intentions. Nobody wants to hear "no, the specific nice thing that serves your niche interests is not worth the effort to implement", I know. There's no lack of sympathy here. But "well, just add this" is a refrain that ignores the reality that this is a generalist site with a small staff and a focus on basic text-mediated discussion.

It is great that specialist markup tools exist for those applications where they're specifically something like mission-critical. TeX is great if you're putting a paper together. MathML/MathJax sounds like a great fit for Math Overflow. A solid recipe markup language for a recipe site: brilliant.

Metafilter is none of those things, and we can't really practically try to be all of them. I know it's a bummer to be told that you need to go to a third party for e.g. nice markup support for the specific thing you're interested in, but that's the practical reality here: we're focused on basic Metafilter functionality and interactions, and stuff outside of that scope needs to be handled by some other means.
posted by cortex (staff) at 8:44 AM on September 29, 2011


It would be a bit like offering a music player + MP3 upload for comments and we're not willing to do that.

But you do do that!

I know, I know, that's not what you meant.

we're focused on basic Metafilter functionality and interactions

This pony really is, conceptually, a way to allow for richer text communication, which seems to me to be a core piece of MetaFilter functionality. Like, the core piece. And there are already current, real examples on the site of where this would be a benefit.

But it's not going to happen, I guess, and that's cool. Thanks for Metafilter. It's a good thing.
posted by jsturgill at 8:57 AM on September 29, 2011 [1 favorite]


The recipe analogy seems lacking (NEWSFLASH: ANALOGY LACKING!), because you can fairly easily explain a recipe procedure successfully in a text-only presentation. It might be visually nicer, but it's not a requirement for successfully communicating the idea.

With the math, though, even the simplest ideas simply cannot be communicated, period. It's not about pretty visuals at all. It's about being able to meet a minimum level of communication - where right now none at all exists. You cannot communicate even very simple equations in text-only. It's just not possible.
posted by odinsdream at 9:06 AM on September 29, 2011 [5 favorites]


This pony really is, conceptually, a way to allow for richer text communication, which seems to me to be a core piece of MetaFilter functionality.

I get that, I really do. What we've tried to say a few times and for some reason is just not getting across is that this isn't a "markup isn't potentially useful" thing, it's a "this doesn't seem to be broadly useful enough to be worth doing" thing.

There aren't that many math question and math discussions (or math-symbol-centric non-math discussions) on Metafilter. Not none, just not really very much at all proportional to what is going on the site in general. Of those that do exist, there are not that many people on this site fluent in the markup language under discussion. Building a whole new markup feature into the site specifically to service a small number of users in a small number of threads doesn't make a lot of practical sense, regardless of whether those people would find the feature neat in those circumstances.

Folks who want to use MathML/MathJax to mark up an expression when having a nicely marked up expression is really genuinely important to their contribution to Metafilter can do so with a third party tool and link to it. I know it's not the dream solution to the problem, but it exists right now, and it's consistent with what we tell folks to do for other special-markup situations as well.
posted by cortex (staff) at 9:09 AM on September 29, 2011


There are some weird characters that I'm sure aren't accessible as named entities, take this for example :

\[ i\hbar\frac{\partial}{\partial t} \Psi = \hat H \Psi \]
posted by jeffburdges at 9:27 AM on September 29, 2011


Using it on a web page seems to be as complicated as adding a single line to pull the MathJax stylesheet.

This is one of those "easy but hard" things. If you knew that you wanted MathML on every page, like the Math stack exchange site, it's an easy decision. If you know that people will use MathML on 0.1% of the pages, like here, then you have to think about the overhead that using this offsite library will cause to 99.9% of your users. One line to include it doesn't mean it's running one line of code. It must parse the whole page, for instance, and does that scale well to AskMe pages with 100 comments? What if the site is down? Does it behave nicely or does it hang up? Should pb make a local copy then? How often will that be updated?
posted by smackfu at 9:32 AM on September 29, 2011


Folks who want to use MathML/MathJax to mark up an expression when having a nicely marked up expression is really genuinely important to their contribution to Metafilter can do so with a third party tool and link to it.

Not to be snarky, but aside from starting a blog, installing MatJax oneself then linking to a blog post, I'm not aware of any thirdparty sites that do this. There's no flickr or pastebin for math that I know of. Maybe that's something that could be done as a side project.
posted by bonehead at 9:33 AM on September 29, 2011 [1 favorite]


(by one of us, I mean, not you guys.)
posted by bonehead at 9:34 AM on September 29, 2011


There are some greasemonkey scripts that add use MathJax for various purposes, like adding MathML support to Chrome. I've modified one to add MathJax support to MetaFilter :
// ==UserScript==
// @name MathJax for MetaFilter
// @namespace http://burdges.com/
// @description Adds MathJax support to MetaFilter
// @include http://*.metafilter.com/*
// ==/UserScript==

if ((window.unsafeWindow == null ? window : unsafeWindow).MathJax == null) {
   var script = document.createElement("script");
   script.src = "http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full";
   var config = 'MathJax.Hub.Startup.onload()';
   if (window.opera) {script.innerHTML = config} else {script.text = config}
   document.getElementsByTagName("head")[0].appendChild(script);
}
If you install this, the above LaTeX code should render as the Schrödinger equation, although perhaps the font sizes should be increased.

If you use Safari, then I'm afraid that GreaseKit does not currently run under Mac OS X Lion because SIMBL still doesn't work under Lion, sorry.
posted by jeffburdges at 9:36 AM on September 29, 2011 [1 favorite]


Oops, that blockquote breaks the script.src line. I'd imagine you'd really want this script activated by some button too.
posted by jeffburdges at 9:45 AM on September 29, 2011


If \( dX_t= \mu_t\,dt + \sigma_t\,dB_t \) then
\[ \begin{align}
df(t,X_t) =\left(\frac{\partial f}{\partial t} + \mu_t \frac{\partial f}{\partial x} + \frac{\sigma_t^2}{2}\frac{\partial^2f}{\partial x^2}\right)dt+ \sigma_t \frac{\partial f}{\partial x}\,dB_t.
\end{align} \]
posted by jeffburdges at 9:54 AM on September 29, 2011


Inline mode works too. Sweet!
posted by jeffburdges at 9:55 AM on September 29, 2011


I realize you're just experimenting at the moment and that's totally fine, but just to be unambiguous about it we're not really gonna be cool with pasting human-unreadable markup into an actual thread with a "go get this greasemonkey script" directive to the reader wanting to decode it. Zalgo was bad enough.
posted by cortex (staff) at 10:04 AM on September 29, 2011 [2 favorites]


Ahh, but that's the beauty of LaTeX, it's pretty much exactly how you'd type it to a human. I'll grant that spacing operations like \, should be avoided, but that's no biggie. I write \sigma and \mu all the time when sending emails, that's way more clear than mu which might mean m times u.

I personally feel that {\partial^2 \over \partial x \partial y} is more readable than \frac{\partial^2}{\partial x \partial y} since I learned TeX before LaTeX. I suppose the notation \partial_{xy} makes it even more human readable though.

For example : Itō's lemma gets more human readable if I write \( df(t,X_t) = ( \partial_t f + \mu \partial_x f + {1\over2} \sigma^2 \partial_{xx} f ) dt+ \sigma \partial_x f dB_t \) and explain separately that \mu and \sigma are functions of t.

There are some unintuitive LaTeX symbols like \nabla or \cup of course, for people often make the human readable aliases \gradient or \union. Ain't nearly as bad as my sql usage here though!

You know, Zalgo is all about decadence and confusion, but math tries very hard for clarity.
posted by jeffburdges at 10:30 AM on September 29, 2011


If you think that is human readable, you've been doing too much LaTeX.
posted by smackfu at 10:42 AM on September 29, 2011 [3 favorites]


There's gotta be some kind of innately readable markup for math. Something like Markdown.
posted by floam at 1:04 PM on September 29, 2011


Is it any surprise that there are few math discussions when users don't have the necessary tools to have such a discussion? If there was a safe way to display math markup (which is not a foreign language or a super-obscure niche interest!), I would be willing to bet that our brilliant and creative userbase would be able to take advantage of that, and there would be more fascinating math discussions in the future. It would also be hugely useful in many science and computer science threads, which do happen frequently here. Saying "nobody is talking about math anyway" when the tools simply don't exist to talk about it coherently is rather circular reasoning.
posted by dialetheia at 1:27 PM on September 29, 2011 [1 favorite]


Saying "nobody is talking about math anyway" when the tools simply don't exist to talk about it coherently is rather circular reasoning.

But the tools don't exist currently largely because the purpose those tools would serve is specifically a niche thing that is not at all a core focus of the site. I'm not shitting on math here, I love math, math is super fucking duper, but the distinction in missions between a specialist site like Math Overflow and a generalist forum-type community like Metafilter should not be that hard to draw. MO is all about the math. Supporting rich markup to serve that purpose there makes total sense, and good on them. Metafilter is occasionally about the math and mostly about things that are not in fact mathy at all. Supporting rich markup for mathematical expressions does not make a whole lot of sense here when it would be used only occasionally and only by a small fraction of the userbase.

"More people would learn and use MathML/whatever if only Metafilter provided native support for it" is both speculation and kind of beside the point that as a point of policy we haven't made a habit of introducing additional markup options for any niche thing on the site. We need a pretty compelling reason to consider something like this, and as much as I like the idea of fostering happiness in our math nerds, "it would make the small slice of the userbase that are math nerds happy" doesn't really reach that threshold.

This is not particularly about math or MathML, it's a basic site decision-making thing that applies to all kinds of potential niche features. The answer, barring a really good reason for it to be otherwise, is generally no on this stuff. Math is awesome, but "math is awesome" doesn't change that.
posted by cortex (staff) at 1:45 PM on September 29, 2011


It's mostly a browser maturity issue, I think. MathML is part of HTML5. When more browsers support it, the question will probably be: "why not allow MathML in the comment box parser?" (with the associated question of decimal/hex entities).

I don't expect this to be true for a year or two though, but that day may come sooner than later. All Google has to do right now is enable to MathML in webkit for Chrome to work, and then that just leaves IE as the only main vendor without a plan.

The MathJax and similar JS solutions are just a stopgap until browsers catch up. MathJax is particularly nice because it's well-tested, works on a lot of vintage browsers and has a lot of support. I'm sure, however, that everyone hopes that it won't be necessary forever.

So, it may be best to revist this in the (near) future when the question will be simply, "can we have the MathML (and entity) tags?"
posted by bonehead at 2:07 PM on September 29, 2011 [1 favorite]


There isn't any reasonable way to represent mathematics with plain ascii, floam. How would you write a union? I write \union in my papers or email to a coauthor, well I've the \def\union\cup macro, but \cup does accurately describe the symbol just fine. How would you write the symbol for n choose k? I'd simply write {n \choose k}. Knuth designed TeX to be human readable.
posted by jeffburdges at 2:28 PM on September 29, 2011


You know what we really need, a simple logo interpreter written in javascript, so people could play put logo games in their comments for everyone to play. ;)
posted by jeffburdges at 2:50 PM on September 29, 2011


... we're not really gonna be cool with pasting human-unreadable markup into an actual thread with a "go get this greasemonkey script" directive to the reader wanting to decode it.

Wow, that's exactly what everyone else is saying. They're not cool with human-unreadable, there's a simple solution, but you're saying the should use greasemonkey or some other alternatives ("can do so with a third party tool and link to it."). People just want to be able to communicate clearly without jumping through hoops.
posted by BurnChao at 2:53 PM on September 29, 2011


Btw, you could change that @include line to :
    // @include http://*.metafilter.com/*MathJax*
So the script would only run when MathJax appears in the title. I doubt that's progress, just say's.
posted by jeffburdges at 2:56 PM on September 29, 2011


Wow, that's exactly what everyone else is saying.

No, it isn't. I'm saying "please don't start dumping raw MathML code (such as) into threads".

Folks can make their own decisions on a case-by-case about whether it's better to try and cobble an expression together in ASCII/Unicode with the comment functionality available on Metafilter or go to some external tool with more expressive power and link to that, just as they can decide between describing a photo or a video or a song or linking to it, transcribing a recipe or linking to it, etc.

Dumping raw code into comments on a regular basis is not a viable solution. That plain text is not great as an expressive tool for complex mathematical expressions is a bummer but not a mandate to move onto something even less suited to lay reading, and like it or not the overwhelming majority of mefites are laypersons as far as reading and writing complex mathematical expressions.

The stuff that would most benefit from nice markup is also the stuff least likely to come up here, which is why we're not jumping on the klugewagon to make this happen.
posted by cortex (staff) at 3:05 PM on September 29, 2011


Ironically, the potential energy of a klugewagon can only be expressed mathematically using bodger notation, which is derived from pure ASCII/Unicode cobble.
posted by It's Raining Florence Henderson at 3:15 PM on September 29, 2011


I think you mean booger notation, IRFH.
posted by rtha at 3:16 PM on September 29, 2011


that snot what I meant
posted by It's Raining Florence Henderson at 3:18 PM on September 29, 2011


There isn't any reasonable way to represent mathematics with plain ascii, floam.

But you aren't limited to plain ascii. You have unicode. Here's a union symbol: ∪

You don't need named or numeric entities, they just possibly make it easier to enter text on regular keyboards is all. (exception: < and >)
posted by aubilenon at 3:23 PM on September 29, 2011


So if you can't use entities, how do you enter unicode? Change your entry language?
posted by bonehead at 4:20 PM on September 29, 2011


That's not MathML, cortex, that's LaTeX. See here for the differences. Raw XML like MathML doesn't survive the processing metafilter does. One just gets an empty page decorated with a few stray characters. Latex, by contrast, is pretty easy to post, as it does not use XML-ish escape characters (the \ and {} are the TeX equivalents to & and < >).

Either way though, I agree. Neither help matters.
posted by bonehead at 4:26 PM on September 29, 2011


My bad, I was trying to make a point of qualifying "MathML/whatever" earlier rather than just using one label. But, yeah, what I was saying is a general thing.
posted by cortex (staff) at 4:38 PM on September 29, 2011


BTW, looking around for MathML sandboxes, I found this gorgeous example. It's actually MathML + SVG. Oh to be able to do Feynman diagrams in some of the physics threads!
posted by bonehead at 4:51 PM on September 29, 2011 [2 favorites]


So if you can't use entities, how do you enter unicode?

You can copy and paste. For example, cubed root doesn't have a named entity but here it is: ∛. There are sites set up to help with this like copypastecharacter.com.
posted by pb (staff) at 4:52 PM on September 29, 2011


...and, as a real example, I was daydreaming on the way home about how nice it would have been to be able to do a freebody diagram in the plane on a conveyor belt thread. The right answer is blindingly obvious when you do the force balance diagram.
posted by bonehead at 4:56 PM on September 29, 2011 [3 favorites]


Speaking of copypaste, maybe we could put together a list of offsite tools that could help and add them to the wiki or the faq. We mention pastebin for people who want to post code snippets. Maybe we could mention iTex2img or other tools for linking to equations.
posted by pb (staff) at 5:15 PM on September 29, 2011


Would you be willing to white-list them as an image source?
posted by bonehead at 5:20 PM on September 29, 2011


Nope. We aren't going add images of any kind.
posted by pb (staff) at 5:21 PM on September 29, 2011 [1 favorite]


bonehead writes "The right answer is blindingly obvious when you do the force balance diagram."

Not really because the debate comes from the interpretation of the phrasing of the question rather than the math of the answer.
posted by Mitheral at 7:34 PM on September 29, 2011


If you mean the scenario that they did on Mythbusters, which, I would argue, is the normative interpretation, I disagree. But that's what force diagrams are for, showing exactly what the assumptions are. If there is an alternate interpretation of the question, a force balance diagram makes the differences immediately obvious. It's a powerful tool for solving these sorts of problems. They should teach vector diagrams in Grade 4 math class, IMO.
posted by bonehead at 8:06 PM on September 29, 2011


bonehead: Not to be snarky, but aside from starting a blog, installing MatJax oneself then linking to a blog post, I'm not aware of any thirdparty sites that do this. There's no flickr or pastebin for math that I know of. Maybe that's something that could be done as a side project.

I took you at your word and got excited that this might be a fun project for me that had a chance of being widely used. However, a search for "mathbin" immediately turned up mathbin.net, which appears to do what is wanted.
posted by gilrain at 11:54 AM on September 30, 2011 [1 favorite]


You know, realistically anyone who wants fancy mathematics can simply workout a compromise between making stuff human readable (upthread) and valid LaTeX (upthread), or use mathbin.net like gilrain suggests.
posted by jeffburdges at 12:02 PM on September 30, 2011


That looks interesting gilrain. I was searching for "MathML sandbox" and the like. There are a number of latex->image generators out there, but none that seemed to offer an easy way to provide a stable reference to an image.

Linkrot may be a problem. The mathbin site says:"Please note that the posts are not permanent. They have a reasonably long lifetime, but they may be deleted after a sufficiently long time (months, or years)." I guess that's long enough to be immediately useful.
posted by bonehead at 12:42 PM on September 30, 2011


This seems significantly harder to solve with third-party sites, for exactly the reason that bonehead mentions. Who's out there giving imagebucket-like space for math representation?

bonehead also brings up a really awesome example that increases the potential use-case even further than just math questions:

Questions about algorithms, logic, sorting, graphs (not charts, graphs), physics, etc. could all benefit.
posted by odinsdream at 1:06 PM on September 30, 2011


Here's a better one: http://www.texify.com/

Feed it TeX and it reproduces an image on the fly, no intermediate storage required. As long as texify.com is around, and doesn't change their api, this will work.

A moderately complicated example: Euler's relation.
posted by bonehead at 1:15 PM on September 30, 2011 [3 favorites]


Power series expansion. Let's try that again: Euler's relation
posted by bonehead at 1:27 PM on September 30, 2011


Seems to be a pretty comprehensive LaTeX\TeX intreperter. In understand both \frac and \over, for example.
posted by bonehead at 1:29 PM on September 30, 2011


Is the offsite scripting thing still an issue for image hosting? I can't believe that exploit is still around.
posted by Brent Parker at 9:06 PM on September 30, 2011


Yeah, it is still an issue. And it still comes up to this day in old threads where we have inline images. Many of those domains have changed hands, been tagged as malware distributors by sites like Google, and then our site gets tagged as a malware distributor for hosting inline content from those domains. So we have to go in and spot clean those.

At this point we've been so long without images it has become part of the site culture. Even if Google and other malware reporters stopped caring about inline images tomorrow we wouldn't add them to site. No images has become a defining characteristic of MetaFilter for better or worse at this point.
posted by pb (staff) at 10:49 PM on September 30, 2011


« Older Thailand in the news again wit...  |  A lot of good links on the blu... Newer »

You are not logged in, either login or create an account to post comments