Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
231 lines (184 sloc) 6.35 KB
% Based on tufte-handout.tex - DESC
% Iago Mosqueira - JRC. 2013
% https://gist.github.com/reinholdsson/7426608/566d8104363cd2fef2d6dd50e90aceab377b4a45
% Example input file: https://t.co/Jl73l6p8rA
% Example output file: https://t.co/udpLlvml8X
%notes
%https://tex.stackexchange.com/questions/122307/tufte-handout-and-footnotes?rq=1
\documentclass[a4paper]{tufte-handout}
% \title[draft]
% xelatex fix via http://www.scriptscoop.com/t/3e53d190f1be/xetex-seems-to-break-headers-in-tufte-handout.html
\ifxetex
\newcommand{\textls}[2][5]{%
\begingroup\addfontfeatures{LetterSpace=#1}#2\endgroup
}
\renewcommand{\allcapsspacing}[1]{\textls[15]{#1}}
\renewcommand{\smallcapsspacing}[1]{\textls[10]{#1}}
\renewcommand{\allcaps}[1]{\textls[15]{\MakeTextUppercase{#1}}}
\renewcommand{\smallcaps}[1]{\smallcapsspacing{\scshape\MakeTextUppercase{#1}}}
\renewcommand{\textsc}[1]{\smallcapsspacing{\textsmallcaps{#1}}}
\fi
\providecommand{\note}{\textsf}
\renewcommand{\large}{\normalsize}
\renewcommand{\huge}{\normalsize}
\renewcommand{\Huge}{\normalsize}
% optionally, change all figures to margin figures (Caleb McDaniel)
$if(marginfigures)$
\renewenvironment{figure}[1][]{\begin{marginfigure}}{\end{marginfigure}}
$endif$
% optionally, make links footnotes instead of hotlinks
$if(links-as-notes)$
\renewcommand{\href}[2]{#2\footnote{\url{#1}}}
$endif$
\newcommand{\stars}{\centerline{* * *}}
%set fonts that support Greek characters
%http://tex.stackexchange.com/questions/71293/increasing-the-text-size-in-tufte-documents
%look into {\greekfont}
\setmainfont[AutoFakeBold=3,ItalicFont={Gentium Italic}]{Gentium}
% \setmainfont{Cardo} % alternate font
\setmonofont{Ubuntu Mono}
\setsansfont{Ubuntu}
%uncomment following for colored links
% \hypersetup{colorlinks}
%tightlist fix
%via http://tex.stackexchange.com/questions/257418/error-tightlist-converting-md-file-into-pdf-using-pandoc
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
% ams
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
% the following have been commented out for causing issues with markdown → pandoc
% \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
% \usepackage[T1]{fontenc}
% \usepackage[utf8]{inputenc}
% add line numbers (Caleb McDaniel)
$if(linenos)$
\usepackage[modulo]{lineno}
\linenumbers
% Uncomment next line to make line numbers font match text font (Andrew Dunning)
% \def\linenumberfont{\normalfont\small}
$endif$
% use symbols instead of numbers for footnotes (Caleb McDaniel)
% http://tex.stackexchange.com/questions/826/symbols-instead-of-numbers-as-footnote-markers
$if(symbol)$
\usepackage{perpage}
\MakePerPage{footnote}
\renewcommand*{\thefootnote}{\fnsymbol{footnote}}
$endif$
% Set up the images/graphics package
\usepackage{graphicx}
\setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}
\graphicspath{{graphics/}}
% \let\Oldincludegraphics\includegraphics
% \renewcommand{\includegraphics}[1]{\Oldincludegraphics[trim={0 3in 0 0},clip,width=\textwidth]{#1}}
% natbib
% \usepackage{natbib} %causes issues with biblatex
% \bibliographystyle{plainnat}
% biblatex
$if(biblatex)$
\usepackage[%
style=ieee,
isbn=true,
url=true,
defernumbers=true,
sorting=nyt, % "Sort by name, year, title."
%sorting=none, % "Do not sort at all. All entries are processed in citation order." (order of appearance)
bibencoding=utf8,
backend=biber,
language=auto, % get main language from babel
autolang=other,
]{biblatex}
$if(biblio-files)$
\bibliography{$biblio-files$}
$endif$
$endif$
% booktabs
\usepackage{longtable,booktabs}
% url
\usepackage{url}
\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref}
% hyperref
\usepackage{hyperref}
% break long URLs
\urlstyle{rm}
% units.
\usepackage{units}
% fancyvrb
\usepackage{fancyvrb}
\fvset{fontsize=\normalsize}
\DefineShortVerb[commandchars=\\\{\}]{\|}
\DefineVerbatimEnvironment{Highlighting}{Verbatim}{commandchars=\\\{\}}
% multiplecol
\usepackage{multicol}
% lipsum
\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
% Shaded
\newenvironment{Shaded}{}{}
\newcommand{\KeywordTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{\textbf{{#1}}}}
\newcommand{\DataTypeTok}[1]{\textcolor[rgb]{0.56,0.13,0.00}{{#1}}}
\newcommand{\DecValTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
\newcommand{\BaseNTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
\newcommand{\FloatTok}[1]{\textcolor[rgb]{0.25,0.63,0.44}{{#1}}}
\newcommand{\CharTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
\newcommand{\StringTok}[1]{\textcolor[rgb]{0.25,0.44,0.63}{{#1}}}
\newcommand{\CommentTok}[1]{\textcolor[rgb]{0.38,0.63,0.69}{\textit{{#1}}}}
\newcommand{\OtherTok}[1]{\textcolor[rgb]{0.00,0.44,0.13}{{#1}}}
\newcommand{\AlertTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}}
\newcommand{\FunctionTok}[1]{\textcolor[rgb]{0.02,0.16,0.49}{{#1}}}
\newcommand{\RegionMarkerTok}[1]{{#1}}
\newcommand{\ErrorTok}[1]{\textcolor[rgb]{1.00,0.00,0.00}{\textbf{{#1}}}}
\newcommand{\NormalTok}[1]{{#1}}
% Support pandoc's -H/--include-in-header option
$for(header-includes)$
$header-includes$
$endfor$
$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$
\bigskip
$if(abstract)$
\begin{abstract}
$abstract$
\end{abstract}
$endif$
$body$
$if(natbib)$
$if(biblio-files)$
$if(biblio-title)$
$if(book-class)$
\renewcommand\bibname{$biblio-title$}
$else$
\renewcommand\refname{$biblio-title$}
$endif$
$endif$
\bibliography{$biblio-files$}
\bibliographystyle{plainnat}
$endif$
$endif$
$if(biblatex)$
\printbibliography$if(biblio-title)$[title=$biblio-title$]$endif$
$endif$
$for(include-after)$
$include-after$
$endfor$
\end{document}