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}
David Carlisle
  • 757,742
  • 1
    Welcome to TeX.sx! For your first question see http://tex.stackexchange.com/questions/13896/how-to-remove-the-top-horizontal-bar-in-fancyhdr. For the second question please add a minimal working example (MWE) that illustrates your problem. – lockstep Mar 29 '13 at 16:01
  • Are you using US Letter paper or ISO A4 paper? – egreg Mar 30 '13 at 00: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 '13 at 00: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 '13 at 01:30

2 Answers2

15

You can set the width of the rules using

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

That should effectively make them disappear.

A.Ellett
  • 50,533
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.

SolidMark
  • 1,389