# Three Monkeys, Three Typewriters, Two Days

## May 7, 2003

### Speaking of TeX

When I first typed TeX in my previous comment, I entered it as "TeX". Then I thought to myself, "This is the Web, not a plaintext document. Surely I can use some CSS to mark this up so that it will look right!"

And indeed, simply doing

T<span style="vertical-align: -0.5ex;
line-height: 0;
text-transform: uppercase">e</span>X


did sort of what I wanted. Here the -0.5ex was a guess based on what I knew the result should look like, the line-height was needed to not cause an unsightly line-spacing increase (CSS3 has some proposed properties for handling this globally), and the text-transform was used to allow non-CSS clients to degrade gracefully.

There was just one problem. The result looked ugly as sin. Still does, really. So I took a peek at what \TeX is actually defined as. And that is:

T\kern-.2em\lower.5ex\hbox{E}X


So I was right about the vertical-align; what I was missing was the kerning. It's still missing, as you can tell, because I cannot think of a good way to do it in CSS (relative positioning is no good, since that will make the space after the "X" too big). Oh, well. Chalk up a point for 20-year-old technology.

On a related note, this is actually a case when use of the "style" attribute seems to be in order. I suppose I could set a class="e-in-TeX" on those spans and move the style into the site stylesheet, but that seems pretty silly too (though now that I have that markup in two or three places on this page that may indeed make sense). What I would like is a way to say, "Put TeX logo here," without having to repeat the icky markup for it every time. Chalk up a second point for 20-year-old technology, I guess.

Posted by bzbarsky at May 7, 2003 11:14 PM