Finally, LaTeX In HTML Files

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

    1. 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.

    1. 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.

  1. In my opinion, this is a really stupid solution as the equations won’t be nor scalable nor selectable. I think that 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).

  2. 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?

  3. 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.

  4. As GaspingSpark already said ” the MathML support that already works in most browsers.

    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.

    Bye ;-)


    Come GaspingSpark ha già detto “il supporto MathML funziona già nella maggior parte dei browser.

    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.

    Ciao ;-)

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.