我在文章的页眉中放了一个图片,但文本只在第一页上叠加在页眉中。我认为问题出在图片上,因为当我删除它时,问题就消失了。
我试过这个答案但它没有帮助我解决问题
代码位于此行上方:
\documentclass[]{article}
\usepackage[utf8]{inputenc}
\usepackage[a4paper,margin=1in,headheight=.4in,headsep=12pt,heightrounded]{geometry}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{subfig}% http://ctan.org/pkg/subfig
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\chead{\includegraphics[scale=.11]{cortada.jpg}\\
SERVIÇO PUBLICO FEDERAL\\
UNIVERSIDADE FEDERAL DE SERIGPE\\
PRO-REITORIA DE POS-GRADUACAO E PESQUISA}
\setlength{\headsep}{0.2cm}
\title{[RASCUNHO] Brincando com cabeçalhos}
\author{José Joaquim Andrade}
\date{November 2018}
\setlength{\parindent}{1.5cm}
\setlength{\parskip}{0.2cm}
\makeindex
\begin{document}
% \maketitle
\section{First Section}
\lipsum
\lipsum[3-16]
\newpage
\section{Second Section}
\lipsum
\section{Second Section}
\lipsum
\end{document}
为了澄清我的问题,下面提供了该问题的屏幕截图:
答案1
头部高度太小。要增加它\setlength{\headheight}{...}
所需尺寸取决于图像,可在.log
文档文件中的警告中找到。例如,对于我使用的虚拟图像,我得到了
Package Fancyhdr Warning: \headheight is too small (28.90755pt):
Make it at least 66.0991pt.
We now make it that large for the rest of the document.
This may cause the page layout to be inconsistent, however.
所以我四舍五入并使用\setlength{\headheight}{67pt}
\documentclass[]{article}
\usepackage[utf8]{inputenc}
\usepackage[a4paper,margin=1in,headheight=.4in,headsep=12pt,heightrounded]{geometry}
\usepackage{graphicx}
\usepackage{lipsum}
\usepackage{subfig}% http://ctan.org/pkg/subfig
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\chead{\includegraphics[scale=.11]{example-image}\\
SERVIÇO PUBLICO FEDERAL\\
UNIVERSIDADE FEDERAL DE SERIGPE\\
PRO-REITORIA DE POS-GRADUACAO E PESQUISA}
\setlength{\headsep}{0.2cm}
\title{[RASCUNHO] Brincando com cabeçalhos}
\author{José Joaquim Andrade}
\date{November 2018}
\setlength{\parindent}{1.5cm}
\setlength{\parskip}{0.2cm}
\makeindex
\setlength{\headheight}{67pt}
\begin{document}
% \maketitle
\section{First Section}
\lipsum
\lipsum[3-16]
\newpage
\section{Second Section}
\lipsum
\section{Second Section}
\lipsum
\end{document}