More ticks

I mentioned the smart quotes algorithm in the previous post. It’s a clever little piece of code written back in the ’80s by David Dunham, who first implemented it in his great desk accessory, miniWRITER. It’s ubiquity nowadays—driven mainly by its inclusion in Microsoft Word—makes lots of documents look better than they otherwise would, but people often overlook the cases where it doesn’t work.

As I said yesterday, the leading apostrophe is the most common case where smart quotes lead you astray, giving you

If it were done when ‘tis done…
Back in the ‘70s…

instead of the correct

If it were done when ’tis done…
Back in the ’70s…

The incorrect use that drives me up a wall, though, is when I see curly quotes used as foot and inch marks. It’s bad enough when they’re in a report at a 12-point size, but I’ve seen them used on big labels in warehouses and laboratories:

Height: 2’ 8”

How anyone can look at that in 2-inch high letters1 and not see that something is wrong is beyond me.

There are well-meaning people who suggest that the proper foot and inch marks are the typewriter quotes:

Height: 2' 8"

This is unquestionably better, but it still isn’t right. Proper foot and inch marks (or minute and second marks if you’re writing about angles) are slanted.

Height: 2′ 8″

In Unicode, they’re called Prime and Double Prime. In HTML, you can use

I use the Unicode (UTF-8) characters themselves, because I find my Markdown documents easier to read that way. Unfortunately, unlike the various curly quotes, the prime and double prime marks aren’t available directly from the Macintosh keyboard. To get around that problem, and because I need to use these marks often, I have TextExpander snippets defined for both: jjft for ′ and jjin for ″. These snippets keep me from offending my own delicate sensibilities.

Since I’ve just mentioned Markdown, I would be remiss if I didn’t also mention SmartyPants, which is John Gruber’s implementation of the smart quotes algorithm and is usually used in conjunction with Markdown. In fact, most, if not all, of the other Markdown flavors have their own SmartyPants implementation, too.

What sets SmartyPants apart from the Dunham and MS Word implementations of the smart quotes algorithm is that it’s batch rather than interactive. You feed it a file filled with typewriter quotes and it gives you back one with typographer’s quotes (and apostrophes).2 This gives it an advantage over the interactive algorithms: it can look ahead and see what’s coming after the quote mark. SmartyPants uses this to make its quotes smarter than Dunham’s or Word’s. For example, here’s one of its special cases:

475:      # Special case for decade abbreviations (the '80s):
476:      s/'(?=\d{2}s)/’/g;

If you’re using SmartyPants, you don’t have to remember to insert the curly apostrophe when typing something like “the ’70s.” SmartyPants will correct the straight quotes for you.

I still insert the ’ directly for this case, though, a habit I developed from using the less smart interactive algorithms. And I have to enter primes and double primes directly, too. Even SmartyPants isn’t smart enough to handle them.

  1. In Times Roman, of course, because that’s the MS Word default. 

  2. It also fixes en-dashes, em-dashes and ellipses, but we’re focused on quotes and apostrophes today.