About three weeks ago, Jodi and I hosted an old friend and colleague. While his primary purpose was to come to SMU to deliver a seminar on his recent work in neutrino physics, he accidentally got me thinking (again) about improving my electronic logbook experience. I’ve spoken before about different ways you can choose to implement your electronic logbook. Here, I focus entirely on TiddlyWiki (http://tiddlwiki.com) and an implementation of LATEX, the mathematical typesetting language.
Such an implementation exists, in general, for JavaScript – this makes it portable to any major modern browser platform. As a review, LATEX [1] is a type-setting language; like a printing press, it correctly places and kerns fonts and allows you to quickly and beautifully format mathematical equations.LATEX is available for every major computing platform. jsMath [2] is a JavaScript implementation of the parsers in LATEX and renders mathematics in native fonts. This is dissimilar from other implementations of LATEX on the web, where instead of fonts, GIF images are created for the equation. For a big document, this means loading dozens, or hundreds, or images. jsMath avoids this completely.
The missing piece: a plugin for TiddlyWiki, so that you can use jsMath in your electronic logbook. That plugin is achieved via the Tiddler “Plugin: jsMath” by Bob McElrath [3]. Here is my own personal recipe for installing jsMath and the Tiddler plugin.
- As of the writing of this entry, I am using TiddlyWiki 2.5.3 and jsMath 3.6c (the latest public release versions of each). I downloaded them from the sites linked in this post.
- I began by installing jsMath in the same directory where my top-level logbook .html file is located. I unpacked the jsMath ZIP archive, which automatically creates a jsMath subdirectory. The top-level logbook .html will look for jsMath in this way when the plugin is installed.
- I installed the TrueType Fonts recommended by the jsMath site (see http://www.math.union.edu/~dpvc/jsMath/download/jsMath-fonts.html). For me, they had to be unpacked into the .fonts/ subdirectory in my home directory. Your needs may vary. Basically, your browser has to have access to these fonts.
- I then added a new Tiddler to my logbook. I titled it “Plugin: jsMath”, and into it I copied the code on Bob’s webpage. I added the tag “systemConfig” to the tiddler, so that it is executed and loaded as a plugin to the logbook.
- Installation complete! I then added LATEX code into my journal tiddlers (e.g. $\gamma \to e^+ e^-$) and it rendered beautifully
A few words of caution, before you get ahead of yourself. Please read the jsMath website information on defining new symbols. It’s not as straight-forward as experienced LATEX users would like it to be, but once you learn the syntax it gets to be a cut-and-paste operation. Second, if you’re using a remote server to host your wiki you are on your own; I don’t know what expectations the code will have for the location of the jsMath code (on the server, on your local machine, or both?). I know that the current implementation of the plugin does some text parsing and looks in the current directory for jsMath – you may have to edit this to make it work when your wiki is on a remote server.
So far, this has been a positive experience. I can still use unicode/HTML short-cuts for things, as needed (e.g. γ → e^^+^^ e^^-^^, which gives you almost the same result as the example LATEX above). But, now for complex equations I have the power of LATEX at my fingertips. I’m even thinking of doing lecture notes for classes in this way, so that they can be instantly placed on the web.
[1] http://www.latex-project.org/