Skip to content
Permalink
Browse files
Working with both Tex and PDF export
  • Loading branch information
aa9863 committed Sep 13, 2018
1 parent 9c4b006 commit 304d331bc71296cd1fe6be4b051eb6028e474c5f
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 121 deletions.
@@ -1,9 +1,6 @@
<!-- Cover and Abstract Document -->

---
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"
---



@@ -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)
@@ -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}
@@ -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$

0 comments on commit 304d331

Please sign in to comment.