Custom Font

This commit is contained in:
Krishna Kumar 2014-06-08 19:02:10 +01:00
parent ce4da3a15f
commit f68f2f2690
3 changed files with 56 additions and 32 deletions

View File

@ -40,8 +40,8 @@
\newif\ifPHD@fourier\PHD@fourierfalse % Fourier with Math Support \newif\ifPHD@fourier\PHD@fourierfalse % Fourier with Math Support
\DeclareOption{fourier}{\PHD@fouriertrue} \DeclareOption{fourier}{\PHD@fouriertrue}
\newif\ifPHD@customfont\PHD@customfontfalse % Custom Font with Math Support \newif\ifsetCustomFont\setCustomFontfalse % Custom Font with Math Support
\DeclareOption{customfont}{\PHD@customfonttrue} \DeclareOption{customfont}{\setCustomFonttrue}
% ******************************* Bibliography ********************************* % ******************************* Bibliography *********************************
\newif\ifsetBib\setBibfalse % Custom Bibliography = true/false \newif\ifsetBib\setBibfalse % Custom Bibliography = true/false
@ -90,7 +90,10 @@ recompile. Good luck with your writing!}
\newif\ifPHD@chapter\PHD@chapterfalse % Enable Separate Abstract \newif\ifPHD@chapter\PHD@chapterfalse % Enable Separate Abstract
\DeclareOption{chapter}{ \DeclareOption{chapter}{
\PHD@chaptertrue \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!} \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% \ProcessOptions\relax%
@ -129,9 +132,12 @@ PhD thesis guidelines recommend using A4 or A5paper}
% Draft Mode % Draft Mode
\DeclareOption{draft}{\PassOptionsToClass{\CurrentOption}{book} \DeclareOption{draft}{\PassOptionsToClass{\CurrentOption}{book}
\ClassWarning{PhDThesisPSnPDF}{Draft is ON. You can use `draftmode' instead, which adds watermark with timestamp and line numbering. Don't forget to turn `draft' off for your final version.}}% \ClassWarning{PhDThesisPSnPDF}{Draft is ON. You can use `draftmode' instead,
which adds watermark with timestamp and line numbering. Don't forget to turn
`draft' off for your final version.}}%
\DeclareOption{draftmode}{\PassOptionsToClass{draft}{book}\PHD@drafttrue \DeclareOption{draftmode}{\PassOptionsToClass{draft}{book}\PHD@drafttrue
\ClassWarning{PhDThesisPSnPDF}{Draft Mode is ON. Don't forget to turn it off for your final version.}}% \ClassWarning{PhDThesisPSnPDF}{Draft Mode is ON.
Don't forget to turn it off for your final version.}}%
% Line Numbers % Line Numbers
\newif\ifPHD@lineno\PHD@linenotrue \newif\ifPHD@lineno\PHD@linenotrue
@ -303,13 +309,21 @@ supported!}
% If NOT Draft Mode % If NOT Draft Mode
\else \else
\renewcommand\SetDraftText[1]{\ClassWarning{PhDThesisPSnPDF}{DraftMode is inactive, to use SetDraftText include `draftmode' in the document class options.}} \renewcommand\SetDraftText[1]{\ClassWarning{PhDThesisPSnPDF}{DraftMode is
inactive, to use SetDraftText include `draftmode' in the document
class options.}}
% Draft Version % Draft Version
\renewcommand\SetDraftVersion[1]{\ClassWarning{PhDThesisPSnPDF}{DraftMode is inactive, to use SetDraftVersion include `draftmode' in the document class options.}} \renewcommand\SetDraftVersion[1]{\ClassWarning{PhDThesisPSnPDF}{DraftMode is
inactive, to use SetDraftVersion include `draftmode' in the document
class options.}}
% Draft Content % Draft Content
\renewcommand\SetDraftWMPosition[1]{\ClassWarning{PhDThesisPSnPDF}{DraftMode is inactive, to use SetDraftWMPosition include `draftmode' in the document class options.}} \renewcommand\SetDraftWMPosition[1]{\ClassWarning{PhDThesisPSnPDF}{DraftMode
is inactive, to use SetDraftWMPosition include `draftmode' in the document
class options.}}
\renewcommand\SetDraftGrayScale[1]{\ClassWarning{PhDThesisPSnPDF}{DraftMode is inactive, to use SetDraftWMPosition include `draftmode' in the document class options.}} \renewcommand\SetDraftGrayScale[1]{\ClassWarning{PhDThesisPSnPDF}{DraftMode is
inactive, to use SetDraftWMPosition include `draftmode' in the document
class options.}}
\fi \fi
@ -318,7 +332,8 @@ supported!}
% ******************************* Bibliography ********************************* % ******************************* Bibliography *********************************
\ifPHD@authoryear \ifPHD@authoryear
\ifPHD@biblatex \ifPHD@biblatex
\RequirePackage[backend=biber, style=authoryear, citestyle=alphabetic, sorting=nty, natbib=true]{biblatex} \RequirePackage[backend=biber, style=authoryear, citestyle=alphabetic,
sorting=nty, natbib=true]{biblatex}
\setBiBLaTeXtrue \setBiBLaTeXtrue
\else \else
\RequirePackage[round, sort, numbers, authoryear]{natbib} %author year \RequirePackage[round, sort, numbers, authoryear]{natbib} %author year
@ -327,7 +342,8 @@ supported!}
\else \else
\ifPHD@numbered \ifPHD@numbered
\ifPHD@biblatex \ifPHD@biblatex
\RequirePackage[backend=biber, style=numeric-comp, citestyle=numeric, sorting=none, natbib=true]{biblatex} \RequirePackage[backend=biber, style=numeric-comp, citestyle=numeric,
sorting=none, natbib=true]{biblatex}
\setBiBLaTeXtrue \setBiBLaTeXtrue
\else \else
\RequirePackage[numbers,sort&compress]{natbib} % numbered citation \RequirePackage[numbers,sort&compress]{natbib} % numbered citation
@ -341,16 +357,19 @@ supported!}
\fi \fi
\else \else
\ifPHD@biblatex \ifPHD@biblatex
\RequirePackage[backend=biber, style=numeric-comp, citestyle=numeric, sorting=none, natbib=true]{biblatex} \RequirePackage[backend=biber, style=numeric-comp,
citestyle=numeric, sorting=none, natbib=true]{biblatex}
\setBiBLaTeXtrue \setBiBLaTeXtrue
\else \else
\RequirePackage[numbers,sort&compress]{natbib} % Default - numbered \RequirePackage[numbers,sort&compress]{natbib} % Default
%- numbered
\fi \fi
\setBibtrue \setBibtrue
\ClassWarning{PhDThesisPSnPDF}{No bibliography style was specified. \ClassWarning{PhDThesisPSnPDF}{No bibliography style was specified.
Default numbered style is used. If you would like to use a different style, use Default numbered style is used. If you would like to use a different
`authoryear' or `numbered' in the options in documentclass or use `custombib` style, use `authoryear' or `numbered' in the options in documentclass
and define the natbib package or biblatex package with required style in the Preamble.tex file} or use `custombib` and define the natbib package or biblatex package
with required style in the Preamble.tex file}
\fi \fi
\fi \fi
\fi \fi
@ -362,24 +381,31 @@ and define the natbib package or biblatex package with required style in the Pre
% Font Selection % Font Selection
\ifPHD@times \ifPHD@times
\RequirePackage{mathptmx} % times roman, including math (where possible) \RequirePackage{mathptmx} % times roman, including math (where possible)
\setFonttrue \setCustomFontfalse
\setFonttrue
\else \else
\ifPHD@fourier \ifPHD@fourier
\RequirePackage{fourier} % Fourier \RequirePackage{fourier} % Fourier
\setCustomFontfalse
\setFonttrue
\else
\ifsetCustomFont
\setFonttrue \setFonttrue
\else \else
\ifPHD@customfont
\setFontfalse \setFontfalse
\else \fi
\fi
\fi
\ifsetFont
\else % If Font is not set throw a warning.
\ClassWarning{PhDThesisPSnPDf}{Using default font Latin Modern. If you \ClassWarning{PhDThesisPSnPDf}{Using default font Latin Modern. If you
would like to use other pre-defined fonts use `times' (The Cambridge University would like to use other pre-defined fonts use `times' (The Cambridge
PhD thesis guidelines recommend using Times font) or `fourier' or load a custom University PhD thesis guidelines recommend using Times font) or `fourier'
font in the preamble.tex file by specifying `customfont' in the class options} or load a custom font in the preamble.tex file by specifying `customfont'
in the class options}
\RequirePackage{lmodern} \RequirePackage{lmodern}
\setFonttrue
\fi
\fi
\fi \fi
\RequirePackage[utf8]{inputenc} \RequirePackage[utf8]{inputenc}

View File

@ -14,11 +14,9 @@
% Add `customfont' in the document class option to use this section % Add `customfont' in the document class option to use this section
\ifsetFont \ifsetCustomFont
\else
% Set your custom font here and use `customfont' in options. Leave empty to % Set your custom font here and use `customfont' in options. Leave empty to
% load computer modern font (default LaTeX font). % load computer modern font (default LaTeX font).
\RequirePackage{libertine} \RequirePackage{libertine}
\fi \fi

Binary file not shown.