我使用 fancy 在页眉中放置了两张图片,但它会删除除目录页之外的所有页面的页脚。如果我删除页眉配置,页脚会重新出现。
我在乳胶日志的标题中收到有关第一张图片的错误消息:
\openout4 = `"Name of file.toc"'.
<first_picture.png, id=140, 581.17125pt x 153.57375pt>
File: first_picture.png Graphic file (type png)
<use first_picture.png>
Package pdftex.def Info: first_picture.png used on input line 79.
(pdftex.def) Requested size: 174.35272pt x 46.07246pt.
<second_picture.png, id=141, 190.7125pt x 85.31876pt>
File: second_picture.png Graphic file (type png)
<use second_picture.png>
Package pdftex.def Info: second_picture.png used on input line 79.
(pdftex.def) Requested size: 95.356pt x 42.65926pt.
Package Fancyhdr Warning: \headheight is too small (12.0pt):
Make it at least 49.6725pt.
We now make it that large for the rest of the document.
This may cause the page layout to be inconsistent, however.
[2 <./first_picture.png> <./second_picture.png>]
Underfull \hbox (badness 10000) in paragraph at lines 84--90
[]
File: first_picture.png Graphic file (type png)
<use first_picture.png>
Package pdftex.def Info: first_picture.png used on input line 98.
(pdftex.def) Requested size: 174.35272pt x 46.07246pt.
File: second_picture.png Graphic file (type png)
<use second_picture.png>
Package pdftex.def Info: second_picture.png used on input line 98.
(pdftex.def) Requested size: 95.356pt x 42.65926pt.
我该怎么办?
\documentclass{article}
\usepackage[french]{babel}
\usepackage[utf8]{inputenc}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{graphicx}
\usepackage{listings,xcolor}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage[hidelinks]{hyperref}
\pagestyle{fancy}
\fancyhf{}
\renewcommand\headrulewidth{1pt}
\fancyhead[L]{\includegraphics[scale=0.3]{first_picture.png}}
\fancyhead[R]{\includegraphics[scale=0.5]{second_picture.png}}
\fancyfoot[C]{COntent which disapears}
\title{The title}
\author{The authors}
\begin{document}
\clearpage\maketitle
\thispagestyle{empty}
\vfill
\begin{center} \includegraphics[scale=0.4]{A picture.png} \end{center}
\vfill
% Saut de page
\newpage
\
% Table des matières
\tableofcontents
% Saut de page
\newpage
\section{A section}
Lorem ipsum dolor sit amet, id eum tollit expetendis, impedit maiorum et qui.
\subsection{A subsection}
Lorem ipsum dolor sit amet, id eum tollit expetendis, impedit maiorum et qui.\\
\begin{itemize}
\item Lorem ipsum
\item tollit expetendis
\item mea cu option
\end{itemize}
\subsection{A second subsection}
Vim elit sonet an, eum velit possim nostrud cu. Rebum praesent mea ne, an eos autem mazim.
\newpage
\end{document}
它起作用了,我改变了头部高度几何参数:
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm,headheight=35pt]{geometry}
答案1
如果页眉中的图像大于页眉的高度,那么它可能会将页脚推离页面的底部,使其看起来消失了,虽然它确实存在,但却看不见。
当标题高度对于内容来说太小时,fancyhdr
会在控制台上打印警告,并告诉您需要多大。至少选择一个这么大的值并添加
headheight=<whatever>
到您传递的选项geometry
。