\documentclass[nofonts]{tufte-handout}

% typography
\usepackage{fontenc}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}
\usepackage{fontspec}
\setmonofont{Triplicate T4c}
\usepackage{microtype}

% other packages
\usepackage{booktabs}
\usepackage{cleveref}
\usepackage{fancyvrb}
    \fvset{fontsize=\normalsize}
\usepackage{graphicx}
    \setkeys{Gin}{width=\linewidth,
                  totalheight=\textheight,
                  keepaspectratio}
\usepackage{listings}
    \lstset{basicstyle=\footnotesize\ttfamily,
            upquote=true,
            showstringspaces=false}
\usepackage{mathtools}
\usepackage[normalem]{ulem}
\usepackage{units}
\usepackage{xspace}

% pandoc & tufte error workarounds
\def\tightlist{}
\newcommand{\passthrough}[1]{#1}
\renewcommand\allcapsspacing[1]{{\addfontfeature{LetterSpace=15}#1}}
\renewcommand\smallcapsspacing[1]{{\addfontfeature{LetterSpace=10}#1}}
\usepackage{longtable}
$if(csl-refs)$
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
\newenvironment{cslreferences}%
  {$if(csl-hanging-indent)$\setlength{\parindent}{0pt}%
  \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}%
  {\par}
$endif$

% citations
\newcommand{\ct}[1]{\footnote{\citet{#1}}}

% custom

$if(title)$
\title{$title$}
$endif$
$if(author)$
\author{$for(author)$$author$$sep$ \and $endfor$}
$endif$
$if(date)$
\date{$date$}
$endif$

\begin{document}
$if(title)$
\maketitle
$endif$

$if(abstract)$
\begin{fullwidth}
    \vskip10pt
    \hfill\textsf{$abstract$}
\end{fullwidth}
$endif$

$body$

$if(bibliography)$
\bibliography{$bibliography$}
\bibliographystyle{plainnat}
$endif$

\end{document}
