错误的页码(ToC-LoT)-ToC 之前有空白页-

错误的页码(ToC-LoT)-ToC 之前有空白页-

首先,我很抱歉我的 WE 不是最小的。我会解释为什么不是...我正在书籍类文档中创建目录。目录从第 iii 页开始(我使用罗马数字)并在第 iv 页结束。但是,目录条目表明目录从第 iv 页开始。

另一个问题是,在 ToC 之前有两页空白页(i、ii),但我不知道如何让它们消失。

最后一个问题与 LoT 有关。尽管在阿拉伯语页码之前包含了 LoT,但 LoT 从第 1 页开始。我试过了\setcounter{page}{xi},但显示缺少一个数字。

我该如何解决这些问题。这是我的 WE(尽管生成了 8 个错误 pdf)。它不是 MWE 的原因是我想添加章节和部分以创建两页的目录。

\documentclass[11pt,a4paper]{book}
\usepackage{kerkis}
\usepackage{units}
\usepackage[pdftex]{graphicx}
\usepackage[Glenn]{fncychap}
\usepackage{float}
\usepackage{xcolor}

\usepackage{tocloft}
\setlength\cftparskip{0pt}
\setlength\cftbeforesecskip{-5pt}
\setlength\cftbeforesubsecskip{-8pt}
\setlength\cftbeforechapskip{-1pt}
\setlength\cftaftertoctitleskip{-50pt}
 \setlength\cftbeforefigskip{-5pt}
\setlength\cftbeforetabskip{-5pt}
\makeatletter
\newcommand*{\tocwithouttitle}{\@starttoc{toc}}
\makeatother
%--------------------------------------------------------------------------------
\makeatletter
\newcommand*{\lofwithouttitle}{\@starttoc{lof}}
\makeatother
%--------------------------------------------------------------------------------
\makeatletter
\newcommand*{\lotwithouttitle}{\@starttoc{lot}}
\makeatother
%--------------------------------------------------------------------------------
%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}

\newcommand{\HRule}{\rule{\linewidth}{0.8mm}}

\begin{document}
\begin{titlepage}
\begin{figure}[H]
 \begin{center}
 \includegraphics[scale=0.2]{logo.jpg}
 \end{center}
 \end{figure}
 \begin {center}
 \large
{University\\Faculty\\Department\\Group}\\
\vspace{2cm}
\HRule\\ \vspace{0.7cm} \textbf{\LARGE Title}\\ \vspace{0.7cm}\HRule
\vspace{2cm}
{\La rge Author}\\ \vspace{2cm}
supervision\\
\vspace{2cm}
{\Large Prof\\
\Large Supervisor}\\ \vspace{4cm}
Month Year
\end{center}

\newpage
\thispagestyle{empty}
\mbox{}
\end{titlepage}

\pagenumbering{roman}

\textcolor{blue}{\chapter*{\contentsname}}
\markboth{\MakeUppercase{\contentsname}}{\MakeUppercase{\contentsname}}
\textcolor{blue}{\tocwithouttitle}
\addcontentsline{toc}{chapter}{Contents}

\textcolor{blue}{\chapter*{Abstract}}
\addcontentsline{toc}{chapter}{Abstract}
\markboth{\MakeUppercase{Abstract}}{\MakeUppercase{Abstract}}

This is the abstract

\textcolor{blue}{\chapter*{Aknowledgements}}
\addcontentsline{toc}{chapter}{Aknowledgements}
\markboth{\MakeUppercase{Aknowledgements}}{\MakeUppercase{Aknowledgements}}

These are aknowledgements

\textcolor{blue}{\chapter*{LoF}}
\markboth{\MakeUppercase{LoF}}{\MakeUppercase{LoF}}
\textcolor{blue}{\lofwithouttitle}
\addcontentsline{toc}{chapter}{LoF}

 \textcolor{blue}{\chapter*{LoT}}
\markboth{\MakeUppercase{LoT}}{\MakeUppercase{LoT}}
\textcolor{blue}{\lotwithouttitle}
%\setcounter{page}{xi}<----Error missing number/seems it doesn't accept roman like that
\addcontentsline{toc}{chapter}{LoT}

\pagenumbering{arabic}

\chapter{Introduction}

This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introductionThis is the introductionThis is the introductionThis is the introductionThis is the introductionThis is the introductionThis is the introductionThis is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.v.This is the introduction.This is the introductionThis is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the introduction.This is the     introduction.This is the introduction.This is the introduction.This is the introduction.

