Skip to content →

neverendingbooks Posts

wp-latex’ sweet revenge : wp+MathJax-> ePub

In the early days of math-blogging, one was happy to get LaTeXRender working. Some years later, the majority of math-blogs were using the, more user-friendly, wp-latex plugin to turn LaTeX-code into png-images. Today, everyone uses MathJax which works with modern CSS and web fonts instead of equation images, so equations scale with surrounding text at all zoom levels.

However, MathJax has one downside : it doesn’t parse in ePub-readers. Peter Krautzberger wrote a post Epub and mathematics in which he suggested two methods to turn MathJax into ePub, but after dozens of experiments I still fail to reproduce these.

No doubt, someone will soon come up with a working alternative, but for the impatient here’s a quick but dirty method to turn your MathJax powered wordpress post into ePub :

the tools

  • download and install the ePub export plugin. It automatically creates an ePub file when a post or page is published or updated. The ePubs are stored in the uploads directory (to be found in the wp-contents directory).
  • download and install the wp-latex plugin. MathJax uses the normal \$ tex-delimeters whereas wp-latex requires \$latex, so this plugin doesn’t interfere with the default use of MathJax.
  • download the wp2latex python script. It converts a standard LaTeX file into a format that is ready to be copied into WordPress.

the routine

  • Edit the post you want to convert to ePub. Copy the contents of the post box to a file say post1.tex and save this in the same directory containing the latex2wp.py script.
  • In Terminal go to that directory and type the command ‘python latex2wp.py post1.tex’. It will produce a new file post1 in the same directory.
  • Copy the contents of post1 into the post box of your WordPress-post and press the update button. This time the TeX-commands in your post will be rendered using wp-latex and the ePub export-plugin will have created an ePub-version of it.
  • Locate this newly created ePub file in the relevant wp-contents/uploads/ folder (file has a number.epub name) and, if wanted, change its name into something easier to recognize and copy it somewhere outside the uploads directory. This will be your desired ePub-version of the post.
  • Replace the contents of the post box of your WordPress-post with the contents of the post1.tex file and hit the ‘Update’ button, to restore your original post (powered by MathJax).
  • Email your ePub-file to your iPad and open it with iBooks. Not quite as nice as MathJax-parsed TeX but a lot better than reading unparsed TeX-commands.
Leave a Comment

master seminar ncg 2011

Note to students following this year’s ‘seminar noncommutative geometry’ : the seminar starts friday september 30th at 13h in room G 0.16.

However, if you have another good reason to be in Ghent on thursday september 22nd, consider attending the inaugural lecture of Koen Thas at 17h in auditorium Emmy Noether, campus De Sterre, Krijgslaan 281, 9000 Gent.

Koen’s lecture has one of the longest titles i’ve seen : “De lange weg – een verhaal over wiskundige problemen die denkers al eeuwenlang teisteren, zonderlingen die in afgelegen berghutten de existentie van de duivel willen aantonen, en een mythisch object dat niet bestaat, maar waar we toch naar zoeken” (“The long road – a story on mathematical problems torturing scientists for centuries, weirdos trying to prove the existence of the Devil in desolated mountain-huts and the search for a mythical object that doesn’t exist”).

Knowing Koen a bit I’d say it will be on the Riemann hypothesis, Grothendieck’s theory of motives and the field with one element. A sneak preview of our upcoming seminar, quoi?

More information on the event and to register see here.

Leave a Comment

the Bourbaki code : offline

If you’ve downloaded recently the little booklet containing the collection of my posts on the Bourbaki code, either in pdf- or epub-format, cherish it. I have taken all Bourbaki-code posts offline (that is, changed their visibility from ‘Public’ to ‘Private’). Here’s why.

Though all speculations and the few ‘discoveries’ in these posts are entirely my own work, I did benefit tremendously from background-information on the pre-war Bourbakis provided by experts in the field via email.

The great divide between myself and these historians is that to me the Bourbaki-story is merely a game and a pleasant time-waster, whereas to them it is the lifeblood of their research, and hence of their professional existence.

I value this interaction too much to jeopardize it by trowing potential useful tidbits of info in the public arena too quickly, before they are thoroughly researched or discarded.

I will continue the Bourbaki-code investigation offline, and, perhaps this will lead one day to something publishable. Here, we will switch back to mathematics, most of you will be relieved to hear.

As a matter of (open-access) principle, if you want to have your own copy of the Bourbaki-code booklet, please email me and specify the format (pdf or epub).

One Comment