我已经写好了一篇论文,准备提交,但不幸的是,一卷的页数限制是 300 页,而我的论文是 324 页。解决方案是将附录从正文中分离出来,并放在单独的卷中。
我现在需要的是一个内容页,上面写着:
Volume one
Chapter 1 blah..... 1
Chapter 2 blah..... 4
...
Volume two
Appendix 1 ...... A1
Appendix 2 ...... A3
Appendix 3 ...... A12
...
此目录页应出现在两卷中。一次是当前目录,一次是第二卷的开头。
我的序言是:
\documentclass[a4paper, 11pt, oneside]{book}
\usepackage[UKenglish]{babel}
\usepackage[left=3cm, right=3cm, bottom=3.5cm, top=3.5cm]{geometry}
\usepackage[
font=footnotesize,
center
]{caption} % Changes font size of figure captions to small
\usepackage[
backend=biber,
block=space,
date=long,
doi=false,
dashed=false,
eprint=false,
firstinits=true,
isbn=false,
minnames=2,
maxnames=2,
mincitenames=2,
maxcitenames=2,
natbib=true,
sortcites=false,
sorting=nyt,
style=authoryear-comp,
terseinits=true,
uniquelist=false,
uniquename=false,
url=false
]{biblatex}
\addbibresource{C:/Documents and Settings/LBOYD/My Documents/LaTeX/BibTex/library.bib}
%Put initials after names...
\DeclareNameAlias{sortname}{last-first}
\DeclareNameAlias{default}{last-first}
%Remove "and" before last name. However, this also removes "and" in a textcite...
\renewcommand*{\finalnamedelim}{\space\&\space}
\usepackage{fancyhdr} % Provides support for improved document headers
\usepackage{graphicx} % Provides support for inserting images
\usepackage{tikz} % Provides support for tikz images
\usetikzlibrary{arrows} % Add arrows package to tikz
\usepackage{wrapfig} % Allows text to wrap around images
\usepackage{sidecap} % Allows captions to be put to side of figures
\usepackage{subfig} % Allows us to include sub-figures
\usepackage{float}
\usepackage{pdflscape}
\usepackage{makeidx}
\usepackage[big,compact]{titlesec}
\usepackage{pdfpages}
\usepackage[inline]{enumitem}
\usepackage{multirow}
\usepackage{mathtools}
\usepackage[hidelinks]{hyperref}
\hypersetup{
pdftitle=Third Year Report,
pdfauthor=Liam Boyd,
pdfkeywords=EngD Thesis CMOS VCO Oscillator Transmission
}
\usepackage{longtable}
\usepackage{acro}% needs v0.4 of `acro'
\acsetup{
page-name=Acronyms,
list-style=longtable,
list-header=chapter*,
list-table-width=10cm,
list-long-format=\capitalisewords
}
\usepackage{mfirstuc}% provides\capitalisewords
\include{Frontmatter/acronyms2} %Include external acronym list.
\makeindex
\setlength{\parindent}{0in}
\usepackage{setspace}
\doublespacing
\newcommand{\comment}[1]{}
\begin{document}
%%---------------------------------------------------------------
% FRONTMATTER
%%---------------------------------------------------------------
\pdfbookmark[0]{Title}{Title}
\input{Frontmatter/titlepage} % Custom front page
\frontmatter
\input{Frontmatter/abstract} % Document Abstract
\addcontentsline{toc}{chapter}{Abstract}
\pagestyle{plain} % Set page style
\input{Frontmatter/declaration}
\addcontentsline{toc}{chapter}{Declaration}
\input{Frontmatter/acknowledgments} % Acknowledgements page
\addcontentsline{toc}{chapter}{Acknowledgements}
\listoffigures % List of figures
\addcontentsline{toc}{chapter}{List of Figures}
\newpage % Start a new page
\listoftables % List of Tables
\addcontentsline{toc}{chapter}{List of Tables}
\newpage % Start a new page
\begingroup
\setlength{\LTleft}{-\tabcolsep}
\printacronyms
\endgroup
\addcontentsline{toc}{chapter}{Acronyms}%\printacronyms
\clearpage % Start a new page
\pdfbookmark[0]{Contents}{Contents}
\tableofcontents % Insert a table of contents
\clearpage
%%---------------------------------------------------------------
% INPUT CHAPTERS
%%---------------------------------------------------------------
\mainmatter
\pagestyle{plain}
\input{Mainmatter/Introduction}
\input{Mainmatter/DesignOptions}
\input{Mainmatter/SystemsContext}
\input{Mainmatter/MB8AW4316}
\input{Mainmatter/MB8AW5318}
\input{Mainmatter/Analysis}
\input{Mainmatter/Conclusion}
%%---------------------------------------------------------------
% BACK MATTER
%%---------------------------------------------------------------
\backmatter % States that we are now into Appendicies
\pagestyle{plain}
\printbibliography[heading=bibintoc] % Insert Bibliography
\input{Backmatter/Appendix} % Appendix
\end{document}
我意识到这类似于将一本书拆分成多卷但编号和格式要求不同。
答案1
我将描述一种book
使用埃托克。代码示例很少,但您应该能够将相关部分转移到您的实际用例中。
请参阅下面对评论中提出的问题的更新回应
以下是两个目录(带有正确的超链接):
代码:
\documentclass{book}
\usepackage{hyperref}
\usepackage{blindtext}
\usepackage{etoc}
\newcommand{\TableOfContents}{%
\centerline{\LARGE\scshape Thesis Contents}
\vspace{0.5cm}
\markboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}
\phantomsection
\addcontentsline{toc}{chapter}{Thesis contents}
\etocsettagdepth {VolumeOne}{all}
\etocsettagdepth {VolumeTwo}{none}
\etocsettocstyle {\section*{Volume One}}{\bigskip}
\tableofcontents
\etocsettagdepth {VolumeOne}{none}
\etocsettagdepth {VolumeTwo}{all}
\etocsettocstyle {\section*{Volume Two}}{\cleardoublepage}
\tableofcontents
}
\begin{document}
\etocdepthtag.toc {VolumeOne}
\frontmatter
\vspace*{1cm}
\begin{center}
\huge\bfseries Volume One:\\ Oscillation Theory and Beyond
\end{center}
\vspace{2cm}
\TableOfContents
\mainmatter
\chapter{Foo}
\blindtext
\chapter{Bar}
\blindtext
\backmatter
\etocdepthtag.toc {VolumeTwo}
\vspace*{1cm}
\begin{center}
\huge\bfseries Volume Two:\\ Appendices
\end{center}
\vspace{2cm}
\TableOfContents
\chapter{Appendix}
\blindtext
\chapter{Another appendix}
\blindtext
\end{document}
现在出现了一种变体,第二卷的目录仅列出了附录。此外,第二卷的页码已重新开始。
\documentclass{book}
\usepackage{hyperref}
\usepackage{blindtext}
\usepackage{etoc}
\newcommand{\TableOfContents}{%
\centerline{\LARGE\scshape Thesis Contents}
\vspace{0.5cm}
\markboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}
\phantomsection
\addcontentsline{toc}{chapter}{Thesis contents}
\etocsettagdepth {VolumeOne}{all}
\etocsettagdepth {VolumeTwo}{none}
\etocsettocstyle {\section*{Volume One}}{\bigskip}
\tableofcontents
\etocsettagdepth {VolumeOne}{none}
\etocsettagdepth {VolumeTwo}{all}
\etocsettocstyle {\section*{Volume Two}}{\cleardoublepage}
\tableofcontents
}
\begin{document}
\etocdepthtag.toc {VolumeOne}
\frontmatter
\vspace*{1cm}
\begin{center}
\huge\bfseries Volume One:\\ Oscillation Theory and Beyond
\end{center}
\vspace{2cm}
\TableOfContents
\mainmatter
\chapter{Foo}
\blindtext
\chapter{Bar}
\blindtext
\mainmatter % to restart page numbering
\backmatter
\etocdepthtag.toc {VolumeTwo}
\vspace*{1cm}
\begin{center}
\huge\bfseries Volume Two:\\ Appendices
\end{center}
\vspace{2cm}
\etocsettagdepth {VolumeOne}{none}
\etocsettagdepth {VolumeTwo}{all}
\etocsettocstyle {\section*{\contentsname}\phantomsection
\addcontentsline{toc}{chapter}{\contentsname}}
{\cleardoublepage}
\markboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}
\tableofcontents
\chapter{Appendix}
\blindtext
\chapter{Another appendix}
\blindtext
\end{document}
答案2
更新
这出乎意料地麻烦。我最初发布了一个我认为是解决方案的内容,基于修改,\tableofcontents
持续了大约十秒钟,然后我发现它无法与一起使用hyperref
。然后我找到了一个可以工作但很笨重的东西。这个版本更令人满意:我最初的直觉(修改目录的打印方式以启用其中两个)是正确的;问题是hyperref
。解决方案在于下面 pst 的回答中的建议,memoir
可以做到这一点。我突然想到这memoir
可能已经解决了我遇到的问题,事情就这样发生了。
因此,以下内容很大程度上要归功于我所采用的 Peter Wilson 的代码(我想其中可能也有一些 David Carlisle 的内容),以及 pst 关于查看 Memoir 的建议,如果没有它,我想我永远也无法找到解决这个问题的方法hyperref
。
方法
我们定义命令
\startvolume{name}
来开始新的一卷。由于提问者显然没有使用“部分”,我只是简单地改编了它,尽管定义一个新的分段单元无疑会更优雅。\startvolume
清除页面,将页码重置为 1,打印介绍性扉页,并在目录中进行适当的输入。为了保持目录的连贯性,我们重新定义了内部宏
l@part
,以便它不会尝试在列表中放置任何页码。我们还调整了的定义,\part
以确保我们的卷页上没有页码。(正确的书籍设计要求卷的扉页 (a) 放在最前面,在标题页之前;(b) 没有页码,但 (c) 被视为页码 1。)接下来是原则上看似简单但实际却很难的部分。标准的 LaTeX 定义意味着
\tableofcontents
您只能拥有一个:一旦打印,必要的文件就会被“破坏”。这是编写方式的结果。原则上这并不难改变,只是因为太过麻烦\@starttoc
而变得棘手。无论如何,有正确的代码,我已经征用了。hyperref
memoir
这一切都成功了,但是 hyperref 抱怨说,因为重置页码会弄乱它。我尝试了各种解决方案。最后,最简单、最可靠的方法似乎是使用选项
hypertexnames=false
;这似乎有效,但它是真正的最糟糕的货物崇拜编程,因为我不能假装真正理解正在发生的事情。需要对 进行少许调整
\backmatter
,因为(因为没人预料到它可能会紧接着\frontmatter
!)它不会将分页重置为罗马字体。
我还没有对您使用的众多软件包进行全面测试,因此毫无疑问可能需要一些调整。但至少这是一个开始。
\documentclass[a4paper,oneside]{book}
\usepackage{filecontents}% Just for demonstration
\begin{filecontents}{\jobname-c.tex}
\chapter{Blah}
\lipsum% Just for demonstration
\chapter{More Blah}
\lipsum
\end{filecontents}
\usepackage[hypertexnames=false]{hyperref}
\usepackage{lipsum}
\makeatletter
%This is to enable an unpaginated "part" entry in the TOC, based on l@part in book.cls
\renewcommand*\l@part[2]{%
\ifnum \c@tocdepth >-2\relax
\addpenalty{-\@highpenalty}%
\addvspace{2.25em \@plus\p@}%
\setlength\@tempdima{3em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
{\leavevmode
\large \bfseries #1}\par
\nobreak
\global\@nobreaktrue
\everypar{\global\@nobreakfalse\everypar{}}%
\endgroup
\fi}
%And this is simply to ensure that we get an empty page for the volume titles
\renewcommand\part{%
\if@openright
\cleardoublepage
\else
\clearpage
\fi
\thispagestyle{empty}%
\if@twocolumn
\onecolumn
\@tempswatrue
\else
\@tempswafalse
\fi
\null\vfil
\secdef\@part\@spart}
%backmatter needs to be patched to reset pagination to arabic
\renewcommand\backmatter{%
\if@openright
\cleardoublepage
\else
\clearpage
\fi
\pagenumbering{arabic}%
\@mainmatterfalse}
\newcommand{\secondtableofcontents}{%
\tableofcontents
\if@filesw
[Table of Contents will generate here]\par
\typeout{Warning: No second table of contents generated. Rerun with \nofiles once all references are stable.}
\fi}
%Finally we patch the \@starttoc macro so that it doesn't clobber the .toc file,
%this code is taken straight from memoir. We are using hyperref here, but for
%completeness we provide for both
\renewcommand{\@starttoc}[1]{%
\begingroup\makeatletter
\@input{\jobname.#1}%
\if@filesw
\AtEndDocument{%
\expandafter\ifx\csname tf@#1\endcsname\relax
\expandafter\newwrite\csname tf@#1\endcsname
\immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
\fi
}%
\fi
\@nobreakfalse
\endgroup}
\@ifpackageloaded{hyperref}{%
\Hy@AtBeginDocument{%
\ifx\hyper@last\@undefined
\def\@starttoc#1{%
\begingroup\makeatletter
\IfFileExists{\jobname.#1}{%
\Hy@WarningNoLine{%
old #1 file detected, not used; run LaTeX again%
}%
}{}%
\if@filesw
\AtEndDocument{%
\expandafter\ifx\csname tf@#1\endcsname\relax
\expandafter\newwrite\csname tf@#1\endcsname
\immediate\openout \csname tf@#1\endcsname \jobname.#1\relax
\fi
}
\fi
\@nobreakfalse
\endgroup
}%
\fi
}
}
% \startvolume{Title} at beginning of each volume: print a starting page
% for hyperref to grab and add contents line
\newcommand{\startvolume}[1]{%
\cleardoublepage%
\setcounter{page}{1}%
\part*{#1}%
\addcontentsline{toc}{part}{#1}%
}
\makeatother
\begin{document}
\frontmatter
\startvolume{I}
\tableofcontents
\mainmatter
\input{\jobname-c.tex}
\frontmatter
\startvolume{II}
\tableofcontents
\backmatter
\input{\jobname-c.tex}
\end{document}
答案3
如果在流程后期从 更改book
为是可以接受的,那么您可以使用它。它的一个特点是和 类似的命令可以重复,因为它们在使用时不会被清除,就像在标准类中一样。这是一个非完善的概念验证,说明如何在 中执行此操作,创建一个可以随后拆分为两个卷的结果。memoir
\tableofcontents
memoir
\documentclass{memoir}
\usepackage{blindtext}
\begin{document}
\author{A. Uthor}
\title{The Book -- Volume One}
\frontmatter
\addcontentsline{toc}{part}{Volume one}
\maketitle
\newpage
\tableofcontents*
\mainmatter
\chapter{Foo}
\blindtext
\chapter{Bar}
\blindtext
% Restart page numbering
\frontmatter
\addcontentsline{toc}{part}{Volume two}
\title{The Book -- Volume Two}
\maketitle
\newpage
\tableofcontents*
\mainmatter
\backmatter
\chapter{Appendix}
\blindtext
\chapter{Another appendix}
\blindtext
\end{document}