Updates to Readme, Preamble settings and Template

This commit is contained in:
Krishna Kumar 2013-11-17 11:51:10 +00:00
parent d777d34072
commit cdd3e3aedb
6 changed files with 217 additions and 106 deletions

View File

@ -1,5 +1,5 @@
\chapter{My Second Chapter}
\section[Short title]{This is going to be a section with a very long section title that it might not fit TOC}
\section[Short title]{Reasonably Long Section Title}
If you have trouble viewing the document please contact Krishna \href{mailto:kks32@cam.ac.uk}{kks32@cam.ac.uk}. The SI Units for dynamic viscosity is \si{\newton\second\per\metre\squared}. I'm going to randomly include a picture~\cref{fig:minion}
@ -48,7 +48,7 @@ If you have trouble viewing the document please contact Krishna \href{mailto:kks
\clearpage
\tochide\section{Hidden Section}
\textbf{Lorem ipsum dolor sit amet}, \textit{consectetur adipiscing elit}. In magna nisi, aliquam id blandit id, congue ac est. Fusce porta consequat leo. Proin feugiat at felis vel consectetur. Ut tempus ipsum sit amet congue posuere. Nulla varius rutrum quam. Donec sed purus luctus, faucibus velit id, ultrices sapien. Cras diam purus, tincidunt eget tristique ut, egestas quis nulla. Curabitur vel iaculis lectus. Nunc nulla urna, ultrices et eleifend in, accumsan ut erat. In ut ante leo. Aenean a lacinia nisl, sit amet ullamcorper dolor. Maecenas blandit, tortor ut scelerisque congue, velit diam volutpat metus, sed vestibulum eros justo ut nulla. Etiam nec ipsum non enim luctus porta in in massa. Cras arcu urna, malesuada ut tellus ut, pellentesque mollis risus.Morbi vel tortor imperdiet arcu auctor mattis sit amet eu nisi. Nulla gravida urna vel nisl egestas varius. Aliquam posuere ante quis malesuada dignissim. Mauris ultrices tristique eros, a dignissim nisl iaculis nec. Praesent dapibus tincidunt mauris nec tempor. Curabitur et consequat nisi. Quisque viverra egestas risus, ut sodales enim blandit at. Mauris quis odio nulla. Cras euismod turpis magna, in facilisis diam congue non. Mauris faucibus nisl a orci dictum, et tempus mi cursus.
Etiam elementum tristique lacus, sit amet eleifend nibh eleifend sed \footnote{My footnote goes blah blah blah! \dots}. Maecenas dapibus augue ut urna malesuada, non tempor nibh mollis. Donec sed sem sollicitudin, convallis velit aliquam, tincidunt diam. In eu venenatis lorem. Aliquam non augue porttitor tellus faucibus porta et nec ante. Proin sodales, libero vitae commodo sodales, dolor nisi cursus magna, non tincidunt ipsum nibh eget purus. Nam rutrum tincidunt arcu, tincidunt vulputate mi sagittis id. Proin et nisi nec orci tincidunt auctor et porta elit. Praesent eu dolor ac magna cursus euismod. Integer non dictum nunc.

View File

@ -15,6 +15,8 @@
%\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{PhDThesisPSnPDF}[2013/11/14 version 1.0 by Krishna Kumar]
\typeout{https://github.com/kks32/phd-thesis-template/}
% ***************************************************************
% ********************** Class Definition ***********************
@ -181,8 +183,11 @@
\pdfglyphtounicode{f_f_l}{FB04}
\pdfgentounicode=1
% ********************************************************************************
% **************************** Pre-defined Settings ******************************
% ********************************************************************************
% ****************************** Setting PDF Meta-Data **************************
% ***************************** Setting PDF Meta-Data ****************************
\ifpdf
\AtBeginDocument{
\hypersetup{
@ -194,45 +199,14 @@
}
\fi
% ****************Clear Header Style on the Last Empty Odd pages ****************
\renewcommand{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else%
\hbox{}%
\thispagestyle{empty} % Empty header styles
\newpage%
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
% ***************************** TOC and Hide Sections ***************************
\newcommand{\nocontentsline}[3]{}
\newcommand{\tochide}[2]{\bgroup\let\addcontentsline=\nocontentsline#1{#2}\egroup}
% ******************************* Create the index ******************************
\ifCU@index
\RequirePackage{makeidx}
\makeindex
\newcommand{\printthesisindex}{
\cleardoublepage
\phantomsection
\printindex}
\else
\newcommand{\printthesisindex}{}
\fi
% *********************************** Nomenclature ******************************
\usepackage{nomencl}
\makenomenclature
\renewcommand\nomgroup[1]{%
\ifthenelse{\equal{#1}{A}}{%
\item[\textbf{Roman Symbols}] }{% A - Roman
\ifthenelse{\equal{#1}{G}}{%
\item[\textbf{Greek Symbols}]}{% G - Greek
\ifthenelse{\equal{#1}{R}}{%
\item[\textbf{Superscripts}]}{% R - Superscripts
\ifthenelse{\equal{#1}{S}}{%
\item[\textbf{Subscripts}]}{{% S - Subscripts
\ifthenelse{\equal{#1}{X}}{%
\item[\textbf{Other Symbols}]}{{% X - Other Symbols
\ifthenelse{\equal{#1}{Z}}{%
\item[\textbf{Acronyms}]}% Z - Acronyms
{{}}}}}}}}}}
% ******************************* Header Formatting *****************************
% Custom Header with Chapter Number, Page Number and Section Numbering
\pagestyle{fancy}
% Style 1:
@ -261,9 +235,29 @@
}
\newcommand{\submissiontext}{{A thesis submitted for the degree of}}
% **************** Clear Header Style on the Last Empty Odd pages ***************
\renewcommand{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else%
\hbox{}%
\thispagestyle{empty} % Empty header styles
\newpage%
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
% ********************************* Roman Pages *********************************
% The romanpages environment set the page numbering to lowercase roman one
% for the contents and figures lists. It also resets
% page-numbering for the remainder of the dissertation (arabic, starting at 1).
\newenvironment{romanpages}{
\setcounter{page}{1}
\renewcommand{\thepage}{\roman{page}}}
{\newpage\renewcommand{\thepage}{\arabic{page}}}
% *******************************************************************************
% **************************** Macro Definitions ********************************
% *******************************************************************************
% These macros are used to declare arguments needed for the
% construction of the title page and other preamble.
@ -292,6 +286,10 @@
\newcommand{\crest}[1]{\renewcommand{\@crest}{#1}}
% Submission Text
\newcommand{\submissiontext}{{A thesis submitted for the degree of}}
% keywords (These keywords will appear in the PDF meta-information
% called `pdfkeywords`.)
\newcommand{\@keywords}{}
@ -312,7 +310,12 @@
%define title page layout
% ********************************************************************************
% ***************************** Front Matter Layout ******************************
% ********************************************************************************
% ********************************** Title Page *********************************
\renewcommand{\maketitle}{%
%Can use the line below to remove the blank page after the title page
%\setcounter{page}{0} % Sasa Tomic
@ -344,8 +347,7 @@
}
% DEDICATION
%
% ********************************* Dedication **********************************
% The dedication environment makes sure the dedication gets its
% own page and is set out in verse format.
@ -362,8 +364,7 @@
{\end{center} \end{quote} \end{alwayssingle}}
% DECLARATION
%
% ******************************** Declaration **********************************
% The declaration environment puts a large, bold, centered
% "Acknowledgements" label at the top of the page. The acknowledgements
% themselves appear in a quote environment, i.e. tabbed in at both sides, and
@ -383,8 +384,8 @@
% ACKNOWLEDGEMENTS
%
% ******************************* Acknowlegments *********************************
% The acknowledgements environment puts a large, bold, centered
% "Acknowledgements" label at the top of the page. The acknowledgements
% themselves appear in a quote environment, i.e. tabbed in at both sides, and
@ -402,6 +403,7 @@
\begin{quote}}
{\end{quote}\end{alwayssingle}}
% The acknowledgementslong environment puts a large, bold, centered
% "Acknowledgements" label at the top of the page. The acknowledgement itself
% does not appears in a quote environment so you can get more in.
@ -418,12 +420,10 @@
{\end{quote}\end{alwayssingle}}
%ABSTRACT
%
%The abstract environment puts a large, bold, centered "Abstract" label at
%the top of the page. The abstract itself appears in a quote environment,
%i.e. tabbed in at both sides, and on its own page.
% ******************************** Abstract ***********************************
% The abstract environment puts a large, bold, centered "Abstract" label at
% the top of the page. The abstract itself appears in a quote environment,
% i.e. tabbed in at both sides, and on its own page.
\newenvironment{abstracts} {\cleardoublepage \begin{alwayssingle} \pagestyle{empty}
\begin{center}
@ -446,6 +446,7 @@
\vspace{0.5cm} \begin{quote}}
{\end{quote}\end{alwayssingle}}
%The abstractseparate environment is for running of a page with the abstract
%on including title and author etc as required to be handed in separately
@ -467,14 +468,33 @@
%ROMANPAGES
%
% The romanpages environment set the page numbering to lowercase roman one
% for the contents and figures lists. It also resets
% page-numbering for the remainder of the dissertation (arabic, starting at 1).
% ******************************** Nomenclature *********************************
\usepackage{nomencl}
\makenomenclature
\renewcommand\nomgroup[1]{%
\ifthenelse{\equal{#1}{A}}{%
\item[\textbf{Roman Symbols}] }{% A - Roman
\ifthenelse{\equal{#1}{G}}{%
\item[\textbf{Greek Symbols}]}{% G - Greek
\ifthenelse{\equal{#1}{R}}{%
\item[\textbf{Superscripts}]}{% R - Superscripts
\ifthenelse{\equal{#1}{S}}{%
\item[\textbf{Subscripts}]}{{% S - Subscripts
\ifthenelse{\equal{#1}{X}}{%
\item[\textbf{Other Symbols}]}{{% X - Other Symbols
\ifthenelse{\equal{#1}{Z}}{%
\item[\textbf{Acronyms}]}% Z - Acronyms
{{}}}}}}}}}}
\newenvironment{romanpages}{
\setcounter{page}{1}
\renewcommand{\thepage}{\roman{page}}}
{\newpage\renewcommand{\thepage}{\arabic{page}}}
% ******************************* Create the index ******************************
\ifCU@index
\RequirePackage{makeidx}
\makeindex
\newcommand{\printthesisindex}{
\cleardoublepage
\phantomsection
\printindex}
\else
\newcommand{\printthesisindex}{}
\fi

View File

@ -1,32 +1,37 @@
% *****************************************************************************
% **************************** Custom Packages *********************************
% *****************************************************************************
% Algorithms and Pseudocode
\usepackage{algpseudocode} % Algorithmicx package support for algorithms and pseudocode
% ************************** Algorithms and Pseudocode *************************
%\usepackage{algpseudocode} % Algorithmicx package support for algorithms and pseudocode
% Captions and Hyperreferncing / URL
% *********************Captions and Hyperreferncing / URL ***********************
%% Captions: This makes captions of figures use a boldfaced small font.
%\RequirePackage[small,bf]{caption}
\RequirePackage[small,bf,figurename=Fig.,labelsep=space,tableposition=top]{caption} % Caption styling
\usepackage[perpage]{footmisc} %Range of footnote options
% Graphics and figures
\usepackage{rotating}
\usepackage{subfigure}
\usepackage{wrapfig}
\usepackage{float}
\RequirePackage[small,bf,figurename=Fig.,labelsep=space,tableposition=top]{caption}
% Table
\usepackage{longtable}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{tabularx}
% ******************************** Footnote ***********************************
%\usepackage[perpage]{footmisc} %Range of footnote options
% Math and SI Units
% ************************** Graphics and figures *****************************
%\usepackage{rotating}
%\usepackage{subfigure}
%\usepackage{wrapfig}
%\usepackage{float}
% ********************************* Table *************************************
%\usepackage{longtable}
%\usepackage{multicol}
%\usepackage{multirow}
%\usepackage{tabularx}
% ****************************** Math and SI Units ****************************
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
@ -34,22 +39,18 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Fonts (like different typewriter fonts etc.)
%%
% *****************************************************************************
% ******************* Fonts (like different typewriter fonts etc.)*************
%\RequirePackage[scaled=.87]{couriers}
%\renewcommand\rmdefault{psb}
\usepackage{libertine}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Bibliography and References
\usepackage{cleveref}
\RequirePackage[square, sort, numbers, authoryear]{natbib}
%\RequirePackage[numbers,sort&compress]{natbib}
% *****************************************************************************
% *************************** Bibliography and References ********************
\usepackage{cleveref} %Referencing without need to explicitly state fig /table
\RequirePackage[square, sort, numbers, authoryear]{natbib} %author year
%\RequirePackage[numbers,sort&compress]{natbib} % numbered citation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -69,10 +70,8 @@
% ********************** Adding TOC and List of Figures ************************
% To hide sections from appearing in TOC add \tochide\section{Section name}
\newcommand{\nocontentsline}[3]{}
\newcommand{\tochide}[2]{\bgroup\let\addcontentsline=\nocontentsline#1{#2}\egroup}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{2}
% To restrict the length of the figure caption in List of figures use:
% \caption[Caption that you want to appear in TOC]{Actual caption of the figure}
% \section[short]{title}

102
README.md
View File

@ -1,7 +1,6 @@
phd-thesis-template
===================
> A PhD thesis LaTeX template for Cambridge University, based on Krishna Kumar's King's latex course and CUED V1.1 Template
> A PhD thesis LaTeX template for Cambridge University, based on Krishna Kumar's King's latex course, CUED V1.1 Template by H. Banderi, and Cambridge Computer Laboratry Template.
### Build your thesis
The template supports PDF, DVI and PS formats. All three formats can be generated
@ -35,4 +34,101 @@ To clean unwanted clutter (all LaTeX auto-generated files), run:
make clean
__Note__: the `Makefile` itself is take from and maintained at
[here](http://code.google.com/p/latex-makefile/).
[here](http://code.google.com/p/latex-makefile/).
-------------------------------------------------------------------------------
# Usage details
## Class Options
`PhDThesisPSnPDF` supports all the options of the standard `book` and `report` classes (on which
it is based).
It also supports some custom options:
* `book` or `report`: Supports both book and report class. Default is `book`.
* `twoside` or `oneside`: This is especially useful for printing double side (twoside) or single side.
* `10pt` or `11pt` or `12pt`: Font Size. Default set as `11pt`.
* `printmode`: Supports PrintMode and Online Version with different page margins and hyperlink styles.
Use `printmode` in the options to activate Print Version with appropriate margins and page layout and view styles. Leaving the options field blank will activate Online version.
* `index`: Including this option in `\documentclass` build the index, which you can put at the and of the thesis.
Instructions on how to use the index can be found [here](http://en.wikibooks.org/wiki/LaTeX/Indexing#Using_makeidx).
_Note_: the package `makeidx` is used to create the index.
## Custom Settings
* The depth of table of contents can be set using:
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
a depth of [3] indicates to a level of `\subsubsection` or #.#.#.#. Default set as 2.
* To hide sections from appearing in TOC use: `\tochide\section{Section name}` in your TeX files
* To restrict the length of the figure caption in List of figures use in `preamble.tex`:
\caption[Caption that you want to appear in TOC]{Actual caption of the figure}
\section[short]{title}
* Define custom caption style for figure and table caption in `preamble.tex` using:
\RequirePackage[small,bf,figurename=Fig.,labelsep=space,tableposition=top]{caption}
* Bibliography with Author-Year Citation in `preamble.tex`:
\RequirePackage[round, sort, numbers, authoryear]{natbib}
-------------------------------------------------------------------------------
# Troubleshooting
## _Q1_: I found a bug in the template. Where do I report bugs?
You can report issues through
[our GitHub repository](https://github.com/kks32/phd-thesis-template).
You can also mail
[the maintainers](https://github.com/kks32/phd-thesis-template/collaborators) directly.
## _Q2_: Where can I find the thesis formatting guidelines this class is based on?
[http://www.eng.cam.ac.uk/postgraduate/assets/library/document/p/original/planningphd.pdf](http://www.eng.cam.ac.uk/postgraduate/assets/library/document/p/original/planningphd.pdf)
## _Q3_: Can I use my own Makefile?
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/)
## _Q4_: Where can I find newer versions of the University of Cambridge logo?
The university updates its logo every now and then. You can find up-to-date
logos on [this page](http://www.admin.cam.ac.uk/offices/communications/services/logos/)
(subject to change without notice).
Download and exchange the new logos with `CUni.eps` and/or `CUni.pdf`.
## _Q5_: Where can I find extra fonts (like Adobe Sabon, Adobe Utopia etc.)?
This template uses Libertine fonts instead of Arial/Times/Sabon.
After you've installed the fonts, add somewhere in the preamble (before `\begin{document}`) the following command:
\renewcommand\rmdefault{psb}
## _Q6_: How should I count the number of words in my thesis?
You can run the following command:
`ps2ascii thesis.pdf | wc -w`
--------------------------------------------------------------------------------
# TODO list
* Support custom margins
* Support non-free fonts!

Binary file not shown.

View File

@ -1,14 +1,10 @@
\documentclass[a4paper,11pt,twoside,printmode,index]{Classes/PhDThesisPSnPDF}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Preamble: Contains packages and user-defined commands
% ********************************* Preamble **********************************
% Preamble: Contains packages and user-defined commands and settings
\input{Preamble/preamble}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Thesis Information & Meta-data
%% PhD Thesis Title, Author, Degree, etc
%%
% ******************** Thesis Information & Meta-data *************************
%% The title of the thesis
\title{Multiscale Modelling of \texorpdfstring{\\}{}Granular Flows}