groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Groff] Smart quotes (and other excesses)


From: Tadziu Hoffmann
Subject: Re: [Groff] Smart quotes (and other excesses)
Date: Thu, 25 Jul 2002 10:58:05 +0200
User-agent: Mutt/1.3.22.1i

> > Traditionally, groff appears to support smart quotes by
> > having the user do it manually, using \*[oq] or something
> > equally hideous.

Those aren't "smart" quotes, those are "real" quotes.
"Smart" quotes is when you let the text formatter decide whether
to insert left or right quotes (which is what you want).

> > Is there any way I can persuade groff to do them for me? For
> > example, by triggering a macro on every character (although
> > this is liable to be rather slow)?
> 
> Unfortunately no.  TeX has this feature (called `active
> characters'), and I sometimes I wonder whether I shall add
> support for this (in case it is possible -- I haven't checked
> this yet).

Active characters are possible in groff with strings, if not
with macros -- there was a discussion sometime back on this list
concerning the same issue.  (The difference between TeX and
groff is that all macros in TeX are string-oriented, so there
is no "artificial" distinction between strings and macros.)

Here's a very crude example:

    .nr SQ 1
    .char " \R[SQ 1-\\n[SQ]]\N[153+\\n[SQ]]
    .sp 3c
    "Hello, world."

Please also note that while TeX does have active characters,
nobody really uses smart quotes, for good reason.  Once you
begin to work on more elaborate texts with nested quotes you'll
need to demand a very good grasp of your text's context by the
formatter if it is to make the right decisions.  And when you're
working with single quotes you need to be additionally aware of
the fact that the apostrophe is the same character as the
english single right quote, and the formatter has to recognize
which one is meant in a particular context.

I daily see texts written with Word where Microsoft's "smart"
quotes have backfired -- and the users are too stupid to either
see the error or to correct it.

For a more drastic analogy, imagine something like
"smart parentheses", where you only have one input character
"parenthesis" and you let the text formatter decide whether to
substitute a left or a right parenthesis.  Sound convincing?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]