# Clearing the footer inside tabular data after some of the content

The europecv package, which I'm using to typeset my CV, seems to use the longtable package for the whole content and this presents a problem for me. I have no direct access to the tabular commands, I only type my content between the \begin{europecv} and \end{europecv} environment.

After some content I have a \newpage and what I want is for all pages after this to have no footer at all. If I try to place a \fancyfooter{}, it doesn't work. I have realized that this does not work because it's being placed inside the tabular data. I must place it outside it, that means, outside the \begin{europecv} and \end{europecv} environment. But that will only clear the footer on the last page, which is not necessarily the only page after the \newpage mentioned above. I want to clear all of them after that command.

I tried to do the same thing, a document spawning multiple pages but without tabular data (without using the europecv environment... This time it worked as expected because the \fancyfooter{} command was not inside a tabular environment.

I have no clue how to do what I want or if it's even possible. Any ideas?

Not working example:

\documentclass[helvetica,narrow,totpages]{europecv}
\usepackage{graphicx}
\usepackage{lipsum}
\begin{document}
\begin{europecv}
\ecvsection{Section}
\ecvitem{Item}{\lipsum[1]}
\ecvitem{Item}{\lipsum[2-3]}
\newpage % I want to clear the footer on all pages AFTER this command
%\fancyfoot{} % If used here, clears the footer on ALL pages
\ecvsection{Section}
\ecvitem{Item}{\lipsum[4-5]}
\ecvitem{Item}{\lipsum[6]}
\ecvitem{Item}{\lipsum[7]}
\end{europecv}
\fancyfoot{} % If used here, clears the footer on the LAST page only
\end{document}


Working example:

\documentclass[helvetica,narrow,totpages]{europecv}
\usepackage{graphicx}
\usepackage{lipsum}
\begin{document}
\lipsum[1-10]
\newpage
\fancyfoot{} % Clears the footer on all pages AFTER \newpage (last 2 in this example)
\lipsum[1-10]
\end{document}


This works because the content is not inside the europecv environment and thus is not inside any table (looking at the europecv package, the \newenvironment{europecv} uses longtable.

Full document example: http://pastebin.com/ExF7W5LC

-
Please edit your question and add a short example code that reproduces the problem. –  Ian Thompson Sep 6 '12 at 21:52
@IanThompson Sorry about that... It's more complete now. –  Ricardo Amaral Sep 7 '12 at 1:01

You need to ensure that TeX has not seen the redefinition of the footer by the time the page that needs the footer is shipped out. You can reduce the amount of lookahead that happens in longtable by setting its chunksize to 1.

\documentclass[helvetica,narrow,totpages]{europecv}
\usepackage{graphicx}
\usepackage{lipsum}
\LTchunksize=1
\begin{document}
\begin{europecv}
\ecvsection{Section}
\ecvitem{Item}{\lipsum[1]}
\ecvitem{Item}{\lipsum[2-3]}
\newpage % I want to clear the footer on all pages AFTER this command
\ecvsection{Section}
\ecvitem{Item}{\lipsum[4-5]}
\fancyfoot{} % If used here, clears the footer on ALL pages
\ecvitem{Item}{\lipsum[6]}
\ecvitem{Item}{\lipsum[7]}

\end{europecv}

\end{document}

-
That clears the footer on ALL pages too... –  Ricardo Amaral Sep 7 '12 at 11:40
I supplied a different answer:-) –  David Carlisle Sep 7 '12 at 11:56
That works fine on the sample, but on my real document, not quite, but almost... For some reason, placing the \fancyfoot just after \newpage it's clearing the footer from the last 3 pages (there's a total of 5 and after \newpage there's 2). If I place \fancyfoot somewhere after \newpage in between the last 2 pages content, it eventually works as expected. But I fell I'll need to move the \fancyfoot command around when the length of my content changes (either before or after \newpage). Any idea how to fix this without having to post my long full document? –  Ricardo Amaral Sep 7 '12 at 12:13
I've posted the full document here: pastebin.com/ExF7W5LC The \newpage is on line 302 (it's the only one) followed by \fancyfoot and \LTchunksize is on line 72. There's only 2 pages after \newpage but the footer is also missing from the third page. –  Ricardo Amaral Sep 7 '12 at 12:36
Basically because of the asynchronous nature of the output routine changing headings mid document is likely to cause such problems. In normal text you can get away with doing it just after \clearpage as that forces latex to ship out all pages collected so far, but for various reasons \newpage in longtable doesn't have quite such an immediate effect. I may look but I can't promise an improvement. One way that would be more robust would be to set a special \mark in the table and then test that mark in the heading and clear itself if the mark is there. (haven't time today, someone might step in:) –  David Carlisle Sep 7 '12 at 13:58