\usepackage{fancyhdr} \pagestyle{fancy} 下的页眉设置

\usepackage{fancyhdr} \pagestyle{fancy} 下的页眉设置

在此处输入图片描述

在此处输入图片描述

奇数页和偶数页的“headrules”表示水平线未覆盖书写文本的整个宽度,这一点从上传的图像中清晰可见。我使用的章节文档的代码如下:

\documentclass[12pt,twoside,a4paper]{book}
\usepackage[a4paper]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead {}
\fancyhead [ER]{\footnotesize \sc Chernoff Distance for Conditionally Specified Models}
\fancyhead [OL] {\footnotesize\sc\rightmark}
\fancyhead [RO,LE] {\thepage}
\fancyfoot {}
\renewcommand{\headrulewidth}{0.4pt}
\usepackage{amsfonts}
\usepackage{latexsym,amsmath}
\usepackage{amssymb,array}
\usepackage{amssymb}
\parindent 0.0 cm
\makeatletter \oddsidemargin 0in \evensidemargin 0in \textwidth
16cm \RequirePackage[dvips]{graphicx} \textheight 20cm
\setlength\textheight{8.8in} \setlength\textwidth{6.25in}
\setlength\topmargin{0.0in}
\newtheorem{t1}{Theorem}[section]
\newtheorem{p1}{Proposition}[section]
\newtheorem{l1}{Lemma}[section]
\newtheorem{c1}{Corollary}[section]
\newtheorem{d1}{Definition}[section]
\newtheorem{r1}{Remark}[section]
\newtheorem{co}{Counterexample}[section]
\newtheorem{ex}{Example}[section]
\renewcommand{\baselinestretch}{1.2}
\numberwithin{equation}{section}
%\newcounter{equation}[section]
\renewcommand{\theequation}{\thesection.\arabic{equation}}

我需要帮助来解决这个问题。如果您知道答案,请在空闲时间提供帮助...

答案1

请按如下方式使用:

\documentclass[12pt,twoside]{book}
\usepackage[a4paper,rmargin=0in, lmargin=0in, 
   textwidth=16cm,textheight=20cm]{geometry}
\usepackage{graphicx}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead {}
\fancyhead [ER]{\footnotesize \sc Chernoff Distance for Conditionally Specified Models}
\fancyhead [OL] {\footnotesize\sc\rightmark}
\fancyhead [RO,LE] {\thepage}
\fancyfoot {}
\renewcommand{\headrulewidth}{0.4pt}
\usepackage{amsfonts}
\usepackage{latexsym,amsmath}
\usepackage{amssymb,array}
\parindent=0cm
\newtheorem{t1}{Theorem}[section]
[...]

然后fancyhdr知道确切的页边距。查看文档中geometry如何定义页面。0mm 的页边距实际上没有意义。

相关内容