[Top][All Lists]

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

Re: [Groff] Smart quotes

From: Werner LEMBERG
Subject: Re: [Groff] Smart quotes
Date: Tue, 06 Feb 2001 08:09:28 +0100 (CET)

> I'd like to write a macro that gets invoked *inline* with
> the " character ( .char " \*[QUOTE_MACRO] ).  QUOTE_MACRO would
> evaluate whether " was an open-quote or a close-quote, and
> substitute `` or '' accordingly.
> Problem is, of course, that groff doesn't like inline macros
> that contain anything but escape sequences, which makes
> evaluation impossible.
> So... how do I do this?

What about this:

.ds quote0 ``
.ds quote1 ''
.nr start-or-end 0
.char " \\*[quote\\n[start-or-end]]\R'start-or-end (1 - \\n[start-or-end])'
This is a "test".

If you need more sophisticated stuff you should rather use TeX which
has full active character support.  For reasons unknown to me,
processing of macros in character definition is intentionally
disabled.  Has someone more background info about this?


reply via email to

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