LaTex 修改页面页眉页脚的样式

1.全局默认参数

latex支持默认的三种预定义的页眉页脚样式(pagestyle),使用方法是是pagestyle{style},其中的style参数确定了使用哪种样式,包括三种:

  • plain,默认设置,在页脚显示页码
  • headings, 页脚空白,在页眉中显示章节名及页码
  • empty, 页眉页脚均设置为空白
2. 局部页面设置

如果只改变当前页面的样式,可以采用 hispagestyle{plain}来设置。

3. 自定义页眉页脚(fancyhdr)

使用fancyhdr包来设置特定的页眉页脚(headers and footers)。

以下代码展示了一个样例,其中页眉是自定义的文章标题,页脚采用 page #number of # total number 形式,表明当年页码和总页码。

usepackage{fancyhdr} % Headers and footers
usepackage{lastpage}
pagestyle{fancy} % All pages have headers and footers
fancyhead{} % Blank out the default header
fancyfoot{} % Blank out the default footer
fancyhead[C]{This is my custom header text } % Custom header text
fancyfoot[RO,LE]{ Page 	hepage hspace{1pt} of pageref{LastPage}} % Custom footer text

© 版权声明
THE END
如果内容对您有所帮助,就支持一下吧!
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容