diff --git a/Classes/PhDThesisPSnPDF.cls b/Classes/PhDThesisPSnPDF.cls index 1ae8be7..10d686f 100644 --- a/Classes/PhDThesisPSnPDF.cls +++ b/Classes/PhDThesisPSnPDF.cls @@ -177,13 +177,6 @@ % ******************************** Packages ************************************ % ****************************************************************************** -% ******************************* Custom Margin ******************************** -% Add `custommargin' in the document class option to use this section -% Set {innerside margin / outerside margin / topmargin / bottom margin} and many custom size for page layout -\ifsetMargin -\else -\RequirePackage[left=35mm,right=20mm,top=35mm,bottom=25mm]{geometry} -\fi % *********************** Layout and Formatting ******************************** \def\pdfshellescape{1} @@ -308,12 +301,14 @@ \RequirePackage{fancyhdr} % Define custom header -\pagestyle{fancy} +% Set Fancy Header Command is defined to Load FancyHdr after Geometry is defined +\newcommand{\setFancyHdr}{ +\pagestyle{fancy} \ifCU@pageStyleI % Style 1: Sets Page Number at the Top and Chapter/Section Name on LE/RO -\renewcommand{\chaptermark}[1]{\markboth{#1}{}} -\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1\ }} +\renewcommand{\chaptermark}[1]{\markboth{##1}{}} +\renewcommand{\sectionmark}[1]{\markright{\thesection\ ##1\ }} \fancyhf{} \fancyhead[RO]{\nouppercase \rightmark\hspace{0.25em} | \hspace{0.25em} \bfseries{\thepage} } \fancyhead[LE]{{\bfseries\thepage} \hspace{0.25em} | \hspace{0.25em} \nouppercase \leftmark } @@ -322,8 +317,8 @@ \else \ifCU@pageStyleII % Style 2: Sets Page Number at the Bottom with Chapter/Section Name on LO/RE -\renewcommand{\chaptermark}[1]{\markboth{#1}{}} -\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} +\renewcommand{\chaptermark}[1]{\markboth{##1}{}} +\renewcommand{\sectionmark}[1]{\markright{\thesection\ ##1}} \fancyhf{} \fancyhead[RO]{\bfseries\nouppercase \rightmark} \fancyhead[LE]{\bfseries \nouppercase \leftmark} @@ -332,8 +327,8 @@ \else % Default Style: Sets Page Number at the Top (LE/RO) with Chapter/Section Name on LO/RE -\renewcommand{\chaptermark}[1]{\markboth {#1}{}} -\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} +\renewcommand{\chaptermark}[1]{\markboth {##1}{}} +\renewcommand{\sectionmark}[1]{\markright{\thesection\ ##1}} \fancyhf{} \fancyhead[LO]{\nouppercase \rightmark} \fancyhead[LE,RO]{\bfseries\thepage} @@ -342,7 +337,7 @@ \fi - +} \setlength{\headheight}{14.5pt} %\renewcommand{\headrulewidth}{0.5pt} @@ -352,6 +347,10 @@ \renewcommand{\headrulewidth}{0pt} } +% If Margin has been set (default margin print/online version) +\ifsetMargin +\setFancyHdr % Apply fancy header settings otherwise apply it in preamble +\fi % **************** Clear Header Style on the Last Empty Odd pages *************** \renewcommand{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else% diff --git a/Preamble/preamble.tex b/Preamble/preamble.tex index d007c4c..3f48409 100644 --- a/Preamble/preamble.tex +++ b/Preamble/preamble.tex @@ -1,5 +1,14 @@ % ***************************************************************************** +% ******************************* Custom Margin ******************************** +% Add `custommargin' in the document class option to use this section +% Set {innerside margin / outerside margin / topmargin / bottom margin} and many custom size for page layout +\ifsetMargin +\else +\RequirePackage[left=37mm,right=30mm,top=35mm,bottom=30mm]{geometry} +\setFancyHdr % To apply fancy header after geometry package is loaded +\fi + % ***************************************************************************** % ******************* Fonts (like different typewriter fonts etc.)************* % Add `customfont' in the document class option to use this section diff --git a/README.md b/README.md index 9e9e773..fa2c249 100644 --- a/README.md +++ b/README.md @@ -235,18 +235,18 @@ You are trying to load an option that is not supported in the PhDThesisClass and # Known Issue(s) / Bugs -* No know bug(s) so far. If you find any let me know or even better, if you can patch it and contribute to the development of the LaTeX Template +* No know bug(s) so far. If you find any let me know or even better, if you can patch it and contribute to the development of the LaTeX Template. + +* Bug in Makefile that prevents conversion from PS to PDF. Workaround: `Run ps2pdf thesis.ps thesis.pdf` to produce the PDF output. -------------------------------------------------------------------------------- # TODO list -* Custommargin option is still in the class file, should move to preamble - * Scale the section sizes by an order when moving from a4paper to a5paper * Support Libertine fonts + Math -* Tweak Make file to convert PS to PDF +* Tweak Make file to convert PS to PDF and clean PS files diff --git a/thesis.pdf b/thesis.pdf index 62f68e4..d540a41 100644 Binary files a/thesis.pdf and b/thesis.pdf differ diff --git a/thesis.tex b/thesis.tex index 8ef6f84..e94e75f 100644 --- a/thesis.tex +++ b/thesis.tex @@ -18,6 +18,10 @@ % % `draft`: For draft mode without loading any images (same as draft in book) % +% ************************* Custom Page Margins ******************************** +% +% `custommargin`: Use `custommargin' in options to activate custom page margins, which can be defined in the preamble.tex. Custom margin will override print/online margin setup. +% % ******************* Choosing the Fonts in Class Options ********************* % % `times`: For Times font with math support. @@ -37,10 +41,6 @@ % `custombib`: Define your own bibliography style in the `preamble.tex` file. % `\RequirePackage[square, sort, numbers, authoryear]{natbib}` % -% ************************* Custom Page Margins ******************************** -% -% `custommargin`: Define your custom margin and other sizes in the geometry package in the preamble.tex. -% % ********************** Choosing the Page Style ********************************* % % `default (leave empty)`: For Page Numbers in Header (Left Even, Right Odd) and Chapter Name in Header (Right Even) and Section Name (Left Odd). Blank Footer. @@ -56,8 +56,8 @@ % ******************** Thesis Information & Meta-data ************************* %% The title of the thesis -\title{ How to write your thesis in \texorpdfstring{\\ \LaTeX}{LaTeX}} -%\texorpdfstring is used for PDF metadata and \\ creates a new line +\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}