Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- Added glossary support.

-   Sanitized the document class options (see README).
-   Updated README with more instructions and information.
-   Changed Makefile to the [Latex Makefile](http://code.google.com/p/latex-makefile/).
-   Updated the samples to use the glossary and the new features.
  • Loading branch information...
commit 2eae98844ee07925b931bfbb78e40cd2fde7833e 1 parent 454baf4
@urbas urbas authored
View
3,906 Makefile
3,883 additions, 23 deletions not shown
View
83 README.md
@@ -13,24 +13,39 @@ desired location.
Now you can start writing your thesis using the `thesis.tex` file.
+Finally, build the `PDF` document by running (in the command line):
+
+ make
+
## How will it look like?
Your thesis document will look something like this (using the Adobe Sabon font and the _clean_ sample, which can be found in [`./Samples/clean`](https://github.com/cambridge/thesis/tree/master/Samples/clean)):
* [Thesis Sample (PDF)](https://github.com/downloads/cambridge/thesis/thesis.pdf)
-The template also supports DVI and PS formats. All three formats are generated
-by the provided `Makefile`.
+The template also supports DVI and PS formats. All three formats can be generated
+with the provided `Makefile`.
-## Producing PDF, DVI and PS documents
+## Producing `PDF`, `DVI` and `PS` documents
### Build your thesis
-To build your thesis, run:
+To build the `PDF` version of your thesis, run:
make
-This should build `thesis.dvi`, `thesis.ps` and `thesis.pdf` documents.
+This build procedure uses `pdflatex` and will produce `thesis.pdf`.
+
+To produce `DVI` and `PS` versions of your document, you should run:
+
+ ./makeps
+
+or
+
+ make BUILD_STRATEGY=latex
+
+This will use the `latex` command to build the document and will produce
+`thesis.dvi`, `thesis.ps` and `thesis.pdf` documents.
### Clean unwanted files
@@ -38,11 +53,20 @@ To clean unwanted clutter (all LaTeX auto-generated files), run:
make clean
-To clean absolutely all files produced by `make`, run:
+__Note__: the `Makefile` itself is take from and maintained at
+[here](http://code.google.com/p/latex-makefile/).
+
+## Known issues
- make distclean
+1. When using the glossary, references are not pointing to the right page.
-For other build options, refer to the `Makefile` file itself.
+ __Workaround__: Build the document with:
+
+ make && makeglossaries thesis && makeindex thesis && pdflatex thesis.tex
+
+2. When using the glossary, the first page of the glossary has a page number.
+
+ _There is no known workaround._ We are trying to fix this.
-------------------------------------------------------------------------------
@@ -69,19 +93,33 @@ It also supports some custom options.
* if the `hyperref` package is used, the option `pdfpagelabels=false` will
be passed to it.
-* `notimes`: tells the class not to use the _times_ font. This option is
- implied by the `nopackages`.
+* `times`: tells the class to use the _times_ font.
+
+* `glossary`: puts the glossary after the TOC. The glossary contains a list of
+ abbreviations, their explanations etc. Describe your abbreviations and add
+ them to the glossary immediately after you introduce them in the body of
+ your thesis. You can use the following command for this:
+
+ \newglossaryentry{computer}
+ {
+ name=computer,
+ description={is a programmable machine that receives input,
+ stores and manipulates data, and provides
+ output in a useful format}
+ }
+
+ Further instructions can be found [here](http://en.wikibooks.org/wiki/LaTeX/Glossary).
+
+ _Note_: `glossaries` is the package used to create the glossary.
+
+* `index`: build the index, which you can put at the and of the thesis with
+ the following command (it will create a new unnumbered chapter):
-* `nopackages`: tells the class not to use any non-essential packages (this
- option implies the `notimes` option).
+ \printthesisindex
- _Note_: If this option is not specified, then the class will use the
- following non-essential packages:
+ Instructions on how to use the index can be found [here](http://en.wikibooks.org/wiki/LaTeX/Indexing#Using_makeidx).
- * `times` (can also be excluded by using the `notimes` option),
- * `amsmath`
- * `amssymb`
- * `amsthm`
+ _Note_: the package `makeidx` is used to create the index.
-------------------------------------------------------------------------------
@@ -111,8 +149,8 @@ The Computer Laboratory guidelines for technical reports:
## _Q3_: Can I use my own Makefile?
-By all means. Here is a very nice (and smart) `Makefile` built specifically for
-LaTeX:
+By all means. We are currently using the very nice (and smart) `Makefile` built
+specifically for LaTeX:
> [http://code.google.com/p/latex-makefile/](http://code.google.com/p/latex-makefile/)
@@ -125,6 +163,8 @@ info see __[1]__):
CUni.eps
CUni.pdf
CollegeShields/
+ Makefile
+ Variables.ini
> __[1]__ You can put these files either into the standard LaTeX directory for
@@ -173,5 +213,4 @@ There is [a page](http://www.cl.cam.ac.uk/local/phd/writingup.html) on the Compu
# TODO list
-* Fill PDF's meta tags (e.g.: author, title, keywords etc.).
-* It is debatable which packages are non-essential. We could reclassify this.
+* Fill out more PDF meta tags (e.g.: keywords, subject etc.).
View
13 Samples/clean/01Preamble.tex
@@ -34,6 +34,7 @@
{1ex}
{\titlerule\vspace{1ex}\filright}
[\vspace{1ex}\titlerule]}
+\newcommand{\PostContentTitleFormat}{\PreContentTitleFormat}
\PreContentTitleFormat
@@ -90,3 +91,15 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Content commands
%%
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Glossary entries
+%%
+\newglossaryentry{pi}{
+ name={\ensuremath{\pi}},
+ sort={pi},
+ description={ratio of the circumference of a circle to the diameter}
+}
View
4 Samples/clean/13MainChapter.tex
@@ -1,6 +1,6 @@
\chapter{Main Chapter}
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce posuere, justo nec malesuada adipiscing, sem sem accumsan odio, vel convallis orci ligula elementum ipsum. Nunc sodales dignissim orci eu placerat. Vestibulum cursus, neque ut vulputate venenatis, metus tellus iaculis turpis, et sagittis odio arcu nec est. Donec egestas bibendum bibendum. Nam ullamcorper sodales nunc, in feugiat ipsum porttitor quis. Vestibulum sem magna, ornare sed venenatis sed, molestie vitae dui. Etiam a libero sem. Nullam gravida massa nec nulla ornare consequat. Sed sed nisl sapien. Phasellus sollicitudin sapien ut odio mattis pharetra. Quisque tempor nunc et diam vehicula id scelerisque velit auctor.
+Lorem ipsum dolor\index{dolor} sit amet, consectetur adipiscing elit. Fusce posuere, justo nec malesuada adipiscing, sem sem accumsan odio, vel convallis orci ligula elementum ipsum. Nunc sodales dignissim orci eu placerat. Vestibulum cursus, neque ut vulputate venenatis, metus tellus iaculis turpis, et sagittis odio arcu nec est. Donec egestas bibendum bibendum. Nam ullamcorper sodales nunc, in feugiat ipsum porttitor quis. Vestibulum sem magna, ornare sed venenatis sed, molestie vitae dui. Etiam a libero sem. Nullam gravida massa nec nulla ornare consequat. Sed sed nisl sapien. Phasellus sollicitudin sapien ut odio mattis pharetra. Quisque tempor nunc et diam vehicula id scelerisque velit auctor.
Quisque ultricies tellus eget neque imperdiet at congue nunc iaculis. Morbi semper commodo risus, ut mattis eros posuere vitae. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Donec quis magna at est mattis vestibulum. Nulla eleifend sodales vestibulum. Nulla ut justo et dui ullamcorper vestibulum nec vel purus. Mauris non nisl eget sapien eleifend cursus. Nunc aliquet porttitor dolor, eget congue nulla rutrum nec. Fusce aliquam mattis quam, in aliquam libero tempus at. Morbi vestibulum tincidunt est sit amet dignissim. Suspendisse dapibus sollicitudin dui, in rhoncus mauris congue nec. Duis pulvinar dignissim blandit. Suspendisse metus leo, gravida nec viverra vitae, dignissim quis magna. Cras quis nibh leo. Nam faucibus, elit quis aliquet fermentum, neque urna scelerisque nisi, sed mollis nulla mauris sit amet lectus.
@@ -12,7 +12,7 @@ \subsection{Subsection}
Cras volutpat aliquet venenatis. Integer rhoncus pharetra elit vel auctor. Cras posuere nibh vel justo blandit venenatis. Praesent in nulla quis nunc rhoncus fringilla. Nulla enim arcu, congue at sodales ut, congue id orci. Sed leo quam, tempor id malesuada vitae, condimentum at quam. Quisque elit lectus, blandit at facilisis quis, varius id turpis.
-Donec convallis turpis eu felis vehicula commodo nec quis arcu. Ut in lacinia leo. Nullam in risus felis, eget feugiat ligula. In nulla urna, tempus quis pellentesque a, iaculis sed mauris. Donec tincidunt semper sem, blandit pellentesque justo blandit ac. Vestibulum et mattis mi. In hendrerit, neque in suscipit pharetra, purus turpis aliquet lacus, vel auctor felis dolor id mi. Nullam ut felis massa. Curabitur et rutrum ligula. Maecenas ac lorem eget turpis viverra vehicula at quis lorem. Sed non eros dui. Sed aliquam faucibus pellentesque. Maecenas sit amet ligula non dolor varius auctor non quis ligula. Fusce dapibus auctor varius. Praesent tortor ligula, auctor ut dictum eu, rhoncus vitae nunc.
+Donec convallis turpis eu felis vehicula commodo nec quis arcu. Ut in \gls{pi} lacinia leo. Nullam in risus felis, eget feugiat ligula. In nulla urna, tempus quis pellentesque a, iaculis sed mauris. Donec tincidunt semper sem, blandit pellentesque justo blandit ac. Vestibulum et mattis mi. In hendrerit, neque in suscipit pharetra, purus turpis aliquet lacus, vel auctor felis dolor id mi. Nullam ut felis massa. Curabitur et rutrum ligula. Maecenas ac lorem eget turpis viverra vehicula at quis lorem. Sed non eros dui. Sed aliquam faucibus pellentesque. Maecenas sit amet ligula non dolor varius auctor non quis ligula. Fusce dapibus auctor varius. Praesent tortor ligula, auctor ut dictum eu, rhoncus vitae nunc.
Quisque metus sem, consectetur sit amet pulvinar varius, sodales eget enim. Suspendisse molestie congue leo ac auctor. Donec erat erat, elementum at convallis sit amet, molestie et ipsum. Nunc venenatis mattis magna, id ultricies purus auctor nec. Donec pharetra turpis sit amet magna convallis consequat. In hac habitasse platea dictumst. Fusce porta molestie massa, sed lacinia felis sollicitudin non. Pellentesque vulputate laoreet consequat. Vivamus ante dolor, bibendum vitae pulvinar id, elementum nec purus. Nullam vel augue velit, ac egestas odio.
View
3  Samples/clean/thesis.tex
@@ -1,4 +1,4 @@
-\documentclass[a4paper,notimes]{cam-thesis}
+\documentclass[a4paper,index,glossary]{cam-thesis}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -80,7 +80,6 @@
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Bibliography
%%
View
3  Variables.ini
@@ -0,0 +1,3 @@
+neverclean := *.pdf *.ps
+includes.fig := CUni.pdf
+onlysources.tex := thesis.tex
View
97 cam-thesis.cls
@@ -64,17 +64,19 @@
\newif\ifcam@techreport\cam@techreportfalse
\DeclareOption{techreport}{\cam@techreporttrue}
-% notimes - disables the use of the `times' font and uses the default (computer
-% modern).
-\newif\ifcam@times\cam@timestrue
-\DeclareOption{notimes}{\cam@timesfalse}
+% times - tells the class to use the times font.
+\newif\ifcam@times\cam@timesfalse
+\DeclareOption{times}{\cam@timestrue}
-% nopackages - prevents the inclusion of ``unnecessary'' (but convenient)
-% packages.
-\newif\ifcam@withpackages\cam@withpackagestrue
-\DeclareOption{nopackages}{\cam@withpackagesfalse}
+% glossary - puts the glossary (after the TOC).
+%
+\newif\ifcam@glossary\cam@glossaryfalse
+\DeclareOption{glossary}{\cam@glossarytrue}
-% TODO: Maybe add the option to not include the `makeidx` package?
+% index - puts the index at the end of the thesis.
+%
+\newif\ifcam@index\cam@indexfalse
+\DeclareOption{index}{\cam@indextrue}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -96,19 +98,6 @@
\RequirePackage{graphicx} % Required for the UC Logo (on the title page)
\RequirePackage{calc} % Used for calculating margins and laying out the title page
\RequirePackage{setspace} % Used for selecting single or onehalf line spacing.
-\RequirePackage{makeidx} % For building the index (otherwise not essential).
-
-\makeindex
-
-\ifcam@withpackages
- \ifcam@times
- \RequirePackage{times} % Not essential
- \fi
-
- \RequirePackage{amsmath} % Not essential
- \RequirePackage{amssymb} % Not essential
- \RequirePackage{amsthm} % Not essential
-\fi
% Hyperref should be included in any case, but we make it non-obtrusive (i.e.: no hyperlink borders).
% Why do we need a separate treatment of hyperref for the techreport? Because the guidelines say so. :)
@@ -130,6 +119,27 @@
\fi
\RequirePackage[all]{hypcap} % Fixes links to floats (must be included after hyperref).
+% Create the index
+\ifcam@index
+ \RequirePackage{makeidx}
+ \makeindex
+ \newcommand{\printthesisindex}{%
+ \cleardoublepage%
+ \phantomsection%
+ \addcontentsline{toc}{chapter}{Index}%
+ \printindex}
+\fi
+
+% Create the glossary
+\ifcam@glossary
+ \RequirePackage{glossaries}
+ \makeglossaries%
+ \newcommand{\cam@printthesisglossary}{%
+ \thispagestyle{empty}%
+ \printglossaries%
+ }
+\fi
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
@@ -191,6 +201,11 @@
% Note: You might need to install it first.
% \renewcommand\rmdefault{psb}
+% Use the times font if the user selected this option.
+\ifcam@times
+ \RequirePackage{times}
+\fi
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
@@ -200,9 +215,8 @@
% One-and-a-half spacing (required by board of graduate studies).
% (Should remove this for Computer Laboratory technical report.)
-\ifcam@techreport
-\else
-\onehalfspacing%
+\ifcam@techreport\else%
+ \onehalfspacing%
\fi
@@ -226,22 +240,27 @@
% thesis.)
\newcommand{\@abstract}{}
\renewcommand{\abstract}[1]{\renewcommand{\@abstract}{#1}}
+
% DOCVAR: acknowledgements (The text that will be instered into the
% acknowledgments of the thesis.)
\newcommand{\@acknowledgements}{}
\newcommand{\acknowledgements}[1]{\renewcommand{\@acknowledgements}{#1}}
+
% DOCVAR: college (The name of the thesis writer's college, which will appear
% just below their name.)
\newcommand{\@college}{}
\newcommand{\college}[1]{\renewcommand{\@college}{#1}}
+
% DOCVAR: keywords (These keywords will appear in the PDF meta-information
% called `pdfkeywords`.)
\newcommand{\@keywords}{}
\newcommand{\keywords}[1]{\renewcommand{\@keywords}{#1}}
+
% DOCVAR: subjectline (This subject will appear in the PDF meta-information
% called `pdfsubject`.)
\newcommand{\@subjectline}{}
\newcommand{\subjectline}[1]{\renewcommand{\@subjectline}{#1}}
+
% DOCVAR: submissiondate (The date of the submission of this thesis. If the
% submission date is provided, it will be printed on the title page--within the
% `submissionnotice` by default. Note that the thesis writer can provide their
@@ -250,6 +269,7 @@
\newif\ifcam@submissiondate\cam@submissiondatefalse
\newcommand{\@submissiondate}{}
\newcommand{\submissiondate}[1]{\renewcommand{\@submissiondate}{#1}\cam@submissiondatetrue}
+
% DOCVAR: submissionnotice (The submission notice is shown on the bottom of the
% title page.)
\newcommand{\@submissionnotice}{%
@@ -260,6 +280,7 @@ A thesis submitted
for the Degree of Doctor of Philosophy%
}
\newcommand{\submissionnotice}[1]{\renewcommand{\@submissionnotice}{#1}}
+
% DOCVAR: collegeshield (The name of the file that contains the image of the
% college's shield. If `collegeshield' is provided, it will be included in the
% title page (just below the author's name and above the name of the college).
@@ -322,11 +343,9 @@ for the Degree of Doctor of Philosophy%
\begin{center}
\begin{spacing}{2}
{\Huge%
- \ifcam@withpackages%
- \ifcam@times\else%
- \bfseries%
- \fi%
- \else\bfseries\fi%
+ \ifcam@times\else%
+ \bfseries%
+ \fi%
{\@title{}}}
\end{spacing}
\end{center}
@@ -401,8 +420,8 @@ for the Degree of Doctor of Philosophy%
%% Abstract
%%
%%%%%
-\ifcam@techreport
-\setcounter{page}{3}
+\ifcam@techreport%
+ \setcounter{page}{20}
\fi
\chapter*{Abstract}
@@ -450,15 +469,21 @@ This thesis:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
-%% Table of contents
+%% Table of contents, figures, symbols and glossary.
%%
%%%%%
+% The following command prevents the page number to be displayed on the first
+% page of the TOC.
+\addtocontents{toc}{\protect\thispagestyle{empty}}
+\pagestyle{empty}
\tableofcontents{}
-% - list of figures (optional)
-% - list of symbols (optional)
-% - glossary (optional)
+\ifcam@glossary%
+ \cam@printthesisglossary
+\fi
+
+\cleardoublepage
\pagestyle{plain}
}
View
3  makeps
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+make BUILD_STRATEGY=latex
View
14 thesis.tex
@@ -12,7 +12,7 @@
%% Original License URL: http://www.freebsd.org/copyright/freebsd-license.html
%%%%%
-\documentclass{cam-thesis}
+\documentclass[index]{cam-thesis}
@@ -32,8 +32,8 @@
%% College shield (optional):
% \collegeshield{CollegeShields/Queens}
-% \collegeshield{CollegeShields/StJohns}
-\collegeshield{CollegeShields/Fitzwilliam}
+\collegeshield{CollegeShields/StJohns}
+% \collegeshield{CollegeShields/Fitzwilliam}
%% Submission date (optional):
\submissiondate{November, 2042}
@@ -93,7 +93,7 @@ \chapter{Introduction}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-\marginpar[Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.]{Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.}
+\marginpar[Marin note.]{Margin par.}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
@@ -145,10 +145,6 @@ \chapter{Extra Information}
%%
%% Index:
%%
-
-\cleardoublepage
-\phantomsection
-\addcontentsline{toc}{chapter}{Index}
-\printindex
+\printthesisindex
\end{document}
Please sign in to comment.
Something went wrong with that request. Please try again.