Skip to content

Commit

Permalink
Version 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Krishna Kumar committed Feb 4, 2014
2 parents d16809f + 2b122fd commit 6e00ac9
Show file tree
Hide file tree
Showing 9 changed files with 196 additions and 62 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
*.nlo*
*make*
*.d*
*.bcf*
*.blg*
*~*
*.nlo*
*make
*.d
*.btmp*
*.fls*
*.glo*
Expand All @@ -26,3 +32,4 @@
thesis.txt*
thesis.bcf*
thesis.run.xml*
*run.xml*
82 changes: 71 additions & 11 deletions Classes/PhDThesisPSnPDF.cls
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,31 @@
\DeclareOption{index}{\PHD@indextrue}

% ******************************* Font Option **********************************
\newif\ifsetFont\setFontfalse % Font is not set
\newif\ifsetFont\setFontfalse % Font is not set

\newif\ifPHD@times\PHD@timesfalse % Times with Math Support
\newif\ifPHD@times\PHD@timesfalse % Times with Math Support
\DeclareOption{times}{\PHD@timestrue}

\newif\ifPHD@fourier\PHD@fourierfalse % Fourier with Math Support
\newif\ifPHD@fourier\PHD@fourierfalse % Fourier with Math Support
\DeclareOption{fourier}{\PHD@fouriertrue}

\newif\ifPHD@customfont\PHD@customfontfalse % Custom Font with Math Support
\newif\ifPHD@customfont\PHD@customfontfalse % Custom Font with Math Support
\DeclareOption{customfont}{\PHD@customfonttrue}

% ******************************* Bibliography *********************************
\newif\ifsetBib\setBibfalse % Using Custom Bibliography
\newif\ifsetBib\setBibfalse % Custom Bibliography = true/false
\newif\ifsetBiBLaTeX\setBiBLaTeXfalse % BiBLaTeX = True / False

\newif\ifPHD@authoryear\PHD@authoryearfalse % Author-Year citation
\newif\ifPHD@biblatex\PHD@biblatexfalse % BiBLaTeX
\DeclareOption{biblatex}{\PHD@biblatextrue}

\newif\ifPHD@authoryear\PHD@authoryearfalse % Author-Year citation
\DeclareOption{authoryear}{\PHD@authoryeartrue}

\newif\ifPHD@numbered\PHD@numberedfalse % Numbered citiation
\newif\ifPHD@numbered\PHD@numberedfalse % Numbered citiation
\DeclareOption{numbered}{\PHD@numberedtrue}

\newif\ifPHD@custombib\PHD@custombibfalse % Custom Bibliography
\newif\ifPHD@custombib\PHD@custombibfalse % Custom Bibliography
\DeclareOption{custombib}{\PHD@custombibtrue}

% ************************* Header / Footer Styling ****************************
Expand Down Expand Up @@ -79,6 +83,15 @@ If not, please remove the option `abstract' from the document class and
recompile. Good luck with your writing!}
}

% ****************** Chapter Mode - To print only selected chapters ************
\newif \ifdefineChapter\defineChapterfalse %To enable Separate abstract

\newif\ifPHD@chapter\PHD@chapterfalse % Enable Separate Abstract
\DeclareOption{chapter}{
\PHD@chaptertrue
\ClassWarning{PhDThesisPSnPDF}{You have chosen an option that generates only selected chapters with references, if this was intentional, ignore this warning. If not, please remove the option `chapter' from the document class and recompile. Good luck with your writing!}
}

\ProcessOptions\relax%

% *************************** Pre-defined Options ******************************
Expand Down Expand Up @@ -273,22 +286,40 @@ supported!}

% ******************************* Bibliography *********************************
\ifPHD@authoryear
\ifPHD@biblatex
\RequirePackage[backend=bibtex8, style=authoryear, citestyle=alphabetic, sorting=nty, natbib=true]{biblatex}
\setBiBLaTeXtrue
\else
\RequirePackage[round, sort, numbers, authoryear]{natbib} %author year
\fi
\setBibtrue
\else
\ifPHD@numbered
\ifPHD@biblatex
\RequirePackage[backend=bibtex8, style=numeric-comp, citestyle=numeric, sorting=none, natbib=true]{biblatex}
\setBiBLaTeXtrue
\else
\RequirePackage[numbers,sort&compress]{natbib} % numbered citation
\fi
\setBibtrue
\else
\ifPHD@custombib
\setBibfalse
\ifPHD@biblatex
\setBiBLaTeXtrue
\fi
\else
\RequirePackage[numbers,sort&compress]{natbib} % Default - numbered
\ifPHD@biblatex
\RequirePackage[backend=bibtex8, style=numeric-comp, citestyle=numeric, sorting=none, natbib=true]{biblatex}
\setBiBLaTeXtrue
\else
\RequirePackage[numbers,sort&compress]{natbib} % Default - numbered
\fi
\setBibtrue
\ClassWarning{PhDThesisPSnPDF}{No bibliography style was specified.
Default numbered style is used. If you would like to use a different style, use
`authoryear' or `numbered' in the options in documentclass or use `custombib`
and define the natbibpackage with required style in the Preamble.tex file}
and define the natbib package or biblatex package with required style in the Preamble.tex file}
\fi
\fi
\fi
Expand All @@ -297,7 +328,8 @@ and define the natbibpackage with required style in the Preamble.tex file}

