%\documentclass[openany]{../template/now} % creates the journal version
\documentclass{../template/now}  % creates the book pdf version

% the now document class sets various dimensions, so be sure to *not* set
% or alter dimensions in your latex code.
% be sure to remove all manual formatting commands such \newpage, \clearpage.

% Strongly discourage haning lines
\widowpenalty=999999
\clubpenalty=999999
\setlength\parfillskip{0pt plus .4\textwidth}
\setlength\emergencystretch{.1\textwidth}

% \usepackage{times}
% \usepackage{microtype}
\usepackage{color}

% Defines \varnothing.
\usepackage{amssymb}

% Defines \mod
\usepackage{amsmath}
% \usepackage{graphicx}
% A column entry can stretch over multiple rows.
% \usepackage{multirow}

% Environment with stretchable columns.
\usepackage{tabularx}

% Certain huge tables should be rotated
\usepackage[figuresright]{rotating}

% URLs in the bibliography.
% \usepackage{url}
% Code listings.
\usepackage{listings}
\lstset{
  numbers=left, frame=lines, tabsize=2, captionpos=b, keepspaces=true,
  commentstyle=\color[rgb]{0.5, 0.5, 0.5},
  keywordstyle=\bfseries\color[rgb]{0, 0, 1},
  numberstyle=\color[rgb]{0.75, 0.75, 0.75},
  columns=fullflexible, showstringspaces=false,
  basicstyle=\footnotesize\ttfamily, extendedchars=true, breaklines=true
}
% CLRS-like algorithms.
\usepackage{clrscode}

\makeatletter
\newcommand{\thickhline}{%
    \noalign {\ifnum 0=`}\fi \hrule height 1pt
    \futurelet \reserved@a \@xhline
}
\newcolumntype{"}{@{\hskip\tabcolsep\vrule width 1pt\hskip\tabcolsep}}
\makeatother

\DeclareCaptionFormat{cont}{#1 \textbf{Continued}#2#3\par}

% a few definitions that are *not* needed in general:
\newcommand{\ie}{\emph{i.e.}}
\newcommand{\eg}{\emph{e.g.}}
\newcommand{\etc}{\emph{etc}}
\newcommand{\now}{\textsc{now}}

% References to part 2
\usepackage{xr-hyper}
\usepackage{hyperref}
\externaldocument[II-]{"../tmp/part2/main"}[part_2.pdf]
\newcommand{\eref}[2]{#1.\ref{#1-#2}}

\title{Secure Processors Part I: \\
       Background, Taxonomy for Secure Enclaves and Intel SGX Architecture}

\author{Victor Costan, Ilia Lebedev and Srinivas Devadas \\
        victor@costan.us, ilebedev@mit.edu and devadas@mit.edu \\
        \em Computer Science and Artificial Intelligence Laboratory \\
        \em Massachusetts Institute of Technology }

\begin{document}

% Define heading control sequences
\newcommand{\HeadingLevelA}[1]{\chapter{#1}}
\newcommand{\HeadingLevelB}[1]{\section{#1}}
\newcommand{\HeadingLevelC}[1]{\subsection{#1}}

% the following settings can be set or left blank at first
\copyrightowner{V.~Costan, I.~Lebedev, and S.~Devadas}
\volume{11}
\issue{1-2}
\pubyear{2017}
\copyrightyear{2017}
\isbn{978-1-68083-300-3}
\doi{10.1561/1000000051}
\firstpage{1}
\lastpage{248}

\frontmatter  % title page, contents, catalog information

\maketitle

\tableofcontents

\mainmatter

% Abstract
\input{text/abstract.tex}

% First four chapters of SGX-explained
\input{text/intro.tex}
\input{text/architecture.tex}
\input{text/security.tex}
\input{text/survey.tex}
\input{text/sgx.tex}
\input{text/conclusion.tex}
\input{text/acks.tex}

\backmatter  % references

\bibliographystyle{plainnat}
\bibliography{references}

\end{document}
