[Tex/LaTex] How to suppress footer on individual page

header-footer

I've got a report document that consists of daily and weekly reports. Each week gets its corresponding shorthanded five days report on one page and a more detailed full week report on the second page. So it's two pages for each week. Each list of five days and each full week report gets a signature line in its footer. So if there are only one paged week reports there will be a signature line on every page but the title page (title page without headers and footers actually works like a charm).

Each week is started by a \newpage command and there is a \newpage between the daily and the full week report. So it looks somehow like this:

[titlepage]
[ 
  - day 1 | lorem ipsum
  - day 2 | lorem ipsum
  - day 3 | lorem ipsum
  - day 4 | lorem ipsum
  - day 5 | lorem ipsum


  _______________
  signature             #pageno
  \newpage
]
[
  full week lorem ipsum


  _______________
  signature             #pageno
  \newpage
]

Now, on a week report that does not fit on a single page I'd like to have the signature line only on the last page of the detailed week report. That is, I'd like to suppress the signature line on every page that does not end with \newpage, i.e. that is automatically wrapped because of its content being to long.

Any advice would be greatly appreciated.

Best Answer

Automatically partially hidden footers can be achieved by creating a custom style (adding a .sty file in the same directory the .tex file is lying). In my special case it looks kinda like this...

Method 1

Firstly the footers (example.tex):

\lofoot{Left odd footer}
\lefoot{Left even footer}

Secondly the command (example.tex):

\newcommand{\example}[2]{
    \section*{#1}
    \thispagestyle{custom}
    #2
    \thispagestyle{scrheadings}
    \newpage
}

Thirdly the style (custom.sty)

\newcommand{\ps@custom}
    \lofoot{} % empty left footers
    \lefoot{} % empty left footers
}

... which means that the style stays scrheadings on one page week reports and gets changed to custom on reports with more than one page.

This is a somewhat dirty solution at least for reports (using \example command which looks and is named a little bit different here) that consist of one or two pages. I haven't tested it against reports consisting of three or more pages, yet. Maybe someone could predict in a comment how this might behave there...

Method 2 - redefining \newpage (or defining an appropriate substitute)

Just to mention: this is somehow the inversion of Method 1. It's not defining a general footer for signature that appears on any page but those that are automatically wrapped (like Method 1). It only defines footers for pages that are manually wrapped.

So, with a redefinition of the \newpage command one can achieve this goal too. If you only want a footer to appear on a page previous to one that has been started by a manual page break, just do the following somewhere before your \begin{document} or in a custom page style. Like this for instance:

\renewcommand{\newpage}{
    \lofoot{
        \begin{tabular}{p{10cm}}
        \hline Unterschrift \\
        \end{tabular}
    }

    \lefoot{
        \begin{tabular}{p{10cm}}
        \hline Unterschrift \\
        \end{tabular}
    }
    \pagebreak
    \lefoot{}
    \lefoot{}
}
Related Question