home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / text / 1626 < prev    next >
Encoding:
Internet Message Format  |  1993-01-26  |  3.5 KB

  1. Path: sparky!uunet!mcsun!julienas!chorus!chorus.fr
  2. From: mgu@chorus.fr (Marc Guillemont)
  3. Newsgroups: comp.text
  4. Subject: Re: extended \*(xx sequence for .RS/.RF; is it possible?
  5. Message-ID: <1879@chorus.chorus.fr>
  6. Date: 26 Jan 93 07:55:14 GMT
  7. References: <1993Jan26.004554.28410@porthos.cc.bellcore.com>
  8. Sender: news@chorus.chorus.fr
  9. Lines: 89
  10.  
  11. From article <1993Jan26.004554.28410@porthos.cc.bellcore.com>, by tony2@prefect.cc.bellcore.com (gozdz,antoni s):
  12.  
  13. > I did not complain that the number of combinations that
  14. > could be used in the .RS/.RF pairs is too small;
  15. > these two-character strings are just difficult to 
  16. > remember when needed again for re-referencing.
  17. > The solution offered might do the job, but obviously, 
  18. > it's not as painless as it might/should be.
  19.  
  20. I have been facing this problem for using forward and backward references
  21. to other sections, tables, figures, equations, etc... and I found also that
  22. two-letters names were simply unusable because it is too difficult to
  23. remember the names. So, I wrote a couple of macros (to be used with the
  24. "mm" macros, but which could be adapted to other packages) which work as
  25. follows:
  26.  
  27. 1/ In the text, when you come to a point where you want to save a
  28. reference, you just call one macro (.tR) with whatever name you want, which
  29. will designate this reference
  30.  
  31. .tR name_of_the_reference
  32.  
  33. 2/ In the text, when you come to a point where you want to retrieve a
  34. reference, you just call the second macro (.gR) with the proper name
  35.  
  36. .gR name_of_the_reference
  37.  
  38. and the macro fills a set of variables with fixed names containing the page
  39. number of the reference, the current section name, etc... E.g.
  40.  
  41. rP = page number
  42. rH = current section number
  43. rF = current figure number
  44. etc..
  45.  
  46. At that point, you just have to use these variables as you need.
  47.  
  48. 3/ Example:
  49.  
  50. This section is dealing with cross references
  51. .tR cross_references
  52. [.....]
  53. In the section dedicated to cross references
  54. .gR cross_references
  55. (see section \*(rH), [.....]
  56.  
  57. 4/ Of course, you need a two-pass processing of your text in order to
  58. process forward references. 
  59.  
  60. 5/ The way these macros operate is very simple: they use tuples of
  61. variables named *x, %x, ~x, etc. where "x" vary in [0-9,A-Z,a-z]. Each time
  62. you require to keep a reference (.tR), the macros looks for a new tuple
  63. (i.e. a new value of "x") and stores in
  64. *x = your name ("name_of_the_reference")
  65. %x = the page number
  66. ~x = the current section number
  67. etc...
  68.  
  69. When you are looking for a reference (.gR), the macro looks for the
  70. variable *x containing the name given and restores the %x, ~x, etc.. values
  71. in the pre-defined variables.
  72.  
  73. Finally, the macro .tR prints on the standard output (with .tm) the
  74. definition of the internal variables, which gives a file like this
  75.  
  76. .ds *0 first_reference
  77. .ds %0 23
  78. .ds ~0 1.1
  79. .ds *1 second_reference
  80. .ds %1 24
  81. .ds ~1 1.3.1
  82. etc...
  83.  
  84. During the first pass of your text processing, the file is produced; during
  85. the second pass, this file is inserted at the beginning of your text, so
  86. that .gR is able to solve all references. A couple of additional hacks
  87. allows the whole thing to work.
  88.  
  89. This macro package is available upon request.
  90. --
  91.     _/_/_/_/_/                _/      _/  _/_/_/_/_/  _/      _/
  92.    _/      _/                _/_/  _/_/  _/          _/      _/
  93.   _/_/_/_/_/  _/_/_/        _/  _/  _/  _/    _/_/  _/      _/
  94.  _/          _/            _/      _/  _/      _/  _/      _/
  95. _/          _/            _/      _/  _/_/_/_/_/  _/_/_/_/_/
  96.  
  97. Marc Guillemont                         Tel: +33 (1) 30 64 82 21
  98. Chorus syste`mes                        Fax: +33 (1) 30 57 00 66
  99.