\documentclass[10pt]{book}
\usepackage{hyperref}
\usepackage[links]{agda}
\usepackage{fontspec}
\setmainfont[
Extension = .ttf,
Path = fonts/,
UprightFont = *-Regular,
BoldFont = *-Bold,
ItalicFont = *-Italic,
BoldItalicFont = *-BoldItalic
]{DejaVuSerif}
\setsansfont[
Extension = .ttf,
Path = fonts/,
UprightFont = *-Regular,
BoldFont = *-Bold,
ItalicFont = *-Oblique,
BoldItalicFont = *-BoldOblique
]{DejaVuSans}
\setmonofont[
Extension = .ttf,
UprightFont = *-Regular,
Path = fonts/
]{Frankenfont}
\usepackage{soul}
\usepackage{xcolor}
\usepackage{tcolorbox}
\tcbuselibrary{skins,breakable}
\usepackage{fancyvrb}
\usepackage{fvextra}
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{setspace}
\usepackage[
a4paper,
total = {170mm,257mm},
left = 20mm,
top = 20mm,
]{geometry}
\sloppy
\setcounter{secnumdepth}{0}
\definecolor{TEXTCOLOR}{HTML}{111111}
\color{TEXTCOLOR}
\definecolor{BACKGROUND-COLOR}{HTML}{EEEEFF}
\let\oldtexttt\texttt\renewcommand{\texttt}[1]{\colorbox{BACKGROUND-COLOR}{\oldtexttt{#1}}}
\newtcolorbox{agda}[1][]{
frame hidden,
colback=BACKGROUND-COLOR,
spartan,
left=5pt,
boxrule=0pt,
breakable,
}
\DefineVerbatimEnvironment{verbatim}{Verbatim}{xleftmargin=0pt}
\newenvironment{pre}{
\VerbatimEnvironment
\begin{agda}
\begin{Verbatim}[breaklines=true]%
}{\end{Verbatim}
\end{agda}
}
\newfontfamily{\AgdaSerifFont}{DejaVu-Serif}
\newfontfamily{\AgdaSansSerifFont}{DejaVu-Sans}
\newfontfamily{\AgdaTypewriterFont}{Frankenfont}
\renewcommand{\AgdaFontStyle}[1]{{\AgdaTypewriterFont{}#1}}
\renewcommand{\AgdaKeywordFontStyle}[1]{{\AgdaTypewriterFont{}#1}}
\renewcommand{\AgdaStringFontStyle}[1]{{\AgdaTypewriterFont{}#1}}
\renewcommand{\AgdaCommentFontStyle}[1]{{\AgdaTypewriterFont{}#1}}
\renewcommand{\AgdaBoundFontStyle}[1]{{\AgdaTypewriterFont{}#1}}
\AgdaNoSpaceAroundCode{}
\usepackage{tocloft}
\setlength\cftchapnumwidth{3em}
\cftsetpnumwidth{4em}
\definecolor{LINKCOLOR}{HTML}{2A7AE2}
\hypersetup{
colorlinks,
linkcolor={LINKCOLOR},
citecolor={LINKCOLOR},
urlcolor={LINKCOLOR}
}
\begin{document}
\setlength{\mathindent}{0pt}
\setlength{\parindent}{0em}
\setlength{\parskip}{1em}
\providecommand{\tightlist}{ \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\begin{titlepage}
\newlength{\drop} \setlength{\drop}{0.12\textheight} \centering \vspace*{\drop}
\begingroup {\large Philip Wadler, Wen Kokke, and Jeremy G. Siek}\\[\baselineskip]
{\Huge PROGRAMMING LANGUAGE}\\[\baselineskip]
{\Huge FOUNDATIONS}\\[\baselineskip]
{\Large IN}\\[\baselineskip]
{\Huge Agda}\\[\drop]
\vfill {\small\scshape 2021}\par \null\endgroup
\end{titlepage}
$for(part)$
$if(part.frontmatter)$
\frontmatter\setcounter{tocdepth}{0}
\tableofcontents\setcounter{tocdepth}{1}
$endif$
$if(part.mainmatter)$
\mainmatter$endif$
$if(part.backmatter)$
\appendix
\addcontentsline{toc}{part}{Appendices}
$endif$
$if(part.frontmatter)$
$else$
\part{$part.title$}
$endif$
$for(part.section)$
\hypertarget{$part.section.anchor$}{ \chapter{$part.section.title$}\label{$part.section.anchor$}}
$part.section.body$
$endfor$
$if(part.frontmatter)$
$endif$
$if(part.mainmatter)$
\cleardoublepage\phantomsection$endif$
$if(part.backmatter)$
$endif$
$endfor$
\end{document}