[Top][All Lists]

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

Re: [Groff] Smart quotes [Was: Strange output ...]

From: Ted Harding
Subject: Re: [Groff] Smart quotes [Was: Strange output ...]
Date: Mon, 19 Feb 2007 20:12:53 -0000 (GMT)

On 19-Feb-07 Ted Harding wrote:
> OOPS!! Thank you -- just shows that eyesight matters!
> And, by the way, to get the desired effect it should have been:
> .de amac
> \Z'\v'-1m'\\$1\v'1m''\Z'\v'1m'\\$2\v'-1m''
> ..
> .LP
> Here is the macro amac in operation:
> .amac "First argument" "Second argument

I'd just like to add, for the general good, that the above arose
in a test of a macro for smart quotes (based on a suggestion by
Werner going back to 06 Feb 2001):

.\" Smart quotes: the input character " alternates between \(lq and \(rq,
.\" starting at \(lq following invocation of .smartq
.\" ./smartq turns it off.
.de smartq
.ds dblq0 \(lq
.ds dblq1 \(rq
.nr dblqn 0
.char " \\\\*[dblq\\\\n[dblqn]]\\R'dblqn (1 - \\\\n[dblqn])'
.de /smartq
.rchar "

The objective of the test was to check that the redefinition
of the doublequote " did not affect its use to delimit macro
arguments (logically it should not, but it's always worth a

So you can do, for instance,

This illustrates the use of "smart quotes" in groff.
In this passage, the quotes are "smart", but in the following
(which typesets groff input code in CR font) we want them "dumb":
\&.de amac
Here is the macro amac in operation:
\&.amac "First argument" "Second argument"

Best wishes to all,

E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 19-Feb-07                                       Time: 20:12:50
------------------------------ XFMail ------------------------------

reply via email to

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