[OS X TeX] LastPage Reference

Roussanka Loukanova rloukano at stp.lingfil.uu.se
Wed Mar 7 01:29:35 CET 2007


On Tue, 6 Mar 2007, Maurino Bautista wrote:

> I copied the following code from Roussanka's posting which works
> properly. I added the lines marked with %%%  and I commented the right
> footer command. I now get the following error:
>
> AED: lastpage setting LastPage
> ! Missing number, treated as zero.
> <to be read again>
>                  \protect
> l.46 \end{document}

It looks to me that no page number has been assigned to LastPage.
Your tex code has typeset ok on my MacBook Pro with gwTeX and TeXLive07 
with both pdftex and latex commands. I have added a 2nd page and all is 
the way you intended: (over) on p.1; the date on p.2.

I'm not sure, but perhaps you could try to run latex (pdflatex) a couple 
of times. (In any way, I did not get any error message in the output 
buffer, nor in the log.)

Roussanka

  >
> Anybody knows what is wrong? All I know is that the package hyperref
> uses (or modifies-redefines-omits?? ) the LastPage reference.
>
> Here is Roussanka's code with the modifications:
>
> ***********************************************************************************************************************************
>
> \documentclass[12pt]{article}
>
> \usepackage[total={6.5in,9.3in},top=1in, left=1in]{geometry} %%%
>
> \usepackage{lmodern}
> \usepackage[T1]{fontenc}
> \usepackage[latin9]{inputenc}
> \usepackage{textcomp}
>
> \usepackage{url}
> \usepackage[unicode,bookmarks,colorlinks]{hyperref}
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \usepackage{fancyhdr}
> \pagestyle{fancy}
>
> \usepackage{lastpage} %%%
> \usepackage{ifthen} %%%
>
> \renewcommand{\headrulewidth}{0.4pt}
> \renewcommand{\footrulewidth}{0pt}
>
> \addtolength{\headheight}{14pt} % space for the rule
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \lhead{\small Roussanka Loukanova \hfill
> $<$\href{mailto:rloukano at stp.lingfil.uu.se}%
> {rloukano at stp.lingfil.uu.se }$>$}
>
> \chead{}
> \rhead{}
> \lfoot{\ifthenelse{\value{page}=\pageref{LastPage}}{\tiny\today}} %%%
> \cfoot{\ifthenelse{\not\value{page}=\pageref{LastPage}}{\scriptsize (over)}} 
> %%%
> %\rfoot{\thepage}
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \begin{document}
>
> Long URL:
>
> \url{http://science.nasa.gov/headlines/y2007/12feb_lunareclipse.htm }
>
> Another WEB address:
>
> $<$\url{http://news.bbc.co.uk/2/hi/science/nature/6411991.stm}$>$
>
> \end{document}
>
> ***********************************************************************************************************************************

------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the macostex-archives mailing list