groff
[Top][All Lists]
Advanced

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

Re: [Groff] how to use .GETST in a figure caption?


From: Anton Shepelev
Subject: Re: [Groff] how to use .GETST in a figure caption?
Date: Wed, 22 Aug 2012 19:35:50 +0400

I wrote:

> Anton Shterenlikht:
>
> > > Also,  you  can  use  the  second  argument to
> > > .GETST to save the reference into a string and
> > > use that in the caption.
> >
> > Thanks, this works:
> >
> >     .PSPIC rep-cold-mises-mesh.ps 6.0
> >     .ds caption "Mises stress in the 0.3 mm notch model
> >     .as caption " at \*[cold]\"
> >     .as caption " at \*[ep02]\"
> >     .as caption " at the notch root.
> >     .as caption " The fine grain material is at the top,\"
> >     .as caption " and the coarse grain material is at the\"
> >     .as caption " bottom. The discontinuity of stress at\"
> >     .as caption " the boundary is cleary visible.\"
> >     .FG "\*[caption]" "" 0 fig:cold-mises-mesh
> >     .SETR fig:cold-mises-mesh
> >     .DE
> >
> >     .DS CB
> >     .PSPIC rep-cold-mises-nomesh.ps 6.0
> >     .ds caption "Same as Fig.\"
> >     .as caption " .GETST fig:cold-mises-mesh,\"
> >     .as caption " but with mesh not shown for clarity.\"
> >     .FG "\*[caption]" "" 0 fig:cold-mises-nomesh
> >     .SETR fig:cold-mises-nomesh
> >     .DE
>
> But it's not what I meant.  A couple of notes:
>
>   a.  The  calls  of .SETR in your example are re-
>       dundant in both  cases  because  the  corre-
>       sponding  references  are already set by the
>       previous call of .FG via  its  fourth  argu-
>       ment.
>
>   b.  Your  version  works  only because .FG, when
>       called   from   within   a   display,   uses
>       address@hidden         instead        of
>       address@hidden  The former relies  on  de-
>       layed  expantion  (see  escape  '\!')  which
>       causes a macro call within a  string  to  be
>       interpreted.
>
> I was suggesting to call
>
>     .ds rsql\" to smother an error message on first pass
>     .GETST fig:cold-mises-mesh ref:cmm
>
> in  the beginning of the ducument and then use the
> resulting string \*[ref:cmm] in captions.

By the way, this innocuous error  message  could  be
mended by modifying mm's .GETST so that on the first
pass it would initialize the string  passed  in  the
second  argument with a dummy value instead of skip-
ping its creation.

Werner, would you approve it?

-- 
()  ascii ribbon campaign - against html e-mail 
/\  www.asciiribbon.org   - against proprietary attachments



reply via email to

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