加载中…
个人资料
danxingdaodekuangpan
danxingdaodekuangpan
  • 博客等级:
  • 博客积分:0
  • 博客访问:196
  • 关注人气:0
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

[转载]在latex中如何去除或设置目录\tableofcontents中的页眉问

(2020-08-12 17:22:28)
标签:

转载

问题描述:

在论文、报告排版中,Latex设置为封面页是无页眉(页脚)的,目录、表目录、图目录、正文的页眉一样,章节页的第一页通常也是没有页眉的。在遇到要求目录、表目录、图目录同封面都为无页眉要求时,我在百度上检索通常的解决方案都是pagestyle{plain}thispagestyle{plain}命令。但本人发现这并不能很好的解决这个问题。

问题解决方案:

(1) 添加章节第一页的页眉。

 使用:

 pagestyle{fancy}

 fancypagestyle{plain}{  ......  }

(2) 去掉目录中的页眉,而不影响其他正文章的页眉。以下命令完全不同于pagestyle{plain}thispagestyle{plain}命令。

 documentclass{report} %book类似

 usepackage{fancyhdr}

 

fancypagestyle{front}{ % style for TOC, LOF, LOT (设置目录、表目录、图目录)

 fancyhf{}

 renewcommand{headrulewidth}{0pt}

 cfoot{thepage} } %可根据自己要求修改

  

 fancypagestyle{main}{ % style for the mainmatter(设置正文目录)

 fancyhf{}

 renewcommandheadrulewidth{.4pt}

 fancyhead[C]{slshape leftmark}

 fancyfoot[C]{thepage} }

 

makeatletter %.cls文件中不需要makeatlettermakeatother

 newcommandfrontpagestyle{cleardoublepagepagestyle{front}letps@plainps@front}   newcommandmainpagestyle{cleardoublepagepagestyle{main}letps@plainps@main}

 makeatother


usepackage{blindtext}

 

begin{document}

 frontpagestyle % switch to the pagestyle front

 tableofcontents

 listoffigures

 listoftables

 mainpagestyle % switch to the pagestyle main   BlinddocumentBlinddocumentBlinddocumentBlinddocumentBlinddocument   BlinddocumentBlinddocumentBlinddocumentBlinddocumentBlinddocument

 end{document}

 

解决方案参考资料:https://tex.stackexchange.com/questions/177101/how-to-remove-header-and-footer-in-table-of-contents-and-lof-and-lot

0

  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有