home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.text.tex
- Path: sparky!uunet!cs.utexas.edu!sun-barr!sh.wide!wnoc-kyo!kyu-cs!inunaki.csce.kyushu-u!masroor
- From: masroor@human.ai.kyushu-u.ac.jp (Muhammad Masroor Ali)
- Subject: Re: continued on the next page
- References: <1992Nov19.175017.11698@informatik.uni-bremen.de>
- Nntp-Posting-Host: human.ai.kyushu-u.ac.jp
- Message-ID: <MASROOR.92Nov20170305@human.ai.kyushu-u.ac.jp>
- Organization: Dept. of Comp. Sci. and Comm. Eng., Kyushu Univ., Fukuoka, Japan
- In-Reply-To: ms@lehre23.informatik.Uni-Bremen.DE's message of Thu, 19 Nov
- 1992 17:50:17 GMT
- Sender: news@csce.kyushu-u.ac.jp (USENET News System)
- Date: Fri, 20 Nov 1992 08:03:05 GMT
- X-Bytes: 2574
- Lines: 102
-
- I am posting it over here because my mail to Martin Schroder bounced
- back.
-
- <Mail Begins>
-
-
-
- >I want a footline in latex (in oddfoot and evenfoot)
- >that tests, if the current page is the last
- >page, otherwise it outputs some text
- >(like "`continued on the next page"').
- >How?
-
-
-
- So far as I know, you have got to make two passes
- to accomplish this. Declare a variable, say \PassIndicator.
- This variable will change values to 1 and -1 to
- indicate first and second passes respectively. In the first pass,
- write the last page number and any other information you
- want to save, to a file, say Test.INF,
- using the write command. And then multiply
- \PassIndicator by -1 (to change its sign) and save it in a file
- say Test.EGG. In the second pass, read the informations saved in the
- file Test.INF and use them to make your desired footline
- or anything you like.
-
-
- A word of caution, don't try to accomplish
- the above in a single pass. I simply wasted three days
- to generate index for a file in single pass. For more details,
- please see page 227 of The TeXbook.
-
-
- I am sending to macro file I use, to save the labor of writing them
- by yourself.
-
-
-
-
- % This macro reads the current pass indicator value from .EGG file
-
- \newcount\PassIndicator
- \newread\EggFileIn
- \newcount\temp
-
- \def\GetPassIndicator{
- % Check if the Test.EGG file exists
- \openin\EggFileIn = Test.EGG
- \ifeof\EggFileIn
- \PassIndicator = 1
- \message{[Egg file does not exist, pass indicator value assumed]}
- \else
- \read\EggFileIn to \temp
- \PassIndicator = \number\temp %Convert from character to number
- \message{[Egg file exists, pass indicator value read in]}
- \fi
- \closein\EggFileIn
- }
-
-
-
- % This macro changes the sign of the pass indicator and
- % re-stores in the .EGG file
-
- \newwrite\EggFileOut
- \def\SavePassIndicator{
- \Message{[Saving pass indicator with sign reversed]}
- \multiply\PassIndicator by -1
- \openout\EggFileOut = Test.EGG
- \write\EggFileOut{\the\PassIndicator}
- \closeout\EggFileOut
- }
-
-
-
-
- In your main file, Test.TEX, use the if command,
-
- \ifnum\PassIndicator=1
- <Tasks for first pass>
- \else
- <Tasks for second pass>
- \fi
-
-
-
- Hope these help.
-
-
- --
- -----------------------------------------------------------------------
- Who says `Nothing' is impossible? I am doing nothing throughout years.
- _______________________________________________________________________
-
- masroor@human.ai.kyushu-u.ac.jp (Muhammad Masroor Ali)
- Department of Computer Science and Communication Engineering
- Faculty of Engineering, Kyushu University
- Fukuoka, 812 JAPAN
-
-
-
-