我在删除目录中的页码时遇到了问题,但页面上的页码却无法删除。我四处寻找答案,并尝试了几种方法,但都不起作用。我必须使用\thispagestyle{plain}
来对页面进行编号,但这会自动将页面放入目录中。如果我使用{empty}
,那么我会删除页面上的页码...
请帮忙!
newpage
\thispagestyle{plain}
\setcounter{page}{1}
%\pagenumbering{gobble} (this supresses the page numbers on the page which is not what I want)
\addcontentsline{toc}{chapter}{Appendices}
\chapter*{Appendix 1: Room Temperature}
\noindent\makebox[\textwidth][c]{\raisebox{-0.9\height}[10pt][10pt]{\includegraphics[page=1,scale=0.6]{Room-Code}}}\par
\addcontentsline{toc}{chapter}{Appendix 1: Room Temperature}
答案1
如果问题中没有 MWE(文档类、TOC 相关包等),那么这只能是猜测。
您可以使用包tocloft
并添加\cftpagenumbersoff{chapter}
到目录中。
例子:
\documentclass{report}
\usepackage{blindtext}% only for dummy text
\usepackage{tocloft}
\begin{document}
\tableofcontents
\blinddocument
\cleardoublepage
\setcounter{page}{1}
\addtocontents{toc}{\protect\cftpagenumbersoff{chapter}}% <- added
\addcontentsline{toc}{chapter}{Appendices}
\chapter*{Appendix 1: Room Temperature}
\addcontentsline{toc}{chapter}{Appendix 1: Room Temperature}
\blindtext
\end{document}
或者对包装提出建议tocbasic
:
\documentclass{report}
\usepackage{blindtext}% only for dummy text
\usepackage{tocbasic}
\newcommand\gobble[1]{}
\begin{document}
\tableofcontents
\blinddocument
\cleardoublepage
\setcounter{page}{1}
\addtocontents{toc}{\DeclareTOCStyleEntry[pagenumberformat=\protect\gobble]{tocline}{chapter}}
\addcontentsline{toc}{chapter}{Appendices}
\chapter*{Appendix 1: Room Temperature}
\addcontentsline{toc}{chapter}{Appendix 1: Room Temperature}
\blindtext
\end{document}
或者\appendix
:
\documentclass{report}
\usepackage{blindtext}% only for dummy text
\usepackage{tocbasic}
\newcommand\gobble[1]{}
\newcommand\appendixprefixintoc[1]{\appendixname~#1:\hfill}
\begin{document}
\tableofcontents
\blinddocument
\cleardoublepage
\appendix
\setcounter{page}{1}
\addtocontents{toc}{\DeclareTOCStyleEntry[pagenumberformat=\protect\gobble]{tocline}{chapter}}
\addcontentsline{toc}{chapter}{Appendices}
\addtocontents{toc}{\DeclareTOCStyleEntry[entrynumberformat=\protect\appendixprefixintoc,dynnumwidth]{tocline}{chapter}}
\chapter{Room Temperature}
\blindtext
\end{document}