# [OS X TeX] Header Control on Float Pages?

Piet van Oostrum piet at cs.uu.nl
Wed Dec 8 04:10:47 EST 2004

>>>>> "Peter S. Burrage" <peter.s.burrage at Dartmouth.EDU> (PSB) wrote:

PSB> I'm still working through exactly what you did in that last chunk of
PSB> code so I just followed your instructions on implementation. It works
PSB> quite well except for the fact that, in the header, both the first and
PSB> second figure are labeled as Figure 1.2 despite the first figure being
PSB> 1.1 in the caption. Similarly the first and second table (second
PSB> chapter) are labeled Table 2.2 (the third table is correctly labeled
PSB> as 2.3) despite correct numbering in the captions. Seems like an off
PSB> by one error somewhere but I can't find it?

Explanation of the code:
I write in the .aux file a line like

\global \@namedef{FLT at 3}{Figure 2}

This defines a macro \FLT at 3 (which is not possible with \def because 3 is
not a letter). 3 here is the page number. This macro is then used in the
header on the next LaTeX run.

The problem is, however that the figure number is expanded at the wrong
time, namely when the figure is inserted in the page, rather than when the
figure is constructed.

Here is a new version. It doesn't even need separate \figuremark and
\tablemark commands but only a general \floatmark.

\makeatletter
\newcommand\floatref{\csname FLT@\thepage\endcsname}
\newcommand\floatmark{\let\thepage\relax\edef\tempa{%
{\global\string\@namedef{FLT@\thepage}{\csname fnum@\@captype\endcsname}}}
\expandafter\write\expandafter\@auxout\tempa}
\makeatother

--
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.van.Oostrum at hccnet.nl
--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
& FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>