home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / text / tex / 11020 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  3.8 KB

  1. Path: sparky!uunet!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!news.claremont.edu!ucivax!news.service.uci.edu!unogate!mvb.saic.com!info-tex
  2. From: MJD@MATH.AMS.ORG (Michael Downes)
  3. Newsgroups: comp.text.tex
  4. Subject: Re: \outer
  5. Message-ID: <715961400.704754.MJD@math.ams.org>
  6. Date: 8 Sep 92 14:10:00 GMT
  7. Organization: Info-Tex<==>Comp.Text.Tex Gateway
  8. Lines: 73
  9. X-Gateway-Source-Info: Mailing List
  10.  
  11. Dan Luecking wrote:
  12.  
  13. > On 3 Sep 92, eijkhout@cupid.cs.utk.edu (Victor Eijkhout) said (among other
  14. > things):
  15. >
  16. > >
  17. > >The outer-ness implies that such macros cannot appear as macro
  18. > >arguments or in macro bodies,
  19. > >something that makes sense for things such as \theorem.
  20. >                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  21. > Wrong. I write mathematical papers and am mostly content with plain TeX's
  22. > \proclaim macro. But sometimes I have to add material in front of or after
  23. > every theorem. The easiest way to do this is (or would be if not for
  24. > \outer-ness)
  25. >
  26. > \def\Proclaim#1#2\par{%
  27. > <preliminary stuff>\proclaim#1. #2\par<closing stuff>}
  28. >
  29. > Another possibility denied me: \def\lemma#1\par{\proclaim Lemma. #1\par}
  30.  
  31. An easy trick for getting around that hindrance was given by
  32. \`Eamonn McManus in TeXhax vol 90 issue 64 (Oct 7 1990): Use
  33.  
  34.   \csname proclaim\endcsname
  35.  
  36. instead of \proclaim inside the definition. If TeX executes this
  37. string it will turn into \proclaim, but if TeX is simply reading it
  38. into a definition or skipping it on the false branch of an if
  39. statement, it is innocuous. I suspect Victor might mention this
  40. somewhere in his book (`TeX by Topic'), though I don't recall offhand.
  41.  
  42. > According to the TeXbook ``...a user shouldn't be stating a theorem as part
  43. > of a definition...''
  44. > I can't think of any sentence in the Texbook more absurd than this one!
  45. > I don't want to state a theorem, just modify the definition of \proclaim
  46. > without having to rewrite the whole thing.
  47.  
  48. Your point of view is based on your decision that you do not want the
  49. error-catching capabilities of outer macros. I'll not beef against
  50. that, but just say that there are others (at least myself) who find
  51. them useful rather than annoying. I write a fair amount of TeX macro
  52. code and find that one of my most frequent errors is leaving off a
  53. closing brace for a definition (yes, even with Emacs and its
  54. auto-matching braces, I still sometimes forget to check).  Lately I
  55. have gone to using a \newmacro ... \endmacro structure around each
  56. definition with \endmacro being \outer.  This pinpoints the source of
  57. a missing close-brace error about as fast and accurately as possible.
  58.  
  59. > The stated reason (in the TeXbook) for \outer-ness is as an error
  60. > catching tool. However, the error messages generated are singularly
  61. > unhelpful.
  62.  
  63. It may be that the \outer attribute is more useful to macro writers
  64. than to document writers. On the other hand, if you throw away all use
  65. of \outer, then missing \fi's or closing braces for definitions are
  66. only caught by end-of-file or by TeX running out of main memory. The
  67. error messages for these are if anything less helpful in locating the
  68. source of the problem than the error message generated by an outer
  69. control sequence. And if you are running a big version of TeX, TeX
  70. will usually not give you the error message until it has read an
  71. entire article or book chapter without typesetting anything.
  72.  
  73. > ... Moreover \outer macros are forbidden ``where tokens are
  74. > being absorbed at high spead''.  What has the speed of absorption
  75. > got to do with error trapping?
  76.  
  77. It's not the speed that's important, it's the fact that the high-speed
  78. absorption of tokens goes hand-in-hand with the possibility of a
  79. runaway condition---the problem that \outer is designed to catch---in
  80. places like the false branch of a conditional, or the replacement text
  81. of a definition.
  82.  
  83. Michael Downes                              mjd@math.ams.org (Internet)
  84.