Page LayoutBusiness Letterhead / Subsequent Pages (different header)

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
lawlist
Posts: 8
Joined: Sun Feb 24, 2013 11:00 pm

Business Letterhead / Subsequent Pages (different header)

Post by lawlist »

I'm trying to set up a simple letter with a multi-line header on the first page, and a different multi-line header on all subsequent pages. The problem is that my headers push the text body completely off the bottom of the page. Here is the code I'm using.

Code: Select all

\documentclass[10pt]{article}
\usepackage{fancyhdr}
\usepackage{ifthen}
\usepackage{everypage}
\usepackage[top=2in, bottom=2.5in, left=1in, right=1in]{geometry}

\AddEverypageHook{%
  \ifthenelse{\value{page}=1}%
  \renewcommand{\lhead{RECIPIENT \\ \today	 \\ Page Number \thepage \\~\\~\\~\\}{\chead{}}}%
  \newpage%
}

\textwidth = 7 in
\textheight = 10 in
\oddsidemargin = 0pt
\evensidemargin = 0pt
\topmargin = -50pt
\headheight = 82.5pt
\headsep = 0pt
\parskip = 4pt
\parindent = 0.0in
\marginparwidth = 0pt
\marginparsep = 0pt
\hoffset = -18pt
\footskip = 8.5pt
\raggedright

\begin{document}

\pagestyle{fancy}
\pagenumbering{arabic}
\setcounter{page}{1}
    \chead{ {COMPANY} \\ {Street Address} \\ {City, State  Zip}\\~\\ {Tel. (XXX) XXX-XXXX} \\ {Email}}
\renewcommand{\headrulewidth}{0.4pt}

% main section

This is the body of the letter.

\end{document}
I would like the text to flow naturally from page to page, without the need for manual page breaks, and always have about a 1in bottom margin. Any ideas how to accomplish this?


Thanks.
Last edited by lawlist on Mon Mar 25, 2013 7:12 pm, edited 3 times in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Business Letterhead / Subsequent Pages (different header)

Post by cgnieder »

Hi lawlist,

Welcome to the LaTeX community.

It's not entirely clear to me what you want. Maybe something like the following which needs no packages (except fancyhdr):

Code: Select all

\pagestyle{fancy}
\lhead{%
  \ifnum\value{page}=1
  \else
    RECIPIENT \\ \today   \\ Page Number \thepage \\~\\~\\~\\
  \fi}
\chead{%
  \ifnum\value{page}=1
    {COMPANY} \\ {Street Address} \\ {City, State  Zip}\\~\\ {Tel. (XXX) XXX-XXXX} \\ {Email}%
  \fi}
May I ask why use load the geometry package but don't use it's capabilities but set all dimensions manually?

Code: Select all

\documentclass[10pt]{article}
\usepackage{fancyhdr}

\usepackage[top=2in, bottom=2.5in, left=1in, right=1in]{geometry}

% why not set these with geometry?
\textwidth = 7 in
\textheight = 10 in
\oddsidemargin = 0pt
\evensidemargin = 0pt
\topmargin = -50pt
\headheight = 82.5pt
\headsep = 0pt
\parskip = 4pt
\parindent = 0.0in
\marginparwidth = 0pt
\marginparsep = 0pt
\hoffset = -18pt
\footskip = 8.5pt

\raggedright

\pagestyle{fancy}
\lhead{%
  \ifnum\value{page}=1
  \else
    RECIPIENT \\ \today   \\ Page Number \thepage \\~\\~\\~\\
  \fi}
\chead{%
  \ifnum\value{page}=1
    {COMPANY} \\ {Street Address} \\ {City, State  Zip}\\~\\ {Tel. (XXX) XXX-XXXX} \\ {Email}%
  \fi}

\renewcommand{\headrulewidth}{0.4pt}

\begin{document}

% main section

This is the body of the letter.

\newpage

This is the second page.

\end{document}
Regards
site moderator & package author
lawlist
Posts: 8
Joined: Sun Feb 24, 2013 11:00 pm

Business Letterhead / Subsequent Pages (different header)

Post by lawlist »

Under certain circumstances the \usepackage[]{geometry} definition fails to properly control the bottom margin on the first page. When this initial definition fails (e.g., due to an inability to play nice with fancyhdr), it is possible to use the \newgeometry command as a workaround.

Code: Select all

\documentclass{article}
\usepackage{geometry}
	\newgeometry{head=131pt, headsep=-40pt, hmargin={1in,1in}, vmargin={1.8in,.7in}}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{parskip}
	\setlength{\parskip}{3ex}
\usepackage{setspace} % \doublespace | \onehalfspace | \singlespace | user defined
\usepackage[all]{nowidow}
\usepackage{chancery}
\usepackage[T1]{pbsi}
\usepackage{times}
	\renewcommand{\rmdefault}{ptm}
	\renewcommand{\normalsize}{\fontsize{14}{17}\selectfont}

\nonfrenchspacing

\raggedright

\newcommand{\tab}{\hspace*{.5in}}

\newcommand*{\chanceryI}{%
      \fontfamily{pzc}\selectfont%
      \fontsize{20}{20}
      \selectfont}

\newcommand*{\chanceryII}{%
      \fontfamily{pzc}\selectfont%
      \fontsize{17}{0}
      \selectfont}

\newcommand*{\palatino}{%
      \fontfamily{ppl} \selectfont%
      \fontsize{15}{0}
      \selectfont}

\newcommand*{\ptm}{%
      \fontfamily{ptm} \selectfont%
      \fontsize{14}{17}
      \selectfont}

\newcommand*{\bsi}{%
      \bsifamily \selectfont%
      \fontsize{16}{15}
      \selectfont}

% HEADERS
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
% first page header
\fancypagestyle{plain}{
            \fancyhead{}
            \fancyhead[C]{{\chanceryI{Company \\ Street Address \\ City, State ~ Zip}} \\~\\ {\chanceryII{Tel. / Fax.: ~ (xxx) xxx-xxxx}} \\~\\ {\palatino{nobody@nowhere.com}} \\~\\ {\ptm{\today}}}
            \fancyfoot[C]{}
                      }
% second page header
\pagestyle{fancy}
    \fancyhead{}
    \fancyhead[L] {\ptm{Name of Recipient \\ \today \\ Page {\thepage\ of {\pageref{LastPage}}} \vspace*{1in} }}
    \fancyfoot[C]{}

\thispagestyle{plain}
\vspace*{0.6in}

\usepackage{lipsum}

\begin{document}


\lipsum[1-10]

\tab Thank you for your attention to this matter.

\tab \tab \tab \tab \tab Sincerely,

\tab \tab \tab \tab \tab {\bsi{Signature}}

\tab \tab \tab \tab \tab Name of Sender


\end{document}
Last edited by localghost on Mon Feb 25, 2013 7:28 pm, edited 1 time in total.
Post Reply