0

Question: 1 I want to start my starting text exact below the top rule i mean how can i reduce margin between first line and top line?

Question: 2 How can i add some text on the top line and below the bottom line? Even i want page numbers on right of the top.

MWE:

\documentclass[a4paper,14pt]{extarticle}
\usepackage[utf8x]{inputenc}
\usepackage{ucs}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage[left=0.70in, right=0.70in, top=0.70in, bottom=0.70in]{geometry}
%page style
\usepackage{fancyhdr}

\pagestyle{fancy}
\renewcommand{\headrulewidth}{2pt}
\renewcommand{\footrulewidth}{2pt}
\begin{document}
Starting of the document
\end{document}
  • 1
    Specify the stuff you want with the macros provided by the fancyhdr package e.g. \fancyhf[rh]{\thepage} or whatever. What's the problem exactly? – cfr Mar 21 '18 at 4:43
  • Would you please explain? – Maths4Sandy Mar 21 '18 at 4:45
  • I just did. I gave you an example. There are plenty more in the manual. I don't know what the question is. You just haven't specified any headers or footers: specify them and they will appear. That's all there is to it. Above and below the line is where these things normally go: it's the default. – cfr Mar 21 '18 at 4:55
  • Sorry for that, Question is i want some text in left head, right head which will appear on the header line. Similarly for footer line – Maths4Sandy Mar 21 '18 at 5:00
  • Second question was i want to decrease the blank space between the header line and beginning of the first line – Maths4Sandy Mar 21 '18 at 5:02
2

If there should be no space between the top rule and the text body use headsep=0pt as option for geometry. But the result looks strange ...

enter image description here

\documentclass[a4paper,14pt]{extarticle}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage[left=0.70in, right=0.70in, top=0.70in, bottom=0.70in,
  headsep=0pt,% remove space between header and text body
  headheight=17pt% suggested by fancyhdr
  ]{geometry}
%page style
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}% remove the default header and footer entries
\fancyhead[L]{left header entry}
\fancyhead[R]{\thepage}
\fancyfoot[L]{left footer entry}
\fancyfoot[R]{right footer entry}
\renewcommand{\headrulewidth}{2pt}
\renewcommand{\footrulewidth}{2pt}
\begin{document}
Starting of the document 
\end{document}
  • Thanks a lot. What would be ideal line spacing? – Maths4Sandy Mar 23 '18 at 12:23

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.