Separate Preamble TeX file

This commit is contained in:
Krishna Kumar 2013-11-17 01:01:46 +00:00
parent 5004fc3885
commit 89c882fa10
5 changed files with 86 additions and 49 deletions

View File

@ -11,7 +11,7 @@ Lorem Ipsum is simply dummy text of the printing and typesetting industry~\cref{
The most famous equation in the world: $E^2 = (m_0c^2)^2 + (pc)^2$, which is known as the \textbf{energy-mass-momentum} relation as an in-line equation. The most famous equation in the world: $E^2 = (m_0c^2)^2 + (pc)^2$, which is known as the \textbf{energy-mass-momentum} relation as an in-line equation.
A {\em \LaTeX{} class file}\index{\LaTeX{} class file@LaTeX class file} is a file, which holds style information for a particular \LaTeX{} class\footnote{You can find more about classes at \url{http://www.ctan.org/pkg/clsguide}.}. A {\em \LaTeX{} class file}\index{\LaTeX{} class file@LaTeX class file} is a file, which holds style information for a particular \LaTeX{}.
%********************************** %Second Section ************************************* %********************************** %Second Section *************************************
\section{Why do we use Loren Ipsum?} %Section - 1.2 \section{Why do we use Loren Ipsum?} %Section - 1.2

View File

@ -2,7 +2,7 @@
%% %%
%% Class ``PhD Thesis PSnPDF'' %% Class ``PhD Thesis PSnPDF''
%% %%
%% Version: v0.1 %% Version: v1.0
%% Authors: Krishna Kumar %% Authors: Krishna Kumar
%% Date: 2013/11/16 %% Date: 2013/11/16
%% Based on: King's LaTeX workshop by Krishna, CUED V1.1 Template by Harish Banderi %% Based on: King's LaTeX workshop by Krishna, CUED V1.1 Template by Harish Banderi
@ -13,8 +13,8 @@
% ******************** Class Identification ********************* % ******************** Class Identification *********************
%\NeedsTeXFormat{LaTeX2e} %\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{PhDThesisPSnPDF}[2013/11/14 version 1.0] \ProvidesClass{PhDThesisPSnPDF}[2013/11/14 version 1.0 by Krishna Kumar]
\typeout{https://github.com/kks32/phd-thesis-template/}
% *************************************************************** % ***************************************************************
% ********************** Class Definition *********************** % ********************** Class Definition ***********************
@ -53,11 +53,11 @@
% Set pdfpage and dvips paper sizes. Conditional tests are similar to that % ************** Set pdfpage and dvips paper sizes ***************
% of ifpdf.sty. Retain within {} to ensure tested macros are never altered,
% even if only effect is to set them to \relax.
% if \pdfoutput is undefined or equal to relax, output a dvips special % if \pdfoutput is undefined or equal to relax, output a dvips special
{\@ifundefined{pdfoutput}{\AtBeginDvi{\special{papersize=\paperwidth,\paperheight}}}{% \@ifundefined{pdfoutput}{
\AtBeginDvi{\special{papersize=\paperwidth,\paperheight}}
}
% pdfoutput is defined and not equal to \relax % pdfoutput is defined and not equal to \relax
% check for pdfpageheight existence just in case someone sets pdfoutput % check for pdfpageheight existence just in case someone sets pdfoutput
% under non-pdflatex. If exists, set them regardless of value of \pdfoutput. % under non-pdflatex. If exists, set them regardless of value of \pdfoutput.
@ -67,7 +67,8 @@
\ifcase\pdfoutput \ifcase\pdfoutput
\AtBeginDvi{\special{papersize=\paperwidth,\paperheight}}% \AtBeginDvi{\special{papersize=\paperwidth,\paperheight}}%
\else \else
\fi}} \fi
% Defines a print mode / online mode to define page-layout and hyperrefering % Defines a print mode / online mode to define page-layout and hyperrefering
@ -91,10 +92,14 @@
anchorcolor=black anchorcolor=black
} }
\if@twoside \RequirePackage[hmarginratio=3:2]{geometry} % Odd and Even side Margin staggering for binding \if@twoside
\hypersetup{pdfpagelayout=TwoPageRight} % Odd and Even side Margin staggering for binding and set viewmode for PDF
\else \RequirePackage[hmarginratio=3:2]{geometry} % Single side print margin for binding \RequirePackage[hmarginratio=3:2]{geometry}
\hypersetup{pdfpagelayout=OneColumn} \hypersetup{pdfpagelayout=TwoPageRight}
\else
% Single side print margin for binding and set view mode for PDF
\RequirePackage[hmarginratio=3:2]{geometry}
\hypersetup{pdfpagelayout=OneColumn}
\fi \fi
\else \else
@ -114,8 +119,8 @@
urlcolor=blue, urlcolor=blue,
citecolor=blue, citecolor=blue,
anchorcolor=green} anchorcolor=green}
% No Margin staggering on Odd and Even side
\RequirePackage[hmarginratio=1:1]{geometry} % No Margin staggering on Odd and Even side \RequirePackage[hmarginratio=1:1]{geometry}
\hypersetup{pdfpagelayout=OneColumn} \hypersetup{pdfpagelayout=OneColumn}
\fi \fi
@ -125,14 +130,9 @@
% Layout, Formatting and Headers % Layout, Formatting and Headers
\def\pdfshellescape{1} \def\pdfshellescape{1}
\usepackage{lscape} % Supports Landscape Layout \RequirePackage{lscape} % Supports Landscape Layout
\usepackage{setspace} % Define line spacing in para \RequirePackage{setspace} % Define line spacing in para
\usepackage{fancyhdr} % Define custom header \RequirePackage{fancyhdr} % Define custom header
\usepackage[perpage]{footmisc} %Range of footnote options
% Algorithms and Pseudocode
\usepackage{algpseudocode} % Algorithmicx package support for algorithms and pseudocode
% Conditional Statements % Conditional Statements
@ -144,7 +144,6 @@
\RequirePackage{tocbibind} % add Bibliography, List of figures and tables to contents \RequirePackage{tocbibind} % add Bibliography, List of figures and tables to contents
\RequirePackage{appendix} % add appendix \RequirePackage{appendix} % add appendix
% Graphics and Figures % Graphics and Figures
\RequirePackage[usenames, dvipsnames]{color} \RequirePackage[usenames, dvipsnames]{color}
\RequirePackage{epstopdf} % Convert eps figures to pdf \RequirePackage{epstopdf} % Convert eps figures to pdf
@ -157,43 +156,19 @@
\RequirePackage{graphicx} \RequirePackage{graphicx}
\DeclareGraphicsExtensions{.eps, .ps} \DeclareGraphicsExtensions{.eps, .ps}
\fi \fi
\usepackage{rotating}
\usepackage{subfigure}
\usepackage{wrapfig}
\usepackage{float}
% Table % URL Package and Definition
\usepackage{longtable}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{tabularx}
% Captions and Hyperreferncing / URL
\usepackage[figurename=Fig.,labelsep=space,tableposition=top]{caption} % Caption styling
\RequirePackage{url} \RequirePackage{url}
% Redefining urlstyle to use smaller fontsize in References with URLs % Redefining urlstyle to use smaller fontsize in References with URLs
\def\url@leostyle{% \def\url@leostyle{%
\@ifundefined{selectfont}{\def\UrlFont{\sf}}{\def\UrlFont{\small\ttfamily}}} \@ifundefined{selectfont}{\def\UrlFont{\sf}}{\def\UrlFont{\small\ttfamily}}}
\urlstyle{leo} \urlstyle{leo}
% Bibliography and References
\usepackage{cleveref}
\usepackage[square, sort, numbers, authoryear]{natbib}
% Math and SI Units
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{siunitx}
%To copy ligatures and Fonts %To copy ligatures and Fonts
\RequirePackage{textcomp} \RequirePackage{textcomp}
\RequirePackage[ansinew]{inputenc} \RequirePackage[ansinew]{inputenc}
\RequirePackage[T1]{fontenc} \RequirePackage[T1]{fontenc}
\usepackage{libertine}
\input{glyphtounicode} \input{glyphtounicode}
\pdfglyphtounicode{f_f}{FB00} \pdfglyphtounicode{f_f}{FB00}
\pdfglyphtounicode{f_i}{FB01} \pdfglyphtounicode{f_i}{FB01}

58
Preamble/preamble.tex Normal file
View File

@ -0,0 +1,58 @@
% **************************** Custom Packages *********************************
% Algorithms and Pseudocode
\usepackage{algpseudocode} % Algorithmicx package support for algorithms and pseudocode
% 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}
% Table
\usepackage{longtable}
\usepackage{multicol}
\usepackage{multirow}
\usepackage{tabularx}
% Math and SI Units
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{siunitx}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 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}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Subfigure (note: this must be included after the `caption` package).
%%\
%\usepackage{subfig}

Binary file not shown.

View File

@ -1,5 +1,9 @@
\documentclass[a4paper,11pt,twoside,printmode,index]{Classes/PhDThesisPSnPDF} \documentclass[a4paper,11pt,twoside,printmode,index]{Classes/PhDThesisPSnPDF}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Preamble: Contains packages and user-defined commands
\input{Preamble/preamble}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Thesis Information & Meta-data %% Thesis Information & Meta-data
%% PhD Thesis Title, Author, Degree, etc %% PhD Thesis Title, Author, Degree, etc