It’s been pretty quiet here on this modest blog, so I’m taking that as an excuse to blog about TeX. One of the fun things about being a low-dimensional topologist is that our papers have many pictures. This leads to the problem of how to add labels to these figures. The right way to do this, I’m convinced, is to do so within the TeX file itself so that the fonts match the body text and it’s easy to move/change the labels without access to the program that originally generated the image files. Colin Rourke’s pinlabel.sty is a good way to do this and is used by the MSP journals such as G&T. The hard part is figuring out the coordinates for the labels without a lot of guesswork. Pete Storm wrote pinlabeler which makes this trivially easy, but unfortunately it doesn’t work naturally with Mac OS X. Therefore I wrote labelpin which is less sophisticated than pinlaber, but works on both OS X and Linux (and probably within Cygwin or MSYS on Windows). It’s just a simple Python script, so there’s no need to compile anything, and on OS X all you should need to do is put it in your path and make it executable (“chmod +x labelpin”).
Alternatives to pinlabel.sty include overpic, WARMReader, and the import environment of xypic. It’s easy to modify the labelpin script to handle any of these, though generally pinlabel is the best package out there. (The only negative of pinlabel is that it requires you have an EPS version of the image file even if you’re using PDFLaTeX, and it can’t handle bitmapped files like PNG or JPG even though PDFLaTeX can. In contrast, I have some macros that work with xypic which can deal with such things, see my script labelxy for details).