[size=14.5455px]I'm using the report document class. Here's my code:
- \documentclass[a4paper, 12pt, twoside, titlepage, openright]{report}
- \usepackage[left=1.5in, right=1in, top=1in, bottom=1in]{geometry}
- \usepackage{hyperref}
-
- \title{Some Title}
-
- \begin{document}
- \pagenumbering{roman}
-
- \maketitle
-
- \cleardoublepage
- \renewcommand{\contentsname}{\centering Table of Contents \par}
- \addcontentsline{toc}{chapter}{\contentsname}
- \tableofcontents
-
- \pagenumbering{arabic}
- \chapter{Introduction}
- \end{document}
[size=14.5455px]On running this, I get a lot of errors like the following:
- Paragraph ended before \HyPsd@@ProtectSpacesFi was complete. ...dcontentsline{toc}{chapter}{\contentsname}
- Undefined control sequence. ...dcontentsline{toc}{chapter}{\contentsname}
- Use of \HyPsd@RemoveMask doesn't match its definition. ...dcontentsline{toc}{chapter}{\contentsname}
- Paragraph ended before \HyPsd@RemoveBraces was complete. ...dcontentsline{toc}{chapter}{\contentsname}
- Extra }, or forgotten \endgroup. ...dcontentsline{toc}{chapter}{\contentsname}
[size=14.5455px]But when I change the ordering of some lines to the following:
- \cleardoublepage
- \addcontentsline{toc}{chapter}{\contentsname}
- \renewcommand{\contentsname}{\centering Table of Contents \par}
- \tableofcontents
[size=14.5455px]There are no errors but of course the \contentsname has not been changed before adding to thetoc