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

  1. Path: sparky!uunet!news.univie.ac.at!scsing.switch.ch!univ-lyon1.fr!ghost.dsi.unimi.it!rpi!usc!news.service.uci.edu!unogate!mvb.saic.com!info-tex
  2. From: Martin Ward <Martin.Ward@durham.ac.uk>
  3. Newsgroups: comp.text.tex
  4. Subject: Re: Problems with false conditionals
  5. Message-ID: <AA10629.9301270942.ws-csm3@uk.ac.durham>
  6. Date: Wed, 27 Jan 93 09:42:08 GMT
  7. Organization: Info-Tex<==>Comp.Text.Tex Gateway
  8. X-Gateway-Source-Info: Mailing List
  9. Lines: 31
  10.  
  11. Michael Barr writes:
  12.  
  13. > The following four lines cause an error:
  14. > \iffalse
  15. > \newif\iftest
  16. > \fi
  17. > \bye
  18. >
  19. > On the other hand, these four don't:
  20. > \iftrue
  21. > \newif\iftest
  22. > \fi
  23. > \bye
  24. >
  25. ...
  26. >
  27. > I think the correct explanation is really the same
  28. > thing that led me to this kludge in the first place: the parser sees
  29. > \ifnnull as an \if, even when it is just being defined.  But it does not
  30. > see it as an \if when it is just a control sequence.
  31.  
  32. This is the answer - when skipping conditional text. TeX is in "fast" mode,
  33. and does not expand macros - including the \newif macro (naturally - imagine
  34. you had previously defined \def\foobar{\newif} - why should TeX know that
  35. it has to expand \foobar? What if the _definition_ of \foobar was in the
  36. conditional text).
  37.  
  38. So all your \newif declarations must come _outside_ all \if nesting.
  39.  
  40.             Martin.
  41.  
  42.