Latex和fancyhdr的问题 [英] Problems with Latex and fancyhdr

查看:125
本文介绍了Latex和fancyhdr的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在Stackoverflow上也欢迎Latex问题,因为它与编程无关.

I hope also Latex questions are welcome here on Stackoverflow since it's not really programming related.

在使用 fancyhdr 包定义标题的正确样式时,我遇到了问题.我想要实现的是拥有

I have a problem in defining the correct style for the header using the fancyhdr package. What I'd like to achieve is to have

  • 在左侧的奇数页上,以下文本我的论文标题"
  • 在右侧偶数页面上,文本"Firstname Surname"

(替换为正确的文本).

(Replaced with the correct text of course).

目前,我有以下测试"乳胶文档:

At the moment I have the following "test" Latex document:

\documentclass[a4paper,12pt,T2A,oneside]{article}
\usepackage[english]{babel}
\usepackage{indentfirst}
\usepackage{amsmath}
\usepackage{amsxtra}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{float}
\usepackage{fancyhdr}
\usepackage[pdfborder=0 0 0]{hyperref}



%define the header
\pagestyle{fancy}

\fancyhf{}
\fancyhf[ROH,LEH]{Firstname Surname}
\fancyhf[REH,LOH]{\bfseries My paper title}

\begin{document}

\title{My title \\}
\author{\small{Firstname Surname}}
\date{June 9, 2009}

\maketitle


\section{Introduction}
blablabla asdfasdf asdf ads fad sf

adsfadsf a fdasfd asfd 

\subsection{This is a subsection}
Some text\ldots

\pagebreak

some further text

\pagebreak

some additional text

% Stop your text
\end{document}

我尝试了这部分的不同变化

I tried different variations of this part

\fancyhf{}
\fancyhf[ROH,LEH]{Firstname Surname}
\fancyhf[REH,LOH]{\bfseries My paper title}

但是我无法使其正常工作.此刻,文本打印在每页上,奇数和偶数.我还发现了此Wiki文章,其中描述了"ROH"等的不同含义...而且也很清楚,但是由于某种原因,它对我不起作用.我必须犯一些愚蠢的错误,这是我现在无法解决的...

but I can't make it work. At the moment the text is printed on each page, odd and even. I also found this wiki article which describes the different meanings of "ROH" etc... and it's also clear, but for some reason it doesn't work for me. I must make some silly mistake which I can't get right now...

谢谢您的帮助!

//
Tex发行版:gwTeX
操作系统:Mac OS X 10.5.8

//
Tex distribution: gwTeX
OS: Mac OS X 10.5.8

推荐答案

您的 \ documentclass [a4paper,12pt,T2A,oneside] {article} 指定 one -是单方面的文章-因此,fancyhdr会在所有页面上打印所有页眉.将其更改为 twoside :

Your \documentclass[a4paper,12pt,T2A,oneside]{article} specifies oneside - that is one sided article - so all headers would get printed on all pages by fancyhdr. Change that to twoside:

\documentclass[a4paper,12pt,T2A,twoside]{article}

有关信息,请参见本文有关使用此选项时可能如何更改页面边框的信息.

See this article for information on how you might have to change page borders when using this option.

这篇关于Latex和fancyhdr的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