Writing a paper in LaTeX will always result in beautiful output, but if you’d like to put that document up on the web you’re limited to two reasonable options: serve the document as a .PDF (with the horrors involves, although Chrome makes things much more palatable), or relying on third-party browser plugins like TeX The World. Now that [Todd Lehman] has finally cooked up a perl script to embed LaTeX in HTML documents, there’s no reason to type e^i*pi + 1 = 0 anymore.
For those not in the know, LaTeX is a document typesetting language that produces beautiful output, usually in PDF form. Unfortunately, when [Tim Berners-Lee] was inventing HTML, he decided to roll his own markup language instead of simply stealing it from [Don Knuth]. Since then, LaTeX aficionados have had to make do with putting TeX snippets into web pages as images or relying on the [; \LaTeX ;] generated from the TeX The World browser extension.
[Todd Lehman]’s perl script generates the PDF of his LaTeX file and pulls out all the weird font and math symbols into PNG files. These PNG files are carefully embedded into the HTML file generated from the normal text pulled from the LaTeX file. It’s a ton of work to get these document systems working correctly, but at least there’s a reasonable way to put good-looking LaTeX on the web now.
23 thoughts on “Finally, LaTeX In HTML Files”
Actually, the accessibility of an image-based system is pretty lacking; investing in MathML with alternative rendering systems for non-supported browsers makes for a much better experience.
See http://www.mathjax.org/ for a rock-solid implementation. Also, that one’s scalable, images aren’t.
IMO the best way to do it is to convert the LaTeX-formulas (because they’re easy to write) into MathML (because it’s a standard format and Firefox even renders it, but it’s awful to write manually) and embedd the MathJAX-script to render it in the browsers that don’t understand MathML.
I’m confused – what was wrong with MathJax? I’ve been embedding LaTeX into HTML for a while now…
I agree. Why now use MathJax? it’s incredible what it can do.
and the “horrors of pdf” are pretty negligible. Sometimes I’m annoyed that it’s an end format but even then there’s a latex package to embed the tex file.
Or use the MathML support that already works in most browsers. http://www.w3.org/Math/
There are lots of converters from LaTex:
In my opinion, this is a really stupid solution as the equations won’t be nor scalable nor selectable. I think that http://mathjax.com/ is a much more beautiful solution to this problem.
> Unfortunately, when [Tim Berners-Lee] was inventing HTML, he decided to roll his own markup language instead of simply stealing it from [Don Knuth]
Thank God! LaTeX is beautiful, but it’s absolutely not suited for web (unless you use it inline, like with MathJax).
Having a public license I guess it wouldn’t had been “stolen” anyways.
I usually use latex2html to do essentially the same thing document structure – not perfect package handling, but otherwise pretty decent at its job.
PNG files? Why not SVG? I guess maybe bitmap is easier to work with during generation though.
You need a paren around i*pi
serve the document as a .PDF (with the horrors
What’s so bad about linking a file? PDFs open just fine for me.
I agree just embedding the equations into HTML directly is more elegant, but down and dirty gets it done as well.
Maybe you are referring to special fonts that need to be embedded into the PDF itself?
If it’s difficult for you to read PDF files, you’re doing it (all) wrong. Acro Reader works just fine.
Especially on a Mac. You don’t even need plugins or a reader for that.
There is a very good reason TBL chose to create HTML instead of using TeX. Rendering simple HTML is much much faster than doing the perfect typography of TeX.
Isn’t this really old news? There’s been LaTeX-to-PNG renderers for online use for quite a while, and lots of LaTeX-to-MathML converters as well. And the quite excellent MathJAX.
I’m too in favour of MathJax, but, to all the naysayers — it’s a hack after all :D
This seems great as a personal project looking into handling LaTeX/PDFs and generating images, but there have been existing solutions for a long time now. The article is pitched a little to far to the “look at this great new technique” side of things.
This tool is very easy and beatiful to make math equation.
As GaspingSpark already said ” the MathML support that already works in most browsers. http://www.w3.org/Math/ ”
To write easily formulas then export them in MathML
or Latex or Maxima, or other formats, just use
this applet which works also offline :
Also it’s not limited to a single browser,
like the chrome software cited before,
moreover the Licence is GPL !
export to clipboard, paste in a text editor and save
as .html or .tex or other as you like.
Come GaspingSpark ha già detto “il supporto MathML funziona già nella maggior parte dei browser. http://www.w3.org/Math/”
Per scrivere facilmente le formule e poi esportarle in MathML
o in latex o Maxima, o altri formati, potete usare
questa applet che funziona anche offline:
rilasciata con licenza GPL !
Non vincolata ad un solo programma di navigazione
come quella di Chrome.
esportare negli appunti, incollarlo in un editor di testo e salvare
come .html o .tex o altri formati che vi servano.
Also consider AsciiDoc. You can write (with embedded Latex math) into a single document that can be processed into DocBook, HTML, PDF, and etc.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)