[Tex/LaTex] Repeating part of document on every page

header-footer

I want to create a document which has the following structure

Header


Name, Date of birth, Address <——– This will be written by people (before the document is compiled) who do not understand LaTex and will be repeated on every paper.


contents …


footer

Is this possible ?

Best Answer

Without a MWE it is difficult to guess what you are trying to do... Hope this is what you want.

With the help of \AddToShipoutPicture from the eso-pic package we create a "second header" in the document where to write the needed information.

\documentclass{article}
\usepackage{eso-pic}
\usepackage{fancyhdr}
\usepackage{blindtext} % just for the example
\usepackage[headsep=2cm]{geometry}
\AddToShipoutPicture{%
  \AtTextUpperLeft{%
    \makebox(420,45)[lt]{%
      \footnotesize%
      \textbf{Author: }\myauthor%
      \hspace*{.5cm}%
      \textbf{Date of birth: }\mydate%
      \hspace*{.5cm}%
      \textbf{Address: }\myaddress%
}}}
\pagestyle{fancy}

\newcommand{\myauthor}{}
\newcommand{\mydate}{}
\newcommand{\myaddress}{}

\begin{document}

\blinddocument % just for the example

\end{document} 

Now the "person" just has to fill in the fields \myauthor, \myauthor and \myauthor.

For example, if you set (sorry, John...)

\newcommand{\myauthor}{John Wayne}
\newcommand{\mydate}{May 26, 1907}
\newcommand{\myaddress}{Winterset, Iowa}

you will get

enter image description here

Related Question