'change alignment of \lfoot and \cfoot in latex with \fancyhdr
I am using \pagestyle{fancy} and am trying to align the \lfoot and \cfoot sections of a page.
Here's my code:
\documentclass{article}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{lipsum}
\renewcommand\familydefault{\sfdefault}
\makeatletter
\usepackage[letterpaper,top=1.in,left=0.4in,right=0.4in]{geometry}
\usepackage{calc}
\usepackage{varwidth} %for the varwidth minipage environment
\pagestyle{fancy}
\setlength{\footskip}{60pt}
\lhead{}
\chead{}
\rhead{}
\lfoot{\includegraphics[scale=0.22]{fakelogo}}
\cfoot{Footer \\ more footer}
\rfoot{}
\renewcommand\headrulewidth{0pt}
\renewcommand\footrulewidth{0pt}
\fancyhfoffset[LH]{\oddsidemargin + \hoffset + 0.5in}
\begin{document}
\lipsum[1-5]
\end{document}
This results in the resulting footer (I lack the reputation to embed it. Sorry!)
Based on my reading of the fancyhdr documentation and geometry, I've tried messing with \footskip and \fancyhfoffset but they all seem to move both the \cfoot and the \lfoot, and keep them non-centered. Any ideas?
Solution 1:[1]
I'm not sure this what you want, but I once fixed this problem as follows:
\lfoot{\includegraphics[height=2em]{../logos/zeropoint}}
\cfoot{\small \thepage/\pageref{LastPage}}
\rfoot{\small
\vspace{-1.5\baselineskip}
RPR Hasselt \\
\url{https://zeropoint.hr}
}
It's pretty much a hack, but it worked. :-)
Hope this helps!
Solution 2:[2]
If you were having the problem I was having, this is the way to force a footer to be in the center:
\cfoot{\makebox[\textwidth][c]{something centered in footer}}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Bart Van Loon |
| Solution 2 | mcmuffin6o |