\newpage
\section{Intro}
bla bla bla\\
\section{Intro}
bla bla bla\\
\section{Intro}
bla  bla bla\\
\section{Intro}
bla bla bla\\
\subsection{intro}
bla bla bla\\

\newpage
\section{Intro}
bla bla bla\\
\section{Intro}
bla bla bla\\
\section{Intro}
 bla bla bla\\
\section{Intro}
bla bla bla\\
\subsection{intro}
bla bla bla\\

\newpage
\section{Intro}
 bla bla bla\\
\section{Intro}
bla bla bla\\
\section{Intro}
bla bla bla\\
 \section{Intro}
bla bla bla\\
\subsection{intro}
bla bla bla\\

 \newpage
\section{Intro}
bla bla bla\\
\section{Intro}
bla bla bla\\
\section{Intro}
bla bla bla\\
\section{Intro}
bla bla bla\\
\subsection{intro}
bla bla bla\\

\chapter{Theory}
This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.This is about theory.

 \newpage
\section{Theo}
bla bla bla\\
\section{Theo}
bla bla bla\\
\section{Theo}
 bla bla bla\\
 \section{Theo}
 bla bla bla\\
 \subsection{theo}
 bla bla bla\\

\newpage
\section{Theo}
 bla bla bla\\
\section{Theo}
bla bla bla\\
\section{Theo}
bla bla bla\\
\section{Theo}
bla bla bla\\
\subsection{theo}
 bla bla bla\\

\newpage
\section{Theo}
bla bla bla\\
\section{Theo}
bla bla bla\\
\section{Theo}
bla bla bla\\
\section{Theo}
bla bla bla\\
\subsection{theo}
bla bla bla\\

\newpage
\section{Theo}
bla bla bla\\
\section{Theo}
bla bla bla\\
\section{Theo}
bla  bla bla\\
\se ction{Theo}
bla bla bla\\
\subsection{theo}
bla  bla bla\\

\chapter{Experiment}
This is about epxeriment.This is about epxeriment.This is about epxeriment.This is about  epxeriment.This is about epxeriment.This is about epxeriment.This is about epxeriment.This  is about epxeriment.This is about epxeriment.This is about epxeriment.This is about  epxeriment.This is about epxeriment.This is about epxeriment.This is about epxeriment.This  is about epxeriment.This is about epxeriment.This is about epxeriment.This is about epxeriment.This is about epxeriment.This is about epxeriment.This is about epxeriment.This  is about epxeriment.This is about epxeriment.This is about epxeriment.This is about  epxeriment.This is about epxeriment.This is about epxeriment.This is about epxeriment.This  is about epxeriment.This is about epxeriment.This is about epxeriment.This is about  epxeriment.This is about epxeriment.This is about epxeriment.This is about epxeriment.This  is about epxeriment.This is about epxeriment.This is about epxeriment.This is about  epxeriment.This is about epxeriment.This is about epxeriment.This is about epxeriment.This  is about epxeriment.This is about epxeriment.This is about epxeriment.This is about  epxeriment.This is about epxeriment.This is about epxeriment.This is about epxeriment.This  is about epxeriment.This is about epxeriment.This is about epxeriment.This is about  epxeriment.This is about epxeriment.This is about epxeriment.This is about epxeriment.This    is about epxeriment.This is about epxeriment.This is about epxeriment.This is about     epxeriment.This is about epxeriment.This is about epxeriment.This is about epxeriment.This     is about epxeriment.This is about epxeriment.This is about epxeriment.This is about     epxeriment.This is about epxeriment.This is about epxeriment.This is about epxeriment.This    is about epxeriment.This is about epxeriment.This is about epxeriment.This is about     epxeriment.

\newpage
\section{Exp}
bla bla bla\\
\section{Exp}
bla bla bla\\
\section{Exp}
bla bla bla\\
\section{Exp}
bla bla bla\\
\subsection{exp}
bla bla bla\\

\newpage
\section{Exp}
bla bla bla\\
\section{Exp}
bla bla bla\\
\section{Exp}
bla bla bla\\
\section{Exp}
bla bla bla\\
\subsection{exp}
bla bla bla\\