% *********************** To copy ligatures and Fonts **************************
\RequirePackage{textcomp}
\RequirePackage[utf8]{inputenc}
%[utf8] was used - removed for biblatex - biber backend required
\RequirePackage{inputenc}
\RequirePackage[T1]{fontenc}

% Font Selection
Expand Down Expand Up @@ -432,6 +464,16 @@ font in the preamble.tex file by specifying `customfont' in the class options}
\renewcommand{\thepage}{\roman{page}}}
{\newpage\renewcommand{\thepage}{\arabic{page}}}

% ******************************* Appendices **********************************
% Appending the appendix name to the letter in TOC
% Especially when backmatter is enabled

%\renewcommand\backmatter{
% \def\chaptermark##1{\markboth{%
% \ifnum \c@secnumdepth > \m@ne \@chapapp\ \thechapter: \fi ##1}{%
% \ifnum \c@secnumdepth > \m@ne \@chapapp\ \thechapter: \fi ##1}}%
% \def\sectionmark##1{\relax}}


% ******************************************************************************
% **************************** Macro Definitions *******************************
Expand Down Expand Up @@ -631,6 +673,24 @@ font in the preamble.tex file by specifying `customfont' in the class options}
\newcommand{\printthesisindex}{}
\fi

% ***************************** Chapter Mode ***********************************
% The chapter mode allows user to only print particular chapters with references
% All other options are disabled by default
% To include only specific chapters without TOC, LOF, Title and Front Matter
% To send it to supervisior for changes

\ifPHD@chapter
\defineChaptertrue
% Disable the table of contents, figures, tables, index and nomenclature
\renewcommand{\maketitle}{}
\renewcommand{\tableofcontents}{}
\renewcommand{\listoffigures}{}
\renewcommand{\listoftables}{}
\renewcommand{\printnomencl}{}
\renewcommand{\printthesisindex}{}
\else
\defineChapterfalse
\fi

% ******************************** Abstract ************************************
% The abstract environment puts a large, bold, centered "Abstract" label at
Expand Down
11 changes: 9 additions & 2 deletions Preamble/preamble.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
% Add `custommargin' in the document class options to use this section
% Set {innerside margin / outerside margin / topmargin / bottom margin} and
% other page dimensions

\ifsetMargin
\else
\RequirePackage[left=37mm,right=30mm,top=35mm,bottom=30mm]{geometry}
Expand All @@ -14,10 +15,12 @@
% ******************* Fonts (like different typewriter fonts etc.)*************

% Add `customfont' in the document class option to use this section

\ifsetFont
\else
% Set your custom font here and use `customfont' in options. Leave empty to
% load computer modern font (default LaTeX font).

\RequirePackage{libertine}
\fi

Expand All @@ -29,12 +32,17 @@
% Add `custombib' in the document class option to use this section
\ifsetBib % True, Bibliography option is chosen in class options
\else % If custom bibliography style chosen then load bibstyle here
\RequirePackage[square, sort, numbers, authoryear]{natbib} % CustomBib
\ifsetBiBLaTeX
\RequirePackage[backend=bitex8, style=numeric-comp, citestyle=numeric, sorting=nty, natbib=true]{biblatex}
\else
\RequirePackage[square, sort, numbers, authoryear]{natbib} % CustomBib
\fi
\fi

% changes the default name `Bibliography` -> `References'
\renewcommand{\bibname}{References}


% *****************************************************************************
% *************** Changing the Visual Style of Chapter Headings ***************
% Uncomment the section below. Requires titlesec package.
Expand Down Expand Up @@ -132,5 +140,4 @@
% The default value of both \appendixtocname and \appendixpagename is `Appendices'. These names can all be changed via:

%\renewcommand{\appendixtocname}{List of appendices}

%\renewcommand{\appendixname}{Appndx}
41 changes: 37 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ THE SOFTWARE.

* A separate abstract with thesis title and author name, along with the titlepage can be generated by passing the argument `abstract` to the document class.

* Option to generate only specific chapters and references without the frontmatter and title page. Useful for review and corrections.

* BibLaTeX support for Bibliography

