From a practical approach, grad students are often familiarized with latex markup, the de-facto standard for writing beautiful mathematical code. Thus, I'd like to embed latex markup within html code and then obtain in return a beautiful mathematical expression. With the help from a friend, I've finally found how! Here's an example:
Wow! It's the famous math poem found by Euler, known as Euler's identity. It embodies the irrational numbers and trigonometry (the pi number), the complex numbers (imaginary unity), the integers and the booleans (0 and 1), the reals (the Neper symbol), the sum, the product, the equality and the equation. What else needs to be said?
But wait, what you really want to know is, how did I managed to embed that equation in this blog? Easy: I use MathTex and some custom javascript. MathTex is a cool web service that produces the image containing the equation to your input code. So, with some simple javascript, I concocted a bookmarklet that performs the sorcery :)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
javascript:
popw='';
y=window;
str=prompt("Type your tex:","%s");
if(str){
popw=window.open(
'http://www.forkosh.dreamhost.com/mathtex.cgi?'+escape(str),
'latexbox',
'width=300,height=200'
);
popw.focus();
if (!document.all) T = setTimeout('popw.focus()',50)
}
void(0);

Here's a live demo:
Latex input:
render
And here's the bookmarklet for you to drag and drop to your bookmarks toolbar.
View comments