$if(highlighting-macros)$
$highlighting-macros$
$endif$

$tightlist.tex()$
$tables.tex()$
$graphics.tex()$
$citations.tex()$

$for(header-includes)$
$header-includes$
$endfor$

\usepackage{hyphenat}
\usepackage{ifthen}
\usepackage{calc}
\usepackage{calculator}

$if(titlepage-bg-image)$
\usepackage{graphicx}
\usepackage{wallpaper}
$endif$

$if(titlepage-geometry)$
\usepackage{geometry}
$endif$

$if(coverpage)$
\usepackage{graphicx}
\usepackage{geometry}
\usepackage{afterpage}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{fadings}
\usepackage[pagecolor=none]{pagecolor}
$endif$

$if(titlepage-theme.page-color)$
\usepackage[pagecolor=none]{pagecolor}
$endif$

$if(titlepage)$
% Set the titlepage font families
$if(titlepage-theme.page-fontfamily)$
\usepackage{fontspec}
\newfontfamily{\titlepagefont}{$titlepage-theme.page-fontfamily$}
$endif$

$if(titlepage-theme.title-fontfamily)$
\usepackage{fontspec}
\newfontfamily{\titlepagetitlefont}{$titlepage-theme.title-fontfamily$}
$endif$

$if(titlepage-theme.author-fontfamily)$
\usepackage{fontspec}
\newfontfamily{\titlepageauthorfont}{$titlepage-theme.author-fontfamily$}
$endif$

$if(titlepage-theme.affiliation-fontfamily)$
\usepackage{fontspec}
\newfontfamily{\titlepageaffiliationfont}{$titlepage-theme.affiliation-fontfamily$}
$endif$

$if(titlepage-theme.footer-fontfamily)$
\usepackage{fontspec}
\newfontfamily{\titlepagefooterfont}{$titlepage-theme.footer-fontfamily$}
$endif$

$if(titlepage-theme.header-fontfamily)$
\usepackage{fontspec}
\newfontfamily{\titlepageheaderfont}{$titlepage-theme.header-fontfamily$}
$endif$

$endif$

$if(coverpage)$
% Set the coverpage font families
$if(coverpage-theme.page-fontfamily)$
\usepackage{fontspec}
\newfontfamily{\coverpagefont}{$coverpage-theme.page-fontfamily$}
$endif$
$if(coverpage-theme.title-fontfamily)$
\usepackage{fontspec}
\newfontfamily{\coverpagetitlefont}{$coverpage-theme.title-fontfamily$}
$endif$
$if(coverpage-theme.author-fontfamily)$
\usepackage{fontspec}
\newfontfamily{\coverpageauthorfont}{$coverpage-theme.author-fontfamily$}
$endif$
$if(coverpage-theme.footer-fontfamily)$
\usepackage{fontspec}
\newfontfamily{\coverpagefooterfont}{$coverpage-theme.footer-fontfamily$}
$endif$
$if(coverpage-theme.header-fontfamily)$
\usepackage{fontspec}
\newfontfamily{\coverpageheaderfont}{$coverpage-theme.header-fontfamily$}
$endif$
$if(coverpage-theme.date-fontfamily)$
\usepackage{fontspec}
\newfontfamily{\coverpagedatefont}{$coverpage-theme.date-fontfamily$}
$endif$

$endif$

