我正在将其classicthesis
用于我的论文,并且我有两个与目录(TOC)方面相关的问题。
正如你从附图中看到的那样
目录中的页码(和点)颜色会发生变化。考虑到两章共享相同的目录和
hyperref
设置,这怎么可能呢?我还想强调的是,对于第 2 章,页码的颜色好像是链接,但它并不是我所期望的链接(即我无法单击它),因为我设置了选项
linktocpage=false
。为什么颜色会改变?我希望目录中的第一项不缩进,也不带点。有什么办法吗?
不幸的是我无法提供任何最小代码,因为我不知道问题可能是什么。我猜这可能与hyperref
这里的包有关,设置如下:
\usepackage{hyperref}
\PassOptionsToPackage{pdftex,hyperfootnotes=false,pdfpagelabels}{hyperref}
\hypersetup{colorlinks=true, pdfborder={0 0 0}, pdfstartpage=3, pdfstartview=FitV, linktocpage=false, breaklinks=true, fpagemode=UseNone, pageanchor=true, pdfpagemode=UseOutlines, plainpages=false, bookmarksnumbered, bookmarksopen=true, bookmarksopenlevel=1,hypertexnames=true, pdfhighlight=/O, urlcolor=webbrown, linkcolor=RoyalBlue, citecolor=webbrown}
对于我做错的事情的任何帮助、建议或想法都将不胜感激。
更新
这是我使用的设置的最小示例。目录第一项的缩进问题仍然存在,但我无法在此示例中重现有关页码颜色错误的问题
\documentclass{report}
\usepackage{classicthesis,lipsum}
\PassOptionsToPackage{pdftex,hyperfootnotes=false,pdfpagelabels}{hyperref}
\usepackage{hyperref}
\pdfcompresslevel=9
\pdfadjustspacing=1
\hypersetup{colorlinks=true, pdfborder={0 0 0}, pdfstartpage=3, pdfstartview=FitV, linktocpage=false,
breaklinks=true, pdfpagemode=UseNone, pageanchor=true, pdfpagemode=UseOutlines,
plainpages=false, bookmarksnumbered, bookmarksopen=true, bookmarksopenlevel=1,%
hypertexnames=true, pdfhighlight=/O,
urlcolor=webbrown, linkcolor=RoyalBlue, citecolor=webbrown,
}
\begin{document}
\refstepcounter{dummy}
\pdfbookmark[1]{\contentsname}{tableofcontents}
\setcounter{tocdepth}{2}
\setcounter{secnumdepth}{3}
\manualmark
\markboth{\spacedlowsmallcaps{\contentsname}}{\spacedlowsmallcaps{\contentsname}}
\tableofcontents
\automark[section]{chapter}
\renewcommand{\chaptermark}[1]{\markboth{\spacedlowsmallcaps{#1}}{\spacedlowsmallcaps{#1}}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\enspace\spacedlowsmallcaps{#1}}}
\clearpage
\begingroup
\let\clearpage\relax
\let\cleardoublepage\relax
\let\cleardoublepage\relax
%----------------------------------------------------------------------------------------
% List of Figures
%----------------------------------------------------------------------------------------
\acresetall
\refstepcounter{dummy}
\addcontentsline{toc}{section}{\listfigurename}
\pdfbookmark[1]{\listfigurename}{lof}
\listoffigures
\vspace{8ex}
%----------------------------------------------------------------------------------------
% List of Tables
%----------------------------------------------------------------------------------------
\refstepcounter{dummy}
\addcontentsline{toc}{chapter}{\listtablename}
\pdfbookmark[1]{\listtablename}{lot}
\listoftables
\sloppy % Just for this example
\chapter{First chapter}\lipsum[1]
\section{First section}\lipsum[1-10]
\section{Second section}\lipsum[11-20]
\section{Third section}\lipsum[21-30]
\section{Last section}\lipsum[31-40]
\chapter{Second chapter}\lipsum[1]
\section{First section}\lipsum[1-10]
\section{Second section}\lipsum[11-20]
\section{Third section}\lipsum[21-30]
\section{Last section}\lipsum[31-40]
\chapter{Third chapter}\lipsum[1]
\section{First section}\lipsum[1-10]
\section{Second section}\lipsum[11-20]
\section{Third section}\lipsum[21-30]
\section{Last section}\lipsum[31-40]
\chapter{Last chapter}\lipsum[1]
\section{First section}\lipsum[1-10]
\section{Second section}\lipsum[11-20]
\section{Third section}\lipsum[21-30]
\section{Last section}\lipsum[31-40]
\end{document}
答案1
图表列表在目录中缩进,因为您已使用section
来输入目录,但您想要chapter
。请注意,不建议手动输入目录条目。我建议使用tocbibind
带有选项 的包nottoc
。
我没有在目录中看到虚线。当我dottedtoc
为包添加选项时classicthesis
,我无法重现您的问题。
包classicthesis
加载包hyperref
。因此后者\PassOptionsToPackage{pdftex,hyperfootnotes=false,pdfpagelabels}{hyperref}
被忽略(并且不需要)。
\manualmark
另外,文档之间和文档内部的切换\automark
可以用序言中的设置来代替。
\documentclass{report}
\usepackage{lipsum}% only for dummy text
\usepackage[nottoc]{tocbibind}
\usepackage[dottedtoc]{classicthesis}
\pdfcompresslevel=9
\pdfadjustspacing=1
\hypersetup{
%colorlinks=true,% already set by classicthesis
pdfborder={0 0 0}, pdfstartpage=3, pdfstartview=FitV, linktocpage=false,
%breaklinks=true,% already set by classicthesis
pdfpagemode=UseNone, pageanchor=true, pdfpagemode=UseOutlines,
plainpages=false, bookmarksnumbered, bookmarksopen=true, bookmarksopenlevel=1,
hypertexnames=true, pdfhighlight=/O,
urlcolor=webbrown, linkcolor=RoyalBlue, citecolor=webbrown,
}
\ohead{\spacedlowsmallcaps{\rightmark}}
\renewcommand{\chaptermark}[1]{\markboth{#1}{#1}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\enspace#1}}
\setcounter{tocdepth}{2}
\setcounter{secnumdepth}{3}
\begin{document}
%\refstepcounter{dummy}% <- undefined counter
\pdfbookmark[1]{\contentsname}{tableofcontents}
\tableofcontents
\clearpage
\begingroup
\let\clearpage\relax
\let\cleardoublepage\relax
%----------------------------------------------------------------------------------------
% List of Figures
%----------------------------------------------------------------------------------------
%\acresetall% <- undefined
%\refstepcounter{dummy} % <- undefined counter
\listoffigures
\vspace{8ex}
%----------------------------------------------------------------------------------------
% List of Tables
%----------------------------------------------------------------------------------------
%\refstepcounter{dummy}% <- undefined counter
\listoftables
\endgroup % <- added: should it be there?
%\sloppy % Just for this example
\chapter{First chapter}\lipsum[1]
\section{First section}\lipsum[1-10]
\section{Second section}\lipsum[11-20]
\section{Third section}\lipsum[21-30]
\section{Last section}\lipsum[31-40]
\chapter{Second chapter}\lipsum[1]
\section{First section}\lipsum[1-10]
\section{Second section}\lipsum[11-20]
\section{Third section}\lipsum[21-30]
\section{Last section}\lipsum[31-40]
\chapter{Third chapter}\lipsum[1]
\section{First section}\lipsum[1-10]
\section{Second section}\lipsum[11-20]
\section{Third section}\lipsum[21-30]
\section{Last section}\lipsum[31-40]
\chapter{Last chapter}\lipsum[1]
\section{First section}\lipsum[1-10]
\section{Second section}\lipsum[11-20]
\section{Third section}\lipsum[21-30]
\section{Last section}\lipsum[31-40]
\end{document}