9

I am using

\usepackage{fancyhdr}
\pagestyle{fancy}
........
\lhead{My Name}

This setup creates header with a horizontal line.

  1. How can I remove line appearing in header?
  2. When I convert this document to pdf it creates one inch extra space in my header. This space does not show up in dvi display or in postscript file. But does show up in pdf. How can I remove extra space in pdf?
\documentclass[10pt, twocolumn]{article}

\usepackage {amsfonts}
\usepackage{mathtools, fancyhdr}
\usepackage{IEEEtrantools}

\pagestyle{fancy}
\addtolength{\evensidemargin}{-1cm}
\addtolength{\oddsidemargin}{-1cm}
\setlength{\parindent}{0in}
\setlength{\parskip}{6pt}

\renewcommand{\headrulewidth}{0pt} 

\usepackage[margin=0.7in, headsep=4pt]{geometry} 

\begin{document}
\chead{My Name, Date...... }

\begin{IEEEeqnarray*}{lcr}
e^{-at} \hspace{1cm} \sin bt & \frac{b}{(s+a)^2+b^2} \hspace{1cm} & s>-a\\
\end{IEEEeqnarray*}
\end{document}
4
  • 1
    Welcome to TeX.sx! For your first question see tex.stackexchange.com/questions/13896/…. For the second question please add a minimal working example (MWE) that illustrates your problem.
    – lockstep
    Mar 29, 2013 at 16:01
  • Are you using US Letter paper or ISO A4 paper?
    – egreg
    Mar 30, 2013 at 0:17
  • Your document seems to work fine for me. Try using \usepackage{showframe}. My guess is that it's your viewer. Some viewers add extra space around the edges of your document. There should be a setting to turn such behavior off. By using showframe, you'll better be able to judge whether it's something with LaTeX or something with your viewer.
    – A.Ellett
    Mar 30, 2013 at 0:55
  • Also, the order you're calling things doesn't seem correct. You should invoke the geometry package before you use fancyhdr. Otherwise, fancyhdr won't get the margins correct. Also, if you're going to use the geometry package, I'm not sure why you're setting \evensidemargin and \rightsidemargin. I believe that the geometry package overrides your setting.
    – A.Ellett
    Mar 30, 2013 at 1:30

2 Answers 2

15

You can set the width of the rules using

\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

That should effectively make them disappear.

5
  • what about second problem? extra space in pdf.
    – BasicTex
    Mar 29, 2013 at 16:11
  • The second problem sounds like something going on with your viewer. But, it might help if you posted a MWE for which others can recreate the same problem.
    – A.Ellett
    Mar 29, 2013 at 16:18
  • Here is my example that creates an extra space at the beginning of the document while viewing pdf file.
    – BasicTex
    Mar 30, 2013 at 0:10
  • how to make it readable? All lines are combined together. Check my original post.
    – BasicTex
    Mar 30, 2013 at 0:13
  • This did it. Thanks!
    – bit_by_bit
    Apr 21, 2020 at 1:14
0

For the solution to the second problem, you should remove the headsep=4pt from the geometry package settings or reduce its value. That removes or reduces the space between the header and the top edge of the page.

I am not sure why you are using headsep in geometry package if you don't want extra spaces in header.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .