Article View: comp.text
Article #3057Re: extended \*(xx sequence for .RS/.RF; is it possible?
From: Marc Guillemont
Date: Tue, 26 Jan 1993 07:55
Date: Tue, 26 Jan 1993 07:55
89 lines
3702 bytes
3702 bytes
From article <1993Jan26.004554.28410@porthos.cc.bellcore.com>, by tony2@prefect.cc.bellcore.com (gozdz,antoni s):
> I did not complain that the number of combinations that
> could be used in the .RS/.RF pairs is too small;
> these two-character strings are just difficult to
> remember when needed again for re-referencing.
>
> The solution offered might do the job, but obviously,
> it's not as painless as it might/should be.
I have been facing this problem for using forward and backward references
to other sections, tables, figures, equations, etc... and I found also that
two-letters names were simply unusable because it is too difficult to
remember the names. So, I wrote a couple of macros (to be used with the
"mm" macros, but which could be adapted to other packages) which work as
follows:
1/ In the text, when you come to a point where you want to save a
reference, you just call one macro (.tR) with whatever name you want, which
will designate this reference
.tR name_of_the_reference
2/ In the text, when you come to a point where you want to retrieve a
reference, you just call the second macro (.gR) with the proper name
.gR name_of_the_reference
and the macro fills a set of variables with fixed names containing the page
number of the reference, the current section name, etc... E.g.
rP = page number
rH = current section number
rF = current figure number
etc..
At that point, you just have to use these variables as you need.
3/ Example:
This section is dealing with cross references
.tR cross_references
[.....]
In the section dedicated to cross references
.gR cross_references
(see section \*(rH), [.....]
4/ Of course, you need a two-pass processing of your text in order to
process forward references.
5/ The way these macros operate is very simple: they use tuples of
variables named *x, %x, ~x, etc. where "x" vary in [0-9,A-Z,a-z]. Each time
you require to keep a reference (.tR), the macros looks for a new tuple
(i.e. a new value of "x") and stores in
*x = your name ("name_of_the_reference")
%x = the page number
~x = the current section number
etc...
When you are looking for a reference (.gR), the macro looks for the
variable *x containing the name given and restores the %x, ~x, etc.. values
in the pre-defined variables.
Finally, the macro .tR prints on the standard output (with .tm) the
definition of the internal variables, which gives a file like this
.ds *0 first_reference
.ds %0 23
.ds ~0 1.1
.ds *1 second_reference
.ds %1 24
.ds ~1 1.3.1
etc...
During the first pass of your text processing, the file is produced; during
the second pass, this file is inserted at the beginning of your text, so
that .gR is able to solve all references. A couple of additional hacks
allows the whole thing to work.
This macro package is available upon request.
--
_/_/_/_/_/ _/ _/ _/_/_/_/_/ _/ _/
_/ _/ _/_/ _/_/ _/ _/ _/
_/_/_/_/_/ _/_/_/ _/ _/ _/ _/ _/_/ _/ _/
_/ _/ _/ _/ _/ _/ _/ _/
_/ _/ _/ _/ _/_/_/_/_/ _/_/_/_/_/
Marc Guillemont Tel: +33 (1) 30 64 82 21
Chorus syste`mes Fax: +33 (1) 30 57 00 66
Technical Details
Message-ID:
<1879@chorus.chorus.fr>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!julienas!chorus!chorus.frReferences:
<1993Jan26.004554.28410@porthos.cc.bellcore.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!julienas!chorus!chorus.fr From: mgu@chorus.fr (Marc Guillemont) Newsgroups: comp.text Subject: Re: extended \*(xx sequence for .RS/.RF; is it possible? Message-ID: <1879@chorus.chorus.fr> Date: 26 Jan 93 07:55:14 GMT References: <1993Jan26.004554.28410@porthos.cc.bellcore.com> Sender: news@chorus.chorus.fr Lines: 89