Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

converting mathjax to pdf files

I have this example here that renders MathJax in real-time. I would like to convert the output into pdf so I could read it later. What is the best way to do this? Show I just tweak the source a little and loop each element in Tex?

like image 345
Mark Avatar asked Nov 06 '11 18:11

Mark


1 Answers

If you want fine-grained control, you'll probably need to roundtrip the data and let latex and pdflatex or latex and dvipng do the work. http://www.fauskes.net/nb/htmleqII/

Obviously, this will translate into higher server load, which may or may not be acceptable.

Printing via the browser will be less code, but only Chrome seems to have consistent cross-platform print-to-pdf functionality (Correct me if I'm wrong here). OSX and Linux clients won't have any problem getting the PDF, but on Windows...... You can't expect them to be able to save it in any accurate format, except maybe as a screenshot.

A PDF is best for printing later, but it might be good to offer .png downloads also, since it shouldn't add much extra work (dvipng call), and would cover all bases (PDF readers may not be installed on school computers, PDF isn't supported by most mobile devices, etc..)

I'd suggest offering both options to users, so they can save the data in the format their device supports best.

like image 64
Lilith River Avatar answered Nov 19 '22 06:11

Lilith River