楼主: janyiyi
1582 0

How to use customised \contentsname in \tableofcontents? [推广有奖]

  • 3关注
  • 17粉丝

讲师

27%

还不是VIP/贵宾

-

威望
0
论坛币
3206 个
通用积分
5056.6800
学术水平
539 点
热心指数
537 点
信用等级
538 点
经验
10157 点
帖子
300
精华
2
在线时间
90 小时
注册时间
2010-10-3
最后登录
2024-4-6

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

[size=14.5455px]I'm using the report document class. Here's my code:

  1. \documentclass[a4paper, 12pt, twoside, titlepage, openright]{report}
  2. \usepackage[left=1.5in, right=1in, top=1in, bottom=1in]{geometry}
  3. \usepackage{hyperref}

  4. \title{Some Title}

  5. \begin{document}
  6.     \pagenumbering{roman}

  7.     \maketitle

  8.     \cleardoublepage
  9.     \renewcommand{\contentsname}{\centering Table of Contents   \par}
  10.     \addcontentsline{toc}{chapter}{\contentsname}
  11.     \tableofcontents

  12.     \pagenumbering{arabic}
  13.     \chapter{Introduction}
  14. \end{document}
复制代码

[size=14.5455px]On running this, I get a lot of errors like the following:

  1. Paragraph ended before \HyPsd@@ProtectSpacesFi was complete. ...dcontentsline{toc}{chapter}{\contentsname}
  2. Undefined control sequence. ...dcontentsline{toc}{chapter}{\contentsname}
  3. Use of \HyPsd@RemoveMask doesn't match its definition. ...dcontentsline{toc}{chapter}{\contentsname}
  4. Paragraph ended before \HyPsd@RemoveBraces was complete. ...dcontentsline{toc}{chapter}{\contentsname}
  5. Extra }, or forgotten \endgroup. ...dcontentsline{toc}{chapter}{\contentsname}
复制代码


[size=14.5455px]But when I change the ordering of some lines to the following:

  1.     \cleardoublepage
  2.     \addcontentsline{toc}{chapter}{\contentsname}
  3.     \renewcommand{\contentsname}{\centering Table of Contents   \par}
  4.     \tableofcontents
复制代码

[size=14.5455px]There are no errors but of course the \contentsname has not been changed before adding to thetoc


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:contents Content custom Table name

已有 1 人评分经验 论坛币 学术水平 热心指数 信用等级 收起 理由
oliyiyi + 60 + 60 + 3 + 3 + 3 精彩帖子

总评分: 经验 + 60  论坛币 + 60  学术水平 + 3  热心指数 + 3  信用等级 + 3   查看全部评分

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-24 22:11