删除顶部出现的多余行

删除顶部出现的多余行

问题:当我添加页码时,页眉中出现了一行,如何去掉它?即使看到文档的开头,实际上我想减少顶部边距。

我拥有的 :

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

相关内容