[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Groff] string variable in pic
From: |
Werner LEMBERG |
Subject: |
Re: [Groff] string variable in pic |
Date: |
Mon, 12 Dec 2005 08:21:09 +0100 (CET) |
> I have found out a way to do it -- essentially, you use the macro
> mechanism, but the trick is to define the macro so that the
> quotation marks are included in the replacement text.
>
> To take your simple box example as illustration:
>
> .PS
> define bcolor { "red" }
>
> define cbox {
> box wid $1 color bcolor
> }
> .PE
> .PS
> cbox(1) "this is red"
> define bcolor { "yellow" }
> cbox(1) "this is yellow"
> .PE
>
> This ensures that occurrences of
>
> bcolor
>
> are replaced by
>
> "red"
>
> or
>
> "yellow"
>
> *including* the quotation marks!
Very nice! Ted, can you take pic.ms and add this trick to it, please?
Werner