\newpage
\section{Exp}
bla bla bla\\
\section{Exp}
bla bla bla\\
\section{Exp}
bla bla bla\\
\section{Exp}
bla bla bla\\
\subsection{exp}
bla bla bla\\

\newpage
\section{Exp}
bla bla bla\\
\section{Exp}
bla bla bla\\
\section{Exp}
bla bla bla\\
\section{Exp}
bla bla bla\\
\subsection{exp}
 bla bla bla\\

\end{document}

我的真实目录,具有更好的间距是

答案1

我无法理解一些事情:(1)为什么将目录放在目录中;(2)为什么要以如此可怕的方式挤压目录;(3)为什么对前言使用不同的颜色。

然而,这里有一种方法可以让您的输入变得更容易。

\documentclass[11pt,a4paper]{book}
\usepackage{kerkis}
\usepackage{units}
\usepackage{graphicx}
\usepackage[Glenn]{fncychap}
\usepackage{xcolor}

\usepackage{tocloft}
\setlength\cftparskip{0pt}
\setlength\cftaftertoctitleskip{-50pt}

% VALUES BELOW ARE QUESTIONABLE
%\setlength\cftbeforesecskip{-5pt}
%\setlength\cftbeforesubsecskip{-8pt}
%\setlength\cftbeforechapskip{-1pt}
% \setlength\cftbeforefigskip{-5pt}
%\setlength\cftbeforetabskip{-5pt}

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\chaptermark}[1]{\markboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}}
\fancyhf{}
\fancyhead[RE]{\slshape\color{\currentprintcolor}%
  \ifnum\value{chapter}>0 \MakeUppercase{\chaptername} \thechapter. \fi\leftmark}
\fancyhead[LO]{\slshape\color{\currentprintcolor}\rightmark}
\fancyhead[RO,LE]{\color{\currentprintcolor}\thepage}
\fancypagestyle{plain}{
  \renewcommand{\headrulewidth}{0pt}
  \fancyhf{}\fancyfoot[C]{\color{\currentprintcolor}\thepage}
}
\setlength{\headheight}{13.5pt}

\newcommand{\currentprintcolor}{black}
\newenvironment{printinblue}
  {\cleardoublepage\renewcommand{\currentprintcolor}{blue}\color{blue}}
  {\cleardoublepage}

\makeatletter
\newcommand*{\withouttitle}[1]{\@starttoc{#1}}
\makeatother
%--------------------------------------------------------------------------------
%!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}

\newcommand{\HRule}{\rule{\linewidth}{0.8mm}}

\begin{document}

\frontmatter

\begin{titlepage}
 \begin{center}
 \includegraphics[scale=0.2]{logo.jpg}
 \end{center}
 \begin {center}
 \large
{University\\Faculty\\Department\\Group}\\
\vspace{2cm}
\HRule\\ \vspace{0.7cm} \textbf{\LARGE Title}\\ \vspace{0.7cm}\HRule
\vspace{2cm}
{\Large Author}\\ \vspace{2cm}
supervision\\
\vspace{2cm}
{\Large Prof\\
\Large Supervisor}\\ \vspace{4cm}
Month Year
\end{center}
\end{titlepage}


\begin{printinblue}

\chapter{\contentsname}
\withouttitle{toc}

\chapter{Abstract}

This is the abstract

\chapter{Acknowledgements}

These are acknowledgements

\chapter{\listfigurename}
\withouttitle{lof}

\chapter{\listtablename}
\withouttitle{lot}

\end{printinblue}

\mainmatter

\chapter{Introduction}

...    

\end{document}

如果你能删除“Glenn”章节样式我会更高兴。


您的输入有很多错误。首先,页码:如果您\addcontentsline在列表末尾(\tocwithouttitle准确地说,在您的 之后)输入,则引用的页面是最后的一。

您的使用\textcolor是错误的:\textcolor{blue}{\tocwithouttitle}会出现很多错误,因为 LaTeX 会尝试在水平框中排版目录:就像\mbox{\tableofcontents}这样不能工作。

因此,最好的方法是更改​​前言的文本颜色,我使用环境来执行此操作printinblue。还需要修改页眉和页脚的排版方式,因此我加载fancyhdr并进行必要的设置,以获得与标准book类设置相同的输出。

使用\frontmatter可以让您免于手动插入目录的标记和参考资料。此外,它会自动将页码设置为罗马数字;您可以\mainmatter选择阿拉伯数字作为页码。

相关内容