This feed contains pages in the “perl” category.

Backwards dashes

For some reason, SmartyPants (or, at least, the Text::Typography perl module that uses the SmartyPants algorithm) defaults to using -- for en-dashes (–) and --- for em-dashes (—). LaTeX has been doing it the other way around for years: shorter (en) dashes are two hyphens, longer (em) dashes are three.

I assume the reasoning is that people generally want em-dashes, not en-dashes, so they should be faster. But I’m going to moan anyway.

To fix it, change the line in the typography subroutine from:

my $attr = defined $_[0] ? shift : 3;

to: my $attr = defined $_[0] ? shift : 2;