Live data from Hacker News

I ported LaTeX to Javascript

manuels.github.com

11–20 of 73 posts

Re: I ported LaTeX to Javascript

#12
post #4
post #2

Promising. I am getting some error messages though. lstat(/bin) failed ... /bin : No such file or directory warning: kpathsea: configuration file texmf.cnf not found in these directories:

These errors are save to ignore. You have to wait some seconds until compiling has completed. Note that the browser might prevent the website from opening the PDF (Pop-up blocking)

Yup, had to wait a bit, then enable popups from GitHub [Iceweasel 10.0.12, Debian Wheezy].

Would a download button appearing when the pdf has compiled be harder to do?

Nice demo

Re: I ported LaTeX to Javascript

#14

Some background would be nice. Wasn't LaTeX notoriously hard to port – to the point that a LateX app for iPad actually ran in an emulator initially [1]. Is this port based on web2c as well? [1] http://www.litchie.com/?p=419

This looks like emscripten to me

Re: I ported LaTeX to Javascript

#18

Some background would be nice. Wasn't LaTeX notoriously hard to port – to the point that a LateX app for iPad actually ran in an emulator initially [1]. Is this port based on web2c as well? [1] http://www.litchie.com/?p=419

Nevertheless it's a good effort as a proof of concept.

I'd also appreciate info on whether Latex packages will be supported in the future. At the moment this does not seem to be the case, though I can imagine this would be a challenging problem to solve for in-browser compilation of documents.

Re: I ported LaTeX to Javascript

#20
Thanks for your hints! I added a 'Open PDF' button to circumvent popup blockers.

Yes, I used emscripten to port it to Javascript. It was not that hard. Emscripten had three bugs I had to fix (the hardest was to find that the %g format was not supported by emscripten's sscanf).

But it was compiled almost like for x86: first convert the pdftex 'web' souce code to c using web2c, then compile it to LLVM bytecode and the LLVM bytecode to JS.

Post reply on HN