![删除顶部出现的多余行](https://linux22.com/image/402766/%E5%88%A0%E9%99%A4%E9%A1%B6%E9%83%A8%E5%87%BA%E7%8E%B0%E7%9A%84%E5%A4%9A%E4%BD%99%E8%A1%8C.png)
问题:当我添加页码时,页眉中出现了一行,如何去掉它?即使看到文档的开头,实际上我想减少顶部边距。
我拥有的 :
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{parskip}
\usepackage{setspace}
\usepackage[width=0.00cm, height=0.00cm, left=0.70in, right=0.70in, top=0.70in, bottom=0.70in]{geometry}
%pagestyle
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{lastpage}
\lhead{}
\rhead{}
\chead{}
\cfoot{Page \thepage \hspace{1pt} of \pageref{LastPage}}
\lfoot{}
\rfoot{}
\begin{document}
Starting of document
\end{document}
答案1
文本上方的规则可以通过 来删除\renewcommand*\headrulewidth{0pt}
。要减少顶部边距,请减少几何选项的值top
并添加选项nohead
。
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{parskip}
\usepackage{setspace}
\usepackage[
left=0.70in, right=0.70in,
top=0.2in,% <- changed, you can adjust the length to your needs
nohead,% <-added
bottom=0.70in
]{geometry}
%pagestyle
\usepackage{fancyhdr}
\renewcommand*\headrulewidth{0pt}% <- added
\pagestyle{fancy}
\usepackage{lastpage}
\fancyhf{}
\cfoot{Page \thepage \hspace{1pt} of \pageref{LastPage}}
\begin{document}
Starting of document
\end{document}