[Top][All Lists]
[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:22:37 +0400 |
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 redun-
dant in both cases because the corresponding
references are already set by the previous
call of .FG via its fourth argument.
b. Your version works only because .FG, when
called from within a display, uses
address@hidden instead of address@hidden
The former relies on delayed 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.
--
() ascii ribbon campaign - against html e-mail
/\ www.asciiribbon.org - against proprietary attachments