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 31, 2009


I decided to to dabble a bit with CSS3’s @font-face directive. Downloadable fonts are now supported by all major browsers, so I replaced Georgia (which I never really liked) with Charis SIL as the typeface for running text on this blog.

Posted by distler at 7:19 PM | Permalink | Followups (7)

October 6, 2009


On a completely unrelated note, why is the JHEP3.cls class so broken?

(To amplify a bit, it seems to be incompatible with a number of standard LaTeX packages; some by happenstance, some because it clumsily – and unsuccessfully – tries to emulate them.)

Perhaps there will be a silver lining to the Springer purchase.

Posted by distler at 12:40 AM | Permalink | Followups (2)

October 5, 2009

Fun with (i)tex

Doubtless, you’re familiar with TeX’s \rlap{} and \llap{} commands. They collapse the bounding box of their content to zero width. The content sticks out of the bounding box (respectively, to the right, or to the left), overlapping the surrounding content. Hence the name…

If, however, you take a look at the code for these commands,

 \def\llap#1{\hbox to0pt{\hss#1}}
 \def\rlap#1{\hbox to0pt{#1\hss}}

you notice one unfortunate thing: they don’t work in math mode. That’s a bummer, because they have (or would have) many useful roles in math mode.

In fact, you might even want a \clap{} command, which would collapse the bounding box to zero width, but cause the content to be centered (sticking out equally, both to the left and to the right) about the current point … something like

 \def\clap#1{\hbox to0pt{\hss#1\hss}}

But, of course, that doesn’t work in math mode, either.

Recently, I happened upon this TUGboat article by Alexander Perlis. It explains how to define macros, \mathrlap{}, \mathllap{} and \mathclap{}, which do the same thing as their horizontal mode counterparts, above, but work in math mode.

And I figured out how to implement the same functionality in MathML.

Posted by distler at 11:24 AM | Permalink | Followups (8)