![面临目录问题吗?](https://linux22.com/image/292987/%E9%9D%A2%E4%B8%B4%E7%9B%AE%E5%BD%95%E9%97%AE%E9%A2%98%E5%90%97%EF%BC%9F.png)
目录第一页没有页眉和页脚,但第二页有页眉和页脚。
我的问题:我不需要目录上的任何编号和页眉/页脚。如何才能让整个目录(不仅仅是第一页)不带页眉或页脚地显示,并从第 1 章开始?
\documentclass[tikz,table,twoside,12pt,a4paper]{report}
\usepackage{PTSansNarrow}
\usepackage[T1]{fontenc}
\usepackage{array,tabularx}
\usepackage[most]{tcolorbox}
\usepackage{xcolor}
\usepackage{enumerate}
\usepackage{graphicx}
\usepackage[ruled, vlined, linesnumbered]{algorithm2e}
\usepackage{censor}
\censorruledepth=-.2ex
\censorruleheight=.1ex
\usepackage{setspace}
\usepackage{subfigure}
\usepackage{subfig}
\usepackage[top=3.5cm, bottom=3.5cm, left=3.5cm, right=2.75cm]{geometry}
\usepackage{fancyhdr}
\usepackage{url}
\usepackage{fancyvrb}
\usepackage{color}
\textwidth14cm
\definecolor{darkblue}{rgb}{0.1,0.3,0.5}
\DefineVerbatimEnvironment%
{MyVerbatim}{Verbatim}
{gobble=0,label=\hspace{.85\textwidth},labelposition=all}
\usepackage[Lenny]{fncychap}%Sonny, Lenny, Glenn, Conny, Rejne, Bjornstrup and Bjarne
\usepackage{cite}
\usepackage{rotfloat}
\usepackage{subfloat}
\usepackage[titletoc]{appendix}
% load package with ``framed'' and ``numbered'' option.
\usepackage[numbered,autolinebreaks,useliterate]{mcode}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{}
\fancyhead[R]{\nouppercase{\leftmark}}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{2pt}
\renewcommand{\footrulewidth}{1pt}
\begin{document}
\pagenumbering{gobble}% Remove page numbers (and reset to 1)
\clearpage
\title{\textbf{THESIS NAME}\\
\begin{figure}[ht]
\centering
\includegraphics[width=0.5\textwidth]{logo.eps}
\end{figure}
}
\date{}
\author{\textbf{SUBMITTED BY:}\\\textbf{STUDENT NAME}
\vspace{5mm}
\\
\textbf{Supervised By}\\
\textbf{NAME}\quad
\vspace{10mm}
\\
\textbf{DEPARTMENT OF COMPUTER SCIENCE} \\\textbf{NAME OF UNIVERSITY} \\\textbf{Session:2012-2013} }
\maketitle
\null
\vfill
\null
\vfill
\onehalfspacing
\newpage
\pagenumbering{roman}
\chapter* {PROJECT APPROVAL}
SAKASLJFSAJFKSAJFJEIJ S\KJ\\\\
\newline
COMMITTEE\\\\
\newline
\begin{flushleft}
External Examiner: \line(1,0){250}
\end{flushleft}
\begin{flushleft}
Comments: \line(1,0){250}
\end{flushleft}
\begin{flushleft}
Internal Examiner: \line(1,0){250}
\end{flushleft}
\begin{flushleft}
Comments: \line(1,0){250}
\end{flushleft}
\begin{flushleft}
Chairman: \line(1,0){250}
\end{flushleft}
\begin{flushleft}
Comments: \line(1,0){250}
\end{flushleft}
\chapter* {DEDICATION}
KSAHDSAFH ASK JFASKJF
\chapter* {ABSTRACT}
XCLSCSAJFSAFOSAFISADKFLASKFL;ASKSAKFLKSALKFS
\chapter* {ACKNOWLEDGEMENT}
LSAFLDSFJ SDAFJIASFAS JFSJAF SFSFAUI DSAF
\chapter* {AUTHOR'S DECLARATION}
ABC
\newline
Signature of Authors\\
\newline
ABC: \xblackout{forty two}\\
\newline
ABC: \xblackout{forty two}\\
\newline
Date: \xblackout{forty two}\\
\newpage
\pagenumbering{gobble}% Remove page numbers (and reset to 1)
\clearpage
\tableofcontents
\pagenumbering{arabic}
\input{ch1}
\input{ch2}
\input{ch3}
\input{ch4}
\input{ch5}
\input{ch6}
\input{ch7}
\input{ch8}
\addcontentsline{toc}{section}{\textbf{Bibliography}}
\bibliographystyle{plain}
\bibliography{bibk}
\end{document}
答案1
我不知道这个输出是否是有意的,但我\relaxed
基本上是\thispagestyle{}
在内的命令\renewcommand{\tableofcontents}
,以便实际应用标题等。
编辑:这个问题的第一个版本非常不清楚甚至是矛盾的,所以我使用了这个答案,但我不会更新它。
重要的一行是
\let\LaTeXStandardTOC\tableofcontents%
\renewcommand{\tableofcontents}{%
\begingroup
\renewcommand{\thispagestyle}[1]{%
\relax% Do nothing at all
}%
\LaTeXStandardTOC%
\endgroup
}%
什么renewcommand{\thispagestyle}
也不做的必须是grouped
,以便它仅在那里有效,并且当发生对该命令的其他调用时按预期工作。
\documentclass[tikz,table,twoside,12pt,a4paper]{report}
\usepackage{blindtext}
\usepackage{PTSansNarrow}
\usepackage[T1]{fontenc}
\usepackage{array,tabularx}
\usepackage[most]{tcolorbox}
\usepackage{xcolor}
\usepackage{enumerate}
\usepackage{graphicx}
\usepackage[ruled, vlined, linesnumbered]{algorithm2e}
\usepackage{censor}
\censorruledepth=-.2ex
\censorruleheight=.1ex
\usepackage{setspace}
\usepackage{subfigure}
\usepackage{subfig}
\usepackage[top=3.5cm, bottom=3.5cm, left=3.5cm, right=2.75cm]{geometry}
\usepackage{fancyhdr}
\usepackage{url}
\usepackage{fancyvrb}
\usepackage{color}
\textwidth14cm
\definecolor{darkblue}{rgb}{0.1,0.3,0.5}
\DefineVerbatimEnvironment%
{MyVerbatim}{Verbatim}
{gobble=0,label=\hspace{.85\textwidth},labelposition=all}
\usepackage[Lenny]{fncychap}%Sonny, Lenny, Glenn, Conny, Rejne, Bjornstrup and Bjarne
\usepackage{cite}
\usepackage{rotfloat}
\usepackage{subfloat}
\usepackage[titletoc]{appendix}
% load package with ``framed'' and ``numbered'' option.
%\usepackage[numbered,autolinebreaks,useliterate]{mcode}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[LE,RO]{}
\fancyhead[R]{\nouppercase{\leftmark}}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{2pt}
\renewcommand{\footrulewidth}{1pt}
\begin{document}
\pagenumbering{gobble}% Remove page numbers (and reset to 1)
\clearpage
\title{\textbf{THESIS NAME}\\
\begin{figure}[ht]
\centering
%\includegraphics[width=0.5\textwidth]{logo.eps}
\end{figure}
}
\date{}
\author{\textbf{SUBMITTED BY:}\\\textbf{STUDENT NAME}
\vspace{5mm}
\\
\textbf{Supervised By}\\
\textbf{NAME}\quad
\vspace{10mm}
\\
\textbf{DEPARTMENT OF COMPUTER SCIENCE} \\\textbf{NAME OF UNIVERSITY} \\\textbf{Session:2012-2013} }
\maketitle
\null
\vfill
\null
\vfill
\onehalfspacing
\newpage
\pagenumbering{roman}
\chapter* {PROJECT APPROVAL}
%SAKASLJFSAJFKSAJFJEIJ S\KJ\\\\
%\newline
COMMITTEE\\ % \\
\newline
\begin{flushleft}
External Examiner: \line(1,0){250}
\end{flushleft}
\begin{flushleft}
Comments: \line(1,0){250}
\end{flushleft}
\begin{flushleft}
Internal Examiner: \line(1,0){250}
\end{flushleft}
\begin{flushleft}
Comments: \line(1,0){250}
\end{flushleft}
\begin{flushleft}
Chairman: \line(1,0){250}
\end{flushleft}
\begin{flushleft}
Comments: \line(1,0){250}
\end{flushleft}
\chapter* {DEDICATION}
KSAHDSAFH ASK JFASKJF
\chapter* {ABSTRACT}
XCLSCSAJFSAFOSAFISADKFLASKFL;ASKSAKFLKSALKFS
\chapter* {ACKNOWLEDGEMENT}
LSAFLDSFJ SDAFJIASFAS JFSJAF SFSFAUI DSAF
\chapter* {AUTHOR'S DECLARATION}
ABC
\newline
Signature of Authors\\
\newline
ABC: \xblackout{forty two}\\
\newline
ABC: \xblackout{forty two}\\
\newline
Date: \xblackout{forty two}\\
\newpage
\pagenumbering{gobble}% Remove page numbers (and reset to 1)
\clearpage
\tableofcontents
\pagenumbering{arabic}
\chapter{Number 1}
\blindtext
\chapter{Number 2}
\section{1}
\section{2}
\section{3}
\section{4}
\section{5}
\section{6}
\section{7}
\section{8}
\section{9}
\blindtext
\chapter{Number 3}
\blindtext
\chapter{Number 4}
\blindtext
\chapter{Number 5}
\blindtext
\chapter{Number 6}
\blindtext
\chapter{Number 7}
\section{1}
\section{2}
\section{3}
\blindtext
\chapter{Number 8}
\blindtext
%\input{ch1}
%\input{ch2}
%\input{ch3}
%\input{ch4}
%\input{ch5}
%\input{ch6}
%\input{ch7}
%\input{ch8}
\addcontentsline{toc}{section}{\textbf{Bibliography}}
\bibliographystyle{plain}
\bibliography{bibk}
\end{document}
笔记我必须注释掉几行才能使示例能够编译!
编辑目录无页眉和页脚的解决方案 如果在要发送\pagestyle{fancy}
时处于活动状态\tablecontents
,则毫无疑问这也适用于目录的第二页及后续页面。因此,将 移至\pagestyle
之后的位置,在\clearpage
之前应用 。
\documentclass[tikz,table,twoside,12pt,a4paper]{report}
\usepackage{blindtext}
\usepackage{PTSansNarrow}
\usepackage[T1]{fontenc}
\usepackage{array,tabularx}
\usepackage[most]{tcolorbox}
\usepackage{xcolor}
\usepackage{enumerate}
\usepackage{graphicx}
\usepackage[ruled, vlined, linesnumbered]{algorithm2e}
\usepackage{censor}
\censorruledepth=-.2ex
\censorruleheight=.1ex
\usepackage{setspace}
\usepackage{subfigure}
\usepackage{subfig}
\usepackage[top=3.5cm, bottom=3.5cm, left=3.5cm, right=2.75cm]{geometry}
\usepackage{fancyhdr}
\usepackage{url}
\usepackage{fancyvrb}
\usepackage{color}
\textwidth14cm
\definecolor{darkblue}{rgb}{0.1,0.3,0.5}
\DefineVerbatimEnvironment%
{MyVerbatim}{Verbatim}
{gobble=0,label=\hspace{.85\textwidth},labelposition=all}
\usepackage[Lenny]{fncychap}%Sonny, Lenny, Glenn, Conny, Rejne, Bjornstrup and Bjarne
\usepackage{cite}
\usepackage{rotfloat}
\usepackage{subfloat}
\usepackage[titletoc]{appendix}
% load package with ``framed'' and ``numbered'' option.
%\usepackage[numbered,autolinebreaks,useliterate]{mcode}
\fancyhf{}
\fancyhead[LE,RO]{}
\fancyhead[R]{\nouppercase{\leftmark}}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{2pt}
\renewcommand{\footrulewidth}{1pt}
\begin{document}
\pagenumbering{gobble}% Remove page numbers (and reset to 1)
\clearpage
\title{\textbf{THESIS NAME}\\
\begin{figure}[ht]
\centering
%\includegraphics[width=0.5\textwidth]{logo.eps}
\end{figure}
}
\date{}
\author{\textbf{SUBMITTED BY:}\\\textbf{STUDENT NAME}
\vspace{5mm}
\\
\textbf{Supervised By}\\
\textbf{NAME}\quad
\vspace{10mm}
\\
\textbf{DEPARTMENT OF COMPUTER SCIENCE} \\\textbf{NAME OF UNIVERSITY} \\\textbf{Session:2012-2013} }
\maketitle
\null
\vfill
\null
\vfill
\onehalfspacing
\newpage
\pagenumbering{roman}
\chapter* {PROJECT APPROVAL}
%SAKASLJFSAJFKSAJFJEIJ S\KJ\\\\
%\newline
COMMITTEE\\ % \\
\newline
\begin{flushleft}
External Examiner: \line(1,0){250}
\end{flushleft}
\begin{flushleft}
Comments: \line(1,0){250}
\end{flushleft}
\begin{flushleft}
Internal Examiner: \line(1,0){250}
\end{flushleft}
\begin{flushleft}
Comments: \line(1,0){250}
\end{flushleft}
\begin{flushleft}
Chairman: \line(1,0){250}
\end{flushleft}
\begin{flushleft}
Comments: \line(1,0){250}
\end{flushleft}
\chapter* {DEDICATION}
KSAHDSAFH ASK JFASKJF
\chapter* {ABSTRACT}
XCLSCSAJFSAFOSAFISADKFLASKFL;ASKSAKFLKSALKFS
\chapter* {ACKNOWLEDGEMENT}
LSAFLDSFJ SDAFJIASFAS JFSJAF SFSFAUI DSAF
\chapter* {AUTHOR'S DECLARATION}
ABC
\newline
Signature of Authors\\
\newline
ABC: \xblackout{forty two}\\
\newline
ABC: \xblackout{forty two}\\
\newline
Date: \xblackout{forty two}\\
\let\LaTeXStandardTOC\tableofcontents%
\renewcommand{\tableofcontents}{%
\begingroup
\renewcommand{\thispagestyle}[1]{%
\relax% Do nothing at all
}%
\LaTeXStandardTOC%
\endgroup
}%
\newpage
\pagenumbering{gobble}% Remove page numbers (and reset to 1)
\clearpage
\tableofcontents
\clearpage%
\pagestyle{fancy}
\pagenumbering{arabic}
\chapter{Number 1}
\blindtext
\chapter{Number 2}
\section{1}
\section{2}
\section{3}
\section{4}
\section{5}
\section{6}
\section{7}
\section{8}
\section{9}
\blindtext
\chapter{Number 3}
\blindtext
\chapter{Number 4}
\blindtext
\chapter{Number 5}
\blindtext
\chapter{Number 6}
\blindtext
\chapter{Number 7}
\section{1}
\section{2}
\section{3}
\blindtext
\chapter{Number 8}
\blindtext
%\input{ch1}
%\input{ch2}
%\input{ch3}
%\input{ch4}
%\input{ch5}
%\input{ch6}
%\input{ch7}
%\input{ch8}
\addcontentsline{toc}{section}{\textbf{Bibliography}}
\bibliographystyle{plain}
\bibliography{bibk}
\end{document}