Skip to the Main Content

Note:These pages make extensive use of the latest XHTML and CSS Standards. They ought to look great in any standards-compliant modern browser. Unfortunately, they will probably look horrible in older browsers, like Netscape 4.x and IE 4.x. Moreover, many posts use MathML, which is, currently only supported in Mozilla. My best suggestion (and you will thank me when surfing an ever-increasing number of sites on the web which have been crafted to use the new standards) is to upgrade to the latest version of your browser. If that's not possible, consider moving to the Standards-compliant and open-source Mozilla browser.

October 4, 2007

LaTeX Macros

One of most useful features of my branch of Instiki is the LaTeX export. If you’ve been developing some ideas with your collaborators, and get to the point where you want to publish something, you click on the “TeX” link at the bottom of the page, and obtain a LaTeX file. Paste the contents into your favourite paper template, and ship it off to the arXivs.

Trouble is, there are some not-insignificant differences between itex and AMSLaTeX, so to make the procedure really smooth, one needs LaTeX macros to implement the various features of itex. And I’d been kinda procrastinating about writing them.

So I was overjoyed when Jason Blevins volunteered to work on this. With a few contributions from me, he managed to generate all the requisite macros (with some caveats1). These are now incorporated in the latest version of Instiki.

I’m particularly pleased with the devilishly clever implementation of \tensor{}{} and \multiscripts{}{}{}.

But there was one issue which arose, about which I’d like to solicit the opinions of you, the users of itex2MML. There’s a conflict between the itex implementation of \binom{}{} and the one in AMSLaTeX. In AMSLaTeX, $$\binom{n}{m}$$ generates

(nm)

whereas itex (a legacy from its ancestor, webtex) produces

nm

without the parentheses.

The way I see it, there are two ways to resolve the conflict:

  1. Change the behaviour of itex, to agree with that of AMSLaTeX (with which, I assume, more users are familiar). The downside is that this may break some existing pages.
  2. Maintain the current behaviour, and have Instiki map \binom{n}{m} to {n \atop m} when generating the LaTeX output.

What do y’all think? Please vote in the comments.

Update (10/5/2007):

Oh heck! Gavin is right. As of itex2MML 1.2.6, \binom{}{} does what you think it should. And I added an \atop command, so that you can easily recover the old behaviour.

1 Aside from the unresolved issue with \binom{}{}, there are a few remaining gotchas:

  1. The plain TeX syntax for fractions, {A \over B} is allowed, but will generate a warning in AMSLaTeX. Use \frac{A}{B} instead.
  2. Webtex’s \array command is not implemented. Use one of the existing “matrix-like” environments.
  3. \color{} works when the argument is a named colour, but generates an error if the argument is an RGB colour-spec.
  4. \bgcolor{} isn’t implemented.
  5. There are no suitable Postscript or TrueType fonts in the standard TeX distributions, which provide the glyphs for
    • \righttoleftarrow (⟲)
    • \lefttorightarrow (⟳)
Posted by distler at October 4, 2007 2:51 PM

TrackBack URL for this Entry:   https://golem.ph.utexas.edu/cgi-bin/MT-3.0/dxy-tb.fcgi/1448

7 Comments & 1 Trackback

Re: LaTeX Macros

I vote for changing the behavior itex. Today it may seem reasonable to leave the inconsistency alone, but in three years do you still want to be explaining to people why \binom produces different results in itex and LaTeX? When it comes to fixing things that are just silly, sooner is better than later.

Posted by: Gavin on October 4, 2007 9:16 PM | Permalink | Reply to this

Re: LaTeX Macros

That’s certainly my inclination.

To be honest, I inherited that bit of code, and had simply assumed (without checking) that \binom{}{} produced binomial coefficients, as it does in AMSLaTeX. I was somewhat chagrined when Jason pointed me to the relevant section of the webtex manual.

To ease the pain, I will probably add an \atop command, so that the current behaviour can be achieved by writing {n \atop m} instead.

Posted by: Jacques Distler on October 4, 2007 9:30 PM | Permalink | PGP Sig | Reply to this
Read the post LaTeX Macros
Weblog: Musings
Excerpt: LaTeX macros for Istiki's LaTeX export.
Tracked: October 5, 2007 8:28 AM

Re: LaTeX Macros

I am very sympathetic to your wiki approach to typing math/physics. However I recently had a problem as I downloaded your presentation from the twistor conference (both the video and wiki generated web page) to listen/read later on a longer train ride. However, I had to find out I did not capture everything as the markup of the slides was broken (without access to the net). Maybe you could also provide an export option that makes stand alone downloadable files?

Posted by: Robert on October 8, 2007 4:55 AM | Permalink | Reply to this

Offline Slideshows.

The slideshow (an XHTML file, a javascript file, and some CSS files), once loaded in your browser, works perfectly fine offline.

You can navigate the slide show using the cursor keys on your keyboard, or using the menu at the lower-right.

The only thing you can’t do is something that triggers a page-retrieval.

  • Hitting the “back” or “reload” buttons in your browser.
  • Calling up the Slide Notes. (Triggers the retrieval of a template to display the notes.)

As long as you avoid triggering a page-retrieval, you should be able to navigate an Instiki/S5 slideshow just fine, while offline.

On the other hand, being on a train should be no excuse for being offline. The train between Durham and London offered very nice WiFi onboard (and power at the seats).

Posted by: Jacques Distler on October 8, 2007 8:05 AM | Permalink | PGP Sig | Reply to this

Re: Offline Slideshows.

I have to admit I am technologically challenged: My laptop battery lasts only 20 minutes thus I have to shut down when I leave the office and boot up when on the train. Then the js and css is (was) gone. Here in Germany only a very small subset of trains has Wifi and if they have it’s T-Online which charge 8 Euros per hour (and I still think a wifi link should be more or less free of charge). The bigger stations at least have Wifi and this allows for brief updates during stops.

Posted by: Robert on October 8, 2007 8:39 AM | Permalink | Reply to this

Re: Offline Slideshows.

My laptop battery lasts only 20 minutes thus I have to shut down when I leave the office and boot up when on the train.

Buying a new battery will fix that, you know.

Posted by: Aaron Bergman on October 8, 2007 11:15 AM | Permalink | Reply to this

Re: Offline Slideshows.

Tried that, didn’t work. Extended version: I have a Dell laptop and buying parts directly from Dell is roughly twice the price you can find as “new and unused” on ebay. Except that the battery I bought on ebay didn’t charge and I had to send it back. Haven’t heard anything from the vendor now for three weeks. Yes, I should send an email and ask…

Posted by: Robert on October 8, 2007 11:57 AM | Permalink | Reply to this

Post a New Comment