0

Question: While i am adding page numbering one line appear in the header, how to get rid from it? Even see the starting of my document, in fact i want to reduce that top margin.

What i have :

\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
    Add \renewcommand*\headrulewidth{0pt} to the preamble. – esdd Oct 7 at 6:54
  • @esdd Its working thanks you. What about other issue please guide me. – Maths4Sandy Oct 7 at 6:56
  • @Maths4Sandy if you're speaking about reducing the top margin as the other issus, you can simply do it thanks to the option top=0.70in of the geometry package. Change the value, with the unit that you like. – Alexandre Quenon Oct 7 at 7:04
  • Off topic: remove width=0cm and height=0cm. – esdd Oct 7 at 7:39
0

The rule above the text can be removed by \renewcommand*\headrulewidth{0pt}. To reduce the top margin decrease the value of geometry option top and add option 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}
  • Thanks a lot. Great help for me. – Maths4Sandy Oct 7 at 7:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.