我无法弄清楚为什么不同页面的页眉和页脚位置不同(请参阅下面的 MWE)。任何有关这方面的帮助都将不胜感激。谢谢
\documentclass[12pt,english]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm, headheight=3pt, footskip=3pt}
\usepackage{calligra}
\usepackage{amssymb}
\usepackage{pifont}
\usepackage{setspace}
\usepackage{marvosym}
\usepackage{wasysym}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{hyperref}
\hypersetup{colorlinks=true,citecolor=blue, linkcolor=blue}
\fancyhf{}
\fancyhead[C]{
\begin{minipage}[t]{1\columnwidth}
\vspace{-0.4cm}\hspace{-0.0cm}\begin{minipage}[t]{0.15\paperwidth}%
\vspace{0bp}
\includegraphics[width=3.2cm,height=3.1cm]{Test}%
\end{minipage}
\hspace{0.05cm}\begin{minipage}[t]{0.6\paperwidth}%
\vspace{0bp}
\begin{center}
\textbf{\Huge{Journal of University\\and College\\}}
\textbf{\large{Recognized By XYZ\\}}
\textbf{\LARGE{Review Pro-forma\\}}
\large{(For ASDFG)}
\end{center}
\end{minipage}
\end{minipage}
%\noindent\makebox[\linewidth]{\rule{\paperwidth}{1.5pt}}
\vspace{0.0cm}
}
\fancyfoot[C]{
\vspace*{-4.0cm}
\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.75pt}}
\textbf{\Large{University \& College\\}}
ASDDDDDDDDDDD DDDDDDDDDDDDD FFFFFFFFFFFFFFFFFFFFFFFFF fffffffffffffffff ggg\\
\small{jjjjjjjjjjjj kkkkkkkkkkkkkk lllllllllllllllllll mmmmmmmmmmmmmmmmmm nnnnnnnnnnnnnnn oooooooooooooo ppppppppp}
}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\setlength\headheight{3.0cm}
\pagestyle{fancy}
\makeatletter
\let\ps@plain\ps@fancy
\makeatother
\usepackage{babel}
\usepackage{blindtext}
\begin{document}
\blindtext[10]
\newpage{}
\blindtext[1]
\end{document}
Test.png 下面是。
答案1
几点:您需要多次导入包,并且还要多次设置各种参数,这有点令人困惑。通常,我建议不要在同一个文档中使用 geometry 和 fancyhdr。好吧,这只是个人喜好问题,但它确实使事情变得更加复杂。
不要使用 vanilla article 类,可以考虑使用 KOMA-script 包中的 scrartcl。它允许您设置页面几何形状并自定义页眉和页脚。它的语法也比 fancyhdr 等好得多。
话虽如此,以下是对您的文档的解读。这是您想要的吗?
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose, left=2cm, right=2cm, top=20mm, bottom=8cm}
\usepackage{setspace}
\usepackage{fancyhdr}
\usepackage[english]{babel}
\usepackage{graphicx}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\setlength\headheight{116pt}
\fancyhf{}
\fancyhead[C]{
\begin{minipage}[t]{1\columnwidth}
\vspace{-0.4cm}\hspace{-0.0cm}\begin{minipage}[t]{0.15\paperwidth}%
\vspace{0bp}
\includegraphics[width=3.2cm,height=3.1cm]{Test}%
\end{minipage}
\hspace{0.05cm}\begin{minipage}[t]{0.6\paperwidth}%
\vspace{0bp}
\begin{center}
\textbf{\Huge{Journal of University\\and College\\}}
\textbf{\large{Recognized By XYZ\\}}
\textbf{\LARGE{Review Pro-forma\\}}
\large{(For ASDFG)}
\end{center}
\end{minipage}
\end{minipage}
%\noindent\makebox[\linewidth]{\rule{\paperwidth}{1.5pt}}
\vspace{0.0cm}
}
\fancyfoot[C]{
\centerline{\hskip-4cm\noindent\makebox[\linewidth]{\rule{\paperwidth}{0.75pt}}}
\textbf{\Large{University \& College\\}}
ASDDDDDDDDDDD DDDDDDDDDDDDD FFFFFFFFFFFFFFFFFFFFFFFFF fffffffffffffffff ggg\\
\small{jjjjjjjjjjjj kkkkkkkkkkkkkk lllllllllllllllllll mmmmmmmmmmmmmmmmmm nnnnnnnnnnnnnnn oooooooooooooo ppppppppp}
}
\pagestyle{fancy}
\usepackage{blindtext}
\begin{document}
\blindtext[20]
\end{document}
(而且顶部和底部的边距非常窄;您确定这是您想要的吗?)