* A LyX Template is now available at [https://github.com/kks32/PhDThesisLyX/](https://github.com/kks32/PhDThesisLyX/)


## Building your thesis

Expand Down Expand Up @@ -101,11 +107,15 @@ Usage: `sh ./compile-thesis.sh [OPTIONS] [filename]`

## Usage details

Thesis information such as title, author, year, degree, etc., and other meta-data can be modified in `thesis-info.tex`

### Class Options

The class file, `PhDThesisPSnPDF`, is based on the standard `book` class

It supports the following custom options:
It supports the following custom options in the documentclass in thesis.tex:

(Usage `\documentclass[a4paper,11pt,print]{Classes/PhDThesisPSnPDF}`)

* `a4paper` (default as per the University guidelines) or `a5paper`: Paper size

Expand Down Expand Up @@ -135,21 +145,35 @@ It supports the following custom options:

* `abstract`: This option enables only the thesis title page and the abstract with title and author to be printed.

* `chapter`: This option enables only the specified chapter and it's references. Useful for review and corrections.


### Abstract separate

* A separate abstract with the title of the PhD and the candidate name has to be submitted to the Student Registry. This can be generated using `abstract` option in the document class. Ignore subsequent warnings about skipping sections (if any).

* To generate the separate abstract and the title page, make sure the following commands are in the `preamble.tex` file:
* To generate the separate abstract and the title page, make sure the following commands are in the preamble section of `thesis.tex` file:

\ifdefineAbstract
\includeonly{Abstract/abstract}
\else
\fi

### Chapter Mode

* The chapter mode allows user to only print specific chapters along with references. By default, it excludes everything else in the front matter and appendices. This can done by using `chapter` option in the document class in `thesis.tex`. Ignore subsequent warnings about skipping sections (if any).

* To generate the separate abstract and the title page, make sure the following commands are in the preamble section of `thesis.tex` file:

\ifdefineChapter
\includeonly{Chapter3/chapter3}
\else
\fi


### Choosing the Fonts

`PhDThesisPSnPDF` currently supports two fonts `Times` and `Latin Modern (default)`.
`PhDThesisPSnPDF` currently supports three fonts `Times`, `Fourier` and `Latin Modern (default)`.

* `times`: (The University of Cambridge guidelines recommend using Times). Specifying times option in the document class will use `mathptpx` or `Times` font with Math Support.
* `fourier`: fourier font with math support
Expand All @@ -163,7 +187,9 @@ It supports the following custom options:

### Choosing the Bibliography style

`PhDThesisPSnPDF` currently supports two styles `authoryear` and `numbered (default)`. Citation style has to be set. You can also specify `custombib` style
`PhDThesisPSnPDF` currently supports two styles `authoryear` and `numbered (default)`. Citation style has to be set. You can also specify `custombib` style and customise the bibliography.

* BibLaTeX support has been added and can be invoked using `biblatex` in the documentclass. Bibtex is used as the backend for `biblatex` at the moment. Will be replaced with biber when Makefile support is added.

* `authoryear`: For author-year citation eg., Krishna (2013)

Expand Down Expand Up @@ -371,9 +397,16 @@ If you are generating a separate abstract for your thesis submission, ignore thi

* Make example thesis a document on how to use the template and include general guidelines and good practices.

* Biber backend support for biblatex with Makefile

--------------------------------------------------------------------------------
## ChangeLog

### 2014/02/04 - Version 1.1
> Commit
* BibLatex Support with bibtex backend
* Chapter mode for compiling only specified chapters and references

### 2014/01/11 - Version 1.0
> Commit 2f6918863e3c9d0a7e95bd2651ce7ef8ae38f90a
* Fixed an issue with the headers in Nomenclature section
Expand Down
40 changes: 40 additions & 0 deletions thesis-info.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
% ************************ Thesis Information & Meta-data **********************
%% The title of the thesis
\title{Writing your PhD Thesis in \texorpdfstring{\\ \LaTeX2e}{LaTeX2e}}
%\texorpdfstring is used for PDF metadata. Usage:
%\texorpdfstring{LaTeX_Version}{PDF Version (non-latex)} eg.,
%\texorpdfstring{$sigma$}{sigma}

%% The full name of the author
\author{Krishna Kumar}

%% Department (eg. Department of Engineering, Maths, Physics)
\dept{Department of Engineering}

%% University and Crest
\university{University of Cambridge}
\crest{\includegraphics[width=0.25\textwidth]{University_Crest}}

%% You can redefine the submission text:
% Default as per the University guidelines: This dissertation is submitted for
% the degree of Doctor of Philosophy
%\renewcommand{\submissiontext}{change the default text here if needed}

%% Full title of the Degree
\degree{Doctor of Philosophy}

%% College affiliation (optional)
\college{King's College}

%% Submission date
\degreedate{2013}

%% Meta information
\subject{LaTeX} \keywords{{LaTeX} {PhD Thesis} {Engineering} {University of
Cambridge}}

% ***************************** BiBLaTeX Reference *****************************
\ifsetBiBLaTeX
\bibliography{References/references}
\fi

Binary file modified thesis.dvi
Binary file not shown.
Binary file modified thesis.pdf
Binary file not shown.
Binary file modified thesis.ps
Binary file not shown.
Loading

0 comments on commit 6e00ac9

Please sign in to comment.