13

Does anyone know how I can make \rfoot at only 1 page.

I am using report as document class, and in my preface I want my name and city at the right side at the bottom of the page

5
  • 3
    The solution may to depend on the document class you're you using? Consider editing your question to add a minimal working example (MWE).
    – jub0bs
    Jan 5, 2015 at 19:51
  • I am using report as document class, and in my preface I want my name and city at the right side at the bottom of the page Jan 5, 2015 at 20:05
  • Is your preface consisting of what is also known as a frontmatter, or are you talking about the title page?
    – Johannes_B
    Jan 5, 2015 at 20:11
  • just the title page Jan 5, 2015 at 20:16
  • You can also have a look at How to customize a titlepage.
    – Johannes_B
    Jan 5, 2015 at 20:46

3 Answers 3

18

This is a more conventional method...

Define a new page style

\fancypagestyle{alim}{\fancyhf{}\renewcommand{\headrulewidth}{0pt}\fancyfoot[R]{Alim, from Unknown City}}

and use

\thispagestyle{alim}

only in the page where you want the right foot, e.g. the title page.

MWE:

\documentclass{report}
\usepackage{fancyhdr}
\usepackage{lipsum} % just for the example

\fancypagestyle{alim}{\fancyhf{}\renewcommand{\headrulewidth}{0pt}\fancyfoot[R]{Alim, from Unknown City}}
\pagestyle{fancy} % or whatever

\begin{document}
\begin{titlepage}
\thispagestyle{alim}
\lipsum[1-4]
\end{titlepage}
\lipsum[1-4]
\end{document} 

Output:

enter image description here

7

Yes, with the help of commands from the atbegshi package.

If you want the \rfoot only in the first page, use this code in the preamble:

\AtBeginDocument{%
  \rfoot{Alim, from Unknown City}%
  \AtBeginShipoutNext{%
    \rfoot{}%
  }%
}

MWE:

\documentclass{report}
\usepackage{atbegshi}
\usepackage{fancyhdr}
\usepackage{lipsum} % just for the example

\fancyhf{}
\pagestyle{fancy}

\AtBeginDocument{%
  \rfoot{Alim, from Unknown City}%
  \AtBeginShipoutNext{%
    \rfoot{}%
  }%
}

\begin{document}
\lipsum[1-20]
\end{document} 

Output:

enter image description here

Instead, if you want the \rfoot only in a page which is not the first (let's suppose page 2), use this code in the preamble:

\AtBeginShipout{%
  \ifnum\value{page}=1%
    \rfoot{Alim, from Unknown City}%
    \AtBeginShipoutNext{%
      \AtBeginShipoutNext{%
        \rfoot{}%
      }%
    }
  \fi%
}

Change 1 to 3 if you want it, for example, on page 4.

MWE:

\documentclass{report}
\usepackage{atbegshi}
\usepackage{fancyhdr}
\usepackage{lipsum} % just for the example

\fancyhf{}
\pagestyle{fancy}

\AtBeginShipout{%
  \ifnum\value{page}=1%
    \rfoot{Alim, from Unknown City}%
    \AtBeginShipoutNext{%
      \AtBeginShipoutNext{%
        \rfoot{}%
      }%
    }
  \fi%
}

\begin{document}
\lipsum[1-20]
\end{document} 

Output:

enter image description here

2
  • Good answer, but i think it is a bit overkill here ;-)
    – Johannes_B
    Jan 5, 2015 at 20:11
  • @Johannes_B I know. But this answers the question in all possible cases... Jan 5, 2015 at 20:41
6

My feeling is that you shouldn't place content in the footer if it forms part of your title page. Instead, just place it at the bottom of the text block, aligned according to your needs. Here's an example:

enter image description here

\documentclass{report}
\usepackage{blindtext}
\begin{document}
\begin{titlepage}
  \vspace*{50pt}% Similar to a regular \chapter gap
  \centering% Horizontal centred content

  \Huge My title% Title

  \huge Some subtitle% Subtitle

  \bigskip

  \LARGE My name% Name

  \Large Something else about me% Something else

  \bigskip

  \large \today% Date

  \vfill% Vertical fill to go to the bottom of the page

  \hfill\normalsize My name, My City% Right-aligned name/city
\end{titlepage}

\blinddocument% Rest of document

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .