2

About 1 month ago, I asked here about spaces between lines and learned about the importance of inserting \par at end of paragraph when the font size has changed. This helped me make sense of several problems.

Today I have a follow up question about the same issue in fancy footers (or headers). I'm trying to match the output of an MS Word document that we use for stationary. In that Word document, there is smaller type in the footer and the single-spacing is tight.

When I try to do the same thing in LaTeX, I'm able to make the fonts smaller, but the line spacing remains large. I've measured and the space between lines never shrinks inside a fancy footer, even when I make the fonts tiny.

If I end a line in the footer with a \par, there is a compiler error saying there is a blank line where there should not be one.

In my code below, I'm pretty sure I understand what is wrong. By using the \footnotesize within the two rows, I don't give LaTeX any information about the need to tighten up the row size. How to redesign so the last 2 rows come out with less space between

Here is the MRE:

\documentclass[english]{article}
\usepackage{lmodern}
\renewcommand{\sfdefault}{lmss}
\renewcommand{\ttdefault}{lmtt}
\renewcommand{\familydefault}{\rmdefault}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[letterpaper]{geometry}
\geometry{verbose,tmargin=1in,bmargin=2in,lmargin=1.5in,rmargin=1in}
\setlength{\parskip}{\smallskipamount}
\setlength{\parindent}{0pt}
\usepackage{setspace}

\makeatletter
\usepackage{fancyhdr}
\usepackage{graphicx}
\headheight=70pt
\marginparwidth=0pt
\footskip=30pt

\usepackage{ifthen}
\usepackage{lastpage}
\usepackage[hidelinks, unicode=true]{hyperref}

\renewcommand{\headrulewidth}{0pt}
\fancyhead{}
\fancyfoot{}

\fancyhead[L]{
\ifthenelse{\value{page}=1}{\hspace*{-1in}IMAGINE A BEAUTIFUL LOGO HERE}
}
\fancyfoot[L]{
\ifthenelse{\value{page}=1}{\textsf{\textbf{The Name of My Center}}\\
\textsf{\footnotesize{}Knowledge Hall Room 1 | 1234 Your Alley | Pretend, ST 66666}\\
\textsf{\footnotesize{}(123)456-1234 | \url{http://google.edu} | email: friendly@myplace.edu}}
{\centering{Page  \thepage \hspace{1pt} of \pageref{LastPage}}}
}

\makeatother

\usepackage{babel}
\begin{document}
\thispagestyle{fancy}

\begin{singlespace}
Joseph Pretend Name\\
Chair, Geography\\
Unreal Dominion University\\
3423 Space Age Bldg.\\
Canada, UK 22348\smallskip{}

\end{singlespace}

Dear Professor:\smallskip{}

asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf
asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf
asdfasdf asdfadf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfdf
asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf
asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf
asdfasdf asdfasdf asdfasdf asdfasdf asdfadf asdfasdf asdfasdf asdfasdf
asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf
asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf

asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf
asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf
asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf ~asdfasdf asdfasdf
asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf
asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf
asdfasdf asdfasdf asdfasdf asdfasdf asdfasdf 

\begin{singlespace}
\smallskip{}

\end{singlespace}

Sincerely:
\bigskip{}
\bigskip{}

Armond T. Philpot

\end{document}
2

True. While the font switch (\footnotesize) does change the font size and baseline skip, single-line usages typically don't issue a paragraph-ending blank line (or explicit \par), and therefore the baseline spacing isn't preserved. In order to see the effect of you change in fonts, place the entire footer inside a minipage and use regular paragraphs (or explicit \pars) to set each line. Here is an alternative though, using manual adjustment of the vertical spacing with a tabular:

enter image description here

\fancyfoot[L]{
  \ifnum\value{page}=1
    \sffamily
    \begin{tabular}{ @{} l }
      \bfseries The Name of My Center \\[-.2\normalbaselineskip]
      \footnotesize Knowledge Hall Room 1 | 1234 Your Alley | Pretend, ST 12345 \\[-.2\normalbaselineskip]
      \footnotesize (123) 456-1234 | \url{http://google.edu} | email: friendly@myplace.edu
    \end{tabular}
  \else
    \makebox[\textwidth]{Page \thepage{} of \pageref{LastPage}}%
  \fi
}

Don't use geometry and then set things like \headheight, \footskip (and others) outside the \geometry setting. Do them all in the same place.

  • Thanks. The minipage had not occurred to me. I will test that one and post what I figure out. – pauljohn32 Apr 26 '17 at 3:33
  • I ended up using a different approach, suggested by one of the local users here. – pauljohn32 May 1 '17 at 20:11
1

I tested various options. This is the one I ended up using.

\fancyfoot[L]{
\ifthenelse{\value{page}=1}{\textsf{\textbf{The Name of My Center}}\footnotesize{}\\
\textsf{Knowledge Hall Room 1 | 1234 Your Alley | Pretend, ST 66666}\\
\textsf{(123)456-1234 | \url{http://google.edu} | email: friendly@myplace.edu}}
{\centering{Page  \thepage \hspace{1pt} of \pageref{LastPage}}}
}

This fixes the problem by opening up the \footnotesize{} in the first line, and it remains in effect until the end of the group.

enter image description here

In my opinion, this is a less dangerous option than manually adjusting \normalbaselineskip, but I agree with you that does also achieve a good result.

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.