2

I am using fancyhdr to hide header and footer in some pages but I also want to write custom footers for certain pages. Is there an easy way to do it?

Or is there any way to put define text in the center of footer?

I am using XeTeX.

  • 1
    Welcome to TeX.sx! Can you describe your wishes more precisely, e.g. via a minimal working example (MWE). There are at least two ways to do this: (1) change pagestyle for the given page or (2) use the mark mechanisms described in the fancyhdr documentation. Which is more appropriate depends on how the changes in the footer are to be triggered. – Andrew Swann Jan 28 '13 at 11:42
4

There is a standard way to do so in fancyhdr, however, I added something like "copy {fancy} style into {footmark} style" so that you don't have to change everything:

\makeatletter
% new style {footmark}
\fancypagestyle{footmark}{
  \ps@@fancy % use {fancy} style as a base of {footmark}
  \fancyfoot[C]{\footmark}
}
% sets value of \footmark and sets the correct style for this page only
\newcommand\markfoot[1]{\gdef\footmark{#1}\thispagestyle{footmark}}
\makeatother

And in the document, in a text that is on the page, you say:

\markfoot{This is foot text.}

This should print This is foot text. centered in the footer of the current page.

  • @user25118 that's a non-sense. Then you want probably something completely different and you ought to specify the question. – yo' Jan 28 '13 at 12:40
  • the problem in this solution that I need to define tens of new styles in preamble to accommodate my needs. I want something like \thispagestyle command. It may be called \thisfancyfoot command. – Fahad Al-Saidi Jan 28 '13 at 12:41
  • Now, there's the \footmark command that prints its argument in footer and on current page only. – yo' Jan 28 '13 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.