diff --git a/Classes/PhDThesisPSnPDF.cls b/Classes/PhDThesisPSnPDF.cls index 0658825..a8096da 100644 --- a/Classes/PhDThesisPSnPDF.cls +++ b/Classes/PhDThesisPSnPDF.cls @@ -82,7 +82,6 @@ options in case you have defined two bibliography styles.} \else \PHD@biblatextrue - \setBibtrue \fi } @@ -116,9 +115,15 @@ \ClassWarning{PhDThesisPSnPDF}{Bibliography selection conflict: A bibliography style aleady specified. Please check the document class options in case you have defined two bibliography styles.} - \else - \useCustomBibtrue - \setBibtrue + \else + \ifPHD@biblatex + \ClassWarning{PhDThesisPSnPDF}{Bibliography selection conflict: A + bibliography style aleady specified. Please check the document class + options in case you have defined two bibliography styles.} + \else + \useCustomBibtrue + \setBibtrue + \fi \fi } @@ -326,7 +331,31 @@ supported!} \renewcommand{\frontmatter}{\nolinenumbers} \renewcommand{\mainmatter}{\linenumbers} \renewcommand{\backmatter}{\linenumbers} -\fi + +% Fix display lineno issue in mathmode +\newcommand*\patchAmsMathEnvironmentForLineno[1]{% + \expandafter\let\csname old#1\expandafter\endcsname\csname #1\endcsname + \expandafter\let\csname oldend#1\expandafter\endcsname\csname end#1\endcsname + \renewenvironment{#1}% + {\linenomath\csname old#1\endcsname}% + {\csname oldend#1\endcsname\endlinenomath}% +}% + +\newcommand*\patchBothAmsMathEnvironmentsForLineno[1]{% + \patchAmsMathEnvironmentForLineno{#1}% + \patchAmsMathEnvironmentForLineno{#1*}% +}% + +\AtBeginDocument{% +\patchBothAmsMathEnvironmentsForLineno{equation}% +\patchBothAmsMathEnvironmentsForLineno{align}% +\patchBothAmsMathEnvironmentsForLineno{flalign}% +\patchBothAmsMathEnvironmentsForLineno{alignat}% +\patchBothAmsMathEnvironmentsForLineno{gather}% +\patchBothAmsMathEnvironmentsForLineno{multline}% +} + +\fi % End \ifPDH@lineno % Creates a Watermark Draft at the specified location. diff --git a/Preamble/preamble.tex b/Preamble/preamble.tex index 4b96e77..2e2d2d7 100644 --- a/Preamble/preamble.tex +++ b/Preamble/preamble.tex @@ -94,12 +94,12 @@ % Add `custombib' in the document class option to use this section \ifuseCustomBib - \RequirePackage[square, sort, numbers, authoryear]{natbib} % CustomBib +% \RequirePackage[square, sort, numbers, authoryear]{natbib} % CustomBib % If you would like to use biblatex for your reference management, as opposed to the default `natbibpackage` pass the option `custombib` in the document class. Comment out the previous line to make sure you don't load the natbib package. Uncomment the following lines and specify the location of references.bib file -% \RequirePackage[backend=biber, style=numeric-comp, citestyle=numeric, sorting=nty, natbib=true]{biblatex} -% \bibliography{References/references} %Location of references.bib only for biblatex +\RequirePackage[backend=biber, style=numeric-comp, citestyle=numeric, sorting=nty, natbib=true]{biblatex} +\bibliography{References/references} %Location of references.bib only for biblatex \fi diff --git a/thesis.pdf b/thesis.pdf index e8eeb12..1b88560 100644 Binary files a/thesis.pdf and b/thesis.pdf differ diff --git a/thesis.tex b/thesis.tex index 14832c6..1f76b62 100644 --- a/thesis.tex +++ b/thesis.tex @@ -11,7 +11,7 @@ % ******************************* PhD Thesis Template ************************** % Please have a look at the README.md file for info on how to use the template -\documentclass[a4paper,12pt,times,numbered,print,index]{Classes/PhDThesisPSnPDF} +\documentclass[a4paper,12pt,biblatex,custombib,times,print,index]{Classes/PhDThesisPSnPDF} % ****************************************************************************** % ******************************* Class Options ******************************** @@ -166,10 +166,10 @@ % Bibliography style previews: http://nodonn.tipido.net/bibstyle.php % Reference styles: http://sites.stat.psu.edu/~surajit/present/bib.htm -\bibliographystyle{apalike} +%\bibliographystyle{apalike} %\bibliographystyle{plainnat} % use this to have URLs listed in References \cleardoublepage -\bibliography{References/references} % Path to your References.bib file +%\bibliography{References/references} % Path to your References.bib file % If you would like to use BibLaTeX for your references, pass `custombib' as @@ -177,7 +177,7 @@ % specified in the preamble.tex file in the custombib section. % Comment out the lines related to natbib above and uncomment the following line. -% \printbibliography[heading=bibintoc, title={References}] +\printbibliography[heading=bibintoc, title={References}] \end{spacing}