Those who know history find new ways to err

It is part of typesetting folklore that Donald Knuth was so upset on seeing the galley proofs of The Art of Computer Programming that he decided to write a computer program that followed the traditions of computer typesetting. And, hence, TeX was born.

For anyone who has to typeset math, TeX is the next best thing to sliced bread. I have been using TeX (in fact, LaTeX exclusively) to submit journal articles to IEEE journals. But it appears that in the race to become more adapted to online publishing, many journals are changing their publishing tools. And, in the case of IEEE, it appears that TeX is no longer in their tool chain.

I first noticed that something was amiss, when I was proof reading the galley proofs of a paper that was to appear in IEEE Transactions of Information Theory. I used \mathscr from the rsfs package to denote sets (as it is more ornate than \mathcal). The paper had an expression

\sum_{q \in \mathscr Q} ...


In the galley proof, the script Q in the subscript was of normalsize, rather than scriptsize. So, I pointed that out in my corrections. In the corrected version, the script Q was of a size between normalsize and scriptsize, which a comment from the typesetter that “we cannot make it smaller”. It is at that time that I realized that they were not using TeX. In fact, all mathematical symbols were inserted as images, which has two consequences:

1. It throws accessibility out of the window. These days I read most papers on my iPad. It is a pain to annonate images (normal tools like highlight, underline, do not work with images).
2. It increases the file size by a factor of 10. Just take a look at the average filesize for papers in the current issue (where the filesize is 2MB to 10MB) and early access papers (which are author preprints before they have been processed by the journal; for these the average filesize is 500-600kB).

Last month I went through another round of painful proof reading of galley proofs for a paper that is to appear in IEEE Transactions on Automatic Control. Again, all the math was converted to images, and the niceties of TeX, like the correct vertical location of : in \coloneqq were lost.

As an author, publishing in IEEE has become more painful for me (due to the typographic errors introduced by whatever software IEEE is using). As a reader, reading IEEE papers has become more painful for me (as I have to download papers that are 5x times bigger in size, and have math typeset as embedded images). Oh well, the irony of IEEE not accepting documents with Type 3 (bitmap) fonts is not lost on me.

This whole process makes me wonder, do we still need big publishers in this day and age of online publishing. Why should we, the authors that generate the content; the reviewers who verify it; the editors who carefully curtail it, offer our voluntary services to a big publisher like IEEE when we get nothing in return (no copy editing, no free open access). I wish I were in a field where I could publish exclusively with good publishers like SIAM and ACM (I have published once with SIAM; they actually copy edited the content and gave me the final TeX files when they were done), or in online journals like JMLR.

Would a table by any other name be as useful

Karl Berry recently blogged about creating the following in TeX:

A 6×6 grid of pictures, with a big picture of size 2×2 in the middle. All pictures should be surrounded by a border.

Karl said that he tried pdfpages package but, in the end, used low-level \halign. Ouch! Use \halign. I don’t know how many people who start with LaTeX or ConTeXt actually know the syntax of \halign. But what I find shocking is that Karl’s next best choice was pdfpages, a package to combine pdf pages. Is the state of affairs with LaTeX tables so bad?

I tried to achieve that same layout in ConTeXt, and it was really simple.

    % Placeholders for figures
\useexternalfigure[photo] [cow]   [width=2cm, height=1.5cm]
\useexternalfigure[center][cow]   [width=4cm, height=3cm]

\setupTABLE[each][each][framecolor=lightred, rulethickness=3bp, frame=on, strut=off]

\starttext

\startTEXpage
\bTABLE
\bTR
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\eTR
\bTR
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\eTR
\bTR
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\bTD[nr=2,nc=2] \externalfigure[center]\eTD
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\eTR
\bTR
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\eTR
\bTR
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\eTR
\bTR
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\bTD \externalfigure[photo]\eTD
\eTR
\eTABLE
\stopTEXpage

\stoptext


Notice the [nr=2,nr=2] for the middle cell. This tells ConTeXt that the middle cell spans 2 rows and 2 columns. And thats it!

For another, more extreme, example see Willi Egger’s My Way on drawing type cases (wooden cases with boxes for storing letter types) used in hand typesetting.

Edit: In a follow-up post, Will Robertson said that he does not like the verbose syntax of ConTeXt tables. Neither do I. As a matter of fact, ConTeXt has multiple table implementations. The oldest table macros, \starttable ... \stoptable were just a wrapper around the TaBlE macros by Michael Wichura. The syntax of this macro is:

\starttable
\NC .... \NC .... \NC .... \NC \NR
\NC .... \NC .... \NC .... \NC \NR
\NC .... \NC .... \NC .... \NC \NR
\stoptable


But this mechanism is not as powerful as natural tables (that is what the mechanism that I posted is called). There is, however, a wrapper around natural tables that uses the syntax of the old table macros but provides most of the functionality of natural tables:

\startTABLE
\NC .... \NC .... \NC .... \NC \NR
\NC .... \NC .... \NC .... \NC \NR
\NC .... \NC .... \NC .... \NC \NR
\stopTABLE


This is meant for simple tables. Therefore, the \NC macro does not accept optional arguments. As a result, we cannot use this simpler interface to get the above result. Unless, of course, we cheat. Note the definition of \TC (tablular cell) below and the deliberate use of \1 and \9 to make the code appear less verbose 🙂

\setupTABLE[each][each][frame=on, rulethickness=3bp, rulecolor=lightred]
\def\TC{\eTD \dobTD}

\def\1{\externalfigure[cow][width=2cm, height=1.5cm]}
\def\9{\externalfigure[cow][width=4cm, height=3cm]}

\starttext

\startTABLE
\NC \1 \NC \1 \NC \1 \NC \1     \NC \1 \NC \1 \NC \NR
\NC \1 \NC \1 \NC \1 \NC \1     \NC \1 \NC \1 \NC \NR
\NC \1 \NC \1 \TC[nc=2,nr=2] \9 \NC \1 \NC \1 \NC \NR
\NC \1 \NC \1                   \NC \1 \NC \1 \NC \NR
\NC \1 \NC \1 \NC \1 \NC \1     \NC \1 \NC \1 \NC \NR
\NC \1 \NC \1 \NC \1 \NC \1     \NC \1 \NC \1 \NC \NR
\stopTABLE

\stoptext


Searching for packages in TeXLive

I recently bought a new ACER netbook which comes preinstalled with Windows 7.  It has been almost four years since I used a windows laptop, so I thought that I will give windows a shot before trying out a linux distro on this guy.

The first difficult question was which TeX distribution to use: MikTeX or TeXlive. In the past I had used MikTeX and was extremely happy with it. However, this time around I decided to check out TeXlive (TL), partly buoyed by my good experience with TL in linux.

Installation, setup, etc was a breeze. I think that I selected the basic setup during installation, and when I tried to compile one of my latex files a few packages were missing–mathtools, calcrsfs, dsfonts. In linux, I usually also install the texlive-math-extras bundle and do not need to worry about math packages. However, in windows, I could not find any such package. So, I tried to install these packages by hand.

TeXlive comes with a nice package manager called tlmgr (Of course, as we are talking about TeX software texlive-manager it had to be abbreviated to tlmgr). This allows one to search the CTAN database for packages. For example, I tried


C:\texlive\2009\bin\win32>tlmgr.bat search --global mathtools
tlmgr: package repository http://mirror.its.uidaho.edu/pub/tex-archive/systems/texlive/tlnet
mh - The MH bundle

which told me that I had to install the mh package to get mathtools.sty. Installing the package is also easy. To install the mh bundle, I just had to say


C:\texlive\2009\bin\win32>tlmgr.bat install mh
tlmgr: package repository http://mirror.its.uidaho.edu/pub/tex-archive/systems/texlive/tlnet
[1/1, ??:??/??:??] install: mh [2129k]
tlmgr: package log updated at C:/texlive/2009/texmf-var/web2c/tlmgr.log
running mktexlsr ...
done running mktexlsr.


Easy. Well almost. Things were not so simple when I tried to install dsfont


C:\texlive\2009\bin\win32>tlmgr.bat search --global dsfont
tlmgr: package repository http://mirror.its.uidaho.edu/pub/tex-archive/systems/texlive/tlnet


I guess the empty output means nothing was found. I was confused. I knew that dsfont in part of TL because I use it in linux. So where was it lurking.

Searching CTAN gave me a hint. dsfont is part of the doublestroke package. Ah! Installing packages went smoothly from then on.

So, the next time you cannot find a package in TL, try searching CTAN.