🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.tex
Article #1997

Re: How to test the page value of a float?

#1997
From: C.E. Thompson
Date: Wed, 02 Sep 1992 13:57
31 lines
1860 bytes
In article <2SEP199204243745@reg.triumf.ca>, asnd@reg.triumf.ca
(Donald Arseneau) writes:
|> In article <2SEP199202472416@reg.triumf.ca>, I wrote:
|> >Use \pageref and it should work on the second pass through LaTeX.
|> 
|> But \pageref does not produce a pure number as it has definitions
|> of \@tempa and such in it.  So it is better to steal parts of the 
|> \pageref definition.
|> 
|> I came up with
|> 
|> %  Assign unique label for float:
|> \edef\@tempa{\noexpand\label{F*\the\c@figure;T*\the\c@table}}\@tempa
|> %  get page number of this float:  {}{number} or \relax
|> \edef\@tempa{\csname r@F*\the\c@figure;T*\the\c@table\endcsname}%
|> \edef\thispage{\expandafter\@cdr\@tempa\@nil\space}%
|> \ifx\thispage\space\def\thispage{0 }\fi %  use 0 if unknown
|> 
|> Then the test \ifnum\thispage=xxx will work, but always giving 
|> \thispage=0 on the first pass through the document.

Even this assumes that \thepage has not been changed from its default
of \arabic{page}. If you redefine it as, say, \roman{page} then the
\pageref values will change correspondingly, and you will end up trying
to do things like "\ifnum iv=4". To get round this you would have to 
dissect \label as well as \pageref.

Chris Thompson
Cambridge University Computing Service
JANET:    cet1@uk.ac.cam.phx
Internet: cet1@phx.cam.ac.uk
Technical Details
Message-ID: <1992Sep2.135700.11773@cl.cam.ac.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!cam-cl!cam-cl!cet1
References: <1992Sep1.150736.5707@irisa.fr> <2SEP199202472416@reg.triumf.ca> <2SEP199204243745@reg.triumf.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!cam-cl!cam-cl!cet1
From: cet1@cl.cam.ac.uk (C.E. Thompson)
Newsgroups: comp.text.tex
Subject: Re: How to test the page value of a float?
Message-ID: <1992Sep2.135700.11773@cl.cam.ac.uk>
Date: 2 Sep 92 13:57:00 GMT
References: <1992Sep1.150736.5707@irisa.fr> <2SEP199202472416@reg.triumf.ca> <2SEP199204243745@reg.triumf.ca>
Sender: pb@cl.cam.ac.uk (Piete Brooks)
Reply-To: cet1@cl.cam.ac.uk (C.E. Thompson)
Organization: U of Cambridge Computer Lab, UK
Lines: 31