The end of Computer Modern?

Well in short, no, but hear me out.
Read more

Free Meta font

If you’re looking for the poor man’s version of FF Meta, I can recommend Delicious. It’s free and looks awfully close to Meta, at least to the untrained eye (the most notable differences are in the numbers). It also comes with a choice of weights and styles (bold, italic, even small caps), which is nice since some free fonts only have one option. So what if it doesn’t have the 24/36 faces in the official versions? It doesn’t cost €229.00 either.

Changing the fonts in R plots

I use R to do almost all of my statistical analysis and plotting. It has a very steep learning curve but once you get into it, it’s very powerful and you can customise almost anything. The only problem is that these changes are not always obvious or easy to do. Case in point: how to change the fonts on an R plot.

Here are some R commands to plot a few made-up data points:

x < - 1:10
y <- x + rnorm(10)
plot(x,y,main="Basic R plot")

And here's the resulting plot:

Basic R plot

But say you don't want to use Arial as the font for the plot? What if you're doing a Wild West plot (I don't know why but just suppose...) and want to use something like Playbill? This can be done in the following steps.

  1. Find the font settings file Rdevga. There are two versions. The first is system-wide and can be found in $R_HOME$/etc/Rdevga (e.g. C:/Program Files/R/R-2.6.0/etc/Rdevga). The second applies only to your user account and can be found in $R_USER (find this in R using Sys.getenv("R_USER")). If Rdevga doesn't exist in your user directory, just copy the system-wide version there.
  2. Modify the user or system-wide Rdevga to add your desired font. The comments in the file explain how to do this; for example, to add Playbill, add a line that reads "TT Playbill : plain". A full list of available fonts on your system can be found (on a Windows machine) by going to Control Panel > Fonts.
  3. Count the number of uncommented non-blank lines in the file and note the number of your newly added line. After a default R installation, a line added to the bottom would be 20.
  4. (Re)start R so that it reads in the new settings. Redo your plot using the font options to select your desired font, e.g. plot(x,y,main="Basic R plot", font.main=20, cex.main=3)
  5. Et voilà! New plot:
    Basic R plot with different font

Some final notes. First, you might have to change the scale of the font for it to look right (e.g. the cex.main command). Second, you can change the font for specific parts of the plot but it’s tricky to change them all at once; see the help files for more information (type ?par in the Rconsole). Third, you can have a maximum of 32 fonts defined in your Rdevga file (i.e. the standard 19 plus 13 of your choosing, unless you replace the standard ones). Finally, this change only works for functions which call the windows method; so exporting to jpg, bmp, png etc should be fine but pdf and postscript will revert to the default fonts. You can change the fonts for these plots but that’s for another time.

Hope this helps!

LaTeX references made easy

I can’t believe it’s taken me so long to find this. Latex is my typesetting software of choice but I’ve always found references to be a pain. First you’ve got to convert your existing EndNote references into BibTeX. Then you need to tweak that file making sure all the ampersands, double-quotes and other marks are TeX-friendly and finally you need to find a style file that makes the whole thing display the way you want to. (I’m sure by this point people are thinking why even bother…)

Anyway I’ve found two things recently which make references in LaTeX much easier. They would have been really useful about a year ago when I was writing my thesis but better late than never.

  1. The LaTeX Bibliography Styles Database is just that: a database of bibliography styles. It’s mainly useful for finding the right style for a particular journal (as opposed to for reports etc).
  2. Even better is the custom-bib package. Once installed, just run latex makebst and answer a series of questions about how you want things formatted. It then automatically creates the .bst style file which, even if you have to make a few changes, is a heck of a lot easier than starting from scratch. It’s worth it just for the “make titles display as entered” feature alone (many BibTeX styles default to sentence case for titles, which is a pain if you want something like “A history of London” rather than “A history of london”).

Typography on the Toronto Tube

It’s been a while since I’ve posted anything but it’s been a busy summer, what with getting married (!), moving back to London and all. We’re enjoying London much more this time around as we now live in a slightly calmer part of town. But regardless of where you are, the Tube is always a part of your day.

One great thing about the London Underground is its excellent typography and graphic design. However the advantages of the clean Beck maps and Johnson font (not Gill Sans – compare the circle i-dot with Johnson’s quirkier diamond-shape) are something that I’ve always taken for granted. I figured it was just one of those things transit authorities had to get right. And other metro systems that I’ve visited recently, e.g. in Barcelona and Tokyo, suggested that while there is certainly variation between designs, generally subway systems have clear and consistent signage.

Suffice to say, it’s been a while since I’ve been to Toronto. This is a long article, but an absolutely fascinating account of how the Toronto Transit Commission has seemingly done everything possible to prevent a consistent and comprehensible design being implemented. If you only have a few minutes, scroll through the pictures to see how bad Tube signage can be. But if you dig in a bit more, you’ll find some great quotes like this:

What’s really lacking really hit home to me when I was [at Sheppard station] in a wheelchair in 2005 unexpectedly – I didn’t know how to navigate out of the station. There are all of these elevators, well, which one do I take to get out of the station? They have a sign that tells you where you are and what’s upstairs, but you don’t have a little visual of the station. I was going to North York General Hospital and it took me a half hour to get out of the station…. [I] finally made my way out after half an hour. But I wasn’t very strong, I’d lost a lot of weight after a couple operations. So that was a real striking moment.

And then a few months later I was going to a New Year’s Eve party and my friends were picking me up at the corner and it took me 15 minutes to get out with a walker. I couldn’t find an exit that would let me get out with a walker.

This, from the man who actually oversaw the design of said Sheppard signs!

Anyway great reading and next time I take the TTC, I might just tie a piece of string to a lamp-post outside so at least I can get out again.

Identifying fonts in PDF files

I was browsing the TeX showcase the other day and came across a catalogue which used a familiar-looking font. Usually if I see a font and want to know what it is, I will use something like Identifont or What the Font. But if you have a PDF with the fonts embedded (the norm), there’s an easier way. Simply open the Properties menu (File > Properties… or ctrl + d) and click on the Fonts tag. You’ll still have to figure out which font is which but that’s fairly easy.

Out of interest, the catalogue font in question was Rotis Sans. It’s not my favourite and seems to be overused in the business world (e.g. consultancies like Accenture and Sustainability Ltd both use it). It looks much better in German though – perhaps not surprising since its designer is in fact German (and worked in a town called Rotis!).

Next Page →