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

  1. Newsgroups: comp.text.tex
  2. Path: sparky!uunet!wupost!gumby!destroyer!ubc-cs!unixg.ubc.ca!reg.triumf.ca!asnd
  3. From: asnd@reg.triumf.ca (Donald Arseneau)
  4. Subject: Re: How to test the page value of a float?
  5. Message-ID: <2SEP199204243745@reg.triumf.ca>
  6. Summary: steal parts of the \pageref definition 
  7. News-Software: VAX/VMS VNEWS 1.41    
  8. Sender: news@unixg.ubc.ca (Usenet News Maintenance)
  9. Nntp-Posting-Host: reg.triumf.ca
  10. Organization: TRIUMF: Tri-University Meson Facility
  11. References: <1992Sep1.150736.5707@irisa.fr> <2SEP199202472416@reg.triumf.ca>
  12. Date: Wed, 2 Sep 1992 11:24:00 GMT
  13. Lines: 20
  14.  
  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. Donald Arseneau           asnd@reg.triumf.ca
  35.