我寫了一篇論文,準備提交,但不幸的是,一卷的頁數限制是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
可能已經解決了我遇到的問題,所以它就發生了。
因此,以下內容在很大程度上要感謝我採用的彼得·威爾遜的代碼(我認為其中可能也有一些大衛·卡萊爾),以及 pst 的建議,看看回憶錄,如果沒有它,我認為不會我本來會找到解決該問題的方法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}