页眉/页脚中的页码(fancyhdr)

页眉/页脚中的页码(fancyhdr)

可能重复:
如何删除 fancyhdr 中的顶部水平条?

我该如何删除页眉中的行以及页脚中的行号和页码?

我的代码如下。

在此处输入图片描述

\documentclass[10pt]{article}
\usepackage{array, xcolor, lipsum, bibentry,fancyhdr}
\usepackage[margin=3cm]{geometry}


\pagestyle{fancy}
\lhead{My Name}
\chead{}
\rhead{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}



\definecolor{lightgray}{gray}{0.8}
\newcolumntype{L}{>{\raggedleft}p{0.14\textwidth}}
\newcolumntype{R}{p{0.8\textwidth}}
\newcommand\VRule{\color{lightgray}\vrule width 0.5pt}


\begin{document}
\thispagestyle{empty}
\begin{center}\bfseries\Huge John Doe \end{center}
\vspace{1em}
\begin{minipage}[ht]{0.70\textwidth}
Address Line 1\\
Address Line 2\\
Address Line 3\\
Address Line 4\\
Address Line 5
\end{minipage}
\begin{minipage}[ht]{0.48\textwidth}
Mobile: 123-456789\\
Email: [email protected]\\
Date of Birth: 01/01/2012\\
Citizenship: My citizenship
\end{minipage}
\vspace{2pt}

\section*{Education}
\begin{tabular}{L!{\VRule}R}
2008--2012&MSc in Computer Science, Great University, Country.\vspace{5pt}\\
2006--2008&BSc in Life Science, Great University, Country.\\
\end{tabular}

\section*{Professional Experience}
\begin{tabular}{L!{\VRule}R}
2011--today&{\bf Work at company XY.}Head of Department. Add my job description here. Add my job description here. Add my job description here. Add my job description here.\\
&\begin{itemize}
\item Add my job description here.
\item Add my job description here.Add my job description here.Add my job description here.
\item Add my job description here.Add my job description here.Add my job description here.Add my job description here.
\item Add my job description here.Add my job description here.Add my job description here.Add my job description here.Add my job description here.Add my job description here.Add my job description here.Add my job description here.Add my job description here.
\end{itemize} \vspace{5pt}\\
2008--2010&{\bf Trainee at company ZY.}\\
&\lipsum[66]\\
\end{tabular}

\section*{Awards and Achievements}
\begin{tabular}{L!{\VRule}R}
2008&Gold medal.\vspace{5pt}\\
2006&Silver medal.\\
\end{tabular}

\section*{Organisational Experience}
\begin{tabular}{L!{\VRule}R}
2008&This event.\vspace{5pt}\\
\end{tabular}


\section*{Languages}
English, Spanish, French, German


\end{document} 

答案1

与您的 MWE 相比,只有几点变化:

\pagestyle{fancy}
\lhead{My Name}
\chead{}
\rhead{\thepage}
\cfoot{} % get rid of the page number 
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}

通过设置\headrulewidth\footrulewidth,您0pt可以按照包文档中的说明删除它们fancyhdr

相关内容