Article View: comp.text.tex
Article #1993Re: How to test the page value of a float?
From: Philippe Louarn
Date: Wed, 02 Sep 1992 13:31
Date: Wed, 02 Sep 1992 13:31
40 lines
1649 bytes
1649 bytes
In article <1992Sep1.150736.5707@irisa.fr>, I write:
|> I want to be able to test the value of the page number where a floating
|> figure WILL be put.
|>
|> I tried :
|>
|> \begin{figure}[p]
|> \ifodd\value{page} <DO_SOMETHING> \else <DO_ANOTHER_THING>\fi
|> \end{figure}
|>
|> That does not run, cause the \value{page} give me the value of
|> the current page (where the figure is declared) and not the value
|> of the page where the figure will be put.
Thanks to Donald Arseneau <asnd@erich.triumf.ca> for his answer:
using something similar to \pageref
\def\floatpagenum#1{\@ifundefined{r@#1}{{\relax}\@warning
{Reference `#1' on page \thepage \space
undefined}}{\edef\@tempa{\@nameuse{r@#1}}
\edef\thispage{\expandafter\@cdr\@tempa\@nil\space}%
\ifx\thispage\space\def\thispage{0 }\fi %
}}
\begin{figure}[p]
\floatpagenum{mylabel} % setting the value of \thispage
\ifodd\thispage
<...>
\else
<...>
\fi
\caption{...}\label{mylabel}
\end{figure}
--
Philippe LOUARN - Projet OPERA / Atelier IRISA
IRISA - INRIA, u.r. de Rennes
Campus de Beaulieu - F-35042 RENNES Cedex - France
Tel : (33) 99 84 73 66 / Fax : (33) 99 32 38 38
louarn@irisa.fr
Technical Details
Message-ID:
<1992Sep2.133140.17532@irisa.fr>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!corton!irisa!irisa.fr!louarnReferences:
<1992Sep1.150736.5707@irisa.fr>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!corton!irisa!irisa.fr!louarn From: louarn@irisa.fr (Philippe Louarn) Newsgroups: comp.text.tex Subject: Re: How to test the page value of a float? Message-ID: <1992Sep2.133140.17532@irisa.fr> Date: 2 Sep 92 13:31:40 GMT References: <1992Sep1.150736.5707@irisa.fr> Sender: news@irisa.fr Organization: IRISA, Rennes (France) Lines: 40