用\ fancyhdr改变乳胶中\ lfoot和\ cfoot的对齐方式

时间:2017-09-13 19:17:14

标签: latex pdflatex

我正在使用\ pagestyle {fancy}并尝试对齐页面的\ lfoot和\ cfoot部分。

这是我的代码:

\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}

这导致the resulting footer(我缺乏嵌入它的声誉。抱歉!)

基于我对fancyhdr文档和几何的阅读,我尝试弄乱了\ footskip和\ fancyhfoffset,但它们似乎都移动了\ cfoot和\ lfoot,并保持它们不居中。有什么想法吗?

2 个答案:

答案 0 :(得分:0)

我不确定你想要什么,但我曾经解决过这个问题如下:

\lfoot{\includegraphics[height=2em]{../logos/zeropoint}}
\cfoot{\small \thepage/\pageref{LastPage}}
\rfoot{\small
        \vspace{-1.5\baselineskip}
        RPR Hasselt \\
        \url{https://zeropoint.hr}
}

它几乎是一个黑客攻击,但它确实有效。 : - )

希望这有帮助!

答案 1 :(得分:0)

在TeX:SE:https://tex.stackexchange.com/questions/391251/change-alignment-of-lfoot-and-cfoot-in-latex-with-fancyhdr

中回答了这个问题
\documentclass{article}

\usepackage{fancyhdr,lipsum}
\usepackage[export]{adjustbox}

\pagestyle{fancy}

\fancyhf{} % Clear header/footer
\fancyfoot[L]{\includegraphics[scale=0.22,valign=c]{example-image}}
\fancyfoot[C]{\begin{tabular}{@{}c@{}}Footer \\ more footer\end{tabular}}

%\setlength{\footskip}{60pt}% Depends on image size

\begin{document}

\lipsum[1-5]

\end{document}

谢谢,@ Werner。 (我不知道如何关闭它,否则。)