From 304d331bc71296cd1fe6be4b051eb6028e474c5f Mon Sep 17 00:00:00 2001 From: Dan Goldsmith Date: Thu, 13 Sep 2018 11:39:01 +0100 Subject: [PATCH] Working with both Tex and PDF export --- Frontpage.md | 12 +- Makefile | 5 +- Template/Classes/CUPhDThesis.cls | 212 ++++++++++++++++--------------- Template/disso.latex | 9 +- 4 files changed, 117 insertions(+), 121 deletions(-) diff --git a/Frontpage.md b/Frontpage.md index 7d18d80..96bbdea 100644 --- a/Frontpage.md +++ b/Frontpage.md @@ -1,9 +1,6 @@ - - --- author: Your Name title: "Project Title" - documentclass: Template/Classes/CUPhDThesis classoption: @@ -19,7 +16,6 @@ toc-depth: 2 lof: true lot: false - keywords: Comma, Seperated, Keywords @@ -32,7 +28,7 @@ header-includes: dept: 'Faculty of Enginnering and Computing' university: 'Coventry University' -crest: Template/Figs/CULogo.pdf +crest: 'Template/Figs/CULogo.pdf' degreetitle: 'BSc: Ethical Hacking and cybersecurity' #Ethics form, REPLACE THIS WITH YOUR ONE @@ -49,7 +45,7 @@ bibliography: example-bib.bib #Bibliograpy Style csl: Template/harvard-coventry-university.csl +#If we are using biblatex instead +biblatexoptions: backend=biber, style=authoryear, sorting=nty, natbib=true +biblio-title: "References" --- - - - diff --git a/Makefile b/Makefile index 1132d22..2a08bf9 100755 --- a/Makefile +++ b/Makefile @@ -11,6 +11,8 @@ TARGET = Dissertaion.pdf #Report Export Options PDF_PANDOC_OPTIONS = --filter=pandoc-citeproc --template=Template/disso.latex --top-level-division=chapter +TEX_PANDOC_OPTIONS = --template=Template/disso.latex --top-level-division=chapter --biblatex + #Default Sources to the input provide ifndef SOURCES SOURCES = $< @@ -34,4 +36,5 @@ endif %.tex: %.md # Old way of doing it, now dealt with through target # #pandoc $(PANDOC_OPTIONS) -o $@ $< - pandoc $(PDF_PANDOC_OPTIONS) -s $(SOURCES) -o Diso.tex + pandoc $(TEX_PANDOC_OPTIONS) -s $(SOURCES) -o Foo.tex +#$(TARGET) diff --git a/Template/Classes/CUPhDThesis.cls b/Template/Classes/CUPhDThesis.cls index 78b89ba..53f858a 100644 --- a/Template/Classes/CUPhDThesis.cls +++ b/Template/Classes/CUPhDThesis.cls @@ -73,61 +73,62 @@ } % ******************************* Bibliography ********************************* -\newif\ifsetBib\setBibfalse % Custom Bibliography = true/false -\newif\ifsetBiBLaTeX\setBiBLaTeXfalse % BiBLaTeX = True / False - -\newif\ifPHD@biblatex\PHD@biblatexfalse % BiBLaTeX -\DeclareOption{biblatex}{ - \ifsetBib - \ClassWarning{CUPhDThesis}{Bibliography selection conflict: A - bibliography style aleady specified. Please check the document class - options in case you have defined two bibliography styles.} - \else - \PHD@biblatextrue - \fi -} - -\newif\ifPHD@authoryear\PHD@authoryearfalse % Author-Year citation -\DeclareOption{authoryear}{ - \ifsetBib - \ClassWarning{CUPhDThesis}{Bibliography selection conflict: A - bibliography style aleady specified. Please check the document class - options in case you have defined two bibliography styles.} - \else - \PHD@authoryeartrue - \setBibtrue - \fi -} - -\newif\ifPHD@numbered\PHD@numberedfalse % Numbered citiation -\DeclareOption{numbered}{ - \ifsetBib - \ClassWarning{CUPhDThesis}{Bibliography selection conflict: A - bibliography style aleady specified. Please check the document class - options in case you have defined two bibliography styles.} - \else - \PHD@numberedtrue - \setBibtrue - \fi -} - -\newif\ifuseCustomBib\useCustomBibfalse % Custom Bibliography -\DeclareOption{custombib}{ - \ifsetBib - \ClassWarning{CUPhDThesis}{Bibliography selection conflict: A - bibliography style aleady specified. Please check the document class - options in case you have defined two bibliography styles.} - \else - \ifPHD@biblatex - \ClassWarning{CUPhDThesis}{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 -} +% DG REmove the built in biblatex stuff +%% \newif\ifsetBib\setBibfalse % Custom Bibliography = true/false +%% \newif\ifsetBiBLaTeX\setBiBLaTeXfalse % BiBLaTeX = True / False + +%% \newif\ifPHD@biblatex\PHD@biblatexfalse % BiBLaTeX +%% \DeclareOption{biblatex}{ +%% \ifsetBib +%% \ClassWarning{CUPhDThesis}{Bibliography selection conflict: A +%% bibliography style aleady specified. Please check the document class +%% options in case you have defined two bibliography styles.} +%% \else +%% \PHD@biblatextrue +%% \fi +%% } + +%% \newif\ifPHD@authoryear\PHD@authoryearfalse % Author-Year citation +%% \DeclareOption{authoryear}{ +%% \ifsetBib +%% \ClassWarning{CUPhDThesis}{Bibliography selection conflict: A +%% bibliography style aleady specified. Please check the document class +%% options in case you have defined two bibliography styles.} +%% \else +%% \PHD@authoryeartrue +%% \setBibtrue +%% \fi +%% } + +%% \newif\ifPHD@numbered\PHD@numberedfalse % Numbered citiation +%% \DeclareOption{numbered}{ +%% \ifsetBib +%% \ClassWarning{CUPhDThesis}{Bibliography selection conflict: A +%% bibliography style aleady specified. Please check the document class +%% options in case you have defined two bibliography styles.} +%% \else +%% \PHD@numberedtrue +%% \setBibtrue +%% \fi +%% } + +%% \newif\ifuseCustomBib\useCustomBibfalse % Custom Bibliography +%% \DeclareOption{custombib}{ +%% \ifsetBib +%% \ClassWarning{CUPhDThesis}{Bibliography selection conflict: A +%% bibliography style aleady specified. Please check the document class +%% options in case you have defined two bibliography styles.} +%% \else +%% \ifPHD@biblatex +%% \ClassWarning{CUPhDThesis}{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 +%% } % ************************* Header / Footer Styling **************************** \newif\ifPHD@textJustify\PHD@textJustifytrue % Set Justification true @@ -470,56 +471,57 @@ supported!} % ******************************* Bibliography ********************************* -\ifPHD@authoryear - \ifPHD@biblatex - \RequirePackage[backend=biber, style=authoryear, citestyle=alphabetic, - sorting=nty, natbib=true]{biblatex} - \setBiBLaTeXtrue - \else - \RequirePackage[round, sort, numbers, authoryear]{natbib} %author year - \fi -\else - \ifPHD@numbered - \ifPHD@biblatex - \RequirePackage[backend=biber, style=numeric-comp, - citestyle=numeric, sorting=none, natbib=true]{biblatex} - \setBiBLaTeXtrue - \else - \RequirePackage[numbers,compress]{natbib} % numbered citation - \fi - \else - \ifuseCustomBib - \AtBeginDocument{ - \@ifpackageloaded{natbib}{}{ - \@ifpackageloaded{biblatex}{}{ - \ClassWarning{CUPhDThesis}{% - You chose custom bibliography, but no corresponding package - (biblatex/natbib) has been loaded. Please load the - appropriate bibliography package in the preamble.} - } - } - } - \else % set default to numbered - \ifPHD@biblatex - \RequirePackage[backend=biber, style=numeric-comp, - citestyle=numeric, sorting=none, natbib=true]{biblatex} - \setBiBLaTeXfalse - \else - \RequirePackage[numbers,compress]{natbib} - \fi % default - \setBibfalse - \fi % custombib - \fi % numbered -\fi % author year - -\ifsetBib -\else -\ClassWarning{CUPhDThesis}{No bibliography style was specified. - Default numbered style is used. If you would like to use a - different style, use 'authoryear' or 'numbered' in the options in - documentclass or use 'custombib' and define the natbib package or - biblatex package with required style in the Preamble.tex file} -\fi +%% DG: More Bibliography stuff +%% \ifPHD@authoryear +%% \ifPHD@biblatex +%% \RequirePackage[backend=biber, style=authoryear, citestyle=alphabetic, +%% sorting=nty, natbib=true]{biblatex} +%% \setBiBLaTeXtrue +%% \else +%% \RequirePackage[round, sort, numbers, authoryear]{natbib} %author year +%% \fi +%% \else +%% \ifPHD@numbered +%% \ifPHD@biblatex +%% \RequirePackage[backend=biber, style=numeric-comp, +%% citestyle=numeric, sorting=none, natbib=true]{biblatex} +%% \setBiBLaTeXtrue +%% \else +%% \RequirePackage[numbers,compress]{natbib} % numbered citation +%% \fi +%% \else +%% \ifuseCustomBib +%% \AtBeginDocument{ +%% \@ifpackageloaded{natbib}{}{ +%% \@ifpackageloaded{biblatex}{}{ +%% \ClassWarning{CUPhDThesis}{% +%% You chose custom bibliography, but no corresponding package +%% (biblatex/natbib) has been loaded. Please load the +%% appropriate bibliography package in the preamble.} +%% } +%% } +%% } +%% \else % set default to numbered +%% \ifPHD@biblatex +%% \RequirePackage[backend=biber, style=numeric-comp, +%% citestyle=numeric, sorting=none, natbib=true]{biblatex} +%% \setBiBLaTeXfalse +%% \else +%% \RequirePackage[numbers,compress]{natbib} +%% \fi % default +%% \setBibfalse +%% \fi % custombib +%% \fi % numbered +%% \fi % author year + +%% \ifsetBib +%% \else +%% \ClassWarning{CUPhDThesis}{No bibliography style was specified. +%% Default numbered style is used. If you would like to use a +%% different style, use 'authoryear' or 'numbered' in the options in +%% documentclass or use 'custombib' and define the natbib package or +%% biblatex package with required style in the Preamble.tex file} +%% \fi % ********************************** Fonts ********************************** \RequirePackage{textcomp} diff --git a/Template/disso.latex b/Template/disso.latex index 035fc2b..22f3094 100644 --- a/Template/disso.latex +++ b/Template/disso.latex @@ -430,14 +430,9 @@ $endif$ $endif$ $endif$ + $if(biblatex)$ -$if(beamer)$ -\begin{frame}[allowframebreaks]{$biblio-title$} -\bibliographytrue -\printbibliography[heading=none] -\end{frame} -$else$ -\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$ +\printbibliography$if(biblio-title)$[title=$biblio-title$] $endif$ $endif$