![我的页码在第一页之后就消失了](https://linux22.com/image/332438/%E6%88%91%E7%9A%84%E9%A1%B5%E7%A0%81%E5%9C%A8%E7%AC%AC%E4%B8%80%E9%A1%B5%E4%B9%8B%E5%90%8E%E5%B0%B1%E6%B6%88%E5%A4%B1%E4%BA%86.png)
我正在用 latex 写一份文档,页眉中有两个徽标,右下角有一个自定义页码。问题是,虽然页眉显示正确,但第二页的页脚似乎从页面上消失了。
这是第二页的右下角,您可以看到页码的几个像素。我用于页眉和页脚的代码是:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=1in, a4paper,textheight=8in]{geometry}
\usepackage[]{graphicx}
\usepackage{float}
\usepackage{subcaption}
\usepackage{amsmath}
\usepackage{caption}
\usepackage{lastpage}
\usepackage{subcaption}
\usepackage{wrapfig}
\setlength{\parindent}{0pt}
\usepackage{fancyhdr}
\usepackage{xcolor}
\usepackage{lipsum}
\fancypagestyle{plain}
%\fancyhead{}
\cfoot{}
\rhead{\includegraphics[height=2cm]{grasp_logo}}
\lhead{\includegraphics[height=2cm]{bsi}}
\rfoot{\thepage\ $|$ \pageref{LastPage}}
\pagestyle{plain}
%\AtBeginDocument{\layout*}
%\lhead{H.G. van den Boorn}
%\chead{Grasp initial findings and proposal}
\title{\textsc{Grasp initial findings and proposal}}
\author{\textsc{H.G. van den Boorn}}
%\date{\vspace{-5ex}}
%\thispagestyle{plain}
\begin{document}
%\vspace*{-15pt}
%{\let\newpage\relax\maketitle}
\maketitle
%\vspace*{10pt}
\lipsum
\section*{Behavioral tests}
\lipsum
\section*{Improvement of scores}
\lipsum
\end{document}
我把它放在了文件开始之前。
我怎么解决这个问题?
答案1
不要忽视警告:
Package Fancyhdr Warning: \headheight is too small (12.0pt):
Make it at least 60.50554pt.
We now make it that large for the rest of the document.
This may cause the page layout to be inconsistent, however.
从第二页开始,文本块向下移动48.50554点,1.7厘米。
您还可获得
Package geometry Warning: Over-specification in `v'-direction.
`height' (578.15999pt) is ignored.
因为指定高度和边距没有意义。
解决方案:
\usepackage[margin=1in,a4paper,headheight=61pt]{geometry}