README.txt 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. Static MathJax v0.1 README
  2. ==========================
  3. Author: Jan Böcker <jan.boecker@jboecker.de>
  4. Date: 2010-08-15 13:53:39 CEST
  5. Static MathJax is a XULRunner application which loads a HTML input
  6. file that uses MathJax into a browser, waits until MathJax is done
  7. processing, and then writes the formatted result to an output HTML
  8. file.
  9. I have only tested exports from Emacs Org-mode as input files. (As of
  10. 2010-08-14, MathJax is used by default with HTML exports in the
  11. current Org development version.)
  12. Optionally, references to the math fonts used will be converted to
  13. "data:" URIs, thus embedding the font data into the HTML file itself.
  14. (see [http://en.wikipedia.org/wiki/Data_URI_scheme])
  15. The code is licensed under the GNU General Public License version
  16. 2, or, at your option, any later version.
  17. Table of Contents
  18. =================
  19. 1 Usage
  20. 2 Caveats
  21. 1 Usage
  22. ~~~~~~~~
  23. To run Static MathJax, an existing XULRunner installation is
  24. required. From the directory to which you unpacked Static MathJax,
  25. run:
  26. xulrunner application.ini <--embed-fonts | --final-mathjax-url <URL>>
  27. <input file> <output file>
  28. If you prefer to call "staticmathjax" instead of "xulrunner
  29. application.ini", link xulrunner-stub into the directory:
  30. ln /usr/lib/xulrunner-1.9.2.8/xulrunner-stub ./staticmathjax
  31. input file:
  32. name of the input file (the result of a HTML export
  33. from Org-mode). It is assumed that this file uses the
  34. UTF-8 character encoding.
  35. output file:
  36. name of the output file.
  37. --embed-fonts:
  38. if specified, the math fonts will be embedded into
  39. the output file using data: URIs
  40. --final-mathjax-url <URL>:
  41. if --embed-fonts is not specified, this
  42. must be the URL to a MathJax installation folder (e.g. "MathJax"
  43. if MathJax is installed in a subdirectory, or
  44. "[http://orgmode.org/mathjax]" to use the version hosted on the Org
  45. website.
  46. All references to math fonts in the output file will point to
  47. this directory.
  48. 2 Caveats
  49. ~~~~~~~~~~
  50. The input file must not use a MathJax installation on the
  51. web. Otherwise, due to a security feature of Firefox, MathJax will
  52. fallback to image fonts. If you have unpacked MathJax to a
  53. subdirectory "MathJax", specify the following in your Org file:
  54. #+MathJax: path:"MathJax"
  55. The math is rendered in Firefox, so MathJax applies its
  56. Firefox-specific settings. When viewing the output files in other
  57. browsers, it will look slightly different than the result that
  58. running MathJax in that browser would produce.
  59. Internet Explorer does not use the correct font, because it only
  60. supports the EOT font format. For all other browsers (including
  61. Firefox), MathJax uses the OTF font format.
  62. Embedding fonts into the HTML file wastes some space due to the
  63. base64 encoding used in data: URIs.
  64. I have found no way to access stdout or set an exit code in an
  65. XULRunner app, so any code which calls Static MathJax has no idea if
  66. processing was successful and when an error occurs, graphical
  67. message boxes are displayed.