I'm planning a (the?) StackExchange site for mathematics. I think it will be awesome, but there is one major difference between mathematicians and programmers which will be a source of friction in the UI: mathematicians will need LaTeX support.
(Edit: I want to clarify that this isn't meant to be a StackExchange question. I realize that nobody can answer any StackExchange questions at this point. The above paragraph is backstory so that you know why I want to do what I want to do. This is a question about Markdown/WMD. I posted on Meta because I want to modify a tool to be almost like the thing that SO uses. Perhaps this question more properly belongs on SO.)
(More Edit: I was under the impression that SE feature-requests were frowned upon since SE "doesn't exist" yet, but SO podcast 64 suggests otherwise. Since LaTeX support would be useful to any SE site with a math or science focus, I'd like to make this a feature request. Could somebody with the rep please change [support] to [feature-request]?)
Answers to this question have lots of good solutions, but I really need them to be seamless. For example, I really like the latex.codecogs.com editor, so I would like an input like this
For a morphism $f\colon T\to X$, consider the curve over $T$
corresponding to the composition
$T\xrightarrow{f}X \xrightarrow{g} \mathcal{M}_{g,n}$.
to be automatically converted into something like this1
For a morphism
,
consider the curve over 
corresponding to the composition
.
which should produce output like this (but doesn't for some reason ... nevermind that).
For a morphism math1 http://math.berkeley.edu/%7Eanton/image/math1.jpg, consider the curve over math2 http://math.berkeley.edu/%7Eanton/image/math2.jpg corresponding to the composition math3 http://math.berkeley.edu/%7Eanton/image/math3.jpg.
Is this trivial or difficult to implement? How would I go about doing it? I tried checking out the WMD source, but none of it is actually available yet, and the repository hasn't changed in over a year.
1 Of course, I wouldn't want to swamp latex.codecogs.com with requests, so I'd want to get their engine running on the site server. My understanding is that they would be cool with this, but I can't tell for sure. Anyway, there is surely some open source engine I can use.
Update (2010/02/04): People still seem to be looking at this post (it just got a couple of upvotes), so I'll briefly describe the solution we've used on Math Overflow. In contexts other than WMD, the text $f\colon T\to X$
is served as-is, and is converted by jsMath, which is loaded in the footer. In the context of WMD, a "preview math" checkbox is inserted under the wmd-input field and tied to a cookie. We use a (very slightly) customized version of wmd.js
which processes the math in the live preview if the box is checked. The customized wmd.js
incorporates the jsMath processing time into the delay algorithm, but the preview still gets kind of slow for some people, in which case they can uncheck the box. There are still occasional issues (e.g. $\{a_n\}$
doesn't work correctly because Markdown removes the backslashes), but the solution is pretty good. Once it's out, we'll switch to MathJax, the successor to jsMath.
cdn.mathjax.org