summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-05-18 23:25:02 +0000
committerKarl Berry <karl@freefriends.org>2009-05-18 23:25:02 +0000
commit7c769b8e95cd5bd87da30c618e5198d6d12461e1 (patch)
tree6518993393c24294d5449771ed8e0bf2098b25dd /Master/texmf-dist
parentfec32543c0ec1c6ff61656ca2662d38390745593 (diff)
tufte-latex update (17may09)
git-svn-id: svn://tug.org/texlive/trunk@13216 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/tufte-latex/History.txt9
-rw-r--r--Master/texmf-dist/doc/latex/tufte-latex/README.txt34
-rw-r--r--Master/texmf-dist/doc/latex/tufte-latex/graphics/be-contents.pdfbin0 -> 18313 bytes
-rw-r--r--Master/texmf-dist/doc/latex/tufte-latex/graphics/be-title.pdfbin0 -> 5353 bytes
-rw-r--r--Master/texmf-dist/doc/latex/tufte-latex/graphics/ei-contents.pdfbin0 -> 19296 bytes
-rw-r--r--Master/texmf-dist/doc/latex/tufte-latex/graphics/ei-title.pdfbin0 -> 13141 bytes
-rw-r--r--Master/texmf-dist/doc/latex/tufte-latex/graphics/vdqi-contents.pdfbin0 -> 23153 bytes
-rw-r--r--Master/texmf-dist/doc/latex/tufte-latex/graphics/vdqi-title.pdfbin0 -> 20938 bytes
-rw-r--r--Master/texmf-dist/doc/latex/tufte-latex/graphics/ve-contents.pdfbin0 -> 19362 bytes
-rw-r--r--Master/texmf-dist/doc/latex/tufte-latex/graphics/ve-title.pdfbin0 -> 18304 bytes
-rw-r--r--Master/texmf-dist/doc/latex/tufte-latex/sample-book.pdfbin0 -> 297360 bytes
-rw-r--r--Master/texmf-dist/doc/latex/tufte-latex/sample-book.tex747
-rw-r--r--Master/texmf-dist/doc/latex/tufte-latex/sample-handout.bib6
-rw-r--r--Master/texmf-dist/doc/latex/tufte-latex/sample-handout.pdfbin114241 -> 123816 bytes
-rw-r--r--Master/texmf-dist/doc/latex/tufte-latex/sample-handout.tex250
-rw-r--r--Master/texmf-dist/source/latex/tufte-latex/sample-book.pdfbin0 -> 297360 bytes
-rw-r--r--Master/texmf-dist/source/latex/tufte-latex/sample-book.tex747
-rw-r--r--Master/texmf-dist/source/latex/tufte-latex/sample-handout.bib6
-rw-r--r--Master/texmf-dist/source/latex/tufte-latex/sample-handout.pdfbin0 -> 123816 bytes
-rw-r--r--Master/texmf-dist/source/latex/tufte-latex/sample-handout.tex250
-rw-r--r--Master/texmf-dist/source/latex/tufte-latex/tufte-book.cls83
-rw-r--r--Master/texmf-dist/source/latex/tufte-latex/tufte-common.sty1427
-rw-r--r--Master/texmf-dist/source/latex/tufte-latex/tufte-handout.cls550
-rw-r--r--Master/texmf-dist/tex/latex/tufte-latex/tufte-book.cls83
-rw-r--r--Master/texmf-dist/tex/latex/tufte-latex/tufte-common.sty1427
-rw-r--r--Master/texmf-dist/tex/latex/tufte-latex/tufte-handout.cls550
26 files changed, 4911 insertions, 1258 deletions
diff --git a/Master/texmf-dist/doc/latex/tufte-latex/History.txt b/Master/texmf-dist/doc/latex/tufte-latex/History.txt
index c03eaabe9ec..8ef3a00b34a 100644
--- a/Master/texmf-dist/doc/latex/tufte-latex/History.txt
+++ b/Master/texmf-dist/doc/latex/tufte-latex/History.txt
@@ -1,3 +1,12 @@
+== 3.0.0 / 2009-05-17
+* Created a Tufte-book document class.
+* Added optional offset parameter to sienotes, cite, etc. so their vertical
+ position can be adjusted manually.
+* Added support for the `bidi' package with XeLateX.
+* Adjusted font sizes and spacing to more closely reflect those used in
+ Tufte's books.
+* Captions are now typeset in the margin as in Tufte's books.
+
== 2.0.1 / 2008-11-16
* Now works with footmisc version > 5.4.
diff --git a/Master/texmf-dist/doc/latex/tufte-latex/README.txt b/Master/texmf-dist/doc/latex/tufte-latex/README.txt
index 741c5a32d3a..b06553125e2 100644
--- a/Master/texmf-dist/doc/latex/tufte-latex/README.txt
+++ b/Master/texmf-dist/doc/latex/tufte-latex/README.txt
@@ -1,7 +1,7 @@
Hi,
Welcome to the beginnings of Tufte LaTeX package to help you
-produce Tufte style handouts, reports, and notes.
+produce Tufte-style handouts, reports, and notes.
== Quick Start
@@ -31,6 +31,36 @@ or search the news:comp.text.tex group via,
http://groups.google.com/group/comp.text.tex
+The following packages are required:
+
+ * chngpage or changepage
+ * fancyhdr
+ * fontenc
+ * geometry
+ * hyperref
+ * natbib and bibentry
+ * optparams
+ * paralist
+ * placeins
+ * ragged2e
+ * setspace
+ * textcase
+ * textcomp
+ * titlesec
+ * titletoc
+ * xcolor
+ * xifthen
+
+The following packages are optional and will be automatically used if installed:
+
+ * beramono
+ * helvet
+ * ifpdf
+ * ifxetex
+ * letterspace (in the microtype package)
+ * mathpazo
+ * soul
+
== Bugs/Features/Support
For kudos, feature requests, patches, or support requests that you
@@ -46,7 +76,7 @@ high quality patches, and you'll find yourself a developer on this project.
== License
-Copyright 2007-2008 Bil Kleb, Bill Wood, and Kevin Godby
+Copyright 2007-2009 Bil Kleb, Bill Wood, and Kevin Godby
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/Master/texmf-dist/doc/latex/tufte-latex/graphics/be-contents.pdf b/Master/texmf-dist/doc/latex/tufte-latex/graphics/be-contents.pdf
new file mode 100644
index 00000000000..2f0ff0a3a9c
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/tufte-latex/graphics/be-contents.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/tufte-latex/graphics/be-title.pdf b/Master/texmf-dist/doc/latex/tufte-latex/graphics/be-title.pdf
new file mode 100644
index 00000000000..c7ee88e66ac
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/tufte-latex/graphics/be-title.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/tufte-latex/graphics/ei-contents.pdf b/Master/texmf-dist/doc/latex/tufte-latex/graphics/ei-contents.pdf
new file mode 100644
index 00000000000..56fdb0e2b16
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/tufte-latex/graphics/ei-contents.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/tufte-latex/graphics/ei-title.pdf b/Master/texmf-dist/doc/latex/tufte-latex/graphics/ei-title.pdf
new file mode 100644
index 00000000000..61d0f5b27d4
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/tufte-latex/graphics/ei-title.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/tufte-latex/graphics/vdqi-contents.pdf b/Master/texmf-dist/doc/latex/tufte-latex/graphics/vdqi-contents.pdf
new file mode 100644
index 00000000000..10ffa390cb6
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/tufte-latex/graphics/vdqi-contents.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/tufte-latex/graphics/vdqi-title.pdf b/Master/texmf-dist/doc/latex/tufte-latex/graphics/vdqi-title.pdf
new file mode 100644
index 00000000000..c48a4dec336
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/tufte-latex/graphics/vdqi-title.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/tufte-latex/graphics/ve-contents.pdf b/Master/texmf-dist/doc/latex/tufte-latex/graphics/ve-contents.pdf
new file mode 100644
index 00000000000..61a78cdde50
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/tufte-latex/graphics/ve-contents.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/tufte-latex/graphics/ve-title.pdf b/Master/texmf-dist/doc/latex/tufte-latex/graphics/ve-title.pdf
new file mode 100644
index 00000000000..bb2ed48c446
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/tufte-latex/graphics/ve-title.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/tufte-latex/sample-book.pdf b/Master/texmf-dist/doc/latex/tufte-latex/sample-book.pdf
new file mode 100644
index 00000000000..09378a26ca4
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/tufte-latex/sample-book.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/tufte-latex/sample-book.tex b/Master/texmf-dist/doc/latex/tufte-latex/sample-book.tex
new file mode 100644
index 00000000000..eb95dec6311
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/tufte-latex/sample-book.tex
@@ -0,0 +1,747 @@
+\documentclass{tufte-book}
+
+%%
+% Book metadata
+\title{A Tufte-Style Book\thanks{Thanks to Edward R.~Tufte for his inspiration.}}
+\author[The Tufte-LaTeX Developers]{The Tufte-LaTeX\ Developers}
+\publisher{Publisher of This Book}
+
+%%
+% If they're installed, use Bergamo and Chantilly from www.fontsite.com.
+% They're clones of Bembo and Gill Sans, respectively.
+%\IfFileExists{bergamo.sty}{\usepackage[osf]{bergamo}}{}% Bembo
+%\IfFileExists{chantill.sty}{\usepackage{chantill}}{}% Gill Sans
+
+%\usepackage{microtype}
+
+%%
+% Just some sample text
+\usepackage{lipsum}
+
+%%
+% For nicely typeset tabular material
+\usepackage{booktabs}
+
+%%
+% For graphics / images
+\usepackage{graphicx}
+\setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}
+\graphicspath{{graphics/}}
+
+% The fancyvrb package lets us customize the formatting of verbatim
+% environments. We use a slightly smaller font.
+\usepackage{fancyvrb}
+\fvset{fontsize=\normalsize}
+
+%%
+% Prints argument within hanging parentheses (i.e., parentheses that take
+% up no horizontal space). Useful in tabular environments.
+\newcommand{\hangp}[1]{\makebox[0pt][r]{(}#1\makebox[0pt][l]{)}}
+
+%%
+% Prints an asterisk that takes up no horizontal space.
+% Useful in tabular environments.
+\newcommand{\hangstar}{\makebox[0pt][l]{*}}
+
+%%
+% Prints a trailing space in a smart way.
+\usepackage{xspace}
+
+%%
+% Some shortcuts for Tufte's book titles. The lowercase commands will
+% produce the initials of the book title in italics. The all-caps commands
+% will print out the full title of the book in italics.
+\newcommand{\vdqi}{\textit{VDQI}\xspace}
+\newcommand{\ei}{\textit{EI}\xspace}
+\newcommand{\ve}{\textit{VE}\xspace}
+\newcommand{\be}{\textit{BE}\xspace}
+\newcommand{\VDQI}{\textit{The Visual Display of Quantitative Information}\xspace}
+\newcommand{\EI}{\textit{Envisioning Information}\xspace}
+\newcommand{\VE}{\textit{Visual Explanations}\xspace}
+\newcommand{\BE}{\textit{Beautiful Evidence}\xspace}
+
+\newcommand{\TL}{Tufte-\LaTeX\xspace}
+
+% Prints the month name (e.g., January) and the year (e.g., 2008)
+\newcommand{\monthyear}{%
+ \ifcase\month\or January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or
+ December\fi\space\number\year
+}
+
+
+% Prints an epigraph and speaker in sans serif, all-caps type.
+\newcommand{\openepigraph}[2]{%
+ %\sffamily\fontsize{14}{16}\selectfont
+ \begin{fullwidth}
+ \sffamily\large
+ \begin{doublespace}
+ \noindent\allcaps{#1}\\% epigraph
+ \noindent\allcaps{#2}% author
+ \end{doublespace}
+ \end{fullwidth}
+}
+
+% Inserts a blank page
+\newcommand{\blankpage}{\newpage\hbox{}\thispagestyle{empty}\newpage}
+
+\usepackage{units}
+
+% Typesets the font size, leading, and measure in the form of 10/12x26 pc.
+\newcommand{\measure}[3]{#1/#2$\times$\unit[#3]{pc}}
+
+% Macros for typesetting the documentation
+\newcommand{\hl}[1]{\textcolor{Maroon}{#1}}% prints in red
+\newcommand{\hangleft}[1]{\makebox[0pt][r]{#1}}
+\newcommand{\hairsp}{\hspace{1pt}}% hair space
+\newcommand{\hquad}{\hskip0.5em\relax}% half quad space
+\newcommand{\TODO}{\textcolor{red}{\bf TODO!}\xspace}
+\newcommand{\ie}{\textit{i.\hairsp{}e.}\xspace}
+\newcommand{\eg}{\textit{e.\hairsp{}g.}\xspace}
+\providecommand{\XeLaTeX}{X\lower.5ex\hbox{\kern-0.15em\reflectbox{E}}\kern-0.1em\LaTeX}
+\newcommand{\tXeLaTeX}{\XeLaTeX\index{XeLaTeX@\protect\XeLaTeX}}
+% \index{\texttt{\textbackslash xyz}@\hangleft{\texttt{\textbackslash}}\texttt{xyz}}
+\newcommand{\tuftebs}{\symbol{'134}}% a backslash in tt type in OT1/T1
+\newcommand{\doccmd}[1]{%
+ \texttt{\tuftebs#1}%
+ \index{#1@\protect\hangleft{\texttt{\tuftebs}}\texttt{#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{quotation}\ttfamily\parskip0pt\parindent0pt\ignorespaces}{\end{quotation}}% command specification environment
+\newcommand{\docenv}[1]{\texttt{#1}\index{#1@\texttt{#1} environment}\index{environments!#1@\texttt{#1}}}% environment name
+\newcommand{\docpkg}[1]{\texttt{#1}\index{#1@\texttt{#1} package}\index{packages!#1@\texttt{#1}}}% package name
+\newcommand{\doccls}[1]{\texttt{#1}}% document class name
+\newcommand{\docclsopt}[1]{\texttt{#1}\index{#1@\texttt{#1} class option}\index{class options!#1@\texttt{#1}}}% document class option name
+
+% Generates the index
+\usepackage{makeidx}
+\makeindex
+
+\begin{document}
+
+% Front matter
+\frontmatter
+
+% r.1 blank page
+\blankpage
+
+% v.2 epigraphs
+\newpage\thispagestyle{empty}
+\openepigraph{%
+The public is more familiar with bad design than good design.
+It is, in effect, conditioned to prefer bad design,
+because that is what it lives with.
+The new becomes threatening, the old reassuring.
+}{Paul Rand%, {\itshape Design, Form, and Chaos}
+}
+\vfill
+\openepigraph{%
+A designer knows that he has achieved perfection
+not when there is nothing left to add,
+but when there is nothing left to take away.
+}{Antoine de St-Expurey}
+\vfill
+\openepigraph{%
+\ldots the designer of a new system must not only be the implementor and the first
+large-scale user; the designer should also write the first user manual\ldots
+If I had not participated fully in all these activities,
+literally hundreds of improvements would never have been made,
+because I would never have thought of them or perceived
+why they were important.
+}{Donald E. Knuth}
+
+
+% r.3 full title page
+\maketitle
+
+
+% v.4 copyright page
+\newpage
+\begin{fullwidth}
+~\vfill
+\thispagestyle{empty}
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{\baselineskip}
+Copyright \copyright\ \the\year\ \thanklessauthor
+
+\par\smallcaps{Published by \thanklesspublisher}
+
+\par\smallcaps{tufte-latex.googlecode.com}
+
+\par Licensed under the Apache License, Version 2.0 (the ``License''); you may not
+use this file except in compliance with the License. You may obtain a copy
+of the License at \url{http://www.apache.org/licenses/LICENSE-2.0}. Unless
+required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an \smallcaps{``AS IS'' BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND}, either express or implied. See the
+License for the specific language governing permissions and limitations
+under the License.\index{license}
+
+\par\textit{First printing, \monthyear}
+\end{fullwidth}
+
+% r.5 contents
+\tableofcontents
+
+% r.7 dedication
+\cleardoublepage
+~\vfill
+\begin{doublespace}
+\noindent\fontsize{18}{22}\selectfont\itshape
+\nohyphenation
+Dedicated to those who appreciate \LaTeX{}
+and the work of \mbox{Edward R.~Tufte}
+and \mbox{Donald E.~Knuth}.
+\end{doublespace}
+\vfill
+\vfill
+
+
+% r.9 introduction
+\cleardoublepage
+\chapter*{Introduction}
+
+This sample book discusses the design of Edward Tufte's
+books\cite{Tufte2001,Tufte1990,Tufte1997,Tufte2006}
+and the use of the \texttt{tufte-book} and \texttt{sample-handout} document classes.
+
+
+%%
+% Start the main matter (normal chapters)
+\mainmatter
+
+
+\chapter{The Design of Tufte's Books}
+\label{ch:tufte-design}
+
+
+\newthought{The pages} of a book are usually divided into three major
+sections: the front matter (also called preliminary matter or prelim), the
+main matter (the core text of the book), and the back matter (or end
+matter).
+
+\newthought{The front matter} of a book refers to all of the material that
+comes before the main text. The following table from shows a list of
+material that appears in the front matter of \VDQI, \EI, \VE, and \BE
+along with its page number. Page numbers that appear in parentheses refer
+to folios that do not have a printed page number (but they are still
+counted in the page number sequence).
+
+\bigskip
+\begin{minipage}{\textwidth}
+\begin{center}
+\begin{tabular}{lcccc}
+\toprule
+ & \multicolumn{4}{c}{Books} \\
+\cmidrule(l){2-5}
+Page content & \vdqi & \ei & \ve & \be \\
+\midrule
+Blank half title page & \hangp{1} & \hangp{1} & \hangp{1} & \hangp{1} \\
+Frontispiece\footnotemark{}
+ & \hangp{2} & \hangp{2} & \hangp{2} & \hangp{2} \\
+Full title page & \hangp{3} & \hangp{3} & \hangp{3} & \hangp{3} \\
+Copyright page & \hangp{4} & \hangp{4} & \hangp{4} & \hangp{4} \\
+Contents & \hangp{5} & \hangp{5} & \hangp{5} & \hangp{5} \\
+%Blank & -- & \hangp{6} & \hangp{6} & \hangp{6} \\
+Dedication & \hangp{6} & \hangp{7} & \hangp{7} & 7 \\
+%Blank & -- & \hangp{8} & -- & \hangp{8} \\
+Epigraph & -- & -- & \hangp{8} & -- \\
+Introduction & \hangp{7} & \hangp{9} & \hangp{9} & 9 \\
+\bottomrule
+\end{tabular}
+\end{center}
+\end{minipage}
+\vspace{-7\baselineskip}\footnotetext{The contents of this page vary from book to book. In
+ \vdqi this page is blank; in \ei and \ve this page holds a frontispiece;
+ and in \be this page contains three epigraphs.}
+\vspace{7\baselineskip}
+
+\bigskip
+The design of the front matter in Tufte's books varies slightly from the
+traditional design of front matter. First, the pages in front matter are
+traditionally numbered with lowercase roman numerals (\eg, i, ii, iii,
+iv,~\ldots). Second, the front matter page numbering sequence is usually
+separate from the main matter page numbering. That is, the page numbers
+restart at 1 when the main matter begins. In contrast, Tufte has
+enumerated his pages with arabic numerals that share the same page counting
+sequence as the main matter.
+
+There are also some variations in design across Tufte's four books. The
+page opposite the full title page (labeled ``frontispiece'' in the above
+table) has different content in each of the books. In \VDQI, this page is
+blank; in \EI and \VE, this page holds a frontispiece; and in \BE, this
+page contains three epigraphs.
+
+The dedication appears on page~6 in \vdqi (opposite the introduction), and
+is placed on its own spread in the other books. In \ve, an epigraph shares
+the spread with the opening page of the introduction.
+
+None of the page numbers (folios) of the front matter are expressed except in
+\be, where the folios start to appear on the dedication page.
+
+\newthought{The full title page} of each of the books varies slightly in
+design. In all the books, the author's name appears at the top of the
+page, the title it set just above the center line, and the publisher is
+printed along the bottom margin. Some of the differences are outlined in
+the following table.
+
+\bigskip
+\begin{center}
+\footnotesize
+\begin{tabular}{lllll}
+\toprule
+Feature & \vdqi & \ei & \ve & \be \\
+\midrule
+Author & & & & \\
+\quad Typeface & serif & serif & serif & sans serif \\
+\quad Style & italics & italics & italics & upright, caps \\
+\quad Size & 24 pt & 20 pt & 20 pt & 20 pt \\
+\addlinespace
+Title & & & & \\
+\quad Typeface & serif & serif & serif & sans serif \\
+\quad Style & upright & italics & upright & upright, caps \\
+\quad Size & 36 pt & 48 pt & 48 pt & 36 pt \\
+\addlinespace
+Subtitle & & & & \\
+\quad Typeface & -- & -- & serif & -- \\
+\quad Style & -- & -- & upright & -- \\
+\quad Size & -- & -- & 20 pt & -- \\
+\addlinespace
+Edition & & & & \\
+\quad Typeface & sans serif & -- & -- & -- \\
+\quad Style & upright, caps & -- & -- & -- \\
+\quad Size & 14 pt & -- & -- & -- \\
+\addlinespace
+Publisher & & & & \\
+\quad Typeface & serif & serif & serif & sans serif \\
+\quad Style & italics & italics & italics & upright, caps \\
+\quad Size & 14 pt & 14 pt & 14 pt & 14 pt \\
+\bottomrule
+\end{tabular}
+\end{center}
+
+\begin{figure*}[p]
+\fbox{\includegraphics[width=0.45\linewidth]{graphics/vdqi-title.pdf}}
+\hfill
+\fbox{\includegraphics[width=0.45\linewidth]{graphics/ei-title.pdf}}
+\\\vspace{\baselineskip}
+\fbox{\includegraphics[width=0.45\linewidth]{graphics/ve-title.pdf}}
+\hfill
+\fbox{\includegraphics[width=0.45\linewidth]{graphics/be-title.pdf}}
+\end{figure*}
+
+\newthought{The tables of contents} in Tufte's books give us our first
+glimpse of the structure of the main matter. \VDQI is split into two
+parts, each containing some number of chapters. His other three books only
+contain chapters---they're not broken into parts.
+
+\begin{figure*}[p]\index{table of contents}
+\fbox{\includegraphics[width=0.45\linewidth]{graphics/vdqi-contents.pdf}}
+\hfill
+\fbox{\includegraphics[width=0.45\linewidth]{graphics/ei-contents.pdf}}
+\\\vspace{\baselineskip}
+\fbox{\includegraphics[width=0.45\linewidth]{graphics/ve-contents.pdf}}
+\hfill
+\fbox{\includegraphics[width=0.45\linewidth]{graphics/be-contents.pdf}}
+\end{figure*}
+
+
+\section{Typefaces}\label{sec:typefaces1}\index{typefaces}
+\index{fonts|see{typefaces}}
+
+Tufte's books primarily use two typefaces: Bembo and Gill Sans. Bembo is used
+for the headings and body text, while Gill Sans is used for the title page and
+opening epigraphs in \BE.
+
+Since neither Bembo nor Gill Sans are available in default \LaTeX{}
+installations, the \TL document classes default to using Palatino and
+Helvetica, respectively. In addition, the Bera Mono typeface is used for
+\texttt{monospaced} type.
+
+The following font sizes are defined by the \TL classes:
+
+\begin{table}[h]\index{typefaces!sizes}
+ \footnotesize%
+ \begin{center}
+ \begin{tabular}{lccl}
+ \toprule
+ \LaTeX{} size & Font size & Leading & Used for \\
+ \midrule
+ \verb+\tiny+ & 5 & 6 & sidenote numbers \\
+ \verb+\scriptsize+ & 7 & 8 & --- \\
+ \verb+\footnotesize+ & 8 & 10 & sidenotes, captions \\
+ \verb+\small+ & 9 & 12 & quote, quotation, and verse environments \\
+ \verb+\normalsize+ & 10 & 14 & body text \\
+ \verb+\large+ & 11 & 15 & \textsc{b}-heads \\
+ \verb+\Large+ & 12 & 16 & \textsc{a}-heads, \textsc{toc} entries, author, date \\
+ \verb+\LARGE+ & 14 & 18 & handout title \\
+ \verb+\huge+ & 20 & 30 & chapter heads \\
+ \verb+\Huge+ & 24 & 36 & part titles \\
+ \bottomrule
+ \end{tabular}
+ \end{center}
+ \caption{A list of \LaTeX{} font sizes as defined by the \TL document classes.}
+ \label{tab:font-sizes}
+\end{table}
+
+\section{Headings}\label{sec:headings1}\index{headings}
+
+Tufte's books include the following heading levels: parts,
+chapters,\sidenote{Parts and chapters are defined for the \texttt{tufte\-book}
+class only.} sections, subsections, and paragraphs. Not defined by default
+are: sub-subsections and subparagraphs.
+
+\begin{table}[h]
+ \begin{center}
+ \footnotesize%
+ \begin{tabular}{lcr}
+ \toprule
+ Heading & Style & Size \\
+ \midrule
+ Part & roman & \measure{24}{36}{40} \\
+ Chapter & italic & \measure{20}{30}{40} \\
+ Section & italic & \measure{12}{16}{26} \\
+ Subsection & italic & \measure{11}{15}{26} \\
+ Paragraph & italic & 10/14 \\
+ \bottomrule
+ \end{tabular}
+ \end{center}
+ \caption{Heading styles used in \BE.}
+ \label{tab:heading-styles}
+\end{table}
+
+\paragraph{Paragraph} Paragraph headings (as shown here) are introduced by
+italicized text and separated from the main paragraph by a bit of space.
+
+\section{Environments}
+
+The following characteristics define the various environments:
+
+
+\begin{table}[h]
+ \begin{center}
+ \footnotesize%
+ \begin{tabular}{lcl}
+ \toprule
+ Environment & Font size & Notes \\
+ \midrule
+ Body text & \measure{10}{14}{26} & \\
+ Block quote & \measure{9}{12}{24} & Block indent (left and right) by \unit[1]{pc} \\
+ Sidenotes & \measure{8}{10}{12} & Sidenote number is set inline, followed by word space \\
+ Captions & \measure{8}{10}{12} & \\
+ \bottomrule
+ \end{tabular}
+ \end{center}
+ \caption{Environment styles used in \BE.}
+ \label{tab:environment-styles}
+\end{table}
+
+
+\chapter{On the Use of the \texttt{tufte-book} Document Class}
+\label{ch:tufte-book}
+
+The Tufte-\LaTeX\ document classes define a style similar to the
+style Edward Tufte uses in his books and handouts. Tufte's style is known
+for its extensive use of sidenotes, tight integration of graphics with
+text, and well-set typography. This document aims to be at once a
+demonstration of the features of the Tufte-\LaTeX\ document classes
+and a style guide to their use.
+
+\section{Page Layout}\label{sec:page-layout}
+\subsection{Headings}\label{sec:headings}\index{headings}
+This style provides \textsc{a}- and \textsc{b}-heads (that is,
+\Verb|\section| and \Verb|\subsection|), demonstrated above.
+
+If you need more than two levels of section headings, you'll have to define
+them yourself at the moment; there are no pre-defined styles for anything below
+a \Verb|\subsection|. As Bringhurst points out in \textit{The Elements of
+Typographic Style},\cite{Bringhurst2005} you should ``use as many levels of
+headings as you need: no more, and no fewer.''
+
+The Tufte-\LaTeX\ classes will emit an error if you try to use
+\linebreak\Verb|\subsubsection| and smaller headings.
+
+% let's start a new thought -- a new section
+\newthought{In his later books},\cite{Tufte2006} Tufte
+starts each section with a bit of vertical space, a non-indented paragraph,
+and sets the first few words of the sentence in \textsc{small caps}. To
+accomplish this using this style, use the \hl{\doccmd{newthought}} command:
+\begin{docspec}
+ \doccmd{newthought}\{In his later books\}, Tufte starts\ldots
+\end{docspec}
+
+
+\section{Sidenotes}\label{sec:sidenotes}
+One of the most prominent and distinctive features of this style is the
+extensive use of sidenotes. There is a wide margin to provide ample room
+for sidenotes and small figures. Any \doccmd{footnote}s will automatically
+be converted to sidenotes.\footnote{This is a sidenote that was entered
+using the \texttt{\textbackslash footnote} command.} If you'd like to place ancillary
+information in the margin without the sidenote mark (the superscript
+number), you can use the \hl{\doccmd{marginnote}} command.\marginnote{This is a
+margin note. Notice that there isn't a number preceding the note, and
+there is no number in the main text where this note was written.}
+
+The specification of the \hl{\doccmd{sidenote}} command is:
+\begin{docspec}
+ \doccmd{sidenote}[\docopt{number}][\docopt{offset}]\{\docarg{Sidenote text.}\}
+\end{docspec}
+
+Both the \docopt{number} and \docopt{offset} arguments are optional. If you
+provide a \docopt{number} argument, then that number will be used as the
+sidenote number. It will change of the number of the current sidenote only and
+will not affect the numbering sequence of subsequent sidenotes.
+
+Sometimes a sidenote may run over the top of other text or graphics in the
+margin space. If this happens, you can adjust the vertical position of the
+sidenote by providing a dimension in the \docopt{offset} argument. Some
+examples of valid dimensions are:
+\begin{docspec}
+ \ttfamily 1.0in \qquad 2.54cm \qquad 254mm \qquad 6\Verb|\baselineskip|
+\end{docspec}
+If the dimension is positive it will push the sidenote down the page; if the
+dimension is negative, it will move the sidenote up the page.
+
+While both the \docopt{number} and \docopt{offset} arguments are optional, they
+must be provided in order. To adjust the vertical position of the sidenote
+while leaving the sidenote number alone, use the following syntax:
+\begin{docspec}
+ \doccmd{sidenote}[][\docopt{offset}]\{\docarg{Sidenote text.}\}
+\end{docspec}
+The empty brackets tell the \Verb|\sidenote| command to use the default
+sidenote number.
+
+If you \emph{only} want to change the sidenote number, however, you may
+completely omit the \docopt{offset} argument:
+\begin{docspec}
+ \doccmd{sidenote}[\docopt{number}]\{\docarg{Sidenote text.}\}
+\end{docspec}
+
+The \doccmd{marginnote} command has a similar \docarg{offset} argument:
+\begin{docspec}
+ \doccmd{marginnote}[\docopt{offset}]\{\docarg{Margin note text.}\}
+\end{docspec}
+
+\section{References}
+References are placed alongside their citations as sidenotes,
+as well. This can be accomplished using the normal \hl{\doccmd{cite}}
+command.\sidenote{The first paragraph of this document includes a citation.}
+
+The complete list of references may also be printed automatically by using
+the \hl{\doccmd{bibliography}} command. (See the end of this document for an
+example.) If you do not want to print a bibliography at the end of your
+document, use the \hl{\doccmd{nobibliography}} command in its place.
+
+To enter multiple citations at one location,\cite[-3\baselineskip]{Tufte2006,Tufte1990} you can
+provide a list of keys separated by commas and the same optional vertical
+offset argument: \Verb|\cite{Tufte2006,Tufte1990}|.
+\begin{docspec}
+ \doccmd{cite}[\docopt{offset}]\{\docarg{bibkey1,bibkey2,\ldots}\}
+\end{docspec}
+
+\section{Figures and Tables}\label{sec:figures-and-tables}
+Images and graphics play an integral role in Tufte's work.
+In addition to the standard \hl{\docenv{figure}} and \hl{\docenv{tabular}} environments,
+this style provides special figure and table environments for full-width
+floats.
+
+Full page--width figures and tables may be placed in \hl{\docenv{figure*}} or
+\hl{\docenv{table*}} environments. To place figures or tables in the margin,
+use the \hl{\docenv{marginfigure}} or \hl{\docenv{margintable}} environments as follows
+(see figure~\ref{fig:marginfig}):
+
+\begin{marginfigure}%
+ \includegraphics[width=\linewidth]{helix}
+ \caption{This is a margin figure. The helix is defined by
+ $x = \cos(2\pi z)$, $y = \sin(2\pi z)$, and $z = [0, 2.7]$. The figure was
+ drawn using Asymptote (\url{http://asymptote.sf.net/}).}
+ \label{fig:marginfig}
+\end{marginfigure}
+
+\begin{docspec}
+\textbackslash begin\{marginfigure\}\\
+ \qquad\textbackslash includegraphics\{helix\}\\
+ \qquad\textbackslash caption\{This is a margin figure.\}\\
+ \qquad\textbackslash label\{fig:marginfig\}\\
+\textbackslash end\{marginfigure\}\\
+\end{docspec}
+
+The \docenv{marginfigure} and \docenv{margintable} environments accept an optional parameter \docopt{offset} that adjusts the vertical position of the figure or table. See the ``\nameref{sec:sidenotes}'' section above for examples. The specifications are:
+\begin{docspec}
+ \textbackslash{begin\{marginfigure\}[\docopt{offset}]}\\
+ \qquad\ldots\\
+ \textbackslash{end\{marginfigure\}}\\
+ \mbox{}\\
+ \textbackslash{begin\{margintable\}[\docopt{offset}]}\\
+ \qquad\ldots\\
+ \textbackslash{end\{margintable\}}\\
+\end{docspec}
+
+Figure~\ref{fig:fullfig} is an example of the \docenv{figure*}
+environment and figure~\ref{fig:textfig} is an example of the normal
+\docenv{figure} environment.
+
+\begin{figure*}[h]
+ \includegraphics[width=\linewidth]{sine.pdf}%
+ \caption{This graph shows $y = \sin x$ from about $x = [-10, 10]$.
+ \emph{Notice that this figure takes up the full page width.}}%
+ \label{fig:fullfig}%
+\end{figure*}
+
+\begin{figure}
+ \includegraphics{hilbertcurves.pdf}
+% \checkparity This is an \pageparity\ page.%
+ \caption{Hilbert curves of various degrees $n$.
+ \emph{Notice that this figure only takes up the main textblock width.}}
+ \label{fig:textfig}
+ %\zsavepos{pos:textfig}
+\end{figure}
+
+Table~\ref{tab:normaltab} shows table created with the \docpkg{booktabs}
+package. Notice the lack of vertical rules---they serve only to clutter
+the table's data.
+
+\begin{table}[ht]
+ \centering
+ \fontfamily{ppl}\selectfont
+ \begin{tabular}{ll}
+ \toprule
+ Margin & Length \\
+ \midrule
+ Paper width & \unit[8\nicefrac{1}{2}]{inches} \\
+ Paper height & \unit[11]{inches} \\
+ Textblock width & \unit[6\nicefrac{1}{2}]{inches} \\
+ Textblock/sidenote gutter & \unit[\nicefrac{3}{8}]{inches} \\
+ Sidenote width & \unit[2]{inches} \\
+ \bottomrule
+ \end{tabular}
+ \caption{Here are the dimensions of the various margins used in the Tufte-handout class.}
+ \label{tab:normaltab}
+ %\zsavepos{pos:normaltab}
+\end{table}
+
+\section{Full-width text blocks}
+
+In addition to the new float types, there is a \hl{\docenv{fullwidth}}
+environment that stretches across the main text block and the sidenotes
+area.
+
+\begin{Verbatim}
+\begin{fullwidth}
+Lorem ipsum dolor sit amet...
+\end{fullwidth}
+\end{Verbatim}
+
+\begin{fullwidth}
+\small\itshape\lipsum[1]
+\end{fullwidth}
+
+\section{Typography}\label{sec:typography}
+
+\subsection{Typefaces}\label{sec:typefaces}\index{typefaces}
+If the Palatino, \textsf{Helvetica}, and \texttt{Bera Mono} typefaces are installed, this style
+will use them automatically. Otherwise, we'll fall back on the Computer Modern
+typefaces.
+
+\subsection{Letterspacing}\label{sec:letterspacing}
+This document class includes two new commands and some improvements on
+existing commands for letterspacing.
+
+When setting strings of \allcaps{ALL CAPS} or \smallcaps{small caps}, the
+letter\-spacing---that is, the spacing between the letters---should be
+increased slightly.\cite{Bringhurst2005} The \hl{\doccmd{allcaps}} command has proper letterspacing for
+strings of \allcaps{FULL CAPITAL LETTERS}, and the \hl{\doccmd{smallcaps}} command
+has letterspacing for \smallcaps{small capital letters}. These commands
+will also automatically convert the case of the text to upper- or
+lowercase, respectively.
+
+The \hl{\doccmd{textsc}} command has also been redefined to include
+letterspacing. The case of the \doccmd{textsc} argument is left as is,
+however. This allows one to use both uppercase and lowercase letters:
+\textsc{The Initial Letters Of The Words In This Sentence Are Capitalized.}
+
+
+
+\section{Document Class Options}\label{sec:options}
+
+\index{class options|(}
+The \doccls{tufte-book} class is based on the \LaTeX\ \doccls{book}
+document class. Therefore, you can pass any of the typical book
+options. There are a few options that are specific to the
+\doccls{tufte-book} document class, however.
+
+The \hl{\docclsopt{a4paper}} option will set the paper size to \smallcaps{A4} instead of
+the default \smallcaps{US} letter size.
+
+The \hl{\docclsopt{sfsidenotes}} option will set the sidenotes and title block in a
+\textsf{sans serif} typeface instead of the default roman.
+
+The \hl{\docclsopt{twoside}} option will modify the running heads so that the page
+number is printed on the outside edge (as opposed to always printing the page
+number on the right-side edge in \hl{\docclsopt{oneside}} mode).
+
+The \hl{\docclsopt{symmetric}} option typesets the sidenotes on the outside edge of
+the page. This is how books are traditionally printed, but is contrary to
+Tufte's book design which sets the sidenotes on the right side of the page.
+This option implicitly sets the \docclsopt{twoside} option.
+
+The \hl{\docclsopt{justified}} option sets all the text fully justified (flush left
+and right). The default is to set the text ragged right.
+The body text of Tufte's books are set ragged right. This prevents
+needless hyphenation and makes it easier to read the text in the slightly
+narrower column.
+
+The \hl{\docclsopt{bidi}} option loads the \docpkg{bidi} package which is used with
+\tXeLaTeX\ to typeset bi-directional text. Since the \docpkg{bidi}
+package needs to be loaded before the sidenotes and cite commands are defined,
+it can't be loaded in the document preamble.
+
+The \hl{\docclsopt{debug}} option causes the Tufte-\LaTeX\ classes to output debug
+information to the log file which is useful in troubleshooting bugs. It will
+also cause the graphics to be replaced by outlines.
+
+The \hl{\docclsopt{nofonts}} option prevents the Tufte-\LaTeX\ classes from
+automatically loading the Palatino and Helvetica typefaces. You should use
+this option if you wish to load your own fonts. If you're using \tXeLaTeX, this
+option is implied (\ie, the Palatino and Helvetica fonts aren't loaded if you
+use \tXeLaTeX).
+
+The \hl{\docclsopt{nols}} option inhibits the letterspacing code. The Tufte-\LaTeX\
+classes try to load the appropriate letterspacing package (either pdf\TeX's
+\docpkg{letterspace} package or the \docpkg{soul} package). If you're using
+\tXeLaTeX\ with \docpkg{fontenc}, however, you should configure your own
+letterspacing.
+
+The \hl{\docclsopt{notitlepage}} option causes \verb|\maketitle| to generate a title
+block instead of a title page. The \doccls{book} class defaults to a title
+page and the \doccls{handout} class defaults to the title block. There is an
+analogous \hl{\docclsopt{titlepage}} option that forces \verb|\maketitle| to
+generate a full title page instead of the title block.
+
+The \hl{\docclsopt{notoc}} option suppresses Tufte-\LaTeX's custom table of contents
+(\textsc{toc}) design. The current \textsc{toc} design only shows unnumbered
+chapter titles; it doesn't show sections or subsections. The \docclsopt{notoc}
+option will revert to \LaTeX's \textsc{toc} design.
+
+\index{class options|)}
+
+
+\chapter{Debug Stuff}
+
+
+%%
+% The back matter contains appendices, bibliographies, indices, glossaries, etc.
+
+\backmatter
+
+
+
+\bibliography{sample-handout}
+\bibliographystyle{plainnat}
+
+
+\printindex
+
+\end{document}
+
diff --git a/Master/texmf-dist/doc/latex/tufte-latex/sample-handout.bib b/Master/texmf-dist/doc/latex/tufte-latex/sample-handout.bib
index 81715a5dd0c..95e715e29ec 100644
--- a/Master/texmf-dist/doc/latex/tufte-latex/sample-handout.bib
+++ b/Master/texmf-dist/doc/latex/tufte-latex/sample-handout.bib
@@ -6,7 +6,7 @@
month = {May},
edition = {First},
place = {Cheshire, Connecticut},
- isbn = {0961392177}
+ isbn = {0-9613921-7-7}
}
@BOOK{Tufte2001,
@@ -15,7 +15,7 @@
publisher = {Graphics Press},
year = {2001},
address = {Cheshire, Connecticut},
- isbn = {0961392142}
+ isbn = {0-9613921-4-2}
}
@BOOK{Tufte1990,
@@ -24,7 +24,7 @@
publisher = {Graphics Press},
year = {1990},
address = {Cheshire, Connecticut},
- isbn = {0961392118}
+ isbn = {0-9613921-1-8}
}
@BOOK{Tufte1997,
diff --git a/Master/texmf-dist/doc/latex/tufte-latex/sample-handout.pdf b/Master/texmf-dist/doc/latex/tufte-latex/sample-handout.pdf
index d6beae0c9e9..457890656de 100644
--- a/Master/texmf-dist/doc/latex/tufte-latex/sample-handout.pdf
+++ b/Master/texmf-dist/doc/latex/tufte-latex/sample-handout.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/tufte-latex/sample-handout.tex b/Master/texmf-dist/doc/latex/tufte-latex/sample-handout.tex
index 7c65ba41f57..3d8309f9f7e 100644
--- a/Master/texmf-dist/doc/latex/tufte-latex/sample-handout.tex
+++ b/Master/texmf-dist/doc/latex/tufte-latex/sample-handout.tex
@@ -1,5 +1,7 @@
\documentclass{tufte-handout}
+%\geometry{showframe}% for debugging purposes -- displays the margins
+
\usepackage{amsmath}
% Set up the images/graphics package
@@ -7,14 +9,9 @@
\setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}
\graphicspath{{graphics/}}
-\usepackage{mcaption} % FIXME move to .cls file
-
-%\title{An Example of the Usage of the Tufte-Handout Style\thanks{Inspired by Edward~R. Tufte!}}
-\title{An Example of the Usage of the Tufte-Handout Style}
-\author{The Tufte-\LaTeX\ Developers}
-%\date{22 February 2008} % if the \date{} command is left out, the current date will be used
-
-\usepackage{helvet}
+\title{An Example of the Usage of the Tufte-Handout Style\thanks{Inspired by Edward~R. Tufte!}}
+\author[The Tufte-LaTeX Developers]{The Tufte-\LaTeX\ Developers}
+\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}
@@ -28,18 +25,25 @@
\usepackage{fancyvrb}
\fvset{fontsize=\normalsize}
+% Small sections of multiple columns
\usepackage{multicol}
-%\usepackage[savepos]{zref}
-
+% Provides paragraphs of dummy text
\usepackage{lipsum}
-\usepackage{url}
-\urldef{\asyurl}\url{http://asymptote.sf.net/}
+% 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
\begin{document}
-\maketitle % this prints the handout title, author, and date
+\maketitle% this prints the handout title, author, and date
\begin{abstract}
\noindent This document describes the Tufte handout \LaTeX\ document style.
@@ -48,28 +52,28 @@ It also provides examples and comments on the style's use.
%\printclassoptions
-The \Verb|tufte-handout| document class defines a style similar to the
+The Tufte-\LaTeX\ document classes define a style similar to the
style Edward Tufte uses in his books and handouts. Tufte's style is known
for its extensive use of sidenotes, tight integration of graphics with
text, and well-set typography. This document aims to be at once a
-demonstration of the features of the \Verb|tufte-handout| document class
-and a style guide to its use.
+demonstration of the features of the Tufte-\LaTeX\ document classes
+and a style guide to their use.
\section{Page Layout}\label{sec:page-layout}
\subsection{Headings}\label{sec:headings}
This style provides \textsc{a}- and \textsc{b}-heads (that is,
-\Verb|\section| and \Verb|\subsection|) demonstrated above.
+\Verb|\section| and \Verb|\subsection|), demonstrated above.
If you need more than two levels of section headings, you'll have to define
-them yourself at the moment;\sidenote{See see ``Defining new sections'' on
+them yourself at the moment;\sidenote{See see ``\nameref{sec:defining-sections}'' on
page~\pageref{sec:defining-sections} for help with defining more heading
levels.} there are no pre-defined styles for anything below a
\Verb|\subsection|. As Bringhurst points out in \textit{The Elements of
Typographic Style},\cite{Bringhurst2005} you should ``use as many levels of
headings as you need: no more, and no fewer.''
-The Tufte-handout class will emit an error if you try to use
-\Verb|\subsubsection| and smaller headings.
+The Tufte-\LaTeX\ classes will emit an error if you try to use
+\linebreak\Verb|\subsubsection| and smaller headings.
%\medskip
%\begin{fullwidth}
@@ -87,8 +91,9 @@ The Tufte-handout class will emit an error if you try to use
starts each section with a bit of vertical space, a non-indented paragraph,
and sets the first few words of the sentence in \textsc{small caps}. To
accomplish this using this style, use the \Verb|\newthought| command:
-
-\Verb|\newthought{In his later books}, Tufte starts|\ldots
+\begin{docspec}
+ \doccmd{newthought\{In his later books\}, Tufte starts\ldots}
+\end{docspec}
\subsection{Sidenotes}\label{sec:sidenotes}
One of the most prominent and distinctive features of this style is the
@@ -101,68 +106,120 @@ number), you can use the \Verb|\marginnote| command.\marginnote{This is a
margin note. Notice that there isn't a number preceding the note, and
there is no number in the main text where this note was written.}
+The specification of the \Verb|\sidenote| command is:
+\begin{docspec}
+ \doccmd{sidenote[\docopt{number}][\docopt{offset}]\{\docarg{Sidenote text.}\}}
+\end{docspec}
+
+Both the \docopt{number} and \docopt{offset} arguments are optional. If you
+provide a \docopt{number} argument, then that number will be used as the
+sidenote number. It will change of the number of the current sidenote only and
+will not affect the numbering sequence of subsequent sidenotes.
+
+Sometimes a sidenote may run over the top of other text or graphics in the
+margin space. If this happens, you can adjust the vertical position of the
+sidenote by providing a dimension in the \docopt{offset} argument. Some
+examples of valid dimensions are:
+\begin{docspec}
+ \ttfamily 1.0in \qquad 2.54cm \qquad 254mm \qquad 6\Verb|\baselineskip|
+\end{docspec}
+If the dimension is positive it will push the sidenote down the page; if the
+dimension is negative, it will move the sidenote up the page.
+
+While both the \docopt{number} and \docopt{offset} arguments are optional, they
+must be provided in order. To adjust the vertical position of the sidenote
+while leaving the sidenote number alone, use the following syntax:
+\begin{docspec}
+ \doccmd{sidenote[][\docopt{offset}]\{\docarg{Sidenote text.}\}}
+\end{docspec}
+The empty brackets tell the \Verb|\sidenote| command to use the default
+sidenote number.
+
+If you \emph{only} want to change the sidenote number, however, you may
+completely omit the \docopt{offset} argument:
+\begin{docspec}
+ \doccmd{sidenote[\docopt{number}]\{\docarg{Sidenote text.}\}}
+\end{docspec}
+
+The \Verb|\marginnote| command has a similar \docarg{offset} argument:
+\begin{docspec}
+ \doccmd{marginnote[\docopt{offset}]\{\docarg{Margin note text.}\}}
+\end{docspec}
+
\subsection{References}
References are placed alongside their citations as sidenotes,
as well. This can be accomplished using the normal \Verb|\cite|
-command.\footnote{The first paragraph of this document includes a citation.}
+command.\sidenote{The first paragraph of this document includes a citation.}
The complete list of references may also be printed automatically by using
the \Verb|\bibliography| command. (See the end of this document for an
example.) If you do not want to print a bibliography at the end of your
document, use the \Verb|\nobibliography| command in its place.
-To enter multiple citations at one
-location,\cite{Tufte2006}\cite{Tufte1990} you will need to use multiple
-\Verb|\cite| commands: \Verb|\cite{Tufte2006}| \Verb|\cite{Tufte1990}|. Each
-\Verb|\cite| command will generate its own sidenote and its own sidenote
-number.
-
+To enter multiple citations at one location,\cite[-3\baselineskip]{Tufte2006,Tufte1990} you can
+provide a list of keys separated by commas and the same optional vertical
+offset argument: \Verb|\cite{Tufte2006,Tufte1990}|.
+\begin{docspec}
+ \doccmd{cite[\docopt{offset}]\{\docarg{bibkey1,bibkey2,\ldots}\}}
+\end{docspec}
\section{Figures and Tables}\label{sec:figures-and-tables}
Images and graphics play an integral role in Tufte's work.
-In addition to the standard \Verb|figure| and \Verb|tabular| environments,
+In addition to the standard \docenv{figure} and \docenv{tabular} environments,
this style provides special figure and table environments for full-width
floats.
-Full page width figures and tables may be placed in \texttt{figure*} or
-\texttt{table*} environments. To place figures or tables in the margin,
-use the \Verb|marginfigure| or \Verb|margintable| environments as follows
+Full page--width figures and tables may be placed in \docenv{figure*} or
+\docenv{table*} environments. To place figures or tables in the margin,
+use the \docenv{marginfigure} or \docenv{margintable} environments as follows
(see figure~\ref{fig:marginfig}):
-\begin{marginfigure}
- \includegraphics[width=\marginparwidth]{helix}
+
+\begin{marginfigure}%
+ \includegraphics[width=\linewidth]{helix}
\caption{This is a margin figure. The helix is defined by
$x = \cos(2\pi z)$, $y = \sin(2\pi z)$, and $z = [0, 2.7]$. The figure was
- drawn using Asymptote (\asyurl).}
+ drawn using Asymptote (\url{http://asymptote.sf.net/}).}
\label{fig:marginfig}
\end{marginfigure}
\begin{Verbatim}
\begin{marginfigure}
- \includegraphics{blah}
- \caption{This figure is in the margin.}
+ \includegraphics{helix}
+ \caption{This is a margin figure.}
\end{marginfigure}
\end{Verbatim}
+The \docenv{marginfigure} and \docenv{margintable} environments accept an optional parameter \docopt{offset} that adjusts the vertical position of the figure or table. See the ``\nameref{sec:sidenotes}'' section above for examples. The specifications are:
+\begin{docspec}
+ \doccmd{begin\{marginfigure\}[\docopt{offset}]}\\
+ \qquad\ldots\\
+ \doccmd{end\{marginfigure\}}\\
+ \mbox{}\\
+ \doccmd{begin\{margintable\}[\docopt{offset}]}\\
+ \qquad\ldots\\
+ \doccmd{end\{margintable\}}\\
+\end{docspec}
Figure~\ref{fig:fullfig} is an example of the \Verb|figure*|
environment and figure~\ref{fig:textfig} is an example of the normal
\Verb|figure| environment.
-\begin{figure*}
- \includegraphics{sine.pdf}
+
+\begin{figure*}[h]
+ \includegraphics[width=\linewidth]{sine.pdf}%
\caption{This graph shows $y = \sin x$ from about $x = [-10, 10]$.
- \emph{Notice that this figure takes up the full page width.}}
- \label{fig:fullfig}
- %\zsavepos{pos:fullfig}
+ \emph{Notice that this figure takes up the full page width.}}%
+ \label{fig:fullfig}%
\end{figure*}
\begin{figure}
\includegraphics{hilbertcurves.pdf}
+% \checkparity This is an \pageparity\ page.%
\caption{Hilbert curves of various degrees $n$.
\emph{Notice that this figure only takes up the main textblock width.}}
\label{fig:textfig}
%\zsavepos{pos:textfig}
\end{figure}
-Table~\ref{tab:normaltab} shows table created with the \texttt{booktabs}
+Table~\ref{tab:normaltab} shows table created with the \docpkg{booktabs}
package. Notice the lack of vertical rules---they serve only to clutter
the table's data.
@@ -187,7 +244,7 @@ the table's data.
\section{Full-width text blocks}
-In addition to the new float types, there is a \texttt{fullwidth}
+In addition to the new float types, there is a \docenv{fullwidth}
environment that stretches across the main text block and the sidenotes
area.
@@ -204,8 +261,8 @@ Lorem ipsum dolor sit amet...
\section{Typography}\label{sec:typography}
\subsection{Typefaces}\label{sec:typefaces}
-If the Palatino and Bera Mono typefaces are installed, this style will use
-them automatically. Otherwise, we'll fall back on the Computer Modern
+If the Palatino, \textsf{Helvetica}, and \texttt{Bera Mono} typefaces are installed, this style
+will use them automatically. Otherwise, we'll fall back on the Computer Modern
typefaces.
\subsection{Letterspacing}\label{sec:letterspacing}
@@ -213,7 +270,7 @@ This document class includes two new commands and some improvements on
existing commands for letterspacing.
When setting strings of \allcaps{ALL CAPS} or \smallcaps{small caps}, the
-letterspacing---that is, the spacing between the letters---should be
+letter\-spacing---that is, the spacing between the letters---should be
increased slightly.\cite{Bringhurst2005} The \Verb|\allcaps| command has proper letterspacing for
strings of \allcaps{FULL CAPITAL LETTERS}, and the \Verb|\smallcaps| command
has letterspacing for \smallcaps{small capital letters}. These commands
@@ -228,63 +285,52 @@ however. This allows one to use both uppercase and lowercase letters:
\section{Customization}\label{sec:customization}
\subsection{Document class options}\label{sec:options}
-The \Verb|tufte-handout| class is based on the \LaTeX\ \Verb|article|
+The \doccls{tufte-handout} class is based on the \LaTeX\ \doccls{article}
document class. Therefore, you can pass any of the typical article
options. There are a few options that are specific to the
-\Verb|tufte-handout| document class, however.
+\doccls{tufte-handout} document class, however.
-The \Verb|a4paper| option will set the paper size to \smallcaps{A4} instead of
+The \docclsopt{a4paper} option will set the paper size to \smallcaps{A4} instead of
the default \smallcaps{US} letter size.
-The \Verb|sfsidenotes| option will set the sidenotes in a \textsf{sans
-serif} typeface instead of the default roman.
+The \docclsopt{sfsidenotes} option will set the sidenotes and title block in a
+\textsf{sans serif} typeface instead of the default roman.
-The \Verb|twoside| option will modify the running heads so that the page
+The \docclsopt{twoside} option will modify the running heads so that the page
number is printed on the outside edge (as opposed to always printing the page
-number on the right-side edge in \Verb|oneside| mode).
+number on the right-side edge in \docclsopt{oneside} mode).
-The \Verb|symmetric| option typesets the sidenotes on the outside edge of
+The \docclsopt{symmetric} option typesets the sidenotes on the outside edge of
the page. This is how books are traditionally printed, but is contrary to
Tufte's book design which sets the sidenotes on the right side of the page.
-This option implicitly sets the \Verb|twoside| option.
+This option implicitly sets the \docclsopt{twoside} option.
-The \Verb|justified| option sets all the text fully justified (flush left
+The \docclsopt{justified} option sets all the text fully justified (flush left
and right). The default is to set the text ragged right.
The body text of Tufte's books are set ragged right. This prevents
needless hyphenation and makes it easier to read the text in the slightly
narrower column.
\subsection{Defining new sections}\label{sec:defining-sections}
-As mentioned on page~\pageref{sec:headings}, the \Verb|tufte-handout|
-document class only defines \Verb|\section| and \Verb|\subsection|
-headings.
+As mentioned in the ``\nameref{sec:headings}'' section (see
+page~\pageref{sec:headings}), the \doccls{tufte\-handout} document class only
+defines \doccmd{section} and \doccmd{subsection} headings.
-If you wanted to define, say, a \Verb|\paragraph| heading, you could do it
-as follows:
-
-\begin{Verbatim}
-\makeatletter
-\renewcommand\paragraph{\@startsection{paragraph}% the name of the new section
- {4}% the section level number
- {0em}% indentation amount
- {\baselineskip}% amount of space to leave before heading
- {-1.5em}% amount of space to leave after heading
- {\normalfont\itshape}% style
-}
-\makeatother
-\end{Verbatim}
-
-Place that code in the preamble of your document and you'll now be able to use
-\Verb|\paragraph|.
-
-For more details on defining section levels, see \textit{The \LaTeX\
-Companion},\cite{Mittelbach2004} or use the \Verb|titlesec| package.
+We use the \docpkg{titlesec} package to define the appearance of the headings.
+To modify an existing section or to add a new section, see the documentation of
+the \docpkg{titlesec} package.
\section{Installation}\label{sec:installation}
-To install the \Verb|tufte-handout| class, simply drop the
-\Verb|tufte-handout.cls| file into the same directory as your \Verb|.tex|
-file.
+To install the Tufte-\LaTeX\ classes, simply drop the
+following files into the same directory as your \texttt{.tex}
+file:
+\begin{quote}
+ \ttfamily
+ tufte-common.sty\\
+ tufte-handout.cls\\
+ tufte-book.cls
+\end{quote}
% TODO add instructions for installing it globally
@@ -292,24 +338,34 @@ file.
\section{Support}\label{sec:support}
\subsection{Package Dependencies}\label{sec:dependencies}
-The following is a list of packages that the \Verb|tufte-handout| document
-class relies upon. Packages marked with an asterisk are optional.
+The following is a list of packages that the Tufte-\LaTeX\ document
+classes rely upon. Packages marked with an asterisk are optional.
\begin{multicols}{2}
\begin{itemize}
+ \item xifthen
+ \item ifpdf*
+ \item ifxetex*
+ \item hyperref
\item geometry
\item ragged2e
- \item chngpage
+ \item chngpage \emph{or} changepage
\item paralist
\item textcase
- \item footmisc
- \item natbib and bibentry
- \item placeins
- \item caption
- \item fancyhdr
- \item microtype*
\item soul*
- \item palatino*
+ \item letterspace*
+ \item setspace
+ \item natbib \emph{and} bibentry
+ \item optparams
+ \item placeins
+ \item mathpazo*
+ \item helvet*
+ \item fontenc
\item beramono*
+ \item fancyhdr
+ \item xcolor
+ \item textcomp
+ \item titlesec
+ \item titletoc
\end{itemize}
\end{multicols}
@@ -318,13 +374,9 @@ The website for the Tufte-\LaTeX\ packages is located at
\url{http://code.google.com/p/tufte-latex/}. On our website, you'll find
links to our \smallcaps{svn} repository, mailing lists, bug tracker, and documentation.
-
\bibliography{sample-handout}
\bibliographystyle{plainnat}
-%\section{Float Positions---DEBUG}
-%Full figure: $x=\zposx{pos:fullfig}$, $y=\zposy{pos:fullfig}$
-%Text figure: $x=\zposx{pos:textfig}$, $y=\zposy{pos:textfig}$
-%Normal table: $x=\zposx{pos:normaltab}$, $y=\zposy{pos:normaltab}$
+
\end{document}
diff --git a/Master/texmf-dist/source/latex/tufte-latex/sample-book.pdf b/Master/texmf-dist/source/latex/tufte-latex/sample-book.pdf
new file mode 100644
index 00000000000..09378a26ca4
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tufte-latex/sample-book.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/tufte-latex/sample-book.tex b/Master/texmf-dist/source/latex/tufte-latex/sample-book.tex
new file mode 100644
index 00000000000..eb95dec6311
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tufte-latex/sample-book.tex
@@ -0,0 +1,747 @@
+\documentclass{tufte-book}
+
+%%
+% Book metadata
+\title{A Tufte-Style Book\thanks{Thanks to Edward R.~Tufte for his inspiration.}}
+\author[The Tufte-LaTeX Developers]{The Tufte-LaTeX\ Developers}
+\publisher{Publisher of This Book}
+
+%%
+% If they're installed, use Bergamo and Chantilly from www.fontsite.com.
+% They're clones of Bembo and Gill Sans, respectively.
+%\IfFileExists{bergamo.sty}{\usepackage[osf]{bergamo}}{}% Bembo
+%\IfFileExists{chantill.sty}{\usepackage{chantill}}{}% Gill Sans
+
+%\usepackage{microtype}
+
+%%
+% Just some sample text
+\usepackage{lipsum}
+
+%%
+% For nicely typeset tabular material
+\usepackage{booktabs}
+
+%%
+% For graphics / images
+\usepackage{graphicx}
+\setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}
+\graphicspath{{graphics/}}
+
+% The fancyvrb package lets us customize the formatting of verbatim
+% environments. We use a slightly smaller font.
+\usepackage{fancyvrb}
+\fvset{fontsize=\normalsize}
+
+%%
+% Prints argument within hanging parentheses (i.e., parentheses that take
+% up no horizontal space). Useful in tabular environments.
+\newcommand{\hangp}[1]{\makebox[0pt][r]{(}#1\makebox[0pt][l]{)}}
+
+%%
+% Prints an asterisk that takes up no horizontal space.
+% Useful in tabular environments.
+\newcommand{\hangstar}{\makebox[0pt][l]{*}}
+
+%%
+% Prints a trailing space in a smart way.
+\usepackage{xspace}
+
+%%
+% Some shortcuts for Tufte's book titles. The lowercase commands will
+% produce the initials of the book title in italics. The all-caps commands
+% will print out the full title of the book in italics.
+\newcommand{\vdqi}{\textit{VDQI}\xspace}
+\newcommand{\ei}{\textit{EI}\xspace}
+\newcommand{\ve}{\textit{VE}\xspace}
+\newcommand{\be}{\textit{BE}\xspace}
+\newcommand{\VDQI}{\textit{The Visual Display of Quantitative Information}\xspace}
+\newcommand{\EI}{\textit{Envisioning Information}\xspace}
+\newcommand{\VE}{\textit{Visual Explanations}\xspace}
+\newcommand{\BE}{\textit{Beautiful Evidence}\xspace}
+
+\newcommand{\TL}{Tufte-\LaTeX\xspace}
+
+% Prints the month name (e.g., January) and the year (e.g., 2008)
+\newcommand{\monthyear}{%
+ \ifcase\month\or January\or February\or March\or April\or May\or June\or
+ July\or August\or September\or October\or November\or
+ December\fi\space\number\year
+}
+
+
+% Prints an epigraph and speaker in sans serif, all-caps type.
+\newcommand{\openepigraph}[2]{%
+ %\sffamily\fontsize{14}{16}\selectfont
+ \begin{fullwidth}
+ \sffamily\large
+ \begin{doublespace}
+ \noindent\allcaps{#1}\\% epigraph
+ \noindent\allcaps{#2}% author
+ \end{doublespace}
+ \end{fullwidth}
+}
+
+% Inserts a blank page
+\newcommand{\blankpage}{\newpage\hbox{}\thispagestyle{empty}\newpage}
+
+\usepackage{units}
+
+% Typesets the font size, leading, and measure in the form of 10/12x26 pc.
+\newcommand{\measure}[3]{#1/#2$\times$\unit[#3]{pc}}
+
+% Macros for typesetting the documentation
+\newcommand{\hl}[1]{\textcolor{Maroon}{#1}}% prints in red
+\newcommand{\hangleft}[1]{\makebox[0pt][r]{#1}}
+\newcommand{\hairsp}{\hspace{1pt}}% hair space
+\newcommand{\hquad}{\hskip0.5em\relax}% half quad space
+\newcommand{\TODO}{\textcolor{red}{\bf TODO!}\xspace}
+\newcommand{\ie}{\textit{i.\hairsp{}e.}\xspace}
+\newcommand{\eg}{\textit{e.\hairsp{}g.}\xspace}
+\providecommand{\XeLaTeX}{X\lower.5ex\hbox{\kern-0.15em\reflectbox{E}}\kern-0.1em\LaTeX}
+\newcommand{\tXeLaTeX}{\XeLaTeX\index{XeLaTeX@\protect\XeLaTeX}}
+% \index{\texttt{\textbackslash xyz}@\hangleft{\texttt{\textbackslash}}\texttt{xyz}}
+\newcommand{\tuftebs}{\symbol{'134}}% a backslash in tt type in OT1/T1
+\newcommand{\doccmd}[1]{%
+ \texttt{\tuftebs#1}%
+ \index{#1@\protect\hangleft{\texttt{\tuftebs}}\texttt{#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{quotation}\ttfamily\parskip0pt\parindent0pt\ignorespaces}{\end{quotation}}% command specification environment
+\newcommand{\docenv}[1]{\texttt{#1}\index{#1@\texttt{#1} environment}\index{environments!#1@\texttt{#1}}}% environment name
+\newcommand{\docpkg}[1]{\texttt{#1}\index{#1@\texttt{#1} package}\index{packages!#1@\texttt{#1}}}% package name
+\newcommand{\doccls}[1]{\texttt{#1}}% document class name
+\newcommand{\docclsopt}[1]{\texttt{#1}\index{#1@\texttt{#1} class option}\index{class options!#1@\texttt{#1}}}% document class option name
+
+% Generates the index
+\usepackage{makeidx}
+\makeindex
+
+\begin{document}
+
+% Front matter
+\frontmatter
+
+% r.1 blank page
+\blankpage
+
+% v.2 epigraphs
+\newpage\thispagestyle{empty}
+\openepigraph{%
+The public is more familiar with bad design than good design.
+It is, in effect, conditioned to prefer bad design,
+because that is what it lives with.
+The new becomes threatening, the old reassuring.
+}{Paul Rand%, {\itshape Design, Form, and Chaos}
+}
+\vfill
+\openepigraph{%
+A designer knows that he has achieved perfection
+not when there is nothing left to add,
+but when there is nothing left to take away.
+}{Antoine de St-Expurey}
+\vfill
+\openepigraph{%
+\ldots the designer of a new system must not only be the implementor and the first
+large-scale user; the designer should also write the first user manual\ldots
+If I had not participated fully in all these activities,
+literally hundreds of improvements would never have been made,
+because I would never have thought of them or perceived
+why they were important.
+}{Donald E. Knuth}
+
+
+% r.3 full title page
+\maketitle
+
+
+% v.4 copyright page
+\newpage
+\begin{fullwidth}
+~\vfill
+\thispagestyle{empty}
+\setlength{\parindent}{0pt}
+\setlength{\parskip}{\baselineskip}
+Copyright \copyright\ \the\year\ \thanklessauthor
+
+\par\smallcaps{Published by \thanklesspublisher}
+
+\par\smallcaps{tufte-latex.googlecode.com}
+
+\par Licensed under the Apache License, Version 2.0 (the ``License''); you may not
+use this file except in compliance with the License. You may obtain a copy
+of the License at \url{http://www.apache.org/licenses/LICENSE-2.0}. Unless
+required by applicable law or agreed to in writing, software distributed
+under the License is distributed on an \smallcaps{``AS IS'' BASIS, WITHOUT
+WARRANTIES OR CONDITIONS OF ANY KIND}, either express or implied. See the
+License for the specific language governing permissions and limitations
+under the License.\index{license}
+
+\par\textit{First printing, \monthyear}
+\end{fullwidth}
+
+% r.5 contents
+\tableofcontents
+
+% r.7 dedication
+\cleardoublepage
+~\vfill
+\begin{doublespace}
+\noindent\fontsize{18}{22}\selectfont\itshape
+\nohyphenation
+Dedicated to those who appreciate \LaTeX{}
+and the work of \mbox{Edward R.~Tufte}
+and \mbox{Donald E.~Knuth}.
+\end{doublespace}
+\vfill
+\vfill
+
+
+% r.9 introduction
+\cleardoublepage
+\chapter*{Introduction}
+
+This sample book discusses the design of Edward Tufte's
+books\cite{Tufte2001,Tufte1990,Tufte1997,Tufte2006}
+and the use of the \texttt{tufte-book} and \texttt{sample-handout} document classes.
+
+
+%%
+% Start the main matter (normal chapters)
+\mainmatter
+
+
+\chapter{The Design of Tufte's Books}
+\label{ch:tufte-design}
+
+
+\newthought{The pages} of a book are usually divided into three major
+sections: the front matter (also called preliminary matter or prelim), the
+main matter (the core text of the book), and the back matter (or end
+matter).
+
+\newthought{The front matter} of a book refers to all of the material that
+comes before the main text. The following table from shows a list of
+material that appears in the front matter of \VDQI, \EI, \VE, and \BE
+along with its page number. Page numbers that appear in parentheses refer
+to folios that do not have a printed page number (but they are still
+counted in the page number sequence).
+
+\bigskip
+\begin{minipage}{\textwidth}
+\begin{center}
+\begin{tabular}{lcccc}
+\toprule
+ & \multicolumn{4}{c}{Books} \\
+\cmidrule(l){2-5}
+Page content & \vdqi & \ei & \ve & \be \\
+\midrule
+Blank half title page & \hangp{1} & \hangp{1} & \hangp{1} & \hangp{1} \\
+Frontispiece\footnotemark{}
+ & \hangp{2} & \hangp{2} & \hangp{2} & \hangp{2} \\
+Full title page & \hangp{3} & \hangp{3} & \hangp{3} & \hangp{3} \\
+Copyright page & \hangp{4} & \hangp{4} & \hangp{4} & \hangp{4} \\
+Contents & \hangp{5} & \hangp{5} & \hangp{5} & \hangp{5} \\
+%Blank & -- & \hangp{6} & \hangp{6} & \hangp{6} \\
+Dedication & \hangp{6} & \hangp{7} & \hangp{7} & 7 \\
+%Blank & -- & \hangp{8} & -- & \hangp{8} \\
+Epigraph & -- & -- & \hangp{8} & -- \\
+Introduction & \hangp{7} & \hangp{9} & \hangp{9} & 9 \\
+\bottomrule
+\end{tabular}
+\end{center}
+\end{minipage}
+\vspace{-7\baselineskip}\footnotetext{The contents of this page vary from book to book. In
+ \vdqi this page is blank; in \ei and \ve this page holds a frontispiece;
+ and in \be this page contains three epigraphs.}
+\vspace{7\baselineskip}
+
+\bigskip
+The design of the front matter in Tufte's books varies slightly from the
+traditional design of front matter. First, the pages in front matter are
+traditionally numbered with lowercase roman numerals (\eg, i, ii, iii,
+iv,~\ldots). Second, the front matter page numbering sequence is usually
+separate from the main matter page numbering. That is, the page numbers
+restart at 1 when the main matter begins. In contrast, Tufte has
+enumerated his pages with arabic numerals that share the same page counting
+sequence as the main matter.
+
+There are also some variations in design across Tufte's four books. The
+page opposite the full title page (labeled ``frontispiece'' in the above
+table) has different content in each of the books. In \VDQI, this page is
+blank; in \EI and \VE, this page holds a frontispiece; and in \BE, this
+page contains three epigraphs.
+
+The dedication appears on page~6 in \vdqi (opposite the introduction), and
+is placed on its own spread in the other books. In \ve, an epigraph shares
+the spread with the opening page of the introduction.
+
+None of the page numbers (folios) of the front matter are expressed except in
+\be, where the folios start to appear on the dedication page.
+
+\newthought{The full title page} of each of the books varies slightly in
+design. In all the books, the author's name appears at the top of the
+page, the title it set just above the center line, and the publisher is
+printed along the bottom margin. Some of the differences are outlined in
+the following table.
+
+\bigskip
+\begin{center}
+\footnotesize
+\begin{tabular}{lllll}
+\toprule
+Feature & \vdqi & \ei & \ve & \be \\
+\midrule
+Author & & & & \\
+\quad Typeface & serif & serif & serif & sans serif \\
+\quad Style & italics & italics & italics & upright, caps \\
+\quad Size & 24 pt & 20 pt & 20 pt & 20 pt \\
+\addlinespace
+Title & & & & \\
+\quad Typeface & serif & serif & serif & sans serif \\
+\quad Style & upright & italics & upright & upright, caps \\
+\quad Size & 36 pt & 48 pt & 48 pt & 36 pt \\
+\addlinespace
+Subtitle & & & & \\
+\quad Typeface & -- & -- & serif & -- \\
+\quad Style & -- & -- & upright & -- \\
+\quad Size & -- & -- & 20 pt & -- \\
+\addlinespace
+Edition & & & & \\
+\quad Typeface & sans serif & -- & -- & -- \\
+\quad Style & upright, caps & -- & -- & -- \\
+\quad Size & 14 pt & -- & -- & -- \\
+\addlinespace
+Publisher & & & & \\
+\quad Typeface & serif & serif & serif & sans serif \\
+\quad Style & italics & italics & italics & upright, caps \\
+\quad Size & 14 pt & 14 pt & 14 pt & 14 pt \\
+\bottomrule
+\end{tabular}
+\end{center}
+
+\begin{figure*}[p]
+\fbox{\includegraphics[width=0.45\linewidth]{graphics/vdqi-title.pdf}}
+\hfill
+\fbox{\includegraphics[width=0.45\linewidth]{graphics/ei-title.pdf}}
+\\\vspace{\baselineskip}
+\fbox{\includegraphics[width=0.45\linewidth]{graphics/ve-title.pdf}}
+\hfill
+\fbox{\includegraphics[width=0.45\linewidth]{graphics/be-title.pdf}}
+\end{figure*}
+
+\newthought{The tables of contents} in Tufte's books give us our first
+glimpse of the structure of the main matter. \VDQI is split into two
+parts, each containing some number of chapters. His other three books only
+contain chapters---they're not broken into parts.
+
+\begin{figure*}[p]\index{table of contents}
+\fbox{\includegraphics[width=0.45\linewidth]{graphics/vdqi-contents.pdf}}
+\hfill
+\fbox{\includegraphics[width=0.45\linewidth]{graphics/ei-contents.pdf}}
+\\\vspace{\baselineskip}
+\fbox{\includegraphics[width=0.45\linewidth]{graphics/ve-contents.pdf}}
+\hfill
+\fbox{\includegraphics[width=0.45\linewidth]{graphics/be-contents.pdf}}
+\end{figure*}
+
+
+\section{Typefaces}\label{sec:typefaces1}\index{typefaces}
+\index{fonts|see{typefaces}}
+
+Tufte's books primarily use two typefaces: Bembo and Gill Sans. Bembo is used
+for the headings and body text, while Gill Sans is used for the title page and
+opening epigraphs in \BE.
+
+Since neither Bembo nor Gill Sans are available in default \LaTeX{}
+installations, the \TL document classes default to using Palatino and
+Helvetica, respectively. In addition, the Bera Mono typeface is used for
+\texttt{monospaced} type.
+
+The following font sizes are defined by the \TL classes:
+
+\begin{table}[h]\index{typefaces!sizes}
+ \footnotesize%
+ \begin{center}
+ \begin{tabular}{lccl}
+ \toprule
+ \LaTeX{} size & Font size & Leading & Used for \\
+ \midrule
+ \verb+\tiny+ & 5 & 6 & sidenote numbers \\
+ \verb+\scriptsize+ & 7 & 8 & --- \\
+ \verb+\footnotesize+ & 8 & 10 & sidenotes, captions \\
+ \verb+\small+ & 9 & 12 & quote, quotation, and verse environments \\
+ \verb+\normalsize+ & 10 & 14 & body text \\
+ \verb+\large+ & 11 & 15 & \textsc{b}-heads \\
+ \verb+\Large+ & 12 & 16 & \textsc{a}-heads, \textsc{toc} entries, author, date \\
+ \verb+\LARGE+ & 14 & 18 & handout title \\
+ \verb+\huge+ & 20 & 30 & chapter heads \\
+ \verb+\Huge+ & 24 & 36 & part titles \\
+ \bottomrule
+ \end{tabular}
+ \end{center}
+ \caption{A list of \LaTeX{} font sizes as defined by the \TL document classes.}
+ \label{tab:font-sizes}
+\end{table}
+
+\section{Headings}\label{sec:headings1}\index{headings}
+
+Tufte's books include the following heading levels: parts,
+chapters,\sidenote{Parts and chapters are defined for the \texttt{tufte\-book}
+class only.} sections, subsections, and paragraphs. Not defined by default
+are: sub-subsections and subparagraphs.
+
+\begin{table}[h]
+ \begin{center}
+ \footnotesize%
+ \begin{tabular}{lcr}
+ \toprule
+ Heading & Style & Size \\
+ \midrule
+ Part & roman & \measure{24}{36}{40} \\
+ Chapter & italic & \measure{20}{30}{40} \\
+ Section & italic & \measure{12}{16}{26} \\
+ Subsection & italic & \measure{11}{15}{26} \\
+ Paragraph & italic & 10/14 \\
+ \bottomrule
+ \end{tabular}
+ \end{center}
+ \caption{Heading styles used in \BE.}
+ \label{tab:heading-styles}
+\end{table}
+
+\paragraph{Paragraph} Paragraph headings (as shown here) are introduced by
+italicized text and separated from the main paragraph by a bit of space.
+
+\section{Environments}
+
+The following characteristics define the various environments:
+
+
+\begin{table}[h]
+ \begin{center}
+ \footnotesize%
+ \begin{tabular}{lcl}
+ \toprule
+ Environment & Font size & Notes \\
+ \midrule
+ Body text & \measure{10}{14}{26} & \\
+ Block quote & \measure{9}{12}{24} & Block indent (left and right) by \unit[1]{pc} \\
+ Sidenotes & \measure{8}{10}{12} & Sidenote number is set inline, followed by word space \\
+ Captions & \measure{8}{10}{12} & \\
+ \bottomrule
+ \end{tabular}
+ \end{center}
+ \caption{Environment styles used in \BE.}
+ \label{tab:environment-styles}
+\end{table}
+
+
+\chapter{On the Use of the \texttt{tufte-book} Document Class}
+\label{ch:tufte-book}
+
+The Tufte-\LaTeX\ document classes define a style similar to the
+style Edward Tufte uses in his books and handouts. Tufte's style is known
+for its extensive use of sidenotes, tight integration of graphics with
+text, and well-set typography. This document aims to be at once a
+demonstration of the features of the Tufte-\LaTeX\ document classes
+and a style guide to their use.
+
+\section{Page Layout}\label{sec:page-layout}
+\subsection{Headings}\label{sec:headings}\index{headings}
+This style provides \textsc{a}- and \textsc{b}-heads (that is,
+\Verb|\section| and \Verb|\subsection|), demonstrated above.
+
+If you need more than two levels of section headings, you'll have to define
+them yourself at the moment; there are no pre-defined styles for anything below
+a \Verb|\subsection|. As Bringhurst points out in \textit{The Elements of
+Typographic Style},\cite{Bringhurst2005} you should ``use as many levels of
+headings as you need: no more, and no fewer.''
+
+The Tufte-\LaTeX\ classes will emit an error if you try to use
+\linebreak\Verb|\subsubsection| and smaller headings.
+
+% let's start a new thought -- a new section
+\newthought{In his later books},\cite{Tufte2006} Tufte
+starts each section with a bit of vertical space, a non-indented paragraph,
+and sets the first few words of the sentence in \textsc{small caps}. To
+accomplish this using this style, use the \hl{\doccmd{newthought}} command:
+\begin{docspec}
+ \doccmd{newthought}\{In his later books\}, Tufte starts\ldots
+\end{docspec}
+
+
+\section{Sidenotes}\label{sec:sidenotes}
+One of the most prominent and distinctive features of this style is the
+extensive use of sidenotes. There is a wide margin to provide ample room
+for sidenotes and small figures. Any \doccmd{footnote}s will automatically
+be converted to sidenotes.\footnote{This is a sidenote that was entered
+using the \texttt{\textbackslash footnote} command.} If you'd like to place ancillary
+information in the margin without the sidenote mark (the superscript
+number), you can use the \hl{\doccmd{marginnote}} command.\marginnote{This is a
+margin note. Notice that there isn't a number preceding the note, and
+there is no number in the main text where this note was written.}
+
+The specification of the \hl{\doccmd{sidenote}} command is:
+\begin{docspec}
+ \doccmd{sidenote}[\docopt{number}][\docopt{offset}]\{\docarg{Sidenote text.}\}
+\end{docspec}
+
+Both the \docopt{number} and \docopt{offset} arguments are optional. If you
+provide a \docopt{number} argument, then that number will be used as the
+sidenote number. It will change of the number of the current sidenote only and
+will not affect the numbering sequence of subsequent sidenotes.
+
+Sometimes a sidenote may run over the top of other text or graphics in the
+margin space. If this happens, you can adjust the vertical position of the
+sidenote by providing a dimension in the \docopt{offset} argument. Some
+examples of valid dimensions are:
+\begin{docspec}
+ \ttfamily 1.0in \qquad 2.54cm \qquad 254mm \qquad 6\Verb|\baselineskip|
+\end{docspec}
+If the dimension is positive it will push the sidenote down the page; if the
+dimension is negative, it will move the sidenote up the page.
+
+While both the \docopt{number} and \docopt{offset} arguments are optional, they
+must be provided in order. To adjust the vertical position of the sidenote
+while leaving the sidenote number alone, use the following syntax:
+\begin{docspec}
+ \doccmd{sidenote}[][\docopt{offset}]\{\docarg{Sidenote text.}\}
+\end{docspec}
+The empty brackets tell the \Verb|\sidenote| command to use the default
+sidenote number.
+
+If you \emph{only} want to change the sidenote number, however, you may
+completely omit the \docopt{offset} argument:
+\begin{docspec}
+ \doccmd{sidenote}[\docopt{number}]\{\docarg{Sidenote text.}\}
+\end{docspec}
+
+The \doccmd{marginnote} command has a similar \docarg{offset} argument:
+\begin{docspec}
+ \doccmd{marginnote}[\docopt{offset}]\{\docarg{Margin note text.}\}
+\end{docspec}
+
+\section{References}
+References are placed alongside their citations as sidenotes,
+as well. This can be accomplished using the normal \hl{\doccmd{cite}}
+command.\sidenote{The first paragraph of this document includes a citation.}
+
+The complete list of references may also be printed automatically by using
+the \hl{\doccmd{bibliography}} command. (See the end of this document for an
+example.) If you do not want to print a bibliography at the end of your
+document, use the \hl{\doccmd{nobibliography}} command in its place.
+
+To enter multiple citations at one location,\cite[-3\baselineskip]{Tufte2006,Tufte1990} you can
+provide a list of keys separated by commas and the same optional vertical
+offset argument: \Verb|\cite{Tufte2006,Tufte1990}|.
+\begin{docspec}
+ \doccmd{cite}[\docopt{offset}]\{\docarg{bibkey1,bibkey2,\ldots}\}
+\end{docspec}
+
+\section{Figures and Tables}\label{sec:figures-and-tables}
+Images and graphics play an integral role in Tufte's work.
+In addition to the standard \hl{\docenv{figure}} and \hl{\docenv{tabular}} environments,
+this style provides special figure and table environments for full-width
+floats.
+
+Full page--width figures and tables may be placed in \hl{\docenv{figure*}} or
+\hl{\docenv{table*}} environments. To place figures or tables in the margin,
+use the \hl{\docenv{marginfigure}} or \hl{\docenv{margintable}} environments as follows
+(see figure~\ref{fig:marginfig}):
+
+\begin{marginfigure}%
+ \includegraphics[width=\linewidth]{helix}
+ \caption{This is a margin figure. The helix is defined by
+ $x = \cos(2\pi z)$, $y = \sin(2\pi z)$, and $z = [0, 2.7]$. The figure was
+ drawn using Asymptote (\url{http://asymptote.sf.net/}).}
+ \label{fig:marginfig}
+\end{marginfigure}
+
+\begin{docspec}
+\textbackslash begin\{marginfigure\}\\
+ \qquad\textbackslash includegraphics\{helix\}\\
+ \qquad\textbackslash caption\{This is a margin figure.\}\\
+ \qquad\textbackslash label\{fig:marginfig\}\\
+\textbackslash end\{marginfigure\}\\
+\end{docspec}
+
+The \docenv{marginfigure} and \docenv{margintable} environments accept an optional parameter \docopt{offset} that adjusts the vertical position of the figure or table. See the ``\nameref{sec:sidenotes}'' section above for examples. The specifications are:
+\begin{docspec}
+ \textbackslash{begin\{marginfigure\}[\docopt{offset}]}\\
+ \qquad\ldots\\
+ \textbackslash{end\{marginfigure\}}\\
+ \mbox{}\\
+ \textbackslash{begin\{margintable\}[\docopt{offset}]}\\
+ \qquad\ldots\\
+ \textbackslash{end\{margintable\}}\\
+\end{docspec}
+
+Figure~\ref{fig:fullfig} is an example of the \docenv{figure*}
+environment and figure~\ref{fig:textfig} is an example of the normal
+\docenv{figure} environment.
+
+\begin{figure*}[h]
+ \includegraphics[width=\linewidth]{sine.pdf}%
+ \caption{This graph shows $y = \sin x$ from about $x = [-10, 10]$.
+ \emph{Notice that this figure takes up the full page width.}}%
+ \label{fig:fullfig}%
+\end{figure*}
+
+\begin{figure}
+ \includegraphics{hilbertcurves.pdf}
+% \checkparity This is an \pageparity\ page.%
+ \caption{Hilbert curves of various degrees $n$.
+ \emph{Notice that this figure only takes up the main textblock width.}}
+ \label{fig:textfig}
+ %\zsavepos{pos:textfig}
+\end{figure}
+
+Table~\ref{tab:normaltab} shows table created with the \docpkg{booktabs}
+package. Notice the lack of vertical rules---they serve only to clutter
+the table's data.
+
+\begin{table}[ht]
+ \centering
+ \fontfamily{ppl}\selectfont
+ \begin{tabular}{ll}
+ \toprule
+ Margin & Length \\
+ \midrule
+ Paper width & \unit[8\nicefrac{1}{2}]{inches} \\
+ Paper height & \unit[11]{inches} \\
+ Textblock width & \unit[6\nicefrac{1}{2}]{inches} \\
+ Textblock/sidenote gutter & \unit[\nicefrac{3}{8}]{inches} \\
+ Sidenote width & \unit[2]{inches} \\
+ \bottomrule
+ \end{tabular}
+ \caption{Here are the dimensions of the various margins used in the Tufte-handout class.}
+ \label{tab:normaltab}
+ %\zsavepos{pos:normaltab}
+\end{table}
+
+\section{Full-width text blocks}
+
+In addition to the new float types, there is a \hl{\docenv{fullwidth}}
+environment that stretches across the main text block and the sidenotes
+area.
+
+\begin{Verbatim}
+\begin{fullwidth}
+Lorem ipsum dolor sit amet...
+\end{fullwidth}
+\end{Verbatim}
+
+\begin{fullwidth}
+\small\itshape\lipsum[1]
+\end{fullwidth}
+
+\section{Typography}\label{sec:typography}
+
+\subsection{Typefaces}\label{sec:typefaces}\index{typefaces}
+If the Palatino, \textsf{Helvetica}, and \texttt{Bera Mono} typefaces are installed, this style
+will use them automatically. Otherwise, we'll fall back on the Computer Modern
+typefaces.
+
+\subsection{Letterspacing}\label{sec:letterspacing}
+This document class includes two new commands and some improvements on
+existing commands for letterspacing.
+
+When setting strings of \allcaps{ALL CAPS} or \smallcaps{small caps}, the
+letter\-spacing---that is, the spacing between the letters---should be
+increased slightly.\cite{Bringhurst2005} The \hl{\doccmd{allcaps}} command has proper letterspacing for
+strings of \allcaps{FULL CAPITAL LETTERS}, and the \hl{\doccmd{smallcaps}} command
+has letterspacing for \smallcaps{small capital letters}. These commands
+will also automatically convert the case of the text to upper- or
+lowercase, respectively.
+
+The \hl{\doccmd{textsc}} command has also been redefined to include
+letterspacing. The case of the \doccmd{textsc} argument is left as is,
+however. This allows one to use both uppercase and lowercase letters:
+\textsc{The Initial Letters Of The Words In This Sentence Are Capitalized.}
+
+
+
+\section{Document Class Options}\label{sec:options}
+
+\index{class options|(}
+The \doccls{tufte-book} class is based on the \LaTeX\ \doccls{book}
+document class. Therefore, you can pass any of the typical book
+options. There are a few options that are specific to the
+\doccls{tufte-book} document class, however.
+
+The \hl{\docclsopt{a4paper}} option will set the paper size to \smallcaps{A4} instead of
+the default \smallcaps{US} letter size.
+
+The \hl{\docclsopt{sfsidenotes}} option will set the sidenotes and title block in a
+\textsf{sans serif} typeface instead of the default roman.
+
+The \hl{\docclsopt{twoside}} option will modify the running heads so that the page
+number is printed on the outside edge (as opposed to always printing the page
+number on the right-side edge in \hl{\docclsopt{oneside}} mode).
+
+The \hl{\docclsopt{symmetric}} option typesets the sidenotes on the outside edge of
+the page. This is how books are traditionally printed, but is contrary to
+Tufte's book design which sets the sidenotes on the right side of the page.
+This option implicitly sets the \docclsopt{twoside} option.
+
+The \hl{\docclsopt{justified}} option sets all the text fully justified (flush left
+and right). The default is to set the text ragged right.
+The body text of Tufte's books are set ragged right. This prevents
+needless hyphenation and makes it easier to read the text in the slightly
+narrower column.
+
+The \hl{\docclsopt{bidi}} option loads the \docpkg{bidi} package which is used with
+\tXeLaTeX\ to typeset bi-directional text. Since the \docpkg{bidi}
+package needs to be loaded before the sidenotes and cite commands are defined,
+it can't be loaded in the document preamble.
+
+The \hl{\docclsopt{debug}} option causes the Tufte-\LaTeX\ classes to output debug
+information to the log file which is useful in troubleshooting bugs. It will
+also cause the graphics to be replaced by outlines.
+
+The \hl{\docclsopt{nofonts}} option prevents the Tufte-\LaTeX\ classes from
+automatically loading the Palatino and Helvetica typefaces. You should use
+this option if you wish to load your own fonts. If you're using \tXeLaTeX, this
+option is implied (\ie, the Palatino and Helvetica fonts aren't loaded if you
+use \tXeLaTeX).
+
+The \hl{\docclsopt{nols}} option inhibits the letterspacing code. The Tufte-\LaTeX\
+classes try to load the appropriate letterspacing package (either pdf\TeX's
+\docpkg{letterspace} package or the \docpkg{soul} package). If you're using
+\tXeLaTeX\ with \docpkg{fontenc}, however, you should configure your own
+letterspacing.
+
+The \hl{\docclsopt{notitlepage}} option causes \verb|\maketitle| to generate a title
+block instead of a title page. The \doccls{book} class defaults to a title
+page and the \doccls{handout} class defaults to the title block. There is an
+analogous \hl{\docclsopt{titlepage}} option that forces \verb|\maketitle| to
+generate a full title page instead of the title block.
+
+The \hl{\docclsopt{notoc}} option suppresses Tufte-\LaTeX's custom table of contents
+(\textsc{toc}) design. The current \textsc{toc} design only shows unnumbered
+chapter titles; it doesn't show sections or subsections. The \docclsopt{notoc}
+option will revert to \LaTeX's \textsc{toc} design.
+
+\index{class options|)}
+
+
+\chapter{Debug Stuff}
+
+
+%%
+% The back matter contains appendices, bibliographies, indices, glossaries, etc.
+
+\backmatter
+
+
+
+\bibliography{sample-handout}
+\bibliographystyle{plainnat}
+
+
+\printindex
+
+\end{document}
+
diff --git a/Master/texmf-dist/source/latex/tufte-latex/sample-handout.bib b/Master/texmf-dist/source/latex/tufte-latex/sample-handout.bib
index 81715a5dd0c..95e715e29ec 100644
--- a/Master/texmf-dist/source/latex/tufte-latex/sample-handout.bib
+++ b/Master/texmf-dist/source/latex/tufte-latex/sample-handout.bib
@@ -6,7 +6,7 @@
month = {May},
edition = {First},
place = {Cheshire, Connecticut},
- isbn = {0961392177}
+ isbn = {0-9613921-7-7}
}
@BOOK{Tufte2001,
@@ -15,7 +15,7 @@
publisher = {Graphics Press},
year = {2001},
address = {Cheshire, Connecticut},
- isbn = {0961392142}
+ isbn = {0-9613921-4-2}
}
@BOOK{Tufte1990,
@@ -24,7 +24,7 @@
publisher = {Graphics Press},
year = {1990},
address = {Cheshire, Connecticut},
- isbn = {0961392118}
+ isbn = {0-9613921-1-8}
}
@BOOK{Tufte1997,
diff --git a/Master/texmf-dist/source/latex/tufte-latex/sample-handout.pdf b/Master/texmf-dist/source/latex/tufte-latex/sample-handout.pdf
new file mode 100644
index 00000000000..457890656de
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tufte-latex/sample-handout.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/tufte-latex/sample-handout.tex b/Master/texmf-dist/source/latex/tufte-latex/sample-handout.tex
index 7c65ba41f57..3d8309f9f7e 100644
--- a/Master/texmf-dist/source/latex/tufte-latex/sample-handout.tex
+++ b/Master/texmf-dist/source/latex/tufte-latex/sample-handout.tex
@@ -1,5 +1,7 @@
\documentclass{tufte-handout}
+%\geometry{showframe}% for debugging purposes -- displays the margins
+
\usepackage{amsmath}
% Set up the images/graphics package
@@ -7,14 +9,9 @@
\setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}
\graphicspath{{graphics/}}
-\usepackage{mcaption} % FIXME move to .cls file
-
-%\title{An Example of the Usage of the Tufte-Handout Style\thanks{Inspired by Edward~R. Tufte!}}
-\title{An Example of the Usage of the Tufte-Handout Style}
-\author{The Tufte-\LaTeX\ Developers}
-%\date{22 February 2008} % if the \date{} command is left out, the current date will be used
-
-\usepackage{helvet}
+\title{An Example of the Usage of the Tufte-Handout Style\thanks{Inspired by Edward~R. Tufte!}}
+\author[The Tufte-LaTeX Developers]{The Tufte-\LaTeX\ Developers}
+\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}
@@ -28,18 +25,25 @@
\usepackage{fancyvrb}
\fvset{fontsize=\normalsize}
+% Small sections of multiple columns
\usepackage{multicol}
-%\usepackage[savepos]{zref}
-
+% Provides paragraphs of dummy text
\usepackage{lipsum}
-\usepackage{url}
-\urldef{\asyurl}\url{http://asymptote.sf.net/}
+% 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
\begin{document}
-\maketitle % this prints the handout title, author, and date
+\maketitle% this prints the handout title, author, and date
\begin{abstract}
\noindent This document describes the Tufte handout \LaTeX\ document style.
@@ -48,28 +52,28 @@ It also provides examples and comments on the style's use.
%\printclassoptions
-The \Verb|tufte-handout| document class defines a style similar to the
+The Tufte-\LaTeX\ document classes define a style similar to the
style Edward Tufte uses in his books and handouts. Tufte's style is known
for its extensive use of sidenotes, tight integration of graphics with
text, and well-set typography. This document aims to be at once a
-demonstration of the features of the \Verb|tufte-handout| document class
-and a style guide to its use.
+demonstration of the features of the Tufte-\LaTeX\ document classes
+and a style guide to their use.
\section{Page Layout}\label{sec:page-layout}
\subsection{Headings}\label{sec:headings}
This style provides \textsc{a}- and \textsc{b}-heads (that is,
-\Verb|\section| and \Verb|\subsection|) demonstrated above.
+\Verb|\section| and \Verb|\subsection|), demonstrated above.
If you need more than two levels of section headings, you'll have to define
-them yourself at the moment;\sidenote{See see ``Defining new sections'' on
+them yourself at the moment;\sidenote{See see ``\nameref{sec:defining-sections}'' on
page~\pageref{sec:defining-sections} for help with defining more heading
levels.} there are no pre-defined styles for anything below a
\Verb|\subsection|. As Bringhurst points out in \textit{The Elements of
Typographic Style},\cite{Bringhurst2005} you should ``use as many levels of
headings as you need: no more, and no fewer.''
-The Tufte-handout class will emit an error if you try to use
-\Verb|\subsubsection| and smaller headings.
+The Tufte-\LaTeX\ classes will emit an error if you try to use
+\linebreak\Verb|\subsubsection| and smaller headings.
%\medskip
%\begin{fullwidth}
@@ -87,8 +91,9 @@ The Tufte-handout class will emit an error if you try to use
starts each section with a bit of vertical space, a non-indented paragraph,
and sets the first few words of the sentence in \textsc{small caps}. To
accomplish this using this style, use the \Verb|\newthought| command:
-
-\Verb|\newthought{In his later books}, Tufte starts|\ldots
+\begin{docspec}
+ \doccmd{newthought\{In his later books\}, Tufte starts\ldots}
+\end{docspec}
\subsection{Sidenotes}\label{sec:sidenotes}
One of the most prominent and distinctive features of this style is the
@@ -101,68 +106,120 @@ number), you can use the \Verb|\marginnote| command.\marginnote{This is a
margin note. Notice that there isn't a number preceding the note, and
there is no number in the main text where this note was written.}
+The specification of the \Verb|\sidenote| command is:
+\begin{docspec}
+ \doccmd{sidenote[\docopt{number}][\docopt{offset}]\{\docarg{Sidenote text.}\}}
+\end{docspec}
+
+Both the \docopt{number} and \docopt{offset} arguments are optional. If you
+provide a \docopt{number} argument, then that number will be used as the
+sidenote number. It will change of the number of the current sidenote only and
+will not affect the numbering sequence of subsequent sidenotes.
+
+Sometimes a sidenote may run over the top of other text or graphics in the
+margin space. If this happens, you can adjust the vertical position of the
+sidenote by providing a dimension in the \docopt{offset} argument. Some
+examples of valid dimensions are:
+\begin{docspec}
+ \ttfamily 1.0in \qquad 2.54cm \qquad 254mm \qquad 6\Verb|\baselineskip|
+\end{docspec}
+If the dimension is positive it will push the sidenote down the page; if the
+dimension is negative, it will move the sidenote up the page.
+
+While both the \docopt{number} and \docopt{offset} arguments are optional, they
+must be provided in order. To adjust the vertical position of the sidenote
+while leaving the sidenote number alone, use the following syntax:
+\begin{docspec}
+ \doccmd{sidenote[][\docopt{offset}]\{\docarg{Sidenote text.}\}}
+\end{docspec}
+The empty brackets tell the \Verb|\sidenote| command to use the default
+sidenote number.
+
+If you \emph{only} want to change the sidenote number, however, you may
+completely omit the \docopt{offset} argument:
+\begin{docspec}
+ \doccmd{sidenote[\docopt{number}]\{\docarg{Sidenote text.}\}}
+\end{docspec}
+
+The \Verb|\marginnote| command has a similar \docarg{offset} argument:
+\begin{docspec}
+ \doccmd{marginnote[\docopt{offset}]\{\docarg{Margin note text.}\}}
+\end{docspec}
+
\subsection{References}
References are placed alongside their citations as sidenotes,
as well. This can be accomplished using the normal \Verb|\cite|
-command.\footnote{The first paragraph of this document includes a citation.}
+command.\sidenote{The first paragraph of this document includes a citation.}
The complete list of references may also be printed automatically by using
the \Verb|\bibliography| command. (See the end of this document for an
example.) If you do not want to print a bibliography at the end of your
document, use the \Verb|\nobibliography| command in its place.
-To enter multiple citations at one
-location,\cite{Tufte2006}\cite{Tufte1990} you will need to use multiple
-\Verb|\cite| commands: \Verb|\cite{Tufte2006}| \Verb|\cite{Tufte1990}|. Each
-\Verb|\cite| command will generate its own sidenote and its own sidenote
-number.
-
+To enter multiple citations at one location,\cite[-3\baselineskip]{Tufte2006,Tufte1990} you can
+provide a list of keys separated by commas and the same optional vertical
+offset argument: \Verb|\cite{Tufte2006,Tufte1990}|.
+\begin{docspec}
+ \doccmd{cite[\docopt{offset}]\{\docarg{bibkey1,bibkey2,\ldots}\}}
+\end{docspec}
\section{Figures and Tables}\label{sec:figures-and-tables}
Images and graphics play an integral role in Tufte's work.
-In addition to the standard \Verb|figure| and \Verb|tabular| environments,
+In addition to the standard \docenv{figure} and \docenv{tabular} environments,
this style provides special figure and table environments for full-width
floats.
-Full page width figures and tables may be placed in \texttt{figure*} or
-\texttt{table*} environments. To place figures or tables in the margin,
-use the \Verb|marginfigure| or \Verb|margintable| environments as follows
+Full page--width figures and tables may be placed in \docenv{figure*} or
+\docenv{table*} environments. To place figures or tables in the margin,
+use the \docenv{marginfigure} or \docenv{margintable} environments as follows
(see figure~\ref{fig:marginfig}):
-\begin{marginfigure}
- \includegraphics[width=\marginparwidth]{helix}
+
+\begin{marginfigure}%
+ \includegraphics[width=\linewidth]{helix}
\caption{This is a margin figure. The helix is defined by
$x = \cos(2\pi z)$, $y = \sin(2\pi z)$, and $z = [0, 2.7]$. The figure was
- drawn using Asymptote (\asyurl).}
+ drawn using Asymptote (\url{http://asymptote.sf.net/}).}
\label{fig:marginfig}
\end{marginfigure}
\begin{Verbatim}
\begin{marginfigure}
- \includegraphics{blah}
- \caption{This figure is in the margin.}
+ \includegraphics{helix}
+ \caption{This is a margin figure.}
\end{marginfigure}
\end{Verbatim}
+The \docenv{marginfigure} and \docenv{margintable} environments accept an optional parameter \docopt{offset} that adjusts the vertical position of the figure or table. See the ``\nameref{sec:sidenotes}'' section above for examples. The specifications are:
+\begin{docspec}
+ \doccmd{begin\{marginfigure\}[\docopt{offset}]}\\
+ \qquad\ldots\\
+ \doccmd{end\{marginfigure\}}\\
+ \mbox{}\\
+ \doccmd{begin\{margintable\}[\docopt{offset}]}\\
+ \qquad\ldots\\
+ \doccmd{end\{margintable\}}\\
+\end{docspec}
Figure~\ref{fig:fullfig} is an example of the \Verb|figure*|
environment and figure~\ref{fig:textfig} is an example of the normal
\Verb|figure| environment.
-\begin{figure*}
- \includegraphics{sine.pdf}
+
+\begin{figure*}[h]
+ \includegraphics[width=\linewidth]{sine.pdf}%
\caption{This graph shows $y = \sin x$ from about $x = [-10, 10]$.
- \emph{Notice that this figure takes up the full page width.}}
- \label{fig:fullfig}
- %\zsavepos{pos:fullfig}
+ \emph{Notice that this figure takes up the full page width.}}%
+ \label{fig:fullfig}%
\end{figure*}
\begin{figure}
\includegraphics{hilbertcurves.pdf}
+% \checkparity This is an \pageparity\ page.%
\caption{Hilbert curves of various degrees $n$.
\emph{Notice that this figure only takes up the main textblock width.}}
\label{fig:textfig}
%\zsavepos{pos:textfig}
\end{figure}
-Table~\ref{tab:normaltab} shows table created with the \texttt{booktabs}
+Table~\ref{tab:normaltab} shows table created with the \docpkg{booktabs}
package. Notice the lack of vertical rules---they serve only to clutter
the table's data.
@@ -187,7 +244,7 @@ the table's data.
\section{Full-width text blocks}
-In addition to the new float types, there is a \texttt{fullwidth}
+In addition to the new float types, there is a \docenv{fullwidth}
environment that stretches across the main text block and the sidenotes
area.
@@ -204,8 +261,8 @@ Lorem ipsum dolor sit amet...
\section{Typography}\label{sec:typography}
\subsection{Typefaces}\label{sec:typefaces}
-If the Palatino and Bera Mono typefaces are installed, this style will use
-them automatically. Otherwise, we'll fall back on the Computer Modern
+If the Palatino, \textsf{Helvetica}, and \texttt{Bera Mono} typefaces are installed, this style
+will use them automatically. Otherwise, we'll fall back on the Computer Modern
typefaces.
\subsection{Letterspacing}\label{sec:letterspacing}
@@ -213,7 +270,7 @@ This document class includes two new commands and some improvements on
existing commands for letterspacing.
When setting strings of \allcaps{ALL CAPS} or \smallcaps{small caps}, the
-letterspacing---that is, the spacing between the letters---should be
+letter\-spacing---that is, the spacing between the letters---should be
increased slightly.\cite{Bringhurst2005} The \Verb|\allcaps| command has proper letterspacing for
strings of \allcaps{FULL CAPITAL LETTERS}, and the \Verb|\smallcaps| command
has letterspacing for \smallcaps{small capital letters}. These commands
@@ -228,63 +285,52 @@ however. This allows one to use both uppercase and lowercase letters:
\section{Customization}\label{sec:customization}
\subsection{Document class options}\label{sec:options}
-The \Verb|tufte-handout| class is based on the \LaTeX\ \Verb|article|
+The \doccls{tufte-handout} class is based on the \LaTeX\ \doccls{article}
document class. Therefore, you can pass any of the typical article
options. There are a few options that are specific to the
-\Verb|tufte-handout| document class, however.
+\doccls{tufte-handout} document class, however.
-The \Verb|a4paper| option will set the paper size to \smallcaps{A4} instead of
+The \docclsopt{a4paper} option will set the paper size to \smallcaps{A4} instead of
the default \smallcaps{US} letter size.
-The \Verb|sfsidenotes| option will set the sidenotes in a \textsf{sans
-serif} typeface instead of the default roman.
+The \docclsopt{sfsidenotes} option will set the sidenotes and title block in a
+\textsf{sans serif} typeface instead of the default roman.
-The \Verb|twoside| option will modify the running heads so that the page
+The \docclsopt{twoside} option will modify the running heads so that the page
number is printed on the outside edge (as opposed to always printing the page
-number on the right-side edge in \Verb|oneside| mode).
+number on the right-side edge in \docclsopt{oneside} mode).
-The \Verb|symmetric| option typesets the sidenotes on the outside edge of
+The \docclsopt{symmetric} option typesets the sidenotes on the outside edge of
the page. This is how books are traditionally printed, but is contrary to
Tufte's book design which sets the sidenotes on the right side of the page.
-This option implicitly sets the \Verb|twoside| option.
+This option implicitly sets the \docclsopt{twoside} option.
-The \Verb|justified| option sets all the text fully justified (flush left
+The \docclsopt{justified} option sets all the text fully justified (flush left
and right). The default is to set the text ragged right.
The body text of Tufte's books are set ragged right. This prevents
needless hyphenation and makes it easier to read the text in the slightly
narrower column.
\subsection{Defining new sections}\label{sec:defining-sections}
-As mentioned on page~\pageref{sec:headings}, the \Verb|tufte-handout|
-document class only defines \Verb|\section| and \Verb|\subsection|
-headings.
+As mentioned in the ``\nameref{sec:headings}'' section (see
+page~\pageref{sec:headings}), the \doccls{tufte\-handout} document class only
+defines \doccmd{section} and \doccmd{subsection} headings.
-If you wanted to define, say, a \Verb|\paragraph| heading, you could do it
-as follows:
-
-\begin{Verbatim}
-\makeatletter
-\renewcommand\paragraph{\@startsection{paragraph}% the name of the new section
- {4}% the section level number
- {0em}% indentation amount
- {\baselineskip}% amount of space to leave before heading
- {-1.5em}% amount of space to leave after heading
- {\normalfont\itshape}% style
-}
-\makeatother
-\end{Verbatim}
-
-Place that code in the preamble of your document and you'll now be able to use
-\Verb|\paragraph|.
-
-For more details on defining section levels, see \textit{The \LaTeX\
-Companion},\cite{Mittelbach2004} or use the \Verb|titlesec| package.
+We use the \docpkg{titlesec} package to define the appearance of the headings.
+To modify an existing section or to add a new section, see the documentation of
+the \docpkg{titlesec} package.
\section{Installation}\label{sec:installation}
-To install the \Verb|tufte-handout| class, simply drop the
-\Verb|tufte-handout.cls| file into the same directory as your \Verb|.tex|
-file.
+To install the Tufte-\LaTeX\ classes, simply drop the
+following files into the same directory as your \texttt{.tex}
+file:
+\begin{quote}
+ \ttfamily
+ tufte-common.sty\\
+ tufte-handout.cls\\
+ tufte-book.cls
+\end{quote}
% TODO add instructions for installing it globally
@@ -292,24 +338,34 @@ file.
\section{Support}\label{sec:support}
\subsection{Package Dependencies}\label{sec:dependencies}
-The following is a list of packages that the \Verb|tufte-handout| document
-class relies upon. Packages marked with an asterisk are optional.
+The following is a list of packages that the Tufte-\LaTeX\ document
+classes rely upon. Packages marked with an asterisk are optional.
\begin{multicols}{2}
\begin{itemize}
+ \item xifthen
+ \item ifpdf*
+ \item ifxetex*
+ \item hyperref
\item geometry
\item ragged2e
- \item chngpage
+ \item chngpage \emph{or} changepage
\item paralist
\item textcase
- \item footmisc
- \item natbib and bibentry
- \item placeins
- \item caption
- \item fancyhdr
- \item microtype*
\item soul*
- \item palatino*
+ \item letterspace*
+ \item setspace
+ \item natbib \emph{and} bibentry
+ \item optparams
+ \item placeins
+ \item mathpazo*
+ \item helvet*
+ \item fontenc
\item beramono*
+ \item fancyhdr
+ \item xcolor
+ \item textcomp
+ \item titlesec
+ \item titletoc
\end{itemize}
\end{multicols}
@@ -318,13 +374,9 @@ The website for the Tufte-\LaTeX\ packages is located at
\url{http://code.google.com/p/tufte-latex/}. On our website, you'll find
links to our \smallcaps{svn} repository, mailing lists, bug tracker, and documentation.
-
\bibliography{sample-handout}
\bibliographystyle{plainnat}
-%\section{Float Positions---DEBUG}
-%Full figure: $x=\zposx{pos:fullfig}$, $y=\zposy{pos:fullfig}$
-%Text figure: $x=\zposx{pos:textfig}$, $y=\zposy{pos:textfig}$
-%Normal table: $x=\zposx{pos:normaltab}$, $y=\zposy{pos:normaltab}$
+
\end{document}
diff --git a/Master/texmf-dist/source/latex/tufte-latex/tufte-book.cls b/Master/texmf-dist/source/latex/tufte-latex/tufte-book.cls
new file mode 100644
index 00000000000..99ff6dfa219
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tufte-latex/tufte-book.cls
@@ -0,0 +1,83 @@
+\NeedsTeXFormat{LaTeX2e}[1994/06/01]
+
+\ProvidesClass{tufte-book}[2009/05/17 v3.0.0 Tufte-book class]
+
+
+\PassOptionsToPackage{book}{tufte-common}
+\DeclareOption*{% pass options to tufte-common package and the article class
+ \PassOptionsToPackage{\CurrentOption}{tufte-common}
+ \PassOptionsToClass{\CurrentOption}{book}
+ \PackageInfo{tufte-book}{Passing \CurrentOption\space to `book' class}
+}
+\ProcessOptions
+
+\LoadClass{book}
+
+\RequirePackage{tufte-common}
+
+
+%%
+% Set up any book-specific stuff now
+
+%%
+% The front matter in Tufte's /Beautiful Evidence/ contains everything up
+% to the opening page of Chapter 1. The running heads, when they appear,
+% contain only the (arabic) page number in the outside corner.
+%\newif\if@mainmatter \@mainmattertrue
+\renewcommand\frontmatter{%
+ \cleardoublepage%
+ \@mainmatterfalse%
+ \pagenumbering{arabic}%
+ %\pagestyle{plain}%
+ \fancyhf{}%
+ \ifthenelse{\boolean{@tufte@twoside}}%
+ {\fancyhead[LE,RO]{\thepage}}%
+ {\fancyhead[RE,RO]{\thepage}}%
+}
+
+
+%%
+% The main matter in Tufte's /Beautiful Evidence/ doesn't restart the page
+% numbering---it continues where it left off in the front matter.
+\renewcommand\mainmatter{%
+ \cleardoublepage%
+ \@mainmattertrue%
+ \fancyhf{}%
+ \ifthenelse{\boolean{@tufte@twoside}}%
+ {% two-side
+ \renewcommand{\chaptermark}[1]{\markboth{##1}{}}%
+ \fancyhead[LE]{\thepage\quad\smallcaps{\plaintitle}}% book title
+ \fancyhead[RO]{\smallcaps{\leftmark}\quad\thepage}% chapter title
+ }%
+ {% one-side
+ \fancyhead[RE,RO]{\smallcaps{\plaintitle}\quad\thepage}% book title
+ }%
+}
+
+
+%%
+% The back matter contains appendices, indices, glossaries, endnotes,
+% biliographies, list of contributors, illustration credits, etc.
+\renewcommand\backmatter{%
+ \if@openright%
+ \cleardoublepage%
+ \else%
+ \clearpage%
+ \fi%
+ \@mainmatterfalse%
+}
+
+%%
+% Only show the chapter titles in the table of contents
+\setcounter{tocdepth}{0}
+
+%%
+% If there is a `tufte-book-local.sty' file, load it.
+
+\IfFileExists{tufte-book-local.tex}
+ {\input{tufte-book-local}}
+ {}
+
+%%
+% End of file
+\endinput
diff --git a/Master/texmf-dist/source/latex/tufte-latex/tufte-common.sty b/Master/texmf-dist/source/latex/tufte-latex/tufte-common.sty
new file mode 100644
index 00000000000..5fb331085f0
--- /dev/null
+++ b/Master/texmf-dist/source/latex/tufte-latex/tufte-common.sty
@@ -0,0 +1,1427 @@
+\NeedsTeXFormat{LaTeX2e}[1994/06/01]
+
+\ProvidesPackage{tufte-common}[2009/05/17 v3.0.0 Common code for the Tufte-LaTeX styles]
+
+%%
+% We use the `xifthen' package to handle our package option switches
+\RequirePackage{xifthen}
+
+
+%%
+% `debug' option -- provides more information in the .log file for use in
+% troubleshooting problems
+\newboolean{@tufte@debug}
+\DeclareOption{debug}{\setboolean{@tufte@debug}{true}}
+
+%%
+% `nofonts' option -- doesn't load any fonts
+% `fonts' option -- tries to load fonts
+\newboolean{@tufte@loadfonts}\setboolean{@tufte@loadfonts}{true}
+\DeclareOption{fonts}{\setboolean{@tufte@loadfonts}{true}}
+\DeclareOption{nofonts}{\setboolean{@tufte@loadfonts}{false}}
+
+%%
+% `nols' option -- doesn't configure letterspacing
+% `ls' option -- configures letterspacing
+\newboolean{@tufte@letterspace}\setboolean{@tufte@letterspace}{true}
+\DeclareOption{ls}{\setboolean{@tufte@letterspace}{true}}
+\DeclareOption{nols}{\setboolean{@tufte@letterspace}{false}}
+
+%%
+% `book' and `handout' options
+\newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style)
+\newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout)
+\DeclareOption{book}{%
+ \renewcommand{\@tufte@class}{book}
+ \renewcommand{\@tufte@pkgname}{tufte-book}
+ \setboolean{@tufte@titlepage}{true}
+}
+\DeclareOption{handout}{%
+ \renewcommand{\@tufte@class}{article}
+ \renewcommand{\@tufte@pkgname}{tufte-handout}
+ \setboolean{@tufte@titlepage}{false}
+}
+\DeclareOption{article}{% `article' is just an alias for `handout'
+ \renewcommand{\@tufte@class}{article}
+ \renewcommand{\@tufte@pkgname}{tufte-handout}
+ \setboolean{@tufte@titlepage}{false}
+}
+
+%%
+% `titlepage' option -- creates a full title page with \maketitle
+
+\newboolean{@tufte@titlepage}
+\DeclareOption{titlepage}{\setboolean{@tufte@titlepage}{true}}
+\DeclareOption{notitlepage}{\setboolean{@tufte@titlepage}{false}}
+
+%%
+% `a4paper' option
+
+\newboolean{@tufte@afourpaper}
+\DeclareOption{a4paper}{\setboolean{@tufte@afourpaper}{true}}
+
+%%
+% `sfsidenotes' option -- typesets sidenotes in sans serif typeface
+
+\newboolean{@tufte@sfsidenotes}
+\DeclareOption{sfsidenotes}{\setboolean{@tufte@sfsidenotes}{true}}
+
+%%
+% `symmetric' option -- puts marginpar space to the outside edge of the page
+% Note: this option forces the twoside option (see the .cls files)
+
+\newboolean{@tufte@symmetric}
+\DeclareOption{symmetric}{
+ \setboolean{@tufte@symmetric}{true}
+ \PackageInfo{\@tufte@pkgname}{The `symmetric' option implies `twoside'}
+ %\ExecuteOptions{twoside}
+}
+
+%%
+% `twoside' option -- alternates running heads
+
+\newboolean{@tufte@twoside}
+\DeclareOption{twoside}{\setboolean{@tufte@twoside}{true}}
+
+%%
+% `notoc' option -- suppresses the Tufte-style table of contents
+
+\newboolean{@tufte@toc}
+\setboolean{@tufte@toc}{true}
+\DeclareOption{notoc}{\setboolean{@tufte@toc}{false}}
+\DeclareOption{toc}{\setboolean{@tufte@toc}{true}}
+
+%%
+% `justified' option -- uses fully justified text (flush left and flush
+% right) instead of ragged right.
+
+\newboolean{@tufte@justified}
+\DeclareOption{justified}{\setboolean{@tufte@justified}{true}}
+
+%%
+% `bidi' option -- loads the bidi package for bi-directional text
+
+\newboolean{@tufte@loadbidi}
+\DeclareOption{bidi}{\setboolean{@tufte@loadbidi}{true}}
+\DeclareOption{nobidi}{\setboolean{@tufte@loadbibi}{false}}
+
+% FIXME: should probably specify options not supported like Mittelbach's aipproc.cls
+
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\@tufte@class}}
+\ProcessOptions
+
+%%
+% Detect whether we're in two-side mode or not. (Used to set up running
+% heads later.)
+
+\ifthenelse{\boolean{@twoside}}
+ {\setboolean{@tufte@twoside}{true}}
+ {}
+
+
+
+%%
+% Detect if we're using pdfLaTeX
+
+\newboolean{@tufte@pdf}
+\IfFileExists{ifpdf.sty}{%
+ \RequirePackage{ifpdf}
+ \ifthenelse{\boolean{pdf}}
+ {\setboolean{@tufte@pdf}{true}}
+ {\setboolean{@tufte@pdf}{false}}
+}{% assume we're not using pdfTex?
+ \setboolean{@tufte@pdf}{false}
+}
+
+%%
+% Detect if we're using XeLaTeX
+
+\newboolean{@tufte@xetex}
+\IfFileExists{ifxetex.sty}{%
+ \RequirePackage{ifxetex}
+ \ifthenelse{\boolean{xetex}}
+ {\setboolean{@tufte@xetex}{true}}
+ {\setboolean{@tufte@xetex}{false}}
+}{% not using xelatex
+ \setboolean{@tufte@xetex}{false}
+}
+
+%%
+% Load the `hyperref' package. We will set more options later.
+% TODO Set nice defaults for hyperref options
+\ifthenelse{\boolean{@tufte@xetex}}
+ {\RequirePackage[hyperfootnotes=false,xetex]{hyperref}}
+ {\RequirePackage[hyperfootnotes=false]{hyperref}}
+
+\hypersetup{%
+ pdfborder = {0 0 0},
+ bookmarksdepth = section,
+}
+
+%%
+% Set the font sizes and baselines to match Tufte's books
+\renewcommand\normalsize{%
+ \@setfontsize\normalsize\@xpt{14}%
+ \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
+ \abovedisplayshortskip \z@ \@plus3\p@
+ \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
+ \belowdisplayskip \abovedisplayskip
+ \let\@listi\@listI}
+\normalbaselineskip=14pt
+\normalsize
+\renewcommand\small{%
+ \@setfontsize\small\@ixpt{12}%
+ \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
+ \abovedisplayshortskip \z@ \@plus2\p@
+ \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
+ \def\@listi{\leftmargin\leftmargini
+ \topsep 4\p@ \@plus2\p@ \@minus2\p@
+ \parsep 2\p@ \@plus\p@ \@minus\p@
+ \itemsep \parsep}%
+ \belowdisplayskip \abovedisplayskip
+}
+\renewcommand\footnotesize{%
+ \@setfontsize\footnotesize\@viiipt{10}%
+ \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
+ \abovedisplayshortskip \z@ \@plus\p@
+ \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@
+ \def\@listi{\leftmargin\leftmargini
+ \topsep 3\p@ \@plus\p@ \@minus\p@
+ \parsep 2\p@ \@plus\p@ \@minus\p@
+ \itemsep \parsep}%
+ \belowdisplayskip \abovedisplayskip
+}
+\renewcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt}
+\renewcommand\tiny{\@setfontsize\tiny\@vpt\@vipt}
+\renewcommand\large{\@setfontsize\large\@xipt{15}}
+\renewcommand\Large{\@setfontsize\Large\@xiipt{16}}
+\renewcommand\LARGE{\@setfontsize\LARGE\@xivpt{18}}
+\renewcommand\huge{\@setfontsize\huge\@xxpt{30}}
+\renewcommand\Huge{\@setfontsize\Huge\@xxivpt{36}}
+
+\setlength\leftmargini {1pc}
+\setlength\leftmarginii {1pc}
+\setlength\leftmarginiii {1pc}
+\setlength\leftmarginiv {1pc}
+\setlength\leftmarginv {1pc}
+\setlength\leftmarginvi {1pc}
+\setlength\labelsep {.5pc}
+\setlength\labelwidth {\leftmargini}
+\addtolength\labelwidth{-\labelsep}
+
+%%
+% \RaggedRight allows hyphenation
+
+\RequirePackage{ragged2e}
+\setlength{\RaggedRightRightskip}{\z@ plus 0.08\hsize}
+\setlength{\RaggedRightParindent}{1pc}
+
+% Paragraph indentation and separation for normal text
+\newcommand{\@tufte@reset@par}{%
+ \setlength{\RaggedRightParindent}{1.0pc}%
+ \setlength{\parindent}{1pc}%
+ \setlength{\parskip}{0pt}%
+}
+\@tufte@reset@par
+
+% Paragraph indentation and separation for marginal text
+\newcommand{\@tufte@margin@par}{%
+ \setlength{\RaggedRightParindent}{0.5pc}%
+ \setlength{\parindent}{0.5pc}%
+ \setlength{\parskip}{0pt}%
+}
+
+
+%%
+% Set page layout geometry
+
+\RequirePackage[letterpaper,left=1in,top=1in,headsep=2\baselineskip,textwidth=26pc,marginparsep=2pc,marginparwidth=12pc,textheight=44\baselineskip,headheight=\baselineskip]{geometry}
+
+\ifthenelse{\boolean{@tufte@afourpaper}}
+ {\geometry{a4paper,left=24.8mm,top=27.4mm,headsep=2\baselineskip,textwidth=107mm,marginparsep=8.2mm,marginparwidth=49.4mm,textheight=49\baselineskip,headheight=\baselineskip}}
+ {}
+
+\ifthenelse{\boolean{@tufte@symmetric}}
+ {}
+ {\geometry{asymmetric}}% forces internal LaTeX `twoside'
+
+
+%%
+% Separation marginpars by a line's worth of space.
+
+\setlength\marginparpush{10pt}
+
+%%
+% Font for margin items
+
+\ifthenelse{\boolean{@tufte@sfsidenotes}}
+ {\newcommand{\@tufte@marginfont}{\normalfont\footnotesize\sffamily}}
+ {\newcommand{\@tufte@marginfont}{\normalfont\footnotesize}}
+
+
+%%
+% Set the justification baesed on the `justified' class option
+
+\newcommand{\@tufte@justification}{%
+ \ifthenelse{\boolean{@tufte@justified}}%
+ {\justifying}%
+ {\RaggedRight}%
+}
+
+%%
+% Turn off section numbering
+
+\setcounter{secnumdepth}{-1}
+
+%%
+% Tighten up space between displays (e.g., a figure or table) and make symmetric
+
+\setlength\abovedisplayskip{6pt plus 2pt minus 4pt}
+\setlength\belowdisplayskip{6pt plus 2pt minus 4pt}
+
+%%
+% To implement full-width display environments
+
+\newboolean{@tufte@changepage}
+\IfFileExists{changepage.sty}{%
+ \PackageInfo{\@tufte@pkgname}{Found changepage.sty}
+ \RequirePackage[strict]{changepage}
+ \setboolean{@tufte@changepage}{true}
+}{%
+ \PackageInfo{\@tufte@pkgname}{Found chngpage.sty}
+ \RequirePackage[strict]{chngpage}
+ \setboolean{@tufte@changepage}{false}
+}
+
+% Write our own aliases for the \checkoddpage and \ifoddpage or \ifcpoddpage commands
+\newboolean{@tufte@odd@page}
+\setboolean{@tufte@odd@page}{true}
+\newcommand*{\@tufte@checkoddpage}{%
+ \checkoddpage%
+ \ifthenelse{\boolean{@tufte@changepage}}{%
+ \ifoddpage%
+ \setboolean{@tufte@odd@page}{true}%
+ \else%
+ \setboolean{@tufte@odd@page}{false}%
+ \fi%
+ }{%
+ \ifcpoddpage%
+ \setboolean{@tufte@odd@page}{true}%
+ \else%
+ \setboolean{@tufte@odd@page}{false}%
+ \fi
+ }%
+}
+
+
+% Compute lengths used for full-width displays
+
+\newlength{\@tufte@overhang}
+\setlength{\@tufte@overhang}{\marginparwidth}
+\addtolength{\@tufte@overhang}{\marginparsep}
+
+\newlength{\@tufte@fullwidth}
+\setlength{\@tufte@fullwidth}{\textwidth}
+\addtolength{\@tufte@fullwidth}{\marginparsep}
+\addtolength{\@tufte@fullwidth}{\marginparwidth}
+
+\newlength{\@tufte@caption@fill}
+\setlength{\@tufte@caption@fill}{\textwidth}
+\addtolength{\@tufte@caption@fill}{\marginparsep}
+
+
+%%
+% Modified \title, \author, and \date commands. These store the
+% (footnote-less) values in \plaintitle, \plainauthor, and \thedate, respectively.
+
+\newcommand{\plaintitle}{}% plain-text-only title
+\newcommand{\plainauthor}{}% plain-text-only author
+\newcommand{\plainpublisher}{}% plain-text-only publisher
+
+\newcommand{\thanklesstitle}{}% full title text minus \thanks{}
+\newcommand{\thanklessauthor}{}% full author text minus \thanks{}
+\newcommand{\thanklesspublisher}{}% full publisher minus \thanks{}
+
+\newcommand{\@publisher}{}% full publisher with \thanks{}
+\newcommand{\thedate}{\today}
+
+% TODO Fix it so that \thanks is not spaced out (with `soul') and can be
+% used in \maketitle when the `sfsidenotes' option is provided.
+\renewcommand{\thanks}[1]{\NoCaseChange{\footnote{#1}}}
+
+\renewcommand{\title}[2][]{%
+ \gdef\@title{#2}%
+ \begingroup%
+ % TODO store contents of \thanks command
+ \renewcommand{\thanks}[1]{}% swallow \thanks contents
+ \protected@xdef\thanklesstitle{#2}%
+ \endgroup%
+ \ifthenelse{\isempty{#1}}%
+ {\renewcommand{\plaintitle}{\thanklesstitle}}% use thankless title
+ {\renewcommand{\plaintitle}{#1}}% use provided plain-text title
+ \hypersetup{pdftitle={\plaintitle}}% set the PDF metadata title
+}
+
+\def\@author{}% default author is empty (suppresses LaTeX's ``no author'' warning)
+\renewcommand*{\author}[2][]{%
+ \gdef\@author{#2}%
+ \begingroup%
+ % TODO store contents of \thanks command
+ \renewcommand{\thanks}[1]{}% swallow \thanks contents
+ \protected@xdef\thanklessauthor{#2}%
+ \endgroup%
+ \ifthenelse{\isempty{#1}}
+ {\renewcommand{\plainauthor}{\thanklessauthor}}% use thankless author
+ {\renewcommand{\plainauthor}{#1}}% use provided plain-text author
+ \hypersetup{pdfauthor={\plainauthor}}% set the PDF metadata author
+}
+
+\renewcommand*{\date}[1]{%
+ \gdef\@date{#1}%
+ \begingroup%
+ % TODO store contents of \thanks command
+ \renewcommand{\thanks}[1]{}% swallow \thanks contents
+ \protected@xdef\thedate{#1}%
+ \endgroup%
+}
+
+%%
+% Provides a \publisher command to set the publisher
+
+\newcommand{\publisher}[2][]{%
+ \gdef\@publisher{#2}%
+ \begingroup%
+ \renewcommand{\thanks}[1]{}% swallow \thanks contents
+ \protected@xdef\thanklesspublisher{#2}%
+ \endgroup%
+ \ifthenelse{\isempty{#1}}
+ {\renewcommand{\plainpublisher}{\thanklesspublisher}}% use thankless publisher
+ {\renewcommand{\plainpublisher}{#1}}% use provided plain-text publisher
+}
+
+% TODO: Test \hypersetup{pdfauthor,pdftitle} with DVI and XeTeX
+
+%%
+% Require paralist package for tighter lists
+
+\RequirePackage{paralist}
+
+% Add rightmargin to compactenum
+
+\def\@compactenum@{%
+ \expandafter\list\csname label\@enumctr\endcsname{%
+ \usecounter{\@enumctr}%
+ \rightmargin=2em% added this
+ \parsep\plparsep
+ \itemsep\plitemsep
+ \topsep\pltopsep
+ \partopsep\plpartopsep
+ \def\makelabel##1{\hss\llap{##1}}}}
+
+%%
+% Improved letterspacing of small caps and all-caps text.
+%
+% First, try to use the `microtype' package, if it's available.
+% Failing that, try to use the `soul' package, if it's available.
+% Failing that, well, I give up.
+
+\RequirePackage{textcase} % provides \MakeTextUppercase and \MakeTextLowercase
+\def\allcapsspacing{\relax}
+\def\smallcapsspacing{\relax}
+\newcommand{\allcaps}[1]{\MakeTextUppercase{\allcapsspacing{#1}}}
+\newcommand{\smallcaps}[1]{\MakeTextLowercase{\textsc{#1}}}
+
+\newcommand{\@tufte@loadsoul}{%
+ \IfFileExists{soul.sty}{%
+ \RequirePackage{soul}
+ \sodef\allcapsspacing{\upshape}{0.15em}{0.65em}{0.6em}
+ \sodef\smallcapsspacing{\scshape}{0.075em}{0.5em}{0.6em}
+ }{
+ \PackageWarningNoLine{\@tufte@pkgname}{Couldn't locate `soul' package.}
+ }% soul not installed... giving up.
+}
+
+% If we're using pdfLaTeX v1.40+, use the letterspace package.
+% If we're using pdfLaTex < v1.40, use the soul package.
+% If we're using XeLaTeX, use XeLaTeX letterspacing options.
+% Otherwise fall back on the soul package.
+
+\ifthenelse{\boolean{@tufte@pdf}}
+ {\PackageInfo{\@tufte@pkgname}{ifpdf = true}}
+ {\PackageInfo{\@tufte@pkgname}{ifpdf = false}}
+
+\ifthenelse{\boolean{@tufte@xetex}}
+ {\PackageInfo{\@tufte@pkgname}{ifxetex = true}}
+ {\PackageInfo{\@tufte@pkgname}{ifxetex = false}}
+
+% Check pdfLaTeX version
+\def\@tufte@pdftexversion{0}
+\ifx\normalpdftexversion\@undefined \else
+ \let\pdftexversion \normalpdftexversion
+ \let\pdftexrevision\normalpdftexrevision
+ \let\pdfoutput \normalpdfoutput
+\fi
+\ifx\pdftexversion\@undefined \else
+ \ifx\pdftexversion\relax \else
+ \def\@tufte@pdftexversion{6}
+ \ifnum\pdftexversion < 140
+ \def\@tufte@pdftexversion{5}
+ \fi
+ \fi
+\fi
+
+\ifthenelse{\boolean{@tufte@letterspace}}
+ {%
+ \ifnum\@tufte@pdftexversion<6
+ % pdfLaTeX version is too old or not using pdfLaTeX
+ \ifthenelse{\boolean{@tufte@xetex}}
+ {% TODO use xetex letterspacing
+ \PackageInfo{\@tufte@pkgname}{XeTeX detected. Reverting to `soul' package for letterspacing.}
+ \@tufte@loadsoul}
+ {% use `soul' package for letterspacing
+ \PackageInfo{\@tufte@pkgname}{Old version of pdfTeX detected. Reverting to `soul' package for letterspacing.}
+ \@tufte@loadsoul}
+ \else
+ \IfFileExists{letterspace.sty}{%
+ \PackageInfo{\@tufte@pkgname}{Modern version of pdfTeX detected. Using `letterspace' package.}
+ \RequirePackage{letterspace}
+ % Set up letterspacing (using microtype package) -- requires pdfTeX v1.40+
+ \renewcommand{\allcapsspacing}[1]{\textls[200]{##1}}
+ \renewcommand{\smallcapsspacing}[1]{\textls[50]{##1}}
+ \renewcommand{\allcaps}[1]{\textls[200]{\MakeTextUppercase{##1}}}
+ \renewcommand{\smallcaps}[1]{\textsc{\MakeTextLowercase{##1}}}
+ }{% microtype failed, check for soul
+ \PackageInfo{\@tufte@pkgname}{Modern version of pdfTeX detected, but `letterspace' package not installed. Reverting to `soul' package for letterspacing.}
+ \@tufte@loadsoul
+ }
+ \fi}
+ {}
+
+
+\DeclareTextFontCommand{\textsmallcaps}{\scshape}
+\renewcommand{\textsc}[1]{\textsmallcaps{\smallcapsspacing{#1}}}
+
+
+%%
+% An environment for paragraph-style section
+
+\providecommand\newthought[1]{%
+ \addvspace{1.0\baselineskip plus 0.5ex minus 0.2ex}%
+ \noindent\textsc{#1}%
+}
+
+%%
+% Redefine the display environments (quote, quotation, etc.)
+
+\renewenvironment{verse}
+ {\let\\\@centercr
+ \list{}{\itemsep \z@
+ \itemindent -1pc%
+ \listparindent\itemindent
+ \rightmargin \leftmargin
+ \advance\leftmargin 1pc}%
+ \small%
+ \item\relax}
+ {\endlist}
+\renewenvironment{quotation}
+ {\list{}{\listparindent 1pc%
+ \itemindent \listparindent
+ \rightmargin \leftmargin
+ \parsep \z@ \@plus\p@}%
+ \small%
+ \item\relax\noindent\ignorespaces}
+ {\endlist}
+\renewenvironment{quote}
+ {\list{}{\rightmargin\leftmargin}%
+ \small%
+ \item\relax}
+ {\endlist}
+
+
+%%
+% Used for doublespacing, and other linespacing
+
+\RequirePackage{setspace}
+
+%%
+% Load the bidi package if instructed to do so. This package must be loaded
+% prior to our redefining the \footnote and \cite commands.
+
+\ifthenelse{\boolean{@tufte@loadbidi}}{\RequirePackage{bidi}}{}
+
+
+%%
+% A function that removes leading and trailling spaces from the supplied macro.
+% Based on code written by Michael Downes (See ``Around the Bend'', #15.)
+% Executing \@tufte@trim@spaces\xyzzy will result in the contents of \xyzzy
+% being trimmed of leading and trailing white space.
+
+\catcode`\Q=3
+\def\@tufte@trim@spaces#1{%
+ % Use grouping to emulate a multi-token afterassignment queue
+ \begingroup%
+ % Put `\toks 0 {' into the afterassignment queue
+ \aftergroup\toks\aftergroup0\aftergroup{%
+ % Apply \trimb to the replacement text of #1, adding a leading
+ % \noexpand to prevent brace stripping and to serve another purpose
+ % later.
+ \expandafter\@tufte@trim@b\expandafter\noexpand#1Q Q}%
+ % Transfer the trimmed text back into #1.
+ \edef#1{\the\toks0}%
+}
+
+% \trimb removes a trailing space if present, then calls \@tufte@trim@c to
+% clean up any leftover bizarre Qs, and trim a leading space. In
+% order for \trimc to work properly we need to put back a Q first.
+\def\@tufte@trim@b#1 Q{\@tufte@trim@c#1Q}
+
+% Execute \vfuzz assignment to remove leading space; the \noexpand
+% will now prevent unwanted expansion of a macro or other expandable
+% token at the beginning of the trimmed text. The \endgroup will feed
+% in the \aftergroup tokens after the \vfuzz assignment is completed.
+\def\@tufte@trim@c#1Q#2{\afterassignment\endgroup \vfuzz\the\vfuzz#1}
+\catcode`\Q=11
+
+%%
+% Citations should go in the margin as sidenotes
+
+\RequirePackage[numbers]{natbib}
+\RequirePackage{bibentry} % allows bibitems to be typeset outside thebibliography environment
+% Redefine the \BR@b@bibitem command to fix a bug with bibentry+chicago style
+\renewcommand\BR@b@bibitem[2][]{%
+ \ifthenelse{\isempty{#1}}%
+ {\BR@bibitem{#2}}%
+ {\BR@bibitem[#1]{#2}}%
+ \BR@c@bibitem{#2}%
+}
+\nobibliography* % pre-loads the bibliography keys
+\providecommand{\doi}[1]{\textsc{doi:} #1}% pre-defining this so it may be used before the \bibliography command it issued
+
+%%
+% Normal \cite behavior
+\newcounter{@tufte@num@bibkeys}%
+\newcommand{\@tufte@normal@cite}[2][0pt]{%
+ % Snag the last bibentry in the list for later comparison
+ \let\@temp@last@bibkey\@empty%
+ \@for\@temp@bibkey:=#2\do{\let\@temp@last@bibkey\@temp@bibkey}%
+ \sidenote[][#1]{%
+ % Loop through all the bibentries, separating them with semicolons and spaces
+ \setcounter{@tufte@num@bibkeys}{0}%
+ \@for\@temp@bibkeyx:=#2\do{%
+ \ifthenelse{\equal{\@temp@last@bibkey}{\@temp@bibkeyx}}%
+ {\ifthenelse{\equal{\value{@tufte@num@bibkeys}}{0}}{}{and\ }%
+ \@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey
+ \bibentry{\@temp@bibkeyx}}%
+ {\@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey
+ \bibentry{\@temp@bibkeyx};\ }%
+ \stepcounter{@tufte@num@bibkeys}%
+ }%
+ }%
+}
+
+
+%%
+% Macros for holding the list of cite keys until after the \sidenote
+
+\gdef\@tufte@citations{}% list of cite keys
+\newcommand\@tufte@add@citation[1]{\relax% adds a new bibkey to the list of cite keys
+ \ifx\@tufte@citations\@empty\else
+ \g@addto@macro\@tufte@citations{,}% separate by commas
+ \fi
+ \g@addto@macro\@tufte@citations{#1}
+}
+
+\newcommand{\@tufte@print@citations}[1][0pt]{% puts the citations in a margin note
+ % Snag the last bibentry in the list for later comparison
+ \let\@temp@last@bibkey\@empty%
+ \@for\@temp@bibkey:=\@tufte@citations\do{\let\@temp@last@bibkey\@temp@bibkey}%
+ \marginpar{%
+ \hbox{}\vspace*{#1}%
+ \@tufte@marginfont%
+ \@tufte@justification%
+ \@tufte@margin@par% use parindent and parskip settings for marginal text
+ \vspace*{-1\baselineskip}%
+ % Loop through all the bibentries, separating them with semicolons and spaces
+ \setcounter{@tufte@num@bibkeys}{0}%
+ \@for\@temp@bibkeyx:=\@tufte@citations\do{%
+ \ifthenelse{\equal{\@temp@last@bibkey}{\@temp@bibkeyx}}%
+ {\ifthenelse{\equal{\value{@tufte@num@bibkeys}}{0}}{}{and\ }%
+ \@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey
+ \bibentry{\@temp@bibkeyx}}%
+ {\@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey
+ \bibentry{\@temp@bibkeyx};\ }%
+ \stepcounter{@tufte@num@bibkeys}%
+ }%
+ \@tufte@reset@par% use parindent and parskip settings for body text
+ }%
+}
+
+%%
+% \cite behavior when executed within a sidenote
+
+\newcommand{\@tufte@sidenote@citations}{}% contains list of \cites in sidenote
+\newcommand{\@tufte@infootnote@cite}[1]{%
+ \@tufte@add@citation{#1}
+}
+
+%%
+% Set the default \cite style. This is set and reset by the \sidenote command.
+
+\let\cite\@tufte@normal@cite
+
+%%
+% Transform existing \footnotes into \sidenotes
+% Sidenote: ``Where God meant footnotes to go.'' ---Tufte
+
+\RequirePackage{optparams}% for our new sidenote commands -- provides multiple optional arguments for commands
+
+\providecommand*{\footnotelayout}{\@tufte@marginfont\@tufte@justification}
+\renewcommand{\footnotelayout}{\@tufte@marginfont\@tufte@justification}
+
+% Override footmisc's definition to set the sidenote marks (numbers) inside the
+% sidenote's text block.
+\long\def\@makefntext#1{\@textsuperscript{\@tufte@marginfont\tiny\@thefnmark}\,\footnotelayout#1}
+
+% Set the in-text footnote mark in the same typeface as the body text itself.
+\def\@makefnmark{\hbox{\@textsuperscript{\normalfont\footnotesize\@thefnmark}}}
+
+\providecommand*{\multiplefootnotemarker}{3sp}
+\providecommand*{\multfootsep}{,}
+
+\renewcommand*\@footnotemark{%
+ \leavevmode%
+ \ifhmode%
+ \edef\@x@sf{\the\spacefactor}%
+ \@tufte@check@multiple@sidenotes%
+ \nobreak%
+ \fi%
+ \@makefnmark%
+ \ifhmode\spacefactor\@x@sf\fi%
+ \relax%
+}
+
+\newcommand{\@tufte@check@multiple@sidenotes}{%
+ \ifdim\lastkern=\multiplefootnotemarker\relax%
+ \edef\@x@sf{\the\spacefactor}%
+ \unkern%
+ \textsuperscript{\multfootsep}%
+ \spacefactor\@x@sf\relax%
+ \fi
+}
+
+\renewcommand\@footnotetext[2][0pt]{%
+ \marginpar{%
+ \hbox{}\vspace*{#1}%
+ \def\baselinestretch {\setspace@singlespace}%
+ \ifthenelse{\boolean{@tufte@loadbidi}}{\if@rl@footnote\@rltrue\else\@rlfalse\fi}{}%
+ \reset@font\footnotesize%
+ \@tufte@margin@par% use parindent and parskip settings for marginal text
+ \vspace*{-1\baselineskip}\noindent%
+ \protected@edef\@currentlabel{%
+ \csname p@footnote\endcsname\@thefnmark%
+ }%
+ \color@begingroup%
+ \@makefntext{%
+ \ignorespaces#2%
+ }%
+ \color@endgroup%
+ }%
+ \@tufte@reset@par% use parindent and parskip settings for body text
+}%
+
+%
+% Define \sidenote command. Can handle \cite.
+
+\newcommand{\@tufte@sidenote@vertical@offset}{0pt}
+
+% #1 = footnote num, #2 = vertical offset, #3 = footnote text
+\long\def\@tufte@sidenote[#1][#2]#3{%
+ \let\cite\@tufte@infootnote@cite% use the in-sidenote \cite command
+ \gdef\@tufte@citations{}% clear out any old citations
+ \ifthenelse{\NOT\isempty{#2}}{\renewcommand{\@tufte@sidenote@vertical@offset}{#2}}{}%
+ \ifthenelse{\isempty{#1}}{%
+ % no specific footnote number provided
+ \stepcounter\@mpfn%
+ \protected@xdef\@thefnmark{\thempfn}%
+ \@footnotemark\@footnotetext[\@tufte@sidenote@vertical@offset]{#3}%
+ }{%
+ % specific footnote number provided
+ \begingroup%
+ \csname c@\@mpfn\endcsname #1\relax%
+ \unrestored@protected@xdef\@thefnmark{\thempfn}%
+ \endgroup%
+ \@footnotemark\@footnotetext[\@tufte@sidenote@vertical@offset]{#3}%
+ }%
+ \@tufte@print@citations% print any citations
+ \let\cite\@tufte@normal@cite% go back to using normal in-text \cite command
+ \unskip\ignorespaces% remove extra white space
+ \kern-\multiplefootnotemarker% remove \kern left behind by sidenote
+ \kern\multiplefootnotemarker\relax% add new \kern here to replace the one we yanked
+}
+
+\newcommand*{\sidenote}{\optparams{\@tufte@sidenote}{[][0pt]}}
+\renewcommand*{\footnote}{\optparams{\@tufte@sidenote}{[][0pt]}}
+
+%%
+% Sidenote without the footnote mark
+
+\newcommand\marginnote[2][0pt]{%
+ \let\cite\@tufte@infootnote@cite% use the in-sidenote \cite command
+ \gdef\@tufte@citations{}% clear out any old citations
+ \@tufte@margin@par% use parindent and parskip settings for marginal text
+ \marginpar{\hbox{}\vspace*{#1}\@tufte@marginfont\@tufte@justification\vspace*{-1\baselineskip}\noindent #2}%
+ \@tufte@reset@par% use parindent and parskip settings for body text
+ \@tufte@print@citations% print any citations
+ \let\cite\@tufte@normal@cite% go back to using normal in-text \cite command
+}
+
+
+%%
+% The placeins package provides the \FloatBarrier command. This forces
+% LaTeX to place all of the floats before proceeding. We'll use this to
+% keep the float (figure and table) numbers in sequence.
+\RequirePackage{placeins}
+
+%%
+% Margin float environment
+
+\newsavebox{\@tufte@margin@floatbox}
+\newenvironment{@tufte@margin@float}[2][-1.2ex]%
+ {\FloatBarrier% process all floats before this point so the figure/table numbers stay in order.
+ \begin{lrbox}{\@tufte@margin@floatbox}%
+ \begin{minipage}{\marginparwidth}%
+ \@tufte@marginfont%
+ \def\@captype{#2}%
+ \hbox{}\vspace*{#1}%
+ \@tufte@justification%
+ \@tufte@margin@par%
+ \noindent%
+ }
+ {\end{minipage}%
+ \end{lrbox}%
+ \marginpar{\usebox{\@tufte@margin@floatbox}}%
+ \@tufte@reset@par%
+ }
+
+
+%%
+% Margin figure environment
+
+\newenvironment{marginfigure}[1][-1.2ex]%
+ {\begin{@tufte@margin@float}[#1]{figure}}
+ {\end{@tufte@margin@float}}
+
+
+%%
+% Margin table environment
+\newenvironment{margintable}[1][-1.2ex]%
+ {\begin{@tufte@margin@float}[#1]{table}}
+ {\end{@tufte@margin@float}}
+
+
+%%
+% A collection of macros to be used with the new Tufte-style float environments
+
+\newcommand{\floatalignment}{x}% holds the current float alignment (t, b, h, p)
+\newcommand{\setfloatalignment}[1]{\renewcommand{\floatalignment}{#1}}% manually sets the float alignment
+
+% Boxes to temporarily store our float and caption
+\newsavebox{\@tufte@figure@box}
+\newsavebox{\@tufte@caption@box}
+
+% Save original LaTeX float environment
+\let\@tufte@orig@float\@float
+\let\@tufte@orig@endfloat\end@float
+
+% Save original LaTeX \caption and \label commands
+\AtBeginDocument{%
+ \let\@tufte@orig@caption\caption%
+ \let\@tufte@orig@label\label%
+}
+
+% Store the caption and label contents
+\newcommand{\@tufte@stored@shortcaption}{}
+\newcommand{\@tufte@stored@caption}{}
+\newcommand{\@tufte@stored@label}{}
+
+\newcommand{\@tufte@caption}[2][]{%
+ \ifthenelse{\isempty{#1}}
+ {\gdef\@tufte@stored@shortcaption{#2}}%
+ {\gdef\@tufte@stored@shortcaption{#1}}%
+ \gdef\@tufte@stored@caption{#2}%
+}
+
+\newcommand{\@tufte@label}[1]{%
+ \gdef\@tufte@stored@label{#1}%
+}
+
+\newcommand{\@tufte@fps}{}
+
+% TODO make sure new caption and figure code can handle [p] and [h] placements well
+% TODO handle the symmetric class option (move caption to other side of verso pages)
+
+%%
+% Define a float environment to place the captions in the margin space
+
+\newenvironment{@tufte@float}[2][htbp]
+ {% If the float placement specifier is 'b' and only 'b', then bottom-align the mini-pages, otherwise top-align them.
+ \renewcommand{\@tufte@fps}{#1}%
+ \ifthenelse{\equal{#1}{b}\OR\equal{#1}{B}}%
+ {\renewcommand{\floatalignment}{b}}%
+ {\renewcommand{\floatalignment}{t}}%
+ \renewcommand{\caption}[2][]{\@tufte@caption[##1]{##2}}%
+ \renewcommand{\label}[1]{\@tufte@label{##1}}%
+ \@tufte@orig@float{#2}[#1]%
+ \begin{lrbox}{\@tufte@figure@box}%
+ \begin{minipage}[\floatalignment]{\textwidth}\hbox{}%
+ }
+ {% end @tufte@float
+ \par\hbox{}\vspace{-\baselineskip}\ifthenelse{\prevdepth>0}{\vspace{-\prevdepth}}{}% align baselines of boxes
+ \end{minipage}%
+ \end{lrbox}%
+ % build the caption box
+ \begin{lrbox}{\@tufte@caption@box}%
+ \begin{minipage}[\floatalignment]{\marginparwidth}\hbox{}%
+ \ifthenelse{\NOT\equal{\@tufte@stored@caption}{}}{\@tufte@orig@caption[\@tufte@stored@shortcaption]{\@tufte@stored@caption}}{}%
+ \ifthenelse{\NOT\equal{\@tufte@stored@label}{}}{\@tufte@orig@label{\@tufte@stored@label}}{}%
+ \par\vspace{-\prevdepth}%% TODO: DOUBLE-CHECK FOR SAFETY
+ \end{minipage}%
+ \end{lrbox}%
+ % now typeset the stored boxes
+ \begin{fullwidth}%
+ \begin{minipage}[\floatalignment]{\linewidth}%
+ \@tufte@checkoddpage%
+ \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@odd@page}}{%
+ % asymmetric or page is odd, so caption is on the right
+ \usebox{\@tufte@figure@box}%
+ \hspace{\marginparsep}%
+ \smash{\usebox{\@tufte@caption@box}}%
+ }{%
+ % symmetric pages and page is even, so caption is on the left
+ \strut\smash{\usebox{\@tufte@caption@box}}%
+ \hspace{\marginparsep}%
+ \usebox{\@tufte@figure@box}%
+ }%
+ \end{minipage}%
+ \end{fullwidth}%
+ \@tufte@orig@endfloat%
+ % reset commands and temp boxes and captions
+ \let\caption\@tufte@orig@caption%
+ \let\label\@tufte@orig@label%
+ \begin{lrbox}{\@tufte@figure@box}\hbox{}\end{lrbox}%
+ \begin{lrbox}{\@tufte@caption@box}\hbox{}\end{lrbox}%
+ \gdef\@tufte@stored@shortcaption{}%
+ \gdef\@tufte@stored@caption{}%
+ }
+
+%%
+% Redefine the figure environment to place the captions in the margin space
+
+\renewenvironment{figure}[1][htbp]
+ {\begin{@tufte@float}[#1]{figure}}
+ {\end{@tufte@float}}
+
+
+%%
+% Redefine the table environment to place the captions in the margin space
+
+\renewenvironment{table}[1][htbp]
+ {\begin{@tufte@float}[#1]{table}}
+ {\end{@tufte@float}}
+
+
+%%
+% Full-width figures and tables
+
+\newenvironment{@tufte@float@star}[2][htbp]%
+ {% begin
+ % If the float placement specifier is 'b' and only 'b', then place the caption above the figure, else place the caption below the figure.
+ \renewcommand{\@tufte@fps}{#1}%
+ \ifthenelse{\equal{#1}{b}\OR\equal{#1}{B}}%
+ {\renewcommand{\floatalignment}{b}}%
+ {\renewcommand{\floatalignment}{t}}%
+ \renewcommand{\caption}[2][]{\@tufte@caption[##1]{##2}}%
+ \renewcommand{\label}[1]{\@tufte@label{##1}}%
+ \@tufte@orig@float{#2}[#1]%
+ \begin{lrbox}{\@tufte@figure@box}%
+ \begin{minipage}[\floatalignment]{\textwidth}\hbox{}%
+ \begin{fullwidth}
+ }%
+ {% end figure*
+ \par\hbox{}\vspace{-\baselineskip}\ifthenelse{\prevdepth>0}{\vspace{-\prevdepth}}{}% align baselines of boxes
+ \end{fullwidth}%
+ \end{minipage}%
+ \end{lrbox}%
+ % build the caption box
+ % TODO use \captionaboveskip and \captionbelowskip for spacing between caption and figure boxes
+ \begin{lrbox}{\@tufte@caption@box}%
+ \begin{minipage}[\floatalignment]{\marginparwidth}\hbox{}%
+ \ifthenelse{\NOT\equal{\@tufte@stored@caption}{}}{\@tufte@orig@caption[\@tufte@stored@shortcaption]{\@tufte@stored@caption}}{}%
+ \ifthenelse{\NOT\equal{\@tufte@stored@label}{}}{\@tufte@orig@label{\@tufte@stored@label}}{}%
+ \par\vspace{-\prevdepth}%% TODO: DOUBLE-CHECK FOR SAFETY
+ \end{minipage}%
+ \end{lrbox}%
+ % now typeset the stored boxes
+ \@tufte@checkoddpage%
+ \begin{fullwidth}%
+ \begin{minipage}[\floatalignment]{\linewidth}%
+ \ifthenelse{\equal{\floatalignment}{b}}
+ {% place caption above figure
+ \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@odd@page}}
+ {% caption on the right
+ \hfill\smash{\usebox{\@tufte@caption@box}}%
+ \par\usebox{\@tufte@figure@box}%
+ }{% caption on the left
+ \smash{\usebox{\@tufte@caption@box}}\hfill\null%
+ \par\hspace{\@tufte@overhang}\usebox{\@tufte@figure@box}%
+ }%
+ }
+ {% place caption below figure
+ \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@odd@page}}
+ {% caption on the right
+ \usebox{\@tufte@figure@box}\par%
+ \hspace{\@tufte@caption@fill}\smash{\usebox{\@tufte@caption@box}}%
+ }{% caption on the left
+ \null\hspace{\@tufte@overhang}\usebox{\@tufte@figure@box}\par%
+ \smash{\usebox{\@tufte@caption@box}}\hfill%
+ }%
+ }
+ \end{minipage}%
+ \end{fullwidth}%
+ \@tufte@orig@endfloat%
+ % reset commands and temp boxes and captions
+ \let\caption\@tufte@orig@caption%
+ \let\label\@tufte@orig@label%
+ \begin{lrbox}{\@tufte@figure@box}\hbox{}\end{lrbox}
+ \begin{lrbox}{\@tufte@caption@box}\hbox{}\end{lrbox}
+ \gdef\@tufte@stored@shortcaption{}
+ \gdef\@tufte@stored@caption{}
+ }
+
+
+%%
+% Full-width figure
+
+\renewenvironment{figure*}[1][htbp]%
+ {\begin{@tufte@float@star}[#1]{figure}}
+ {\end{@tufte@float@star}}
+
+
+%%
+% Full-width table
+
+\renewenvironment{table*}[1][htbp]%
+ {\begin{@tufte@float@star}[#1]{table}}
+ {\end{@tufte@float@star}}
+
+
+%%
+% Full-page-width area
+
+\newenvironment{fullwidth}
+ {\ifthenelse{\boolean{@tufte@symmetric}}
+ {\ifthenelse{\boolean{@tufte@changepage}}{\begin{adjustwidth*}{}{-\@tufte@overhang}}{\begin{adjustwidth}[]{}{-\@tufte@overhang}}}
+ {\begin{adjustwidth}{}{-\@tufte@overhang}}%
+ }
+ {\ifthenelse{\boolean{@tufte@symmetric}}
+ {\ifthenelse{\boolean{@tufte@changepage}}{\end{adjustwidth*}}{\end{adjustwidth}}}
+ {\end{adjustwidth}}
+ }
+
+%%
+% Format the captions in a style similar to the sidenotes
+
+\long\def\@caption#1[#2]#3{%
+ \par%
+ \addcontentsline{\csname ext@#1\endcsname}{#1}%
+ {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \@tufte@marginfont\@tufte@justification%
+ \noindent\csname fnum@#1\endcsname: \ignorespaces#3\par
+ %\@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \endgroup}
+
+%%
+% If we're NOT using XeLaTeX and the `nofonts' class option was NOT provided,
+% we should load the Palatino, Helvetica, and Bera Mono fonts (if they are
+% installed.)
+
+\ifthenelse{\boolean{@tufte@loadfonts}\AND\NOT\boolean{@tufte@xetex}}{%
+ \IfFileExists{mathpazo.sty}{\RequirePackage[osf,sc]{mathpazo}}{}
+ \IfFileExists{helvet.sty}{\RequirePackage[scaled=0.90]{helvet}}{}
+ \IfFileExists{beramono.sty}{\RequirePackage[scaled=0.85]{beramono}}{}
+ \RequirePackage[T1]{fontenc}
+ \RequirePackage{textcomp}
+}{}
+
+
+%%
+% Turns newlines into spaces. Based on code from the `titlesec' package.
+
+\DeclareRobustCommand{\@tufte@newlinetospace}{%
+ \@ifstar{\@tufte@newlinetospace@i}{\@tufte@newlinetospace@i}%
+}
+
+\def\@tufte@newlinetospace@i{%
+ \ifdim\lastskip>\z@\else\space\fi
+ \ignorespaces%
+}
+
+\DeclareRobustCommand{\newlinetospace}[1]{%
+ \let\@tufte@orig@cr\\% save the original meaning of \\
+ \def\\{\@tufte@newlinetospace}% turn \\ and \\* into \space
+ \let\newline\\% turn \newline into \space
+ #1%
+ \let\\\@tufte@orig@cr% revert to original meaning of \\
+}
+
+
+%%
+% Sets up the running heads and folios.
+
+\RequirePackage{fancyhdr}
+
+% Set the default page style to 'fancy'
+\pagestyle{fancy}
+
+% Set the header/footer width to be the body text block plus the margin
+% note area.
+\ifthenelse{\boolean{@tufte@symmetric}}
+ {\fancyhfoffset[LE,RO]{\@tufte@overhang}}
+ {\fancyhfoffset[RE,RO]{\@tufte@overhang}}
+
+% The running heads/feet don't have rules
+\renewcommand{\headrulewidth}{0pt}
+\renewcommand{\footrulewidth}{0pt}
+
+% The 'fancy' page style is the default style for all pages.
+\fancyhf{} % clear header and footer fields
+\ifthenelse{\boolean{@tufte@twoside}}
+ {\fancyhead[LE]{\thepage\quad\smallcaps{\newlinetospace{\plainauthor}}}%
+ \fancyhead[RO]{\smallcaps{\newlinetospace{\plaintitle}}\quad\thepage}}
+ {\fancyhead[RE,RO]{\smallcaps{\newlinetospace{\plaintitle}}\quad\thepage}}
+
+
+% The `plain' page style is used on chapter opening pages.
+% In Tufte's /Beautiful Evidence/ he never puts page numbers at the
+% bottom of pages -- the folios are unexpressed.
+\fancypagestyle{plain}{
+ \fancyhf{} % clear header and footer fields
+ % Uncomment the following five lines of code if you want the opening page
+ % of the chapter to express the folio in the lower outside corner.
+ %\ifthenelse{\boolean{@tufte@twoside}}
+ % {\fancyfoot[LE,RO]{\thepage}}
+ % {\fancyfoot[RE,RO]{\thepage}}
+}
+
+% The `empty' page style suppresses all headers and footers.
+% It's used on title pages and `intentionally blank' pages.
+\fancypagestyle{empty}{
+ \fancyhf{} % clear header and footer fields
+}
+
+
+%%
+% Set raggedright and paragraph indentation for document
+
+\AtBeginDocument{\@tufte@justification}
+
+
+%%
+% Prints the list of class options and their states.
+
+\newcommand{\typeoutbool}[2]{%
+ \ifthenelse{\boolean{#2}}
+ {\typeout{\space\space#1: true}}
+ {\typeout{\space\space#1: false}}
+}
+
+\newcommand{\typeoutstr}[2]{%
+ \typeout{\space\space#1: #2}
+}
+
+\newcommand{\PrintTufteSettings}{%
+ \typeout{-------------------- Tufte-LaTeX settings ----------}
+ \typeout{Class: \@tufte@pkgname}
+ \typeout{}
+ \typeout{Class options:}
+ \typeoutbool{a4paper}{@tufte@afourpaper}
+ \typeoutbool{load fonts}{@tufte@loadfonts}
+ \typeoutbool{fully-justified}{@tufte@justified}
+ \typeoutbool{letterspacing}{@tufte@letterspace}
+ \typeoutbool{sans-serif sidenotes}{@tufte@sfsidenotes}
+ \typeoutbool{symmetric margins}{@tufte@symmetric}
+ \typeoutbool{titlepage}{@tufte@titlepage}
+ \typeoutbool{twoside}{@tufte@twoside}
+ \typeoutbool{debug}{@tufte@debug}
+ \typeout{}
+ \typeout{Internal variables:}
+ \typeoutbool{[twoside]}{@twoside}
+ \typeoutbool{pdflatex}{@tufte@pdf}
+ \typeoutbool{xelatex}{@tufte@xetex}
+ \typeout{----------------------------------------------------}
+}
+
+
+
+%%
+% Color
+\RequirePackage[usenames,dvipsnames,svgnames]{xcolor}
+
+%%
+% Produces a full title page
+
+\newcommand{\maketitlepage}[0]{%
+ \cleardoublepage%
+ {%
+ \sffamily%
+ \begin{fullwidth}%
+ \fontsize{18}{20}\selectfont\par\noindent\textcolor{darkgray}{\allcaps{\thanklessauthor}}%
+ \vspace{11.5pc}%
+ \fontsize{36}{40}\selectfont\par\noindent\textcolor{darkgray}{\allcaps{\thanklesstitle}}%
+ \vfill%
+ \fontsize{14}{16}\selectfont\par\noindent\allcaps{\thanklesspublisher}%
+ \end{fullwidth}%
+ }
+ \thispagestyle{empty}%
+ \clearpage%
+}
+
+%%
+% Title block
+
+\renewcommand{\maketitle}{%
+ \newpage
+ \global\@topnum\z@% prevent floats from being placed at the top of the page
+ \begingroup
+ \setlength{\parindent}{0pt}
+ \setlength{\parskip}{4pt}
+ \ifthenelse{\boolean{@tufte@sfsidenotes}}
+ {\begingroup
+ % FIXME fails with \thanks
+ \sffamily
+ \par{\LARGE\allcaps{\@title}}
+ \ifthenelse{\equal{\@author}{}}{}{\par{\Large\allcaps{\@author}}}
+ \ifthenelse{\equal{\@date}{}}{}{\par{\Large\allcaps{\@date}}}
+ \endgroup}
+ {\begingroup
+ \par{\LARGE\textit{\@title}}
+ \ifthenelse{\equal{\@author}{}}{}{\par{\Large\textit{\@author}}}
+ \ifthenelse{\equal{\@date}{}}{}{\par{\Large\textit{\@date}}}
+ \endgroup}
+ \par
+ \endgroup
+ \thispagestyle{plain}% suppress the running head
+}
+
+
+%%
+% Title page (if the `titlepage' option was passed to the tufte-handout
+% class.)
+
+\ifthenelse{\boolean{@tufte@titlepage}}
+ {\renewcommand{\maketitle}{\maketitlepage}}
+ {}
+
+%%
+% When \cleardoublepage is called, produce a blank (empty) page -- i.e.,
+% without headers and footers
+\def\cleardoublepage{\clearpage\if@twoside\ifodd\c@page\else
+ \hbox{}
+ %\vspace*{\fill}
+ %\begin{center}
+ % This page intentionally contains only this sentence.
+ %\end{center}
+ %\vspace{\fill}
+ \thispagestyle{empty}
+ \newpage
+ \if@twocolumn\hbox{}\newpage\fi\fi\fi}
+
+%%
+% Make Tuftian-style section headings and TOC formatting
+
+\RequirePackage{titlesec,titletoc}
+
+\titleformat{\chapter}%
+ [display]% shape
+ {\relax\ifthenelse{\NOT\boolean{@tufte@symmetric}}{\begin{fullwidth}}{}}% format applied to label+text
+ {\itshape\huge\thechapter}% label
+ {0pt}% horizontal separation between label and title body
+ {\huge\rm\itshape}% before the title body
+ [\ifthenelse{\NOT\boolean{@tufte@symmetric}}{\end{fullwidth}}{}]% after the title body
+
+\titleformat{\section}%
+ [hang]% shape
+ {\normalfont\Large\itshape}% format applied to label+text
+ {\thesection}% label
+ {1em}% horizontal separation between label and title body
+ {}% before the title body
+ []% after the title body
+
+\titleformat{\subsection}%
+ [hang]% shape
+ {\normalfont\large\itshape}% format applied to label+text
+ {\thesubsection}% label
+ {1em}% horizontal separation between label and title body
+ {}% before the title body
+ []% after the title body
+
+\titleformat{\paragraph}%
+ [runin]% shape
+ {\normalfont\itshape}% format applied to label+text
+ {\theparagraph}% label
+ {1em}% horizontal separation between label and title body
+ {}% before the title body
+ []% after the title body
+
+
+\titlespacing*{\chapter}{0pt}{50pt}{40pt}
+\titlespacing*{\section}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
+\titlespacing*{\subsection}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus.2ex}
+
+% Subsubsection and following section headings shouldn't be used.
+% See Bringhurst's _The Elements of Typography_, section 4.2.2.
+\renewcommand\subsubsection{%
+ \PackageError{\@tufte@pkgname}{\noexpand\subsubsection is undefined by this class.%
+ \MessageBreak See Robert Bringhurst's _The Elements of
+ \MessageBreak Typographic Style_, section 4.2.2.
+ \MessageBreak \noexpand\subsubsection was used}
+ {From Bringhurst's _The Elements of Typographic Style_, section 4.2.2: Use as
+ \MessageBreak many levels of headings as you need, no more and no fewer. Also see the many
+ \MessageBreak related threads on Ask E.T. at http://www.edwardtufte.com/.}
+}
+
+%\renewcommand\paragraph{%
+% \PackageError{\@tufte@pkgname}{\noexpand\paragraph is undefined by this class.%
+% \MessageBreak See Robert Bringhurst's _The Elements of
+% \MessageBreak Typographic Style_, section 4.2.2.
+% \MessageBreak \noexpand\paragraph was used}
+% {From Bringhurst's _The Elements of Typographic Style_, section 4.2.2: Use as
+% \MessageBreak many levels of headings as you need, no more and no fewer. Also see the many
+% \MessageBreak related threads on Ask E.T. at http://www.edwardtufte.com/.}
+%}
+
+\renewcommand\subparagraph{%
+ \PackageError{\@tufte@pkgname}{\noexpand\subparagraph is undefined by this class.%
+ \MessageBreak See Robert Bringhurst's _The Elements of
+ \MessageBreak Typographic Style_, section 4.2.2.
+ \MessageBreak \noexpand\subparagraph was used}
+ {From Bringhurst's _The Elements of Typographic Style_, section 4.2.2: Use as
+ \MessageBreak many levels of headings as you need, no more and no fewer. Also see the many
+ \MessageBreak related threads on Ask E.T. at http://www.edwardtufte.com/.}
+}
+
+
+% Formatting for main TOC (printed in front matter)
+% {section} [left] {above} {before w/label} {before w/o label} {filler + page} [after]
+\ifthenelse{\boolean{@tufte@toc}}
+ {\titlecontents{chapter}%
+ [0em] % distance from left margin
+ {\begin{fullwidth}\fontsize{13pt}{18pt}\selectfont} % above (global formatting of entry)
+ {\contentslabel{2em}\rm\itshape} % before w/label (label = ``Chapter 1'')
+ {\rm\itshape} % before w/o label
+ {\rm\qquad\thecontentspage} % filler + page (leaders and page num)
+ [\vspace{1.5\baselineskip}\end{fullwidth}] % after
+ }
+ {}
+
+%\titlecontents{chapter}%
+% [0em]% distance from left margin
+% {\fontsize{12pt}{18pt}\selectfont}% above (global formatting of entry)
+% {\textit}% before w/ label (label = ``Chapter 1'')
+% {\textit}% before w/o label
+% {\qquad\thecontentspage}% filler and page (leaders and page num)
+% [\vspace{1.5\baselineskip}]% after
+
+
+
+%%
+% A handy command to disable hyphenation for short bits of text.
+% Borrowed from Peter Wilson's `hyphenat' package.
+
+\newlanguage\langwohyphens% define a language without hyphenation rules
+\newcommand{\nohyphens}[1]{{\language\langwohyphens #1}}% used for short bits of text
+\newcommand{\nohyphenation}{\language\langwohyphens}% can be used inside environments for longer text
+
+%%
+% The bibliography environment
+
+\setlength\bibindent{1.5em}
+\renewenvironment{thebibliography}[1]
+ {%
+ \ifthenelse{\equal{\@tufte@class}{book}}%
+ {\chapter{\bibname}}%
+ {\section*{\refname}}%
+% \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
+ \list{\@biblabel{\@arabic\c@enumiv}}%
+ {\settowidth\labelwidth{\@biblabel{#1}}%
+ \leftmargin\labelwidth
+ \advance\leftmargin\labelsep
+ \@openbib@code
+ \usecounter{enumiv}%
+ \let\p@enumiv\@empty
+ \renewcommand\theenumiv{\@arabic\c@enumiv}}%
+ \sloppy
+ \clubpenalty4000
+ \@clubpenalty \clubpenalty
+ \widowpenalty4000%
+ \sfcode`\.\@m%
+ }
+ {%
+ \def\@noitemerr
+ {\@latex@warning{Empty `thebibliography' environment}}%
+ \endlist%
+ }
+\renewcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
+
+
+%%
+% An index environment to mimic Tufte's indexes
+
+\RequirePackage{multicol}
+\renewenvironment{theindex}
+ {\begin{fullwidth}%
+ \small%
+ \ifthenelse{\equal{\@tufte@class}{book}}%
+ {\chapter{\indexname}}%
+ {\section*{\indexname}}%
+ \parskip0pt%
+ \parindent0pt%
+ \let\item\@idxitem%
+ \begin{multicols}{3}%
+ }
+ {\end{multicols}%
+ \end{fullwidth}%
+ }
+\renewcommand\@idxitem{\par\hangindent 2em}
+\renewcommand\subitem{\par\hangindent 3em\hspace*{1em}}
+\renewcommand\subsubitem{\par\hangindent 4em\hspace*{2em}}
+\renewcommand\indexspace{\par\addvspace{1.0\baselineskip plus 0.5ex minus 0.2ex}\relax}%
+\newcommand{\lettergroup}[1]{}% swallow the letter heading in the index
+
+
+%%
+% If debugging is enabled, print the Tufte-LaTeX options and the list of
+% files.
+
+\ifthenelse{\boolean{@tufte@debug}}
+ {\PrintTufteSettings\listfiles}
+ {}
+
+
+%%
+% If there is a `tufte-common-local.tex' file, load it up.
+
+\IfFileExists{tufte-common-local.tex}
+ {\input{tufte-common-local}}
+ {}
+
+
+%%
+% End of file
+\endinput
+
diff --git a/Master/texmf-dist/source/latex/tufte-latex/tufte-handout.cls b/Master/texmf-dist/source/latex/tufte-latex/tufte-handout.cls
index 8075ec3c164..ca9ab630829 100644
--- a/Master/texmf-dist/source/latex/tufte-latex/tufte-handout.cls
+++ b/Master/texmf-dist/source/latex/tufte-latex/tufte-handout.cls
@@ -1,552 +1,50 @@
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
-\ProvidesClass{tufte-handout}[2008/11/16 v2.0.1 Tufte-handout class]
+\ProvidesClass{tufte-handout}[2009/05/17 v3.0.0 Tufte-handout class]
%%
-% a4paper option
-
-\newif\if@tufteh@afourpaper \@tufteh@afourpaperfalse
-\DeclareOption{a4paper}{\@tufteh@afourpapertrue}
-
-%%
-% sfsidenotes option -- typesets sidenotes in sans serif typeface
-
-\newif\if@tufteh@sfsidenotes \@tufteh@sfsidenotesfalse
-\DeclareOption{sfsidenotes}{\@tufteh@sfsidenotestrue}
-
-%%
-% symmetric option -- puts marginpar space to the outside edge of the page
-% Note: this forces twoside
-
-\newif\if@tufteh@symmetric\@tufteh@symmetricfalse
-\DeclareOption{symmetric}{
- \@tufteh@symmetrictrue
+% The symmetric option forces twoside.
+\DeclareOption{symmetric}{%
+ \ExecuteOptions{twoside}
+ \PassOptionsToPackage{twoside}{tufte-common}
\PassOptionsToClass{twoside}{article}
+ \PackageInfo{tufte-handout}{Passing twoside to `article' class}
}
-%%
-% justified option -- uses fully justified text (flush left and flush
-% right) instead of ragged right.
-
-\newif\if@tufteh@justified\@tufteh@justifiedfalse
-\DeclareOption{justified}{\@tufteh@justifiedtrue}
-
-
-% FIXME: should probably specify options not supported like Mittelbach's aipproc.cls
-
-\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
+\PassOptionsToPackage{handout}{tufte-common}
+\DeclareOption*{% pass options to tufte-common package and the article class
+ \PassOptionsToPackage{\CurrentOption}{tufte-common}
+ \PassOptionsToClass{\CurrentOption}{article}
+ \PackageInfo{tufte-handout}{Passing \CurrentOption\space to `article' class}
+}
\ProcessOptions
\LoadClass{article}
-%%
-% Detect whether we're in two-side mode or not. (Used to set up running
-% heads later.)
-
-\newif\if@tufteh@twoside\let\if@tufteh@twoside\if@twoside
-
-%%
-% Set page layout geometry
-
-\RequirePackage[letterpaper,includemp,width=6.5in,marginparsep=0.375in,marginparwidth=2in]{geometry}
-
-\if@tufteh@afourpaper
- \geometry{a4paper,includemp,width=170mm,marginparsep=10mm,marginparwidth=50mm}
-\fi
-
-\if@tufteh@symmetric
-\else
- \geometry{asymmetric}
-\fi
-
-
-%%
-% Separation marginpars by a line's worth of space.
-
-\setlength\marginparpush{\baselineskip}
-
-%%
-% Font for margin items
-
-\if@tufteh@sfsidenotes
- \newcommand{\@tufteh@marginfont}{\normalfont\scriptsize\sffamily}
-\else
- \newcommand{\@tufteh@marginfont}{\normalfont\scriptsize}
-\fi
-
-%%
-% \RaggedRight allows hyphenation
-
-\RequirePackage{ragged2e}
-\setlength{\RaggedRightRightskip}{\z@ plus 0.08\hsize}
-
-%%
-% Set the justification baesed on the `justified' class option
-
-\newcommand{\@tufteh@justification}{%
- \if@tufteh@justified
- \justifying
- \else
- \RaggedRight
- \fi
-}
-
-%%
-% Turn off section numbering
-
-\setcounter{secnumdepth}{-1}
-
-%%
-% Tighten up space between displays (e.g., a figure or table) and make symmetric
-
-\setlength\abovedisplayskip{6pt plus 2pt minus 4pt}
-\setlength\belowdisplayskip{6pt plus 2pt minus 4pt}
-
-%%
-% To implement full-width display environments
-
-\RequirePackage[strict]{chngpage}
-
-%%
-% Detect if we're using pdfLaTeX
-\IfFileExists{ifpdf.sty}{%
- \RequirePackage{ifpdf}
-}{% assume we're not using pdfTex?
- \newif\ifpdf\pdffalse
-}
-
-%%
-% Detect if we're using XeLaTeX
-\IfFileExists{ifxetex.sty}{%
- \RequirePackage{ifxetex}
-}{% not using xelatex
- \newif\ifxetex\xetexfalse
-}
-
+\RequirePackage{tufte-common}
-% Compute length used for full-width displays
-
-\newlength{\@tufteh@overhang}
-\setlength{\@tufteh@overhang}{\marginparwidth}
-\addtolength{\@tufteh@overhang}{\marginparsep}
%%
-% Alter \maketitle from article.cls
-
-\renewcommand\maketitle{\par
- \global\let\and\relax
- \global\let\thanks\footnote
- \begingroup
- \newpage
- \global\@topnum\z@
- \@maketitle
- \endgroup
- \global\let\thanks\relax
- \global\let\maketitle\relax
- \global\let\@maketitle\relax
- \global\let\@thanks\@empty
- %\global\let\@author\@empty
- %\global\let\@date\@empty
- %\global\let\@title\@empty
- \global\let\title\relax
- \global\let\author\relax
- \global\let\date\relax
-}
-\def\@maketitle{%
- \newpage
- \noindent\sffamily\large{\allcaps{\@title}}\\
- \vskip0.5\baselineskip
- \noindent\normalsize{\allcaps{\@author}}\\
- \vskip0.3\baselineskip
- \noindent{\allcaps{\@date}}
- \thispagestyle{plain}
-}
+% Set up any handout-specific stuff now
%%
% Abstract
-\renewenvironment{abstract}%
- {\begin{quotation}
- \begin{sffamily}
- \begin{small}}%
- { \end{small}
- \end{sffamily}
- \end{quotation}}
-
-%%
-% Require paralist package for tighter lists
-
-\RequirePackage{paralist}
-
-% Add rightmargin to compactenum
-
-\def\@compactenum@{%
- \expandafter\list\csname label\@enumctr\endcsname{%
- \usecounter{\@enumctr}%
- \rightmargin=2em% added this
- \parsep\plparsep
- \itemsep\plitemsep
- \topsep\pltopsep
- \partopsep\plpartopsep
- \def\makelabel##1{\hss\llap{##1}}}}
-
-%%
-% Improved letterspacing of small caps and all-caps text.
-%
-% First, try to use the `microtype' package, if it's available.
-% Failing that, try to use the `soul' package, if it's available.
-% Failing that, well, I give up.
-
-\RequirePackage{textcase} % provides \MakeTextUppercase and \MakeTextLowercase
-\def\allcapsspacing{\relax}
-\def\smallcapsspacing{\relax}
-\newcommand{\allcaps}[1]{\MakeTextUppercase{\allcapsspacing{#1}}}
-\newcommand{\smallcaps}[1]{\MakeTextLowercase{\textsc{#1}}}
-
-\newcommand{\@tufteh@loadsoul}{%
- \IfFileExists{soul.sty}{%
- \RequirePackage{soul}
- \sodef\allcapsspacing{\upshape}{0.15em}{0.65em}{0.6em}
- \sodef\smallcapsspacing{\scshape}{0.075em}{0.5em}{0.6em}
- }{
- \PackageWarningNoLine{tufte-handout}{Couldn't locate `soul' package.}
- }% soul not installed... giving up.
-}
-
-% If we're using pdfLaTeX v1.40+, use the letterspace package.
-% If we're using pdfLaTex < v1.40, use the soul package.
-% If we're using XeLaTeX, use XeLaTeX letterspacing options.
-% Otherwise fall back on the soul package.
-
-\ifpdf\PackageInfo{tufte-handout}{ifpdf = true}
-\else\PackageInfo{tufte-handout}{ifpdf = false}
-\fi
-
-\ifxetex\PackageInfo{tufte-handout}{ifxetex = true}
-\else\PackageInfo{tufte-handout}{ifxetex = false}
-\fi
-
-
-
-% Check pdfLaTeX version
-\def\@tufteh@pdftexversion{0}
-\ifx\normalpdftexversion\@undefined \else
- \let\pdftexversion \normalpdftexversion
- \let\pdftexrevision\normalpdftexrevision
- \let\pdfoutput \normalpdfoutput
-\fi
-\ifx\pdftexversion\@undefined \else
- \ifx\pdftexversion\relax \else
- \def\@tufteh@pdftexversion{6}
- \ifnum\pdftexversion < 140
- \def\@tufteh@pdftexversion{5}
- \fi
- \fi
-\fi
-
-\ifnum\@tufteh@pdftexversion<6
- % pdfLaTeX version is too old or not using pdfLaTeX
- \ifxetex
- % TODO use xetex letterspacing
- \PackageInfo{tufte-handout}{XeTeX detected. Reverting to `soul' package for letterspacing.}
- \@tufteh@loadsoul
- \else
- \PackageInfo{tufte-handout}{Old version of pdfTeX detected. Reverting to `soul' package for letterspacing.}
- \@tufteh@loadsoul
- \fi
-\else
- \IfFileExists{letterspace.sty}{%
- \PackageInfo{tufte-handout}{Modern version of pdfTeX detected. Using `letterspace' package.}
- \RequirePackage{letterspace}
- % Set up letterspacing (using microtype package) -- requires pdfTeX v1.40+
- \renewcommand{\smallcapsspacing}[1]{\textls[50]{##1}}
- \renewcommand{\allcaps}[1]{\textls[200]{\MakeTextUppercase{##1}}}
- \renewcommand{\smallcaps}[1]{\textsc{\MakeTextLowercase{##1}}}
- }{% microtype failed, check for soul
- \PackageInfo{tufte-handout}{Modern version of pdfTeX detected, but `letterspace' package not installed. Reverting to `soul' package for letterspacing.}
- \@tufteh@loadsoul
- }
-\fi
-
-
-\DeclareTextFontCommand{\textsmallcaps}{\scshape}
-\renewcommand{\textsc}[1]{\textsmallcaps{\smallcapsspacing{#1}}}
-
-
-%%
-% An environment for paragraph-style section
-
-\providecommand\newthought[1]{\vspace{1.8\baselineskip plus 3pt minus 2pt}%
- {\noindent\textsc{#1}}}
-
-%%
-% Transform existing \footnotes into \sidenotes
-% Sidenote: ``Where God meant footnotes to go.'' ---Tufte
-
-\RequirePackage[side,multiple]{footmisc}
-\providecommand*{\footnotelayout}{\@tufteh@marginfont\@tufteh@justification}
-\renewcommand{\footnotelayout}{\@tufteh@marginfont\@tufteh@justification}
-
-% Override footmisc's definition to set the sidenote marks (numbers) inside the
-% sidenote's text block.
-\long\def\@makefntext#1{\@textsuperscript{\@tufteh@marginfont\tiny\@thefnmark}\,\footnotelayout#1}
-
-% Set the in-text footnote mark in the same typeface as the body text itself.
-\def\@makefnmark{\hbox{\@textsuperscript{\normalfont\scriptsize\@thefnmark}}}
-
-\let\sidenote\footnote
-
-%%
-% Sidenote without the footnote mark
-
-\providecommand\marginnote[1]%
- {\marginpar{\@tufteh@marginfont\@tufteh@justification #1}}
-
-%%
-% Citations should go in the margin as well
-
-\RequirePackage{natbib}
-\RequirePackage{bibentry} % allows bibitems to be typeset outside thebibliography environment
-\nobibliography* % pre-loads the bibliography keys
-\renewcommand{\cite}[1]{\sidenote{\bibentry{#1}.}}
-\providecommand{\doi}[1]{\textsc{doi:} #1} % pre-defining this so it may be used before the \bibliography command it issued
-
-% TODO: Rewrite \cite so that you can specify multiple bib keys
-% at once. For example, \cite{Author01,Author02}
-% TODO: Combine sequences of citations so that 2,3,4,6 becomes 2-4,6
-% but be careful of hyperref interaction
-
-%%
-% Make Tuftian-style section headings
-
-% TODO: I'd prefer to use the 'titlesec' package for this formatting, but
-% I'll do it old-style for now. --Kevin
-
-\renewcommand\section{\@startsection {section}{1}{\z@}%
- {-3.5ex \@plus -1ex \@minus -.2ex}%
- {2.3ex \@plus.2ex}%
- {\normalfont\large\it}}
-\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
- {-3.25ex\@plus -1ex \@minus -.2ex}%
- {1.5ex \@plus .2ex}%
- {\normalfont\normalsize\it}}
-
-% Subsubsection and following section headings shouldn't be used.
-% See Bringhurst's _The Elements of Typography_, section 4.2.2.
-\renewcommand\subsubsection{%
- \PackageError{tufte-handout}{\noexpand\subsubsection is undefined by this class.%
- \MessageBreak See Robert Bringhurst's _The Elements of
- \MessageBreak Typographic Style_, section 4.2.2.
- \MessageBreak \noexpand\subsubsection was used}
- {From Bringhurst's _The Elements of Typographic Style_, section 4.2.2: Use as
- \MessageBreak many levels of headings as you need, no more and no fewer. Also see the many
- \MessageBreak related threads on Ask E.T. at http://www.edwardtufte.com/.}
-}
-
-\renewcommand\paragraph{%
- \PackageError{tufte-handout}{\noexpand\paragraph is undefined by this class.%
- \MessageBreak See Robert Bringhurst's _The Elements of
- \MessageBreak Typographic Style_, section 4.2.2.
- \MessageBreak \noexpand\paragraph was used}
- {From Bringhurst's _The Elements of Typographic Style_, section 4.2.2: Use as
- \MessageBreak many levels of headings as you need, no more and no fewer. Also see the many
- \MessageBreak related threads on Ask E.T. at http://www.edwardtufte.com/.}
-}
-
-\renewcommand\subparagraph{%
- \PackageError{tufte-handout}{\noexpand\subparagraph is undefined by this class.%
- \MessageBreak See Robert Bringhurst's _The Elements of
- \MessageBreak Typographic Style_, section 4.2.2.
- \MessageBreak \noexpand\subparagraph was used}
- {From Bringhurst's _The Elements of Typographic Style_, section 4.2.2: Use as
- \MessageBreak many levels of headings as you need, no more and no fewer. Also see the many
- \MessageBreak related threads on Ask E.T. at http://www.edwardtufte.com/.}
-}
-
-
-%%
-% The placeins package provides the \FloatBarrier command. This forces
-% LaTeX to place all of the floats before proceeding. We'll use this to
-% keep the float (figure and table) numbers in sequence.
-\RequirePackage{placeins}
-
-%%
-% Margin figure environment
-
-\newsavebox{\@tufteh@marginfigbox}
-\newenvironment{marginfigure}[1]
- [-1.2ex]
- {\FloatBarrier% process all floats before this point so the figure numbers stay in order.
- \begin{lrbox}{\@tufteh@marginfigbox}
- \begin{minipage}{\marginparwidth}
- \@tufteh@marginfont
- \def\@captype{figure}
- \vspace*{#1}
- \@tufteh@justification
- }
- {\end{minipage}%
- \end{lrbox}%
- \marginpar{\usebox{\@tufteh@marginfigbox}}}
-
-
-%%
-% Margin table environment
-\newsavebox{\@tufteh@margintablebox}
-\newenvironment{margintable}[1]
- [-1.2ex]
- {\FloatBarrier% process all floats before this point so the figure numbers stay in order.
- \begin{lrbox}{\@tufteh@margintablebox}
- \begin{minipage}{\marginparwidth}
- \@tufteh@marginfont
- \def\@captype{table}
- \vspace*{#1}
- \@tufteh@justification
- }
- {\end{minipage}%
- \end{lrbox}%
- \marginpar{\usebox{\@tufteh@margintablebox}}}
-
-
-%%
-% Full-width figure
-
-\renewenvironment{figure*}[1]%
- [htbp]%
- {\@float{figure}[#1]%
- \if@tufteh@symmetric
- \begin{adjustwidth}[]{}{-\@tufteh@overhang}%
- \else
- \begin{adjustwidth}{}{-\@tufteh@overhang}%
- \fi
- \begin{minipage}{\linewidth}}%
- {\end{minipage}%
- \end{adjustwidth}%
- \end@float}
-
-%%
-% Full-width table
-
-\renewenvironment{table*}[1]
- [htbp]%
- {\@float{table}[#1]%
- \if@tufteh@symmetric
- \begin{adjustwidth}[]{}{-\@tufteh@overhang}%
- \else
- \begin{adjustwidth}{}{-\@tufteh@overhang}%
- \fi
- \begin{minipage}{\linewidth}}%
- {\end{minipage}%
- \end{adjustwidth}%
- \end@float}
-
-%%
-% Full-page-width area
-
-\newenvironment{fullwidth}
- {\if@tufteh@symmetric
- \begin{adjustwidth}[]{}{-\@tufteh@overhang}%
- \else
- \begin{adjustwidth}{}{-\@tufteh@overhang}%
- \fi
- }
- {\end{adjustwidth}}
-
-%%
-% Format the captions in a style similar to the sidenotes
-
-\RequirePackage[format=default,font={rm,scriptsize},justification=raggedright,singlelinecheck=false]{caption}
-
-% if the `sfsidenotes' option is specified, set the captions in sf, too.
-\if@tufteh@sfsidenotes
- \captionsetup{font={sf,scriptsize}}
-\else
- \captionsetup{font={rm,scriptsize}}
-\fi
-
-% if the `justified' option is specified, set the captions in flush left
-% and flush right
-\if@tufteh@justified
- \captionsetup{justification=justified}
-\else
- \captionsetup{justification=raggedright}
-\fi
-
-%%
-% If the Palatino typeface (and its math symbol set) are installed, load them.
-
-\IfFileExists{palatino.sty}{%
- \RequirePackage{palatino}
- \IfFileExists{mathpazo.sty}{\RequirePackage[osf,sc]{mathpazo}}{}
-}{} % if the Palatino typefaces aren't found, do nothing.
-
-
-%%
-% If the Bera Mono typeface is available, use it.
-
-\IfFileExists{beramono.sty}{%
- \RequirePackage[T1]{fontenc}
- \RequirePackage[scaled=0.85]{beramono}
-}{}
-
-
-%%
-% Sets up the running heads and folios.
-
-\RequirePackage{fancyhdr}
-
-% Set the header/footer width to be the body text block plus the margin
-% note area.
-\if@tufteh@symmetric
- \fancyhfoffset[LE,RO]{\@tufteh@overhang}
-\else
- \fancyhfoffset[RE,RO]{\@tufteh@overhang}
-\fi
-
-% The 'fancy' page style is the default style for all pages.
-\fancyhf{} % clear header and footer fields
-\if@tufteh@twoside
- \fancyhead[LE]{\thepage\quad\smallcaps{\@author}}
- \fancyhead[RO]{\smallcaps{\@title}\quad\thepage}
-\else
- \fancyhead[RE,RO]{\smallcaps{\@title}\quad\thepage}
-\fi
-\renewcommand{\headrulewidth}{0pt}
-\renewcommand{\footrulewidth}{0pt}
-
-% The 'plain' page style is used on chapter opening pages.
-\fancypagestyle{plain}{
- \fancyhf{} % clear header and footer fields
- \if@tufteh@twoside
- \fancyfoot[LE,RO]{\thepage}
- \else
- \fancyfoot[RE,RO]{\thepage}
- \fi
-}
-
-% The 'empty' page style suppresses all headers and footers.
-% It's used on title pages and `intentionally blank' pages.
-\fancypagestyle{empty}{
- \fancyhf{} % clear header and footer fields
-}
-
-% Set the default page style to 'fancy'
-\pagestyle{fancy}
+% TODO The abstract should be printed on its own page of the `titlepage'
+% option was specified.
+\renewenvironment{abstract}
+ {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi}
+ {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}}
%%
-% Set raggedright and paragraph indentation for document
+% If there is a `tufte-handout-local.tex' file, load it.
-\AtBeginDocument{\@tufteh@justification\setlength\parindent{1em}}
+\IfFileExists{tufte-handout-local.tex}
+ {\input{tufte-handout-local}}
+ {}
%%
-% Prints the list of class options and their states.
-\newcommand{\printclassoptions}{%
- \texttt{symmetric}---\if@tufteh@symmetric true\else false\fi\\
- \texttt{a4paper}---\if@tufteh@afourpaper true\else false\fi\\
- \texttt{twoside}---\if@tufteh@twoside true\else false\fi\\
- \texttt{sfsidenotes}---\if@tufteh@sfsidenotes true\else false\fi\\
- \texttt{justified}---\if@tufteh@justified true\else false\fi
-}
-
+% End of file
\endinput
diff --git a/Master/texmf-dist/tex/latex/tufte-latex/tufte-book.cls b/Master/texmf-dist/tex/latex/tufte-latex/tufte-book.cls
new file mode 100644
index 00000000000..99ff6dfa219
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/tufte-latex/tufte-book.cls
@@ -0,0 +1,83 @@
+\NeedsTeXFormat{LaTeX2e}[1994/06/01]
+
+\ProvidesClass{tufte-book}[2009/05/17 v3.0.0 Tufte-book class]
+
+
+\PassOptionsToPackage{book}{tufte-common}
+\DeclareOption*{% pass options to tufte-common package and the article class
+ \PassOptionsToPackage{\CurrentOption}{tufte-common}
+ \PassOptionsToClass{\CurrentOption}{book}
+ \PackageInfo{tufte-book}{Passing \CurrentOption\space to `book' class}
+}
+\ProcessOptions
+
+\LoadClass{book}
+
+\RequirePackage{tufte-common}
+
+
+%%
+% Set up any book-specific stuff now
+
+%%
+% The front matter in Tufte's /Beautiful Evidence/ contains everything up
+% to the opening page of Chapter 1. The running heads, when they appear,
+% contain only the (arabic) page number in the outside corner.
+%\newif\if@mainmatter \@mainmattertrue
+\renewcommand\frontmatter{%
+ \cleardoublepage%
+ \@mainmatterfalse%
+ \pagenumbering{arabic}%
+ %\pagestyle{plain}%
+ \fancyhf{}%
+ \ifthenelse{\boolean{@tufte@twoside}}%
+ {\fancyhead[LE,RO]{\thepage}}%
+ {\fancyhead[RE,RO]{\thepage}}%
+}
+
+
+%%
+% The main matter in Tufte's /Beautiful Evidence/ doesn't restart the page
+% numbering---it continues where it left off in the front matter.
+\renewcommand\mainmatter{%
+ \cleardoublepage%
+ \@mainmattertrue%
+ \fancyhf{}%
+ \ifthenelse{\boolean{@tufte@twoside}}%
+ {% two-side
+ \renewcommand{\chaptermark}[1]{\markboth{##1}{}}%
+ \fancyhead[LE]{\thepage\quad\smallcaps{\plaintitle}}% book title
+ \fancyhead[RO]{\smallcaps{\leftmark}\quad\thepage}% chapter title
+ }%
+ {% one-side
+ \fancyhead[RE,RO]{\smallcaps{\plaintitle}\quad\thepage}% book title
+ }%
+}
+
+
+%%
+% The back matter contains appendices, indices, glossaries, endnotes,
+% biliographies, list of contributors, illustration credits, etc.
+\renewcommand\backmatter{%
+ \if@openright%
+ \cleardoublepage%
+ \else%
+ \clearpage%
+ \fi%
+ \@mainmatterfalse%
+}
+
+%%
+% Only show the chapter titles in the table of contents
+\setcounter{tocdepth}{0}
+
+%%
+% If there is a `tufte-book-local.sty' file, load it.
+
+\IfFileExists{tufte-book-local.tex}
+ {\input{tufte-book-local}}
+ {}
+
+%%
+% End of file
+\endinput
diff --git a/Master/texmf-dist/tex/latex/tufte-latex/tufte-common.sty b/Master/texmf-dist/tex/latex/tufte-latex/tufte-common.sty
new file mode 100644
index 00000000000..5fb331085f0
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/tufte-latex/tufte-common.sty
@@ -0,0 +1,1427 @@
+\NeedsTeXFormat{LaTeX2e}[1994/06/01]
+
+\ProvidesPackage{tufte-common}[2009/05/17 v3.0.0 Common code for the Tufte-LaTeX styles]
+
+%%
+% We use the `xifthen' package to handle our package option switches
+\RequirePackage{xifthen}
+
+
+%%
+% `debug' option -- provides more information in the .log file for use in
+% troubleshooting problems
+\newboolean{@tufte@debug}
+\DeclareOption{debug}{\setboolean{@tufte@debug}{true}}
+
+%%
+% `nofonts' option -- doesn't load any fonts
+% `fonts' option -- tries to load fonts
+\newboolean{@tufte@loadfonts}\setboolean{@tufte@loadfonts}{true}
+\DeclareOption{fonts}{\setboolean{@tufte@loadfonts}{true}}
+\DeclareOption{nofonts}{\setboolean{@tufte@loadfonts}{false}}
+
+%%
+% `nols' option -- doesn't configure letterspacing
+% `ls' option -- configures letterspacing
+\newboolean{@tufte@letterspace}\setboolean{@tufte@letterspace}{true}
+\DeclareOption{ls}{\setboolean{@tufte@letterspace}{true}}
+\DeclareOption{nols}{\setboolean{@tufte@letterspace}{false}}
+
+%%
+% `book' and `handout' options
+\newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style)
+\newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout)
+\DeclareOption{book}{%
+ \renewcommand{\@tufte@class}{book}
+ \renewcommand{\@tufte@pkgname}{tufte-book}
+ \setboolean{@tufte@titlepage}{true}
+}
+\DeclareOption{handout}{%
+ \renewcommand{\@tufte@class}{article}
+ \renewcommand{\@tufte@pkgname}{tufte-handout}
+ \setboolean{@tufte@titlepage}{false}
+}
+\DeclareOption{article}{% `article' is just an alias for `handout'
+ \renewcommand{\@tufte@class}{article}
+ \renewcommand{\@tufte@pkgname}{tufte-handout}
+ \setboolean{@tufte@titlepage}{false}
+}
+
+%%
+% `titlepage' option -- creates a full title page with \maketitle
+
+\newboolean{@tufte@titlepage}
+\DeclareOption{titlepage}{\setboolean{@tufte@titlepage}{true}}
+\DeclareOption{notitlepage}{\setboolean{@tufte@titlepage}{false}}
+
+%%
+% `a4paper' option
+
+\newboolean{@tufte@afourpaper}
+\DeclareOption{a4paper}{\setboolean{@tufte@afourpaper}{true}}
+
+%%
+% `sfsidenotes' option -- typesets sidenotes in sans serif typeface
+
+\newboolean{@tufte@sfsidenotes}
+\DeclareOption{sfsidenotes}{\setboolean{@tufte@sfsidenotes}{true}}
+
+%%
+% `symmetric' option -- puts marginpar space to the outside edge of the page
+% Note: this option forces the twoside option (see the .cls files)
+
+\newboolean{@tufte@symmetric}
+\DeclareOption{symmetric}{
+ \setboolean{@tufte@symmetric}{true}
+ \PackageInfo{\@tufte@pkgname}{The `symmetric' option implies `twoside'}
+ %\ExecuteOptions{twoside}
+}
+
+%%
+% `twoside' option -- alternates running heads
+
+\newboolean{@tufte@twoside}
+\DeclareOption{twoside}{\setboolean{@tufte@twoside}{true}}
+
+%%
+% `notoc' option -- suppresses the Tufte-style table of contents
+
+\newboolean{@tufte@toc}
+\setboolean{@tufte@toc}{true}
+\DeclareOption{notoc}{\setboolean{@tufte@toc}{false}}
+\DeclareOption{toc}{\setboolean{@tufte@toc}{true}}
+
+%%
+% `justified' option -- uses fully justified text (flush left and flush
+% right) instead of ragged right.
+
+\newboolean{@tufte@justified}
+\DeclareOption{justified}{\setboolean{@tufte@justified}{true}}
+
+%%
+% `bidi' option -- loads the bidi package for bi-directional text
+
+\newboolean{@tufte@loadbidi}
+\DeclareOption{bidi}{\setboolean{@tufte@loadbidi}{true}}
+\DeclareOption{nobidi}{\setboolean{@tufte@loadbibi}{false}}
+
+% FIXME: should probably specify options not supported like Mittelbach's aipproc.cls
+
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{\@tufte@class}}
+\ProcessOptions
+
+%%
+% Detect whether we're in two-side mode or not. (Used to set up running
+% heads later.)
+
+\ifthenelse{\boolean{@twoside}}
+ {\setboolean{@tufte@twoside}{true}}
+ {}
+
+
+
+%%
+% Detect if we're using pdfLaTeX
+
+\newboolean{@tufte@pdf}
+\IfFileExists{ifpdf.sty}{%
+ \RequirePackage{ifpdf}
+ \ifthenelse{\boolean{pdf}}
+ {\setboolean{@tufte@pdf}{true}}
+ {\setboolean{@tufte@pdf}{false}}
+}{% assume we're not using pdfTex?
+ \setboolean{@tufte@pdf}{false}
+}
+
+%%
+% Detect if we're using XeLaTeX
+
+\newboolean{@tufte@xetex}
+\IfFileExists{ifxetex.sty}{%
+ \RequirePackage{ifxetex}
+ \ifthenelse{\boolean{xetex}}
+ {\setboolean{@tufte@xetex}{true}}
+ {\setboolean{@tufte@xetex}{false}}
+}{% not using xelatex
+ \setboolean{@tufte@xetex}{false}
+}
+
+%%
+% Load the `hyperref' package. We will set more options later.
+% TODO Set nice defaults for hyperref options
+\ifthenelse{\boolean{@tufte@xetex}}
+ {\RequirePackage[hyperfootnotes=false,xetex]{hyperref}}
+ {\RequirePackage[hyperfootnotes=false]{hyperref}}
+
+\hypersetup{%
+ pdfborder = {0 0 0},
+ bookmarksdepth = section,
+}
+
+%%
+% Set the font sizes and baselines to match Tufte's books
+\renewcommand\normalsize{%
+ \@setfontsize\normalsize\@xpt{14}%
+ \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
+ \abovedisplayshortskip \z@ \@plus3\p@
+ \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
+ \belowdisplayskip \abovedisplayskip
+ \let\@listi\@listI}
+\normalbaselineskip=14pt
+\normalsize
+\renewcommand\small{%
+ \@setfontsize\small\@ixpt{12}%
+ \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
+ \abovedisplayshortskip \z@ \@plus2\p@
+ \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
+ \def\@listi{\leftmargin\leftmargini
+ \topsep 4\p@ \@plus2\p@ \@minus2\p@
+ \parsep 2\p@ \@plus\p@ \@minus\p@
+ \itemsep \parsep}%
+ \belowdisplayskip \abovedisplayskip
+}
+\renewcommand\footnotesize{%
+ \@setfontsize\footnotesize\@viiipt{10}%
+ \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
+ \abovedisplayshortskip \z@ \@plus\p@
+ \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@
+ \def\@listi{\leftmargin\leftmargini
+ \topsep 3\p@ \@plus\p@ \@minus\p@
+ \parsep 2\p@ \@plus\p@ \@minus\p@
+ \itemsep \parsep}%
+ \belowdisplayskip \abovedisplayskip
+}
+\renewcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt}
+\renewcommand\tiny{\@setfontsize\tiny\@vpt\@vipt}
+\renewcommand\large{\@setfontsize\large\@xipt{15}}
+\renewcommand\Large{\@setfontsize\Large\@xiipt{16}}
+\renewcommand\LARGE{\@setfontsize\LARGE\@xivpt{18}}
+\renewcommand\huge{\@setfontsize\huge\@xxpt{30}}
+\renewcommand\Huge{\@setfontsize\Huge\@xxivpt{36}}
+
+\setlength\leftmargini {1pc}
+\setlength\leftmarginii {1pc}
+\setlength\leftmarginiii {1pc}
+\setlength\leftmarginiv {1pc}
+\setlength\leftmarginv {1pc}
+\setlength\leftmarginvi {1pc}
+\setlength\labelsep {.5pc}
+\setlength\labelwidth {\leftmargini}
+\addtolength\labelwidth{-\labelsep}
+
+%%
+% \RaggedRight allows hyphenation
+
+\RequirePackage{ragged2e}
+\setlength{\RaggedRightRightskip}{\z@ plus 0.08\hsize}
+\setlength{\RaggedRightParindent}{1pc}
+
+% Paragraph indentation and separation for normal text
+\newcommand{\@tufte@reset@par}{%
+ \setlength{\RaggedRightParindent}{1.0pc}%
+ \setlength{\parindent}{1pc}%
+ \setlength{\parskip}{0pt}%
+}
+\@tufte@reset@par
+
+% Paragraph indentation and separation for marginal text
+\newcommand{\@tufte@margin@par}{%
+ \setlength{\RaggedRightParindent}{0.5pc}%
+ \setlength{\parindent}{0.5pc}%
+ \setlength{\parskip}{0pt}%
+}
+
+
+%%
+% Set page layout geometry
+
+\RequirePackage[letterpaper,left=1in,top=1in,headsep=2\baselineskip,textwidth=26pc,marginparsep=2pc,marginparwidth=12pc,textheight=44\baselineskip,headheight=\baselineskip]{geometry}
+
+\ifthenelse{\boolean{@tufte@afourpaper}}
+ {\geometry{a4paper,left=24.8mm,top=27.4mm,headsep=2\baselineskip,textwidth=107mm,marginparsep=8.2mm,marginparwidth=49.4mm,textheight=49\baselineskip,headheight=\baselineskip}}
+ {}
+
+\ifthenelse{\boolean{@tufte@symmetric}}
+ {}
+ {\geometry{asymmetric}}% forces internal LaTeX `twoside'
+
+
+%%
+% Separation marginpars by a line's worth of space.
+
+\setlength\marginparpush{10pt}
+
+%%
+% Font for margin items
+
+\ifthenelse{\boolean{@tufte@sfsidenotes}}
+ {\newcommand{\@tufte@marginfont}{\normalfont\footnotesize\sffamily}}
+ {\newcommand{\@tufte@marginfont}{\normalfont\footnotesize}}
+
+
+%%
+% Set the justification baesed on the `justified' class option
+
+\newcommand{\@tufte@justification}{%
+ \ifthenelse{\boolean{@tufte@justified}}%
+ {\justifying}%
+ {\RaggedRight}%
+}
+
+%%
+% Turn off section numbering
+
+\setcounter{secnumdepth}{-1}
+
+%%
+% Tighten up space between displays (e.g., a figure or table) and make symmetric
+
+\setlength\abovedisplayskip{6pt plus 2pt minus 4pt}
+\setlength\belowdisplayskip{6pt plus 2pt minus 4pt}
+
+%%
+% To implement full-width display environments
+
+\newboolean{@tufte@changepage}
+\IfFileExists{changepage.sty}{%
+ \PackageInfo{\@tufte@pkgname}{Found changepage.sty}
+ \RequirePackage[strict]{changepage}
+ \setboolean{@tufte@changepage}{true}
+}{%
+ \PackageInfo{\@tufte@pkgname}{Found chngpage.sty}
+ \RequirePackage[strict]{chngpage}
+ \setboolean{@tufte@changepage}{false}
+}
+
+% Write our own aliases for the \checkoddpage and \ifoddpage or \ifcpoddpage commands
+\newboolean{@tufte@odd@page}
+\setboolean{@tufte@odd@page}{true}
+\newcommand*{\@tufte@checkoddpage}{%
+ \checkoddpage%
+ \ifthenelse{\boolean{@tufte@changepage}}{%
+ \ifoddpage%
+ \setboolean{@tufte@odd@page}{true}%
+ \else%
+ \setboolean{@tufte@odd@page}{false}%
+ \fi%
+ }{%
+ \ifcpoddpage%
+ \setboolean{@tufte@odd@page}{true}%
+ \else%
+ \setboolean{@tufte@odd@page}{false}%
+ \fi
+ }%
+}
+
+
+% Compute lengths used for full-width displays
+
+\newlength{\@tufte@overhang}
+\setlength{\@tufte@overhang}{\marginparwidth}
+\addtolength{\@tufte@overhang}{\marginparsep}
+
+\newlength{\@tufte@fullwidth}
+\setlength{\@tufte@fullwidth}{\textwidth}
+\addtolength{\@tufte@fullwidth}{\marginparsep}
+\addtolength{\@tufte@fullwidth}{\marginparwidth}
+
+\newlength{\@tufte@caption@fill}
+\setlength{\@tufte@caption@fill}{\textwidth}
+\addtolength{\@tufte@caption@fill}{\marginparsep}
+
+
+%%
+% Modified \title, \author, and \date commands. These store the
+% (footnote-less) values in \plaintitle, \plainauthor, and \thedate, respectively.
+
+\newcommand{\plaintitle}{}% plain-text-only title
+\newcommand{\plainauthor}{}% plain-text-only author
+\newcommand{\plainpublisher}{}% plain-text-only publisher
+
+\newcommand{\thanklesstitle}{}% full title text minus \thanks{}
+\newcommand{\thanklessauthor}{}% full author text minus \thanks{}
+\newcommand{\thanklesspublisher}{}% full publisher minus \thanks{}
+
+\newcommand{\@publisher}{}% full publisher with \thanks{}
+\newcommand{\thedate}{\today}
+
+% TODO Fix it so that \thanks is not spaced out (with `soul') and can be
+% used in \maketitle when the `sfsidenotes' option is provided.
+\renewcommand{\thanks}[1]{\NoCaseChange{\footnote{#1}}}
+
+\renewcommand{\title}[2][]{%
+ \gdef\@title{#2}%
+ \begingroup%
+ % TODO store contents of \thanks command
+ \renewcommand{\thanks}[1]{}% swallow \thanks contents
+ \protected@xdef\thanklesstitle{#2}%
+ \endgroup%
+ \ifthenelse{\isempty{#1}}%
+ {\renewcommand{\plaintitle}{\thanklesstitle}}% use thankless title
+ {\renewcommand{\plaintitle}{#1}}% use provided plain-text title
+ \hypersetup{pdftitle={\plaintitle}}% set the PDF metadata title
+}
+
+\def\@author{}% default author is empty (suppresses LaTeX's ``no author'' warning)
+\renewcommand*{\author}[2][]{%
+ \gdef\@author{#2}%
+ \begingroup%
+ % TODO store contents of \thanks command
+ \renewcommand{\thanks}[1]{}% swallow \thanks contents
+ \protected@xdef\thanklessauthor{#2}%
+ \endgroup%
+ \ifthenelse{\isempty{#1}}
+ {\renewcommand{\plainauthor}{\thanklessauthor}}% use thankless author
+ {\renewcommand{\plainauthor}{#1}}% use provided plain-text author
+ \hypersetup{pdfauthor={\plainauthor}}% set the PDF metadata author
+}
+
+\renewcommand*{\date}[1]{%
+ \gdef\@date{#1}%
+ \begingroup%
+ % TODO store contents of \thanks command
+ \renewcommand{\thanks}[1]{}% swallow \thanks contents
+ \protected@xdef\thedate{#1}%
+ \endgroup%
+}
+
+%%
+% Provides a \publisher command to set the publisher
+
+\newcommand{\publisher}[2][]{%
+ \gdef\@publisher{#2}%
+ \begingroup%
+ \renewcommand{\thanks}[1]{}% swallow \thanks contents
+ \protected@xdef\thanklesspublisher{#2}%
+ \endgroup%
+ \ifthenelse{\isempty{#1}}
+ {\renewcommand{\plainpublisher}{\thanklesspublisher}}% use thankless publisher
+ {\renewcommand{\plainpublisher}{#1}}% use provided plain-text publisher
+}
+
+% TODO: Test \hypersetup{pdfauthor,pdftitle} with DVI and XeTeX
+
+%%
+% Require paralist package for tighter lists
+
+\RequirePackage{paralist}
+
+% Add rightmargin to compactenum
+
+\def\@compactenum@{%
+ \expandafter\list\csname label\@enumctr\endcsname{%
+ \usecounter{\@enumctr}%
+ \rightmargin=2em% added this
+ \parsep\plparsep
+ \itemsep\plitemsep
+ \topsep\pltopsep
+ \partopsep\plpartopsep
+ \def\makelabel##1{\hss\llap{##1}}}}
+
+%%
+% Improved letterspacing of small caps and all-caps text.
+%
+% First, try to use the `microtype' package, if it's available.
+% Failing that, try to use the `soul' package, if it's available.
+% Failing that, well, I give up.
+
+\RequirePackage{textcase} % provides \MakeTextUppercase and \MakeTextLowercase
+\def\allcapsspacing{\relax}
+\def\smallcapsspacing{\relax}
+\newcommand{\allcaps}[1]{\MakeTextUppercase{\allcapsspacing{#1}}}
+\newcommand{\smallcaps}[1]{\MakeTextLowercase{\textsc{#1}}}
+
+\newcommand{\@tufte@loadsoul}{%
+ \IfFileExists{soul.sty}{%
+ \RequirePackage{soul}
+ \sodef\allcapsspacing{\upshape}{0.15em}{0.65em}{0.6em}
+ \sodef\smallcapsspacing{\scshape}{0.075em}{0.5em}{0.6em}
+ }{
+ \PackageWarningNoLine{\@tufte@pkgname}{Couldn't locate `soul' package.}
+ }% soul not installed... giving up.
+}
+
+% If we're using pdfLaTeX v1.40+, use the letterspace package.
+% If we're using pdfLaTex < v1.40, use the soul package.
+% If we're using XeLaTeX, use XeLaTeX letterspacing options.
+% Otherwise fall back on the soul package.
+
+\ifthenelse{\boolean{@tufte@pdf}}
+ {\PackageInfo{\@tufte@pkgname}{ifpdf = true}}
+ {\PackageInfo{\@tufte@pkgname}{ifpdf = false}}
+
+\ifthenelse{\boolean{@tufte@xetex}}
+ {\PackageInfo{\@tufte@pkgname}{ifxetex = true}}
+ {\PackageInfo{\@tufte@pkgname}{ifxetex = false}}
+
+% Check pdfLaTeX version
+\def\@tufte@pdftexversion{0}
+\ifx\normalpdftexversion\@undefined \else
+ \let\pdftexversion \normalpdftexversion
+ \let\pdftexrevision\normalpdftexrevision
+ \let\pdfoutput \normalpdfoutput
+\fi
+\ifx\pdftexversion\@undefined \else
+ \ifx\pdftexversion\relax \else
+ \def\@tufte@pdftexversion{6}
+ \ifnum\pdftexversion < 140
+ \def\@tufte@pdftexversion{5}
+ \fi
+ \fi
+\fi
+
+\ifthenelse{\boolean{@tufte@letterspace}}
+ {%
+ \ifnum\@tufte@pdftexversion<6
+ % pdfLaTeX version is too old or not using pdfLaTeX
+ \ifthenelse{\boolean{@tufte@xetex}}
+ {% TODO use xetex letterspacing
+ \PackageInfo{\@tufte@pkgname}{XeTeX detected. Reverting to `soul' package for letterspacing.}
+ \@tufte@loadsoul}
+ {% use `soul' package for letterspacing
+ \PackageInfo{\@tufte@pkgname}{Old version of pdfTeX detected. Reverting to `soul' package for letterspacing.}
+ \@tufte@loadsoul}
+ \else
+ \IfFileExists{letterspace.sty}{%
+ \PackageInfo{\@tufte@pkgname}{Modern version of pdfTeX detected. Using `letterspace' package.}
+ \RequirePackage{letterspace}
+ % Set up letterspacing (using microtype package) -- requires pdfTeX v1.40+
+ \renewcommand{\allcapsspacing}[1]{\textls[200]{##1}}
+ \renewcommand{\smallcapsspacing}[1]{\textls[50]{##1}}
+ \renewcommand{\allcaps}[1]{\textls[200]{\MakeTextUppercase{##1}}}
+ \renewcommand{\smallcaps}[1]{\textsc{\MakeTextLowercase{##1}}}
+ }{% microtype failed, check for soul
+ \PackageInfo{\@tufte@pkgname}{Modern version of pdfTeX detected, but `letterspace' package not installed. Reverting to `soul' package for letterspacing.}
+ \@tufte@loadsoul
+ }
+ \fi}
+ {}
+
+
+\DeclareTextFontCommand{\textsmallcaps}{\scshape}
+\renewcommand{\textsc}[1]{\textsmallcaps{\smallcapsspacing{#1}}}
+
+
+%%
+% An environment for paragraph-style section
+
+\providecommand\newthought[1]{%
+ \addvspace{1.0\baselineskip plus 0.5ex minus 0.2ex}%
+ \noindent\textsc{#1}%
+}
+
+%%
+% Redefine the display environments (quote, quotation, etc.)
+
+\renewenvironment{verse}
+ {\let\\\@centercr
+ \list{}{\itemsep \z@
+ \itemindent -1pc%
+ \listparindent\itemindent
+ \rightmargin \leftmargin
+ \advance\leftmargin 1pc}%
+ \small%
+ \item\relax}
+ {\endlist}
+\renewenvironment{quotation}
+ {\list{}{\listparindent 1pc%
+ \itemindent \listparindent
+ \rightmargin \leftmargin
+ \parsep \z@ \@plus\p@}%
+ \small%
+ \item\relax\noindent\ignorespaces}
+ {\endlist}
+\renewenvironment{quote}
+ {\list{}{\rightmargin\leftmargin}%
+ \small%
+ \item\relax}
+ {\endlist}
+
+
+%%
+% Used for doublespacing, and other linespacing
+
+\RequirePackage{setspace}
+
+%%
+% Load the bidi package if instructed to do so. This package must be loaded
+% prior to our redefining the \footnote and \cite commands.
+
+\ifthenelse{\boolean{@tufte@loadbidi}}{\RequirePackage{bidi}}{}
+
+
+%%
+% A function that removes leading and trailling spaces from the supplied macro.
+% Based on code written by Michael Downes (See ``Around the Bend'', #15.)
+% Executing \@tufte@trim@spaces\xyzzy will result in the contents of \xyzzy
+% being trimmed of leading and trailing white space.
+
+\catcode`\Q=3
+\def\@tufte@trim@spaces#1{%
+ % Use grouping to emulate a multi-token afterassignment queue
+ \begingroup%
+ % Put `\toks 0 {' into the afterassignment queue
+ \aftergroup\toks\aftergroup0\aftergroup{%
+ % Apply \trimb to the replacement text of #1, adding a leading
+ % \noexpand to prevent brace stripping and to serve another purpose
+ % later.
+ \expandafter\@tufte@trim@b\expandafter\noexpand#1Q Q}%
+ % Transfer the trimmed text back into #1.
+ \edef#1{\the\toks0}%
+}
+
+% \trimb removes a trailing space if present, then calls \@tufte@trim@c to
+% clean up any leftover bizarre Qs, and trim a leading space. In
+% order for \trimc to work properly we need to put back a Q first.
+\def\@tufte@trim@b#1 Q{\@tufte@trim@c#1Q}
+
+% Execute \vfuzz assignment to remove leading space; the \noexpand
+% will now prevent unwanted expansion of a macro or other expandable
+% token at the beginning of the trimmed text. The \endgroup will feed
+% in the \aftergroup tokens after the \vfuzz assignment is completed.
+\def\@tufte@trim@c#1Q#2{\afterassignment\endgroup \vfuzz\the\vfuzz#1}
+\catcode`\Q=11
+
+%%
+% Citations should go in the margin as sidenotes
+
+\RequirePackage[numbers]{natbib}
+\RequirePackage{bibentry} % allows bibitems to be typeset outside thebibliography environment
+% Redefine the \BR@b@bibitem command to fix a bug with bibentry+chicago style
+\renewcommand\BR@b@bibitem[2][]{%
+ \ifthenelse{\isempty{#1}}%
+ {\BR@bibitem{#2}}%
+ {\BR@bibitem[#1]{#2}}%
+ \BR@c@bibitem{#2}%
+}
+\nobibliography* % pre-loads the bibliography keys
+\providecommand{\doi}[1]{\textsc{doi:} #1}% pre-defining this so it may be used before the \bibliography command it issued
+
+%%
+% Normal \cite behavior
+\newcounter{@tufte@num@bibkeys}%
+\newcommand{\@tufte@normal@cite}[2][0pt]{%
+ % Snag the last bibentry in the list for later comparison
+ \let\@temp@last@bibkey\@empty%
+ \@for\@temp@bibkey:=#2\do{\let\@temp@last@bibkey\@temp@bibkey}%
+ \sidenote[][#1]{%
+ % Loop through all the bibentries, separating them with semicolons and spaces
+ \setcounter{@tufte@num@bibkeys}{0}%
+ \@for\@temp@bibkeyx:=#2\do{%
+ \ifthenelse{\equal{\@temp@last@bibkey}{\@temp@bibkeyx}}%
+ {\ifthenelse{\equal{\value{@tufte@num@bibkeys}}{0}}{}{and\ }%
+ \@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey
+ \bibentry{\@temp@bibkeyx}}%
+ {\@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey
+ \bibentry{\@temp@bibkeyx};\ }%
+ \stepcounter{@tufte@num@bibkeys}%
+ }%
+ }%
+}
+
+
+%%
+% Macros for holding the list of cite keys until after the \sidenote
+
+\gdef\@tufte@citations{}% list of cite keys
+\newcommand\@tufte@add@citation[1]{\relax% adds a new bibkey to the list of cite keys
+ \ifx\@tufte@citations\@empty\else
+ \g@addto@macro\@tufte@citations{,}% separate by commas
+ \fi
+ \g@addto@macro\@tufte@citations{#1}
+}
+
+\newcommand{\@tufte@print@citations}[1][0pt]{% puts the citations in a margin note
+ % Snag the last bibentry in the list for later comparison
+ \let\@temp@last@bibkey\@empty%
+ \@for\@temp@bibkey:=\@tufte@citations\do{\let\@temp@last@bibkey\@temp@bibkey}%
+ \marginpar{%
+ \hbox{}\vspace*{#1}%
+ \@tufte@marginfont%
+ \@tufte@justification%
+ \@tufte@margin@par% use parindent and parskip settings for marginal text
+ \vspace*{-1\baselineskip}%
+ % Loop through all the bibentries, separating them with semicolons and spaces
+ \setcounter{@tufte@num@bibkeys}{0}%
+ \@for\@temp@bibkeyx:=\@tufte@citations\do{%
+ \ifthenelse{\equal{\@temp@last@bibkey}{\@temp@bibkeyx}}%
+ {\ifthenelse{\equal{\value{@tufte@num@bibkeys}}{0}}{}{and\ }%
+ \@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey
+ \bibentry{\@temp@bibkeyx}}%
+ {\@tufte@trim@spaces\@temp@bibkeyx% trim spaces around bibkey
+ \bibentry{\@temp@bibkeyx};\ }%
+ \stepcounter{@tufte@num@bibkeys}%
+ }%
+ \@tufte@reset@par% use parindent and parskip settings for body text
+ }%
+}
+
+%%
+% \cite behavior when executed within a sidenote
+
+\newcommand{\@tufte@sidenote@citations}{}% contains list of \cites in sidenote
+\newcommand{\@tufte@infootnote@cite}[1]{%
+ \@tufte@add@citation{#1}
+}
+
+%%
+% Set the default \cite style. This is set and reset by the \sidenote command.
+
+\let\cite\@tufte@normal@cite
+
+%%
+% Transform existing \footnotes into \sidenotes
+% Sidenote: ``Where God meant footnotes to go.'' ---Tufte
+
+\RequirePackage{optparams}% for our new sidenote commands -- provides multiple optional arguments for commands
+
+\providecommand*{\footnotelayout}{\@tufte@marginfont\@tufte@justification}
+\renewcommand{\footnotelayout}{\@tufte@marginfont\@tufte@justification}
+
+% Override footmisc's definition to set the sidenote marks (numbers) inside the
+% sidenote's text block.
+\long\def\@makefntext#1{\@textsuperscript{\@tufte@marginfont\tiny\@thefnmark}\,\footnotelayout#1}
+
+% Set the in-text footnote mark in the same typeface as the body text itself.
+\def\@makefnmark{\hbox{\@textsuperscript{\normalfont\footnotesize\@thefnmark}}}
+
+\providecommand*{\multiplefootnotemarker}{3sp}
+\providecommand*{\multfootsep}{,}
+
+\renewcommand*\@footnotemark{%
+ \leavevmode%
+ \ifhmode%
+ \edef\@x@sf{\the\spacefactor}%
+ \@tufte@check@multiple@sidenotes%
+ \nobreak%
+ \fi%
+ \@makefnmark%
+ \ifhmode\spacefactor\@x@sf\fi%
+ \relax%
+}
+
+\newcommand{\@tufte@check@multiple@sidenotes}{%
+ \ifdim\lastkern=\multiplefootnotemarker\relax%
+ \edef\@x@sf{\the\spacefactor}%
+ \unkern%
+ \textsuperscript{\multfootsep}%
+ \spacefactor\@x@sf\relax%
+ \fi
+}
+
+\renewcommand\@footnotetext[2][0pt]{%
+ \marginpar{%
+ \hbox{}\vspace*{#1}%
+ \def\baselinestretch {\setspace@singlespace}%
+ \ifthenelse{\boolean{@tufte@loadbidi}}{\if@rl@footnote\@rltrue\else\@rlfalse\fi}{}%
+ \reset@font\footnotesize%
+ \@tufte@margin@par% use parindent and parskip settings for marginal text
+ \vspace*{-1\baselineskip}\noindent%
+ \protected@edef\@currentlabel{%
+ \csname p@footnote\endcsname\@thefnmark%
+ }%
+ \color@begingroup%
+ \@makefntext{%
+ \ignorespaces#2%
+ }%
+ \color@endgroup%
+ }%
+ \@tufte@reset@par% use parindent and parskip settings for body text
+}%
+
+%
+% Define \sidenote command. Can handle \cite.
+
+\newcommand{\@tufte@sidenote@vertical@offset}{0pt}
+
+% #1 = footnote num, #2 = vertical offset, #3 = footnote text
+\long\def\@tufte@sidenote[#1][#2]#3{%
+ \let\cite\@tufte@infootnote@cite% use the in-sidenote \cite command
+ \gdef\@tufte@citations{}% clear out any old citations
+ \ifthenelse{\NOT\isempty{#2}}{\renewcommand{\@tufte@sidenote@vertical@offset}{#2}}{}%
+ \ifthenelse{\isempty{#1}}{%
+ % no specific footnote number provided
+ \stepcounter\@mpfn%
+ \protected@xdef\@thefnmark{\thempfn}%
+ \@footnotemark\@footnotetext[\@tufte@sidenote@vertical@offset]{#3}%
+ }{%
+ % specific footnote number provided
+ \begingroup%
+ \csname c@\@mpfn\endcsname #1\relax%
+ \unrestored@protected@xdef\@thefnmark{\thempfn}%
+ \endgroup%
+ \@footnotemark\@footnotetext[\@tufte@sidenote@vertical@offset]{#3}%
+ }%
+ \@tufte@print@citations% print any citations
+ \let\cite\@tufte@normal@cite% go back to using normal in-text \cite command
+ \unskip\ignorespaces% remove extra white space
+ \kern-\multiplefootnotemarker% remove \kern left behind by sidenote
+ \kern\multiplefootnotemarker\relax% add new \kern here to replace the one we yanked
+}
+
+\newcommand*{\sidenote}{\optparams{\@tufte@sidenote}{[][0pt]}}
+\renewcommand*{\footnote}{\optparams{\@tufte@sidenote}{[][0pt]}}
+
+%%
+% Sidenote without the footnote mark
+
+\newcommand\marginnote[2][0pt]{%
+ \let\cite\@tufte@infootnote@cite% use the in-sidenote \cite command
+ \gdef\@tufte@citations{}% clear out any old citations
+ \@tufte@margin@par% use parindent and parskip settings for marginal text
+ \marginpar{\hbox{}\vspace*{#1}\@tufte@marginfont\@tufte@justification\vspace*{-1\baselineskip}\noindent #2}%
+ \@tufte@reset@par% use parindent and parskip settings for body text
+ \@tufte@print@citations% print any citations
+ \let\cite\@tufte@normal@cite% go back to using normal in-text \cite command
+}
+
+
+%%
+% The placeins package provides the \FloatBarrier command. This forces
+% LaTeX to place all of the floats before proceeding. We'll use this to
+% keep the float (figure and table) numbers in sequence.
+\RequirePackage{placeins}
+
+%%
+% Margin float environment
+
+\newsavebox{\@tufte@margin@floatbox}
+\newenvironment{@tufte@margin@float}[2][-1.2ex]%
+ {\FloatBarrier% process all floats before this point so the figure/table numbers stay in order.
+ \begin{lrbox}{\@tufte@margin@floatbox}%
+ \begin{minipage}{\marginparwidth}%
+ \@tufte@marginfont%
+ \def\@captype{#2}%
+ \hbox{}\vspace*{#1}%
+ \@tufte@justification%
+ \@tufte@margin@par%
+ \noindent%
+ }
+ {\end{minipage}%
+ \end{lrbox}%
+ \marginpar{\usebox{\@tufte@margin@floatbox}}%
+ \@tufte@reset@par%
+ }
+
+
+%%
+% Margin figure environment
+
+\newenvironment{marginfigure}[1][-1.2ex]%
+ {\begin{@tufte@margin@float}[#1]{figure}}
+ {\end{@tufte@margin@float}}
+
+
+%%
+% Margin table environment
+\newenvironment{margintable}[1][-1.2ex]%
+ {\begin{@tufte@margin@float}[#1]{table}}
+ {\end{@tufte@margin@float}}
+
+
+%%
+% A collection of macros to be used with the new Tufte-style float environments
+
+\newcommand{\floatalignment}{x}% holds the current float alignment (t, b, h, p)
+\newcommand{\setfloatalignment}[1]{\renewcommand{\floatalignment}{#1}}% manually sets the float alignment
+
+% Boxes to temporarily store our float and caption
+\newsavebox{\@tufte@figure@box}
+\newsavebox{\@tufte@caption@box}
+
+% Save original LaTeX float environment
+\let\@tufte@orig@float\@float
+\let\@tufte@orig@endfloat\end@float
+
+% Save original LaTeX \caption and \label commands
+\AtBeginDocument{%
+ \let\@tufte@orig@caption\caption%
+ \let\@tufte@orig@label\label%
+}
+
+% Store the caption and label contents
+\newcommand{\@tufte@stored@shortcaption}{}
+\newcommand{\@tufte@stored@caption}{}
+\newcommand{\@tufte@stored@label}{}
+
+\newcommand{\@tufte@caption}[2][]{%
+ \ifthenelse{\isempty{#1}}
+ {\gdef\@tufte@stored@shortcaption{#2}}%
+ {\gdef\@tufte@stored@shortcaption{#1}}%
+ \gdef\@tufte@stored@caption{#2}%
+}
+
+\newcommand{\@tufte@label}[1]{%
+ \gdef\@tufte@stored@label{#1}%
+}
+
+\newcommand{\@tufte@fps}{}
+
+% TODO make sure new caption and figure code can handle [p] and [h] placements well
+% TODO handle the symmetric class option (move caption to other side of verso pages)
+
+%%
+% Define a float environment to place the captions in the margin space
+
+\newenvironment{@tufte@float}[2][htbp]
+ {% If the float placement specifier is 'b' and only 'b', then bottom-align the mini-pages, otherwise top-align them.
+ \renewcommand{\@tufte@fps}{#1}%
+ \ifthenelse{\equal{#1}{b}\OR\equal{#1}{B}}%
+ {\renewcommand{\floatalignment}{b}}%
+ {\renewcommand{\floatalignment}{t}}%
+ \renewcommand{\caption}[2][]{\@tufte@caption[##1]{##2}}%
+ \renewcommand{\label}[1]{\@tufte@label{##1}}%
+ \@tufte@orig@float{#2}[#1]%
+ \begin{lrbox}{\@tufte@figure@box}%
+ \begin{minipage}[\floatalignment]{\textwidth}\hbox{}%
+ }
+ {% end @tufte@float
+ \par\hbox{}\vspace{-\baselineskip}\ifthenelse{\prevdepth>0}{\vspace{-\prevdepth}}{}% align baselines of boxes
+ \end{minipage}%
+ \end{lrbox}%
+ % build the caption box
+ \begin{lrbox}{\@tufte@caption@box}%
+ \begin{minipage}[\floatalignment]{\marginparwidth}\hbox{}%
+ \ifthenelse{\NOT\equal{\@tufte@stored@caption}{}}{\@tufte@orig@caption[\@tufte@stored@shortcaption]{\@tufte@stored@caption}}{}%
+ \ifthenelse{\NOT\equal{\@tufte@stored@label}{}}{\@tufte@orig@label{\@tufte@stored@label}}{}%
+ \par\vspace{-\prevdepth}%% TODO: DOUBLE-CHECK FOR SAFETY
+ \end{minipage}%
+ \end{lrbox}%
+ % now typeset the stored boxes
+ \begin{fullwidth}%
+ \begin{minipage}[\floatalignment]{\linewidth}%
+ \@tufte@checkoddpage%
+ \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@odd@page}}{%
+ % asymmetric or page is odd, so caption is on the right
+ \usebox{\@tufte@figure@box}%
+ \hspace{\marginparsep}%
+ \smash{\usebox{\@tufte@caption@box}}%
+ }{%
+ % symmetric pages and page is even, so caption is on the left
+ \strut\smash{\usebox{\@tufte@caption@box}}%
+ \hspace{\marginparsep}%
+ \usebox{\@tufte@figure@box}%
+ }%
+ \end{minipage}%
+ \end{fullwidth}%
+ \@tufte@orig@endfloat%
+ % reset commands and temp boxes and captions
+ \let\caption\@tufte@orig@caption%
+ \let\label\@tufte@orig@label%
+ \begin{lrbox}{\@tufte@figure@box}\hbox{}\end{lrbox}%
+ \begin{lrbox}{\@tufte@caption@box}\hbox{}\end{lrbox}%
+ \gdef\@tufte@stored@shortcaption{}%
+ \gdef\@tufte@stored@caption{}%
+ }
+
+%%
+% Redefine the figure environment to place the captions in the margin space
+
+\renewenvironment{figure}[1][htbp]
+ {\begin{@tufte@float}[#1]{figure}}
+ {\end{@tufte@float}}
+
+
+%%
+% Redefine the table environment to place the captions in the margin space
+
+\renewenvironment{table}[1][htbp]
+ {\begin{@tufte@float}[#1]{table}}
+ {\end{@tufte@float}}
+
+
+%%
+% Full-width figures and tables
+
+\newenvironment{@tufte@float@star}[2][htbp]%
+ {% begin
+ % If the float placement specifier is 'b' and only 'b', then place the caption above the figure, else place the caption below the figure.
+ \renewcommand{\@tufte@fps}{#1}%
+ \ifthenelse{\equal{#1}{b}\OR\equal{#1}{B}}%
+ {\renewcommand{\floatalignment}{b}}%
+ {\renewcommand{\floatalignment}{t}}%
+ \renewcommand{\caption}[2][]{\@tufte@caption[##1]{##2}}%
+ \renewcommand{\label}[1]{\@tufte@label{##1}}%
+ \@tufte@orig@float{#2}[#1]%
+ \begin{lrbox}{\@tufte@figure@box}%
+ \begin{minipage}[\floatalignment]{\textwidth}\hbox{}%
+ \begin{fullwidth}
+ }%
+ {% end figure*
+ \par\hbox{}\vspace{-\baselineskip}\ifthenelse{\prevdepth>0}{\vspace{-\prevdepth}}{}% align baselines of boxes
+ \end{fullwidth}%
+ \end{minipage}%
+ \end{lrbox}%
+ % build the caption box
+ % TODO use \captionaboveskip and \captionbelowskip for spacing between caption and figure boxes
+ \begin{lrbox}{\@tufte@caption@box}%
+ \begin{minipage}[\floatalignment]{\marginparwidth}\hbox{}%
+ \ifthenelse{\NOT\equal{\@tufte@stored@caption}{}}{\@tufte@orig@caption[\@tufte@stored@shortcaption]{\@tufte@stored@caption}}{}%
+ \ifthenelse{\NOT\equal{\@tufte@stored@label}{}}{\@tufte@orig@label{\@tufte@stored@label}}{}%
+ \par\vspace{-\prevdepth}%% TODO: DOUBLE-CHECK FOR SAFETY
+ \end{minipage}%
+ \end{lrbox}%
+ % now typeset the stored boxes
+ \@tufte@checkoddpage%
+ \begin{fullwidth}%
+ \begin{minipage}[\floatalignment]{\linewidth}%
+ \ifthenelse{\equal{\floatalignment}{b}}
+ {% place caption above figure
+ \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@odd@page}}
+ {% caption on the right
+ \hfill\smash{\usebox{\@tufte@caption@box}}%
+ \par\usebox{\@tufte@figure@box}%
+ }{% caption on the left
+ \smash{\usebox{\@tufte@caption@box}}\hfill\null%
+ \par\hspace{\@tufte@overhang}\usebox{\@tufte@figure@box}%
+ }%
+ }
+ {% place caption below figure
+ \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@odd@page}}
+ {% caption on the right
+ \usebox{\@tufte@figure@box}\par%
+ \hspace{\@tufte@caption@fill}\smash{\usebox{\@tufte@caption@box}}%
+ }{% caption on the left
+ \null\hspace{\@tufte@overhang}\usebox{\@tufte@figure@box}\par%
+ \smash{\usebox{\@tufte@caption@box}}\hfill%
+ }%
+ }
+ \end{minipage}%
+ \end{fullwidth}%
+ \@tufte@orig@endfloat%
+ % reset commands and temp boxes and captions
+ \let\caption\@tufte@orig@caption%
+ \let\label\@tufte@orig@label%
+ \begin{lrbox}{\@tufte@figure@box}\hbox{}\end{lrbox}
+ \begin{lrbox}{\@tufte@caption@box}\hbox{}\end{lrbox}
+ \gdef\@tufte@stored@shortcaption{}
+ \gdef\@tufte@stored@caption{}
+ }
+
+
+%%
+% Full-width figure
+
+\renewenvironment{figure*}[1][htbp]%
+ {\begin{@tufte@float@star}[#1]{figure}}
+ {\end{@tufte@float@star}}
+
+
+%%
+% Full-width table
+
+\renewenvironment{table*}[1][htbp]%
+ {\begin{@tufte@float@star}[#1]{table}}
+ {\end{@tufte@float@star}}
+
+
+%%
+% Full-page-width area
+
+\newenvironment{fullwidth}
+ {\ifthenelse{\boolean{@tufte@symmetric}}
+ {\ifthenelse{\boolean{@tufte@changepage}}{\begin{adjustwidth*}{}{-\@tufte@overhang}}{\begin{adjustwidth}[]{}{-\@tufte@overhang}}}
+ {\begin{adjustwidth}{}{-\@tufte@overhang}}%
+ }
+ {\ifthenelse{\boolean{@tufte@symmetric}}
+ {\ifthenelse{\boolean{@tufte@changepage}}{\end{adjustwidth*}}{\end{adjustwidth}}}
+ {\end{adjustwidth}}
+ }
+
+%%
+% Format the captions in a style similar to the sidenotes
+
+\long\def\@caption#1[#2]#3{%
+ \par%
+ \addcontentsline{\csname ext@#1\endcsname}{#1}%
+ {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}%
+ \begingroup
+ \@parboxrestore
+ \if@minipage
+ \@setminipage
+ \fi
+ \@tufte@marginfont\@tufte@justification%
+ \noindent\csname fnum@#1\endcsname: \ignorespaces#3\par
+ %\@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
+ \endgroup}
+
+%%
+% If we're NOT using XeLaTeX and the `nofonts' class option was NOT provided,
+% we should load the Palatino, Helvetica, and Bera Mono fonts (if they are
+% installed.)
+
+\ifthenelse{\boolean{@tufte@loadfonts}\AND\NOT\boolean{@tufte@xetex}}{%
+ \IfFileExists{mathpazo.sty}{\RequirePackage[osf,sc]{mathpazo}}{}
+ \IfFileExists{helvet.sty}{\RequirePackage[scaled=0.90]{helvet}}{}
+ \IfFileExists{beramono.sty}{\RequirePackage[scaled=0.85]{beramono}}{}
+ \RequirePackage[T1]{fontenc}
+ \RequirePackage{textcomp}
+}{}
+
+
+%%
+% Turns newlines into spaces. Based on code from the `titlesec' package.
+
+\DeclareRobustCommand{\@tufte@newlinetospace}{%
+ \@ifstar{\@tufte@newlinetospace@i}{\@tufte@newlinetospace@i}%
+}
+
+\def\@tufte@newlinetospace@i{%
+ \ifdim\lastskip>\z@\else\space\fi
+ \ignorespaces%
+}
+
+\DeclareRobustCommand{\newlinetospace}[1]{%
+ \let\@tufte@orig@cr\\% save the original meaning of \\
+ \def\\{\@tufte@newlinetospace}% turn \\ and \\* into \space
+ \let\newline\\% turn \newline into \space
+ #1%
+ \let\\\@tufte@orig@cr% revert to original meaning of \\
+}
+
+
+%%
+% Sets up the running heads and folios.
+
+\RequirePackage{fancyhdr}
+
+% Set the default page style to 'fancy'
+\pagestyle{fancy}
+
+% Set the header/footer width to be the body text block plus the margin
+% note area.
+\ifthenelse{\boolean{@tufte@symmetric}}
+ {\fancyhfoffset[LE,RO]{\@tufte@overhang}}
+ {\fancyhfoffset[RE,RO]{\@tufte@overhang}}
+
+% The running heads/feet don't have rules
+\renewcommand{\headrulewidth}{0pt}
+\renewcommand{\footrulewidth}{0pt}
+
+% The 'fancy' page style is the default style for all pages.
+\fancyhf{} % clear header and footer fields
+\ifthenelse{\boolean{@tufte@twoside}}
+ {\fancyhead[LE]{\thepage\quad\smallcaps{\newlinetospace{\plainauthor}}}%
+ \fancyhead[RO]{\smallcaps{\newlinetospace{\plaintitle}}\quad\thepage}}
+ {\fancyhead[RE,RO]{\smallcaps{\newlinetospace{\plaintitle}}\quad\thepage}}
+
+
+% The `plain' page style is used on chapter opening pages.
+% In Tufte's /Beautiful Evidence/ he never puts page numbers at the
+% bottom of pages -- the folios are unexpressed.
+\fancypagestyle{plain}{
+ \fancyhf{} % clear header and footer fields
+ % Uncomment the following five lines of code if you want the opening page
+ % of the chapter to express the folio in the lower outside corner.
+ %\ifthenelse{\boolean{@tufte@twoside}}
+ % {\fancyfoot[LE,RO]{\thepage}}
+ % {\fancyfoot[RE,RO]{\thepage}}
+}
+
+% The `empty' page style suppresses all headers and footers.
+% It's used on title pages and `intentionally blank' pages.
+\fancypagestyle{empty}{
+ \fancyhf{} % clear header and footer fields
+}
+
+
+%%
+% Set raggedright and paragraph indentation for document
+
+\AtBeginDocument{\@tufte@justification}
+
+
+%%
+% Prints the list of class options and their states.
+
+\newcommand{\typeoutbool}[2]{%
+ \ifthenelse{\boolean{#2}}
+ {\typeout{\space\space#1: true}}
+ {\typeout{\space\space#1: false}}
+}
+
+\newcommand{\typeoutstr}[2]{%
+ \typeout{\space\space#1: #2}
+}
+
+\newcommand{\PrintTufteSettings}{%
+ \typeout{-------------------- Tufte-LaTeX settings ----------}
+ \typeout{Class: \@tufte@pkgname}
+ \typeout{}
+ \typeout{Class options:}
+ \typeoutbool{a4paper}{@tufte@afourpaper}
+ \typeoutbool{load fonts}{@tufte@loadfonts}
+ \typeoutbool{fully-justified}{@tufte@justified}
+ \typeoutbool{letterspacing}{@tufte@letterspace}
+ \typeoutbool{sans-serif sidenotes}{@tufte@sfsidenotes}
+ \typeoutbool{symmetric margins}{@tufte@symmetric}
+ \typeoutbool{titlepage}{@tufte@titlepage}
+ \typeoutbool{twoside}{@tufte@twoside}
+ \typeoutbool{debug}{@tufte@debug}
+ \typeout{}
+ \typeout{Internal variables:}
+ \typeoutbool{[twoside]}{@twoside}
+ \typeoutbool{pdflatex}{@tufte@pdf}
+ \typeoutbool{xelatex}{@tufte@xetex}
+ \typeout{----------------------------------------------------}
+}
+
+
+
+%%
+% Color
+\RequirePackage[usenames,dvipsnames,svgnames]{xcolor}
+
+%%
+% Produces a full title page
+
+\newcommand{\maketitlepage}[0]{%
+ \cleardoublepage%
+ {%
+ \sffamily%
+ \begin{fullwidth}%
+ \fontsize{18}{20}\selectfont\par\noindent\textcolor{darkgray}{\allcaps{\thanklessauthor}}%
+ \vspace{11.5pc}%
+ \fontsize{36}{40}\selectfont\par\noindent\textcolor{darkgray}{\allcaps{\thanklesstitle}}%
+ \vfill%
+ \fontsize{14}{16}\selectfont\par\noindent\allcaps{\thanklesspublisher}%
+ \end{fullwidth}%
+ }
+ \thispagestyle{empty}%
+ \clearpage%
+}
+
+%%
+% Title block
+
+\renewcommand{\maketitle}{%
+ \newpage
+ \global\@topnum\z@% prevent floats from being placed at the top of the page
+ \begingroup
+ \setlength{\parindent}{0pt}
+ \setlength{\parskip}{4pt}
+ \ifthenelse{\boolean{@tufte@sfsidenotes}}
+ {\begingroup
+ % FIXME fails with \thanks
+ \sffamily
+ \par{\LARGE\allcaps{\@title}}
+ \ifthenelse{\equal{\@author}{}}{}{\par{\Large\allcaps{\@author}}}
+ \ifthenelse{\equal{\@date}{}}{}{\par{\Large\allcaps{\@date}}}
+ \endgroup}
+ {\begingroup
+ \par{\LARGE\textit{\@title}}
+ \ifthenelse{\equal{\@author}{}}{}{\par{\Large\textit{\@author}}}
+ \ifthenelse{\equal{\@date}{}}{}{\par{\Large\textit{\@date}}}
+ \endgroup}
+ \par
+ \endgroup
+ \thispagestyle{plain}% suppress the running head
+}
+
+
+%%
+% Title page (if the `titlepage' option was passed to the tufte-handout
+% class.)
+
+\ifthenelse{\boolean{@tufte@titlepage}}
+ {\renewcommand{\maketitle}{\maketitlepage}}
+ {}
+
+%%
+% When \cleardoublepage is called, produce a blank (empty) page -- i.e.,
+% without headers and footers
+\def\cleardoublepage{\clearpage\if@twoside\ifodd\c@page\else
+ \hbox{}
+ %\vspace*{\fill}
+ %\begin{center}
+ % This page intentionally contains only this sentence.
+ %\end{center}
+ %\vspace{\fill}
+ \thispagestyle{empty}
+ \newpage
+ \if@twocolumn\hbox{}\newpage\fi\fi\fi}
+
+%%
+% Make Tuftian-style section headings and TOC formatting
+
+\RequirePackage{titlesec,titletoc}
+
+\titleformat{\chapter}%
+ [display]% shape
+ {\relax\ifthenelse{\NOT\boolean{@tufte@symmetric}}{\begin{fullwidth}}{}}% format applied to label+text
+ {\itshape\huge\thechapter}% label
+ {0pt}% horizontal separation between label and title body
+ {\huge\rm\itshape}% before the title body
+ [\ifthenelse{\NOT\boolean{@tufte@symmetric}}{\end{fullwidth}}{}]% after the title body
+
+\titleformat{\section}%
+ [hang]% shape
+ {\normalfont\Large\itshape}% format applied to label+text
+ {\thesection}% label
+ {1em}% horizontal separation between label and title body
+ {}% before the title body
+ []% after the title body
+
+\titleformat{\subsection}%
+ [hang]% shape
+ {\normalfont\large\itshape}% format applied to label+text
+ {\thesubsection}% label
+ {1em}% horizontal separation between label and title body
+ {}% before the title body
+ []% after the title body
+
+\titleformat{\paragraph}%
+ [runin]% shape
+ {\normalfont\itshape}% format applied to label+text
+ {\theparagraph}% label
+ {1em}% horizontal separation between label and title body
+ {}% before the title body
+ []% after the title body
+
+
+\titlespacing*{\chapter}{0pt}{50pt}{40pt}
+\titlespacing*{\section}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
+\titlespacing*{\subsection}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus.2ex}
+
+% Subsubsection and following section headings shouldn't be used.
+% See Bringhurst's _The Elements of Typography_, section 4.2.2.
+\renewcommand\subsubsection{%
+ \PackageError{\@tufte@pkgname}{\noexpand\subsubsection is undefined by this class.%
+ \MessageBreak See Robert Bringhurst's _The Elements of
+ \MessageBreak Typographic Style_, section 4.2.2.
+ \MessageBreak \noexpand\subsubsection was used}
+ {From Bringhurst's _The Elements of Typographic Style_, section 4.2.2: Use as
+ \MessageBreak many levels of headings as you need, no more and no fewer. Also see the many
+ \MessageBreak related threads on Ask E.T. at http://www.edwardtufte.com/.}
+}
+
+%\renewcommand\paragraph{%
+% \PackageError{\@tufte@pkgname}{\noexpand\paragraph is undefined by this class.%
+% \MessageBreak See Robert Bringhurst's _The Elements of
+% \MessageBreak Typographic Style_, section 4.2.2.
+% \MessageBreak \noexpand\paragraph was used}
+% {From Bringhurst's _The Elements of Typographic Style_, section 4.2.2: Use as
+% \MessageBreak many levels of headings as you need, no more and no fewer. Also see the many
+% \MessageBreak related threads on Ask E.T. at http://www.edwardtufte.com/.}
+%}
+
+\renewcommand\subparagraph{%
+ \PackageError{\@tufte@pkgname}{\noexpand\subparagraph is undefined by this class.%
+ \MessageBreak See Robert Bringhurst's _The Elements of
+ \MessageBreak Typographic Style_, section 4.2.2.
+ \MessageBreak \noexpand\subparagraph was used}
+ {From Bringhurst's _The Elements of Typographic Style_, section 4.2.2: Use as
+ \MessageBreak many levels of headings as you need, no more and no fewer. Also see the many
+ \MessageBreak related threads on Ask E.T. at http://www.edwardtufte.com/.}
+}
+
+
+% Formatting for main TOC (printed in front matter)
+% {section} [left] {above} {before w/label} {before w/o label} {filler + page} [after]
+\ifthenelse{\boolean{@tufte@toc}}
+ {\titlecontents{chapter}%
+ [0em] % distance from left margin
+ {\begin{fullwidth}\fontsize{13pt}{18pt}\selectfont} % above (global formatting of entry)
+ {\contentslabel{2em}\rm\itshape} % before w/label (label = ``Chapter 1'')
+ {\rm\itshape} % before w/o label
+ {\rm\qquad\thecontentspage} % filler + page (leaders and page num)
+ [\vspace{1.5\baselineskip}\end{fullwidth}] % after
+ }
+ {}
+
+%\titlecontents{chapter}%
+% [0em]% distance from left margin
+% {\fontsize{12pt}{18pt}\selectfont}% above (global formatting of entry)
+% {\textit}% before w/ label (label = ``Chapter 1'')
+% {\textit}% before w/o label
+% {\qquad\thecontentspage}% filler and page (leaders and page num)
+% [\vspace{1.5\baselineskip}]% after
+
+
+
+%%
+% A handy command to disable hyphenation for short bits of text.
+% Borrowed from Peter Wilson's `hyphenat' package.
+
+\newlanguage\langwohyphens% define a language without hyphenation rules
+\newcommand{\nohyphens}[1]{{\language\langwohyphens #1}}% used for short bits of text
+\newcommand{\nohyphenation}{\language\langwohyphens}% can be used inside environments for longer text
+
+%%
+% The bibliography environment
+
+\setlength\bibindent{1.5em}
+\renewenvironment{thebibliography}[1]
+ {%
+ \ifthenelse{\equal{\@tufte@class}{book}}%
+ {\chapter{\bibname}}%
+ {\section*{\refname}}%
+% \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
+ \list{\@biblabel{\@arabic\c@enumiv}}%
+ {\settowidth\labelwidth{\@biblabel{#1}}%
+ \leftmargin\labelwidth
+ \advance\leftmargin\labelsep
+ \@openbib@code
+ \usecounter{enumiv}%
+ \let\p@enumiv\@empty
+ \renewcommand\theenumiv{\@arabic\c@enumiv}}%
+ \sloppy
+ \clubpenalty4000
+ \@clubpenalty \clubpenalty
+ \widowpenalty4000%
+ \sfcode`\.\@m%
+ }
+ {%
+ \def\@noitemerr
+ {\@latex@warning{Empty `thebibliography' environment}}%
+ \endlist%
+ }
+\renewcommand\newblock{\hskip .11em\@plus.33em\@minus.07em}
+
+
+%%
+% An index environment to mimic Tufte's indexes
+
+\RequirePackage{multicol}
+\renewenvironment{theindex}
+ {\begin{fullwidth}%
+ \small%
+ \ifthenelse{\equal{\@tufte@class}{book}}%
+ {\chapter{\indexname}}%
+ {\section*{\indexname}}%
+ \parskip0pt%
+ \parindent0pt%
+ \let\item\@idxitem%
+ \begin{multicols}{3}%
+ }
+ {\end{multicols}%
+ \end{fullwidth}%
+ }
+\renewcommand\@idxitem{\par\hangindent 2em}
+\renewcommand\subitem{\par\hangindent 3em\hspace*{1em}}
+\renewcommand\subsubitem{\par\hangindent 4em\hspace*{2em}}
+\renewcommand\indexspace{\par\addvspace{1.0\baselineskip plus 0.5ex minus 0.2ex}\relax}%
+\newcommand{\lettergroup}[1]{}% swallow the letter heading in the index
+
+
+%%
+% If debugging is enabled, print the Tufte-LaTeX options and the list of
+% files.
+
+\ifthenelse{\boolean{@tufte@debug}}
+ {\PrintTufteSettings\listfiles}
+ {}
+
+
+%%
+% If there is a `tufte-common-local.tex' file, load it up.
+
+\IfFileExists{tufte-common-local.tex}
+ {\input{tufte-common-local}}
+ {}
+
+
+%%
+% End of file
+\endinput
+
diff --git a/Master/texmf-dist/tex/latex/tufte-latex/tufte-handout.cls b/Master/texmf-dist/tex/latex/tufte-latex/tufte-handout.cls
index 8075ec3c164..ca9ab630829 100644
--- a/Master/texmf-dist/tex/latex/tufte-latex/tufte-handout.cls
+++ b/Master/texmf-dist/tex/latex/tufte-latex/tufte-handout.cls
@@ -1,552 +1,50 @@
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
-\ProvidesClass{tufte-handout}[2008/11/16 v2.0.1 Tufte-handout class]
+\ProvidesClass{tufte-handout}[2009/05/17 v3.0.0 Tufte-handout class]
%%
-% a4paper option
-
-\newif\if@tufteh@afourpaper \@tufteh@afourpaperfalse
-\DeclareOption{a4paper}{\@tufteh@afourpapertrue}
-
-%%
-% sfsidenotes option -- typesets sidenotes in sans serif typeface
-
-\newif\if@tufteh@sfsidenotes \@tufteh@sfsidenotesfalse
-\DeclareOption{sfsidenotes}{\@tufteh@sfsidenotestrue}
-
-%%
-% symmetric option -- puts marginpar space to the outside edge of the page
-% Note: this forces twoside
-
-\newif\if@tufteh@symmetric\@tufteh@symmetricfalse
-\DeclareOption{symmetric}{
- \@tufteh@symmetrictrue
+% The symmetric option forces twoside.
+\DeclareOption{symmetric}{%
+ \ExecuteOptions{twoside}
+ \PassOptionsToPackage{twoside}{tufte-common}
\PassOptionsToClass{twoside}{article}
+ \PackageInfo{tufte-handout}{Passing twoside to `article' class}
}
-%%
-% justified option -- uses fully justified text (flush left and flush
-% right) instead of ragged right.
-
-\newif\if@tufteh@justified\@tufteh@justifiedfalse
-\DeclareOption{justified}{\@tufteh@justifiedtrue}
-
-
-% FIXME: should probably specify options not supported like Mittelbach's aipproc.cls
-
-\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
+\PassOptionsToPackage{handout}{tufte-common}
+\DeclareOption*{% pass options to tufte-common package and the article class
+ \PassOptionsToPackage{\CurrentOption}{tufte-common}
+ \PassOptionsToClass{\CurrentOption}{article}
+ \PackageInfo{tufte-handout}{Passing \CurrentOption\space to `article' class}
+}
\ProcessOptions
\LoadClass{article}
-%%
-% Detect whether we're in two-side mode or not. (Used to set up running
-% heads later.)
-
-\newif\if@tufteh@twoside\let\if@tufteh@twoside\if@twoside
-
-%%
-% Set page layout geometry
-
-\RequirePackage[letterpaper,includemp,width=6.5in,marginparsep=0.375in,marginparwidth=2in]{geometry}
-
-\if@tufteh@afourpaper
- \geometry{a4paper,includemp,width=170mm,marginparsep=10mm,marginparwidth=50mm}
-\fi
-
-\if@tufteh@symmetric
-\else
- \geometry{asymmetric}
-\fi
-
-
-%%
-% Separation marginpars by a line's worth of space.
-
-\setlength\marginparpush{\baselineskip}
-
-%%
-% Font for margin items
-
-\if@tufteh@sfsidenotes
- \newcommand{\@tufteh@marginfont}{\normalfont\scriptsize\sffamily}
-\else
- \newcommand{\@tufteh@marginfont}{\normalfont\scriptsize}
-\fi
-
-%%
-% \RaggedRight allows hyphenation
-
-\RequirePackage{ragged2e}
-\setlength{\RaggedRightRightskip}{\z@ plus 0.08\hsize}
-
-%%
-% Set the justification baesed on the `justified' class option
-
-\newcommand{\@tufteh@justification}{%
- \if@tufteh@justified
- \justifying
- \else
- \RaggedRight
- \fi
-}
-
-%%
-% Turn off section numbering
-
-\setcounter{secnumdepth}{-1}
-
-%%
-% Tighten up space between displays (e.g., a figure or table) and make symmetric
-
-\setlength\abovedisplayskip{6pt plus 2pt minus 4pt}
-\setlength\belowdisplayskip{6pt plus 2pt minus 4pt}
-
-%%
-% To implement full-width display environments
-
-\RequirePackage[strict]{chngpage}
-
-%%
-% Detect if we're using pdfLaTeX
-\IfFileExists{ifpdf.sty}{%
- \RequirePackage{ifpdf}
-}{% assume we're not using pdfTex?
- \newif\ifpdf\pdffalse
-}
-
-%%
-% Detect if we're using XeLaTeX
-\IfFileExists{ifxetex.sty}{%
- \RequirePackage{ifxetex}
-}{% not using xelatex
- \newif\ifxetex\xetexfalse
-}
-
+\RequirePackage{tufte-common}
-% Compute length used for full-width displays
-
-\newlength{\@tufteh@overhang}
-\setlength{\@tufteh@overhang}{\marginparwidth}
-\addtolength{\@tufteh@overhang}{\marginparsep}
%%
-% Alter \maketitle from article.cls
-
-\renewcommand\maketitle{\par
- \global\let\and\relax
- \global\let\thanks\footnote
- \begingroup
- \newpage
- \global\@topnum\z@
- \@maketitle
- \endgroup
- \global\let\thanks\relax
- \global\let\maketitle\relax
- \global\let\@maketitle\relax
- \global\let\@thanks\@empty
- %\global\let\@author\@empty
- %\global\let\@date\@empty
- %\global\let\@title\@empty
- \global\let\title\relax
- \global\let\author\relax
- \global\let\date\relax
-}
-\def\@maketitle{%
- \newpage
- \noindent\sffamily\large{\allcaps{\@title}}\\
- \vskip0.5\baselineskip
- \noindent\normalsize{\allcaps{\@author}}\\
- \vskip0.3\baselineskip
- \noindent{\allcaps{\@date}}
- \thispagestyle{plain}
-}
+% Set up any handout-specific stuff now
%%
% Abstract
-\renewenvironment{abstract}%
- {\begin{quotation}
- \begin{sffamily}
- \begin{small}}%
- { \end{small}
- \end{sffamily}
- \end{quotation}}
-
-%%
-% Require paralist package for tighter lists
-
-\RequirePackage{paralist}
-
-% Add rightmargin to compactenum
-
-\def\@compactenum@{%
- \expandafter\list\csname label\@enumctr\endcsname{%
- \usecounter{\@enumctr}%
- \rightmargin=2em% added this
- \parsep\plparsep
- \itemsep\plitemsep
- \topsep\pltopsep
- \partopsep\plpartopsep
- \def\makelabel##1{\hss\llap{##1}}}}
-
-%%
-% Improved letterspacing of small caps and all-caps text.
-%
-% First, try to use the `microtype' package, if it's available.
-% Failing that, try to use the `soul' package, if it's available.
-% Failing that, well, I give up.
-
-\RequirePackage{textcase} % provides \MakeTextUppercase and \MakeTextLowercase
-\def\allcapsspacing{\relax}
-\def\smallcapsspacing{\relax}
-\newcommand{\allcaps}[1]{\MakeTextUppercase{\allcapsspacing{#1}}}
-\newcommand{\smallcaps}[1]{\MakeTextLowercase{\textsc{#1}}}
-
-\newcommand{\@tufteh@loadsoul}{%
- \IfFileExists{soul.sty}{%
- \RequirePackage{soul}
- \sodef\allcapsspacing{\upshape}{0.15em}{0.65em}{0.6em}
- \sodef\smallcapsspacing{\scshape}{0.075em}{0.5em}{0.6em}
- }{
- \PackageWarningNoLine{tufte-handout}{Couldn't locate `soul' package.}
- }% soul not installed... giving up.
-}
-
-% If we're using pdfLaTeX v1.40+, use the letterspace package.
-% If we're using pdfLaTex < v1.40, use the soul package.
-% If we're using XeLaTeX, use XeLaTeX letterspacing options.
-% Otherwise fall back on the soul package.
-
-\ifpdf\PackageInfo{tufte-handout}{ifpdf = true}
-\else\PackageInfo{tufte-handout}{ifpdf = false}
-\fi
-
-\ifxetex\PackageInfo{tufte-handout}{ifxetex = true}
-\else\PackageInfo{tufte-handout}{ifxetex = false}
-\fi
-
-
-
-% Check pdfLaTeX version
-\def\@tufteh@pdftexversion{0}
-\ifx\normalpdftexversion\@undefined \else
- \let\pdftexversion \normalpdftexversion
- \let\pdftexrevision\normalpdftexrevision
- \let\pdfoutput \normalpdfoutput
-\fi
-\ifx\pdftexversion\@undefined \else
- \ifx\pdftexversion\relax \else
- \def\@tufteh@pdftexversion{6}
- \ifnum\pdftexversion < 140
- \def\@tufteh@pdftexversion{5}
- \fi
- \fi
-\fi
-
-\ifnum\@tufteh@pdftexversion<6
- % pdfLaTeX version is too old or not using pdfLaTeX
- \ifxetex
- % TODO use xetex letterspacing
- \PackageInfo{tufte-handout}{XeTeX detected. Reverting to `soul' package for letterspacing.}
- \@tufteh@loadsoul
- \else
- \PackageInfo{tufte-handout}{Old version of pdfTeX detected. Reverting to `soul' package for letterspacing.}
- \@tufteh@loadsoul
- \fi
-\else
- \IfFileExists{letterspace.sty}{%
- \PackageInfo{tufte-handout}{Modern version of pdfTeX detected. Using `letterspace' package.}
- \RequirePackage{letterspace}
- % Set up letterspacing (using microtype package) -- requires pdfTeX v1.40+
- \renewcommand{\smallcapsspacing}[1]{\textls[50]{##1}}
- \renewcommand{\allcaps}[1]{\textls[200]{\MakeTextUppercase{##1}}}
- \renewcommand{\smallcaps}[1]{\textsc{\MakeTextLowercase{##1}}}
- }{% microtype failed, check for soul
- \PackageInfo{tufte-handout}{Modern version of pdfTeX detected, but `letterspace' package not installed. Reverting to `soul' package for letterspacing.}
- \@tufteh@loadsoul
- }
-\fi
-
-
-\DeclareTextFontCommand{\textsmallcaps}{\scshape}
-\renewcommand{\textsc}[1]{\textsmallcaps{\smallcapsspacing{#1}}}
-
-
-%%
-% An environment for paragraph-style section
-
-\providecommand\newthought[1]{\vspace{1.8\baselineskip plus 3pt minus 2pt}%
- {\noindent\textsc{#1}}}
-
-%%
-% Transform existing \footnotes into \sidenotes
-% Sidenote: ``Where God meant footnotes to go.'' ---Tufte
-
-\RequirePackage[side,multiple]{footmisc}
-\providecommand*{\footnotelayout}{\@tufteh@marginfont\@tufteh@justification}
-\renewcommand{\footnotelayout}{\@tufteh@marginfont\@tufteh@justification}
-
-% Override footmisc's definition to set the sidenote marks (numbers) inside the
-% sidenote's text block.
-\long\def\@makefntext#1{\@textsuperscript{\@tufteh@marginfont\tiny\@thefnmark}\,\footnotelayout#1}
-
-% Set the in-text footnote mark in the same typeface as the body text itself.
-\def\@makefnmark{\hbox{\@textsuperscript{\normalfont\scriptsize\@thefnmark}}}
-
-\let\sidenote\footnote
-
-%%
-% Sidenote without the footnote mark
-
-\providecommand\marginnote[1]%
- {\marginpar{\@tufteh@marginfont\@tufteh@justification #1}}
-
-%%
-% Citations should go in the margin as well
-
-\RequirePackage{natbib}
-\RequirePackage{bibentry} % allows bibitems to be typeset outside thebibliography environment
-\nobibliography* % pre-loads the bibliography keys
-\renewcommand{\cite}[1]{\sidenote{\bibentry{#1}.}}
-\providecommand{\doi}[1]{\textsc{doi:} #1} % pre-defining this so it may be used before the \bibliography command it issued
-
-% TODO: Rewrite \cite so that you can specify multiple bib keys
-% at once. For example, \cite{Author01,Author02}
-% TODO: Combine sequences of citations so that 2,3,4,6 becomes 2-4,6
-% but be careful of hyperref interaction
-
-%%
-% Make Tuftian-style section headings
-
-% TODO: I'd prefer to use the 'titlesec' package for this formatting, but
-% I'll do it old-style for now. --Kevin
-
-\renewcommand\section{\@startsection {section}{1}{\z@}%
- {-3.5ex \@plus -1ex \@minus -.2ex}%
- {2.3ex \@plus.2ex}%
- {\normalfont\large\it}}
-\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
- {-3.25ex\@plus -1ex \@minus -.2ex}%
- {1.5ex \@plus .2ex}%
- {\normalfont\normalsize\it}}
-
-% Subsubsection and following section headings shouldn't be used.
-% See Bringhurst's _The Elements of Typography_, section 4.2.2.
-\renewcommand\subsubsection{%
- \PackageError{tufte-handout}{\noexpand\subsubsection is undefined by this class.%
- \MessageBreak See Robert Bringhurst's _The Elements of
- \MessageBreak Typographic Style_, section 4.2.2.
- \MessageBreak \noexpand\subsubsection was used}
- {From Bringhurst's _The Elements of Typographic Style_, section 4.2.2: Use as
- \MessageBreak many levels of headings as you need, no more and no fewer. Also see the many
- \MessageBreak related threads on Ask E.T. at http://www.edwardtufte.com/.}
-}
-
-\renewcommand\paragraph{%
- \PackageError{tufte-handout}{\noexpand\paragraph is undefined by this class.%
- \MessageBreak See Robert Bringhurst's _The Elements of
- \MessageBreak Typographic Style_, section 4.2.2.
- \MessageBreak \noexpand\paragraph was used}
- {From Bringhurst's _The Elements of Typographic Style_, section 4.2.2: Use as
- \MessageBreak many levels of headings as you need, no more and no fewer. Also see the many
- \MessageBreak related threads on Ask E.T. at http://www.edwardtufte.com/.}
-}
-
-\renewcommand\subparagraph{%
- \PackageError{tufte-handout}{\noexpand\subparagraph is undefined by this class.%
- \MessageBreak See Robert Bringhurst's _The Elements of
- \MessageBreak Typographic Style_, section 4.2.2.
- \MessageBreak \noexpand\subparagraph was used}
- {From Bringhurst's _The Elements of Typographic Style_, section 4.2.2: Use as
- \MessageBreak many levels of headings as you need, no more and no fewer. Also see the many
- \MessageBreak related threads on Ask E.T. at http://www.edwardtufte.com/.}
-}
-
-
-%%
-% The placeins package provides the \FloatBarrier command. This forces
-% LaTeX to place all of the floats before proceeding. We'll use this to
-% keep the float (figure and table) numbers in sequence.
-\RequirePackage{placeins}
-
-%%
-% Margin figure environment
-
-\newsavebox{\@tufteh@marginfigbox}
-\newenvironment{marginfigure}[1]
- [-1.2ex]
- {\FloatBarrier% process all floats before this point so the figure numbers stay in order.
- \begin{lrbox}{\@tufteh@marginfigbox}
- \begin{minipage}{\marginparwidth}
- \@tufteh@marginfont
- \def\@captype{figure}
- \vspace*{#1}
- \@tufteh@justification
- }
- {\end{minipage}%
- \end{lrbox}%
- \marginpar{\usebox{\@tufteh@marginfigbox}}}
-
-
-%%
-% Margin table environment
-\newsavebox{\@tufteh@margintablebox}
-\newenvironment{margintable}[1]
- [-1.2ex]
- {\FloatBarrier% process all floats before this point so the figure numbers stay in order.
- \begin{lrbox}{\@tufteh@margintablebox}
- \begin{minipage}{\marginparwidth}
- \@tufteh@marginfont
- \def\@captype{table}
- \vspace*{#1}
- \@tufteh@justification
- }
- {\end{minipage}%
- \end{lrbox}%
- \marginpar{\usebox{\@tufteh@margintablebox}}}
-
-
-%%
-% Full-width figure
-
-\renewenvironment{figure*}[1]%
- [htbp]%
- {\@float{figure}[#1]%
- \if@tufteh@symmetric
- \begin{adjustwidth}[]{}{-\@tufteh@overhang}%
- \else
- \begin{adjustwidth}{}{-\@tufteh@overhang}%
- \fi
- \begin{minipage}{\linewidth}}%
- {\end{minipage}%
- \end{adjustwidth}%
- \end@float}
-
-%%
-% Full-width table
-
-\renewenvironment{table*}[1]
- [htbp]%
- {\@float{table}[#1]%
- \if@tufteh@symmetric
- \begin{adjustwidth}[]{}{-\@tufteh@overhang}%
- \else
- \begin{adjustwidth}{}{-\@tufteh@overhang}%
- \fi
- \begin{minipage}{\linewidth}}%
- {\end{minipage}%
- \end{adjustwidth}%
- \end@float}
-
-%%
-% Full-page-width area
-
-\newenvironment{fullwidth}
- {\if@tufteh@symmetric
- \begin{adjustwidth}[]{}{-\@tufteh@overhang}%
- \else
- \begin{adjustwidth}{}{-\@tufteh@overhang}%
- \fi
- }
- {\end{adjustwidth}}
-
-%%
-% Format the captions in a style similar to the sidenotes
-
-\RequirePackage[format=default,font={rm,scriptsize},justification=raggedright,singlelinecheck=false]{caption}
-
-% if the `sfsidenotes' option is specified, set the captions in sf, too.
-\if@tufteh@sfsidenotes
- \captionsetup{font={sf,scriptsize}}
-\else
- \captionsetup{font={rm,scriptsize}}
-\fi
-
-% if the `justified' option is specified, set the captions in flush left
-% and flush right
-\if@tufteh@justified
- \captionsetup{justification=justified}
-\else
- \captionsetup{justification=raggedright}
-\fi
-
-%%
-% If the Palatino typeface (and its math symbol set) are installed, load them.
-
-\IfFileExists{palatino.sty}{%
- \RequirePackage{palatino}
- \IfFileExists{mathpazo.sty}{\RequirePackage[osf,sc]{mathpazo}}{}
-}{} % if the Palatino typefaces aren't found, do nothing.
-
-
-%%
-% If the Bera Mono typeface is available, use it.
-
-\IfFileExists{beramono.sty}{%
- \RequirePackage[T1]{fontenc}
- \RequirePackage[scaled=0.85]{beramono}
-}{}
-
-
-%%
-% Sets up the running heads and folios.
-
-\RequirePackage{fancyhdr}
-
-% Set the header/footer width to be the body text block plus the margin
-% note area.
-\if@tufteh@symmetric
- \fancyhfoffset[LE,RO]{\@tufteh@overhang}
-\else
- \fancyhfoffset[RE,RO]{\@tufteh@overhang}
-\fi
-
-% The 'fancy' page style is the default style for all pages.
-\fancyhf{} % clear header and footer fields
-\if@tufteh@twoside
- \fancyhead[LE]{\thepage\quad\smallcaps{\@author}}
- \fancyhead[RO]{\smallcaps{\@title}\quad\thepage}
-\else
- \fancyhead[RE,RO]{\smallcaps{\@title}\quad\thepage}
-\fi
-\renewcommand{\headrulewidth}{0pt}
-\renewcommand{\footrulewidth}{0pt}
-
-% The 'plain' page style is used on chapter opening pages.
-\fancypagestyle{plain}{
- \fancyhf{} % clear header and footer fields
- \if@tufteh@twoside
- \fancyfoot[LE,RO]{\thepage}
- \else
- \fancyfoot[RE,RO]{\thepage}
- \fi
-}
-
-% The 'empty' page style suppresses all headers and footers.
-% It's used on title pages and `intentionally blank' pages.
-\fancypagestyle{empty}{
- \fancyhf{} % clear header and footer fields
-}
-
-% Set the default page style to 'fancy'
-\pagestyle{fancy}
+% TODO The abstract should be printed on its own page of the `titlepage'
+% option was specified.
+\renewenvironment{abstract}
+ {\begin{quotation}\if@tufte@sfsidenotes\begin{sffamily}\fi}
+ {\if@tufte@sfsidenotes\end{sffamily}\fi\end{quotation}}
%%
-% Set raggedright and paragraph indentation for document
+% If there is a `tufte-handout-local.tex' file, load it.
-\AtBeginDocument{\@tufteh@justification\setlength\parindent{1em}}
+\IfFileExists{tufte-handout-local.tex}
+ {\input{tufte-handout-local}}
+ {}
%%
-% Prints the list of class options and their states.
-\newcommand{\printclassoptions}{%
- \texttt{symmetric}---\if@tufteh@symmetric true\else false\fi\\
- \texttt{a4paper}---\if@tufteh@afourpaper true\else false\fi\\
- \texttt{twoside}---\if@tufteh@twoside true\else false\fi\\
- \texttt{sfsidenotes}---\if@tufteh@sfsidenotes true\else false\fi\\
- \texttt{justified}---\if@tufteh@justified true\else false\fi
-}
-
+% End of file
\endinput