artasparks / gpub

GPub: Go Publishing for Glift
MIT License
17 stars 3 forks source link

Apostrophes don't open (66) and close (99) quotes properly #10

Closed dormerod closed 8 years ago

dormerod commented 9 years ago

Most word processing and typesetting programs seem to automatically detect the opening and closing of quotes, so that the user doesn't have to think about them. Generally apostrophes (') become (‘) and (’) (like 6s and 9s), and ditto for (“…”). At the moment GPub doesn't do this and it seems that all single and double apostrophes are output as 9s.

This is another issue that isn't necessarily GPub's fault, because pdflatex seems to turn all apostrophes into 9s. Perhaps it expects the author to have already specified which character to use?

In most cases the apostrophes are paired, but there are also cases where a single apostrophe is used. Examples:

Know when to hold 'em (6 type apostrophe only) It's (9 type apostrophe only).

Can we deal with this within GPub to overcome the limitations of pdflatex?

artasparks commented 9 years ago

It's a TeX issue: http://tex.stackexchange.com/questions/172871/display-apostrophe

low priority for now. Probably could do some regular expressions that would get most of the way there

dormerod commented 8 years ago

Currently, this is probably the most important remaining issue to address before we publish.

If this is fixed next, it also allows more time for us and our proofreaders to spot any bugs in the eventual solution, to avoid potentially rushing another fix at the last minute.

I think the logic for this is:

  1. Check for apostrophes and quotes that have another character hard up against them on the left side (with no space) -- turn those into 9 style apostrophes and quotes.
  2. Check for remaining apostrophes and quotes which have a character hard up against them on the right side -- convert to 6 style.
  3. Everything else is probably safe to leave and TeX will convert them into 9 style itself.

(Implicit in this order is that apostrophes in words like it's will become 9 style and the character to the right is irrelevant.)

artasparks commented 8 years ago

This is already supported by the way LaTeX handles these things:

``foo'' bar will be converted to “foo”