\documentclass{tufte-handout}

%\geometry{showframe}% for debugging purposes -- displays the margins

\usepackage{graphicx}
\usepackage[space]{grffile}
\usepackage{latexsym}
\usepackage{textcomp}
\usepackage{longtable}
\usepackage{tabulary}
\usepackage{booktabs,array,multirow}
\usepackage{amsfonts,amsmath,amssymb}
\providecommand\citet{\cite}
\providecommand\citep{\cite}
\providecommand\citealt{\cite}
\usepackage{url}
\usepackage{hyperref}
\hypersetup{colorlinks=false,pdfborder={0 0 0}}
\usepackage{etoolbox}
\makeatletter
\patchcmd\@combinedblfloats{\box\@outputbox}{\unvbox\@outputbox}{}{%
  \errmessage{\noexpand\@combinedblfloats could not be patched}%
}%
\makeatother
% You can conditionalize code for latexml or normal latex using this.
\newif\iflatexml\latexmlfalse
\providecommand{\tightlist}{\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}%

\AtBeginDocument{\DeclareGraphicsExtensions{.pdf,.PDF,.eps,.EPS,.png,.PNG,.tif,.TIF,.jpg,.JPG,.jpeg,.JPEG}}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}


% Set up the images/graphics package
%\usepackage{graphicx}
\setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}
\graphicspath{{graphics/}}

\title{Tufte-style Handout or Book}

\author[Alberto Pepe]{Alberto Pepe}

%\date{24 January 2009}  % if the \date{} command is left out, the current date will be used

% The following package makes prettier tables.  We're all about the bling!
%\usepackage{booktabs}

% The units package provides nice, non-stacked fractions and better spacing
% for units.
\usepackage{units}

% The fancyvrb package lets us customize the formatting of verbatim
% environments.  We use a slightly smaller font.
\usepackage{fancyvrb}
\fvset{fontsize=\normalsize}

% Small sections of multiple columns
\usepackage{multicol}

% Provides paragraphs of dummy text
\usepackage{lipsum}

% These commands are used to pretty-print LaTeX commands
\newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically
\newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument
\newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument
\newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment
\newcommand{\docenv}[1]{\textsf{#1}}% environment name
\newcommand{\docpkg}[1]{\texttt{#1}}% package name
\newcommand{\doccls}[1]{\texttt{#1}}% document class name
\newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name

% Use this header.tex file for:
% 1. frontmatter/preamble LaTeX definitions
%  - Example: \usepackage{xspace}
% 2. global macros available in all document blocks
%  - Example: \def\example{This is an example macro.}
%
% You should ONLY add such definitions in this header.tex space,
%  and treat the main article content as the body/mainmatter of your document
% Preamble-only macros such as \documentclass and \usepackage are
% NOT allowed in the main document, and definitions will be local to the current block.



\begin{document}

\maketitle% this prints the handout title, author, and date


\begin{abstract}
\noindent This template provides an example on how to create beautiful
Tufte-styled handouts or books with Authorea. This template provides
specifically examples on how to create margin notes, figure notes, and
references to figures, and citations. \textbf{Try to export this
document (or click PDF) to see a PDF-version of this document formatted
in Tufte style.~}
\end{abstract}






\section*{Introduction}

{\label{874460}}

This is some simple text in Latin, boldface: \textbf{In hac habitasse
platea dictumst.} This is an equation:~\({}^{4}_{12}\mathbf{C}^{5+}_{2}\). And this is a
citation to an Ebola paper\cite{28733113}. Please note that the Tufte
style is~\textbf{very} sensitive to special characters in BibTeX ids. As
such, \textbf{please only use alphanumeric values in your BibTeX ids}.
This is a reference to the figure~{\ref{931769}}. Some
more random text below.~

\par\null

\subsection*{What is Lorem Ipsum?}

{\label{145104}}

Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book. It has survived not only five
centuries, but also the leap into electronic typesetting, remaining
essentially unchanged. It was popularised in the 1960s with the release
of Letraset sheets containing Lorem Ipsum passages, and more recently
with desktop publishing software like Aldus PageMaker including versions
of Lorem Ipsum.

\par\null

\section*{LaTeX section}

Differentials often need a bit of help with their spacing as in
\[
\iint xy^2\,dx\,dy 
=\frac{1}{6}x^2y^3,
\]
whereas vector problems often lead to statements such as
\[
u=\frac{-y}{x^2+y^2}\,,\quad
v=\frac{x}{x^2+y^2}\,,\quad\text{and}\quad
w=0\,.
\]\selectlanguage{english}
\begin{figure}[h!]
\begin{center}
\includegraphics[width=1.00\columnwidth]{figures/mass/mass}
\caption{{Note that this Figure gets a caption which is translated to a sidemargin
note. Pellentesque suscipit risus massa, non vestibulum libero euismod
feugiat. In hac habitasse platea dictumst. Maecenas rutrum lobortis
lobortis. Vestibulum convallis porttitor sem ac ultricies.
{\label{931769}}%
}}
\end{center}
\end{figure}

\par\null\par\null

\section*{Another section with some margin notes
(below)}

{\label{491247}}

Nunc a aliquet sem, eget aliquet purus. Vestibulum ac placerat mauris.
Proin sed dolor ac justo semper iaculis. Donec varius, nibh sit amet
finibus tristique, sapien ante interdum odio, et pretium sapien libero
nec massa. In hac habitasse platea dictumst. Donec vel augue ac sapien
imperdiet pretium. Maecenas gravida risus id ultricies dignissim.
Maecenas gravida felis quis dolor faucibus, sed maximus lorem tristique.
Nam hendrerit quam quis ante porta posuere. Fusce finibus maximus orci
at porttitor. Nulla tempor ex a porttitor consequat. Quisque quis tempor
eros. Donec nisi mauris, sollicitudin in dapibus eu, interdum ultricies
quam.

\par\null

I will try to put a margin note here as a footnote\footnote{This is an example of a footnote which is converted to a sidenote}.

\selectlanguage{english}
\FloatBarrier
\bibliographystyle{plainnat}
\bibliography{bibliography/converted_to_latex.bib%
}

\end{CJK}\end{document}

