home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / text / tex / 10828 < prev    next >
Encoding:
Text File  |  1992-09-02  |  1.8 KB  |  44 lines

  1. Path: sparky!uunet!mcsun!uknet!cam-cl!cam-cl!cet1
  2. From: cet1@cl.cam.ac.uk (C.E. Thompson)
  3. Newsgroups: comp.text.tex
  4. Subject: Re: How to test the page value of a float?
  5. Message-ID: <1992Sep2.135700.11773@cl.cam.ac.uk>
  6. Date: 2 Sep 92 13:57:00 GMT
  7. References: <1992Sep1.150736.5707@irisa.fr> <2SEP199202472416@reg.triumf.ca> <2SEP199204243745@reg.triumf.ca>
  8. Sender: pb@cl.cam.ac.uk (Piete Brooks)
  9. Reply-To: cet1@cl.cam.ac.uk (C.E. Thompson)
  10. Organization: U of Cambridge Computer Lab, UK
  11. Lines: 31
  12.  
  13. In article <2SEP199204243745@reg.triumf.ca>, asnd@reg.triumf.ca
  14. (Donald Arseneau) writes:
  15. |> In article <2SEP199202472416@reg.triumf.ca>, I wrote:
  16. |> >Use \pageref and it should work on the second pass through LaTeX.
  17. |> 
  18. |> But \pageref does not produce a pure number as it has definitions
  19. |> of \@tempa and such in it.  So it is better to steal parts of the 
  20. |> \pageref definition.
  21. |> 
  22. |> I came up with
  23. |> 
  24. |> %  Assign unique label for float:
  25. |> \edef\@tempa{\noexpand\label{F*\the\c@figure;T*\the\c@table}}\@tempa
  26. |> %  get page number of this float:  {}{number} or \relax
  27. |> \edef\@tempa{\csname r@F*\the\c@figure;T*\the\c@table\endcsname}%
  28. |> \edef\thispage{\expandafter\@cdr\@tempa\@nil\space}%
  29. |> \ifx\thispage\space\def\thispage{0 }\fi %  use 0 if unknown
  30. |> 
  31. |> Then the test \ifnum\thispage=xxx will work, but always giving 
  32. |> \thispage=0 on the first pass through the document.
  33.  
  34. Even this assumes that \thepage has not been changed from its default
  35. of \arabic{page}. If you redefine it as, say, \roman{page} then the
  36. \pageref values will change correspondingly, and you will end up trying
  37. to do things like "\ifnum iv=4". To get round this you would have to 
  38. dissect \label as well as \pageref.
  39.  
  40. Chris Thompson
  41. Cambridge University Computing Service
  42. JANET:    cet1@uk.ac.cam.phx
  43. Internet: cet1@phx.cam.ac.uk
  44.