home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / text / tex / 13352 < prev    next >
Encoding:
Text File  |  1992-11-19  |  3.2 KB  |  118 lines

  1. Newsgroups: comp.text.tex
  2. Path: sparky!uunet!cs.utexas.edu!sun-barr!sh.wide!wnoc-kyo!kyu-cs!inunaki.csce.kyushu-u!masroor
  3. From: masroor@human.ai.kyushu-u.ac.jp (Muhammad Masroor Ali)
  4. Subject: Re: continued on the next page
  5. References: <1992Nov19.175017.11698@informatik.uni-bremen.de>
  6. Nntp-Posting-Host: human.ai.kyushu-u.ac.jp
  7. Message-ID: <MASROOR.92Nov20170305@human.ai.kyushu-u.ac.jp>
  8. Organization: Dept. of Comp. Sci. and Comm. Eng., Kyushu Univ., Fukuoka, Japan
  9. In-Reply-To: ms@lehre23.informatik.Uni-Bremen.DE's message of Thu, 19 Nov 
  10.     1992 17:50:17 GMT
  11. Sender: news@csce.kyushu-u.ac.jp (USENET News System)
  12. Date: Fri, 20 Nov 1992 08:03:05 GMT
  13. X-Bytes: 2574
  14. Lines: 102
  15.  
  16. I am posting it over here because my mail to Martin Schroder bounced
  17. back.
  18.  
  19. <Mail Begins>
  20.  
  21.  
  22.  
  23.     >I want a footline in latex (in oddfoot and evenfoot)
  24.     >that tests, if the current page is the last
  25.     >page, otherwise it outputs some text
  26.     >(like "`continued on the next page"').
  27.     >How?
  28.  
  29.  
  30.  
  31. So far as I know, you have got to make two passes
  32. to accomplish this. Declare a variable, say \PassIndicator.
  33. This variable will change values to 1 and -1 to
  34. indicate first and second passes respectively. In the first pass,
  35. write  the last page number and any other information you
  36. want to save, to a file, say Test.INF,
  37. using the write command. And then multiply
  38. \PassIndicator by -1 (to change its sign) and save it in a file
  39. say Test.EGG. In the second pass, read the informations saved in the 
  40. file Test.INF and use them to make  your desired footline
  41. or anything you like.
  42.  
  43.  
  44. A word of caution, don't try to accomplish
  45. the above in a single pass. I simply wasted three days
  46. to generate index for a file in single pass. For more details,
  47. please see page 227 of The TeXbook.
  48.  
  49.  
  50. I am sending to macro file I use, to save the labor of writing them 
  51. by yourself.
  52.  
  53.  
  54.  
  55.  
  56. % This macro reads the current pass indicator value from .EGG file
  57.  
  58. \newcount\PassIndicator
  59. \newread\EggFileIn
  60. \newcount\temp
  61.  
  62. \def\GetPassIndicator{
  63.     % Check if the Test.EGG file exists
  64.     \openin\EggFileIn = Test.EGG
  65.     \ifeof\EggFileIn
  66.         \PassIndicator = 1
  67.         \message{[Egg file does not exist, pass indicator value assumed]}
  68.     \else
  69.         \read\EggFileIn to \temp 
  70.         \PassIndicator = \number\temp        %Convert from character to number
  71.         \message{[Egg file exists, pass indicator value read in]}
  72.     \fi
  73.     \closein\EggFileIn
  74.     }
  75.  
  76.  
  77.  
  78. % This macro changes the sign of the pass indicator and
  79. % re-stores in the .EGG file
  80.  
  81. \newwrite\EggFileOut
  82. \def\SavePassIndicator{
  83.     \Message{[Saving pass indicator with sign reversed]}
  84.     \multiply\PassIndicator by -1
  85.     \openout\EggFileOut = Test.EGG
  86.     \write\EggFileOut{\the\PassIndicator}
  87.     \closeout\EggFileOut
  88.     }
  89.  
  90.  
  91.  
  92.  
  93. In your main file, Test.TEX, use the if command,
  94.  
  95. \ifnum\PassIndicator=1
  96.     <Tasks for first pass>
  97. \else
  98.     <Tasks for second pass>
  99. \fi
  100.  
  101.  
  102.  
  103. Hope these help.
  104.  
  105.  
  106. --
  107.    -----------------------------------------------------------------------
  108.     Who says `Nothing' is impossible? I am doing nothing throughout years. 
  109.    _______________________________________________________________________
  110.  
  111.     masroor@human.ai.kyushu-u.ac.jp (Muhammad Masroor Ali)
  112.     Department of Computer Science and Communication Engineering
  113.     Faculty of Engineering, Kyushu University
  114.     Fukuoka, 812 JAPAN
  115.  
  116.     
  117.         
  118.