| 1 |
\documentclass{tufte-handout} |
| 2 |
|
| 3 |
\title{An Example of the Usage of the Tufte-Handout Style\thanks{Inspired by Edward~R. Tufte!}} |
| 4 |
|
| 5 |
\author[The Tufte-LaTeX Developers]{The Tufte-\LaTeX\ Developers} |
| 6 |
|
| 7 |
%\date{28 March 2010} % without \date command, current date is supplied |
| 8 |
|
| 9 |
%\geometry{showframe} % display margins for debugging page layout |
| 10 |
|
| 11 |
\usepackage{graphicx} % allow embedded images |
| 12 |
\setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} |
| 13 |
\graphicspath{{graphics/}} % set of paths to search for images |
| 14 |
\usepackage{amsmath} % extended mathematics |
| 15 |
\usepackage{booktabs} % book-quality tables |
| 16 |
\usepackage{units} % non-stacked fractions and better unit spacing |
| 17 |
\usepackage{multicol} % multiple column layout facilities |
| 18 |
\usepackage{lipsum} % filler text |
| 19 |
\usepackage{fancyvrb} % extended verbatim environments |
| 20 |
\fvset{fontsize=\normalsize}% default font size for fancy-verbatim environments |
| 21 |
|
| 22 |
% Standardize command font styles and environments |
| 23 |
\newcommand{\doccmd}[1]{\texttt{\textbackslash#1}}% command name -- adds backslash automatically |
| 24 |
\newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument |
| 25 |
\newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument |
| 26 |
\newcommand{\docenv}[1]{\textsf{#1}}% environment name |
| 27 |
\newcommand{\docpkg}[1]{\texttt{#1}}% package name |
| 28 |
\newcommand{\doccls}[1]{\texttt{#1}}% document class name |
| 29 |
\newcommand{\docclsopt}[1]{\texttt{#1}}% document class option name |
| 30 |
\newenvironment{docspec}{\begin{quote}\noindent}{\end{quote}}% command specification environment |
| 31 |
|
| 32 |
\begin{document} |
| 33 |
|
| 34 |
\maketitle% this prints the handout title, author, and date |
| 35 |
|
| 36 |
\begin{abstract} |
| 37 |
\noindent |
| 38 |
This document describes the Tufte handout \LaTeX\ document style. |
| 39 |
It also provides examples and comments on the style's use. |
| 40 |
Only a brief overview is presented here; |
| 41 |
for a complete reference, see the sample book. |
| 42 |
\end{abstract} |
| 43 |
|
| 44 |
%\printclassoptions |
| 45 |
|
| 46 |
The Tufte-\LaTeX\ document classes define a style similar to the |
| 47 |
style Edward Tufte uses in his books and handouts. Tufte's style is known |
| 48 |
for its extensive use of sidenotes, tight integration of graphics with |
| 49 |
text, and well-set typography. This document aims to be at once a |
| 50 |
demonstration of the features of the Tufte-\LaTeX\ document classes |
| 51 |
and a style guide to their use. |
| 52 |
|
| 53 |
\section{Page Layout}\label{sec:page-layout} |
| 54 |
\subsection{Headings}\label{sec:headings} |
| 55 |
This style provides \textsc{a}- and \textsc{b}-heads (that is, |
| 56 |
\Verb|\section| and \Verb|\subsection|), demonstrated above. |
| 57 |
|
| 58 |
The Tufte-\LaTeX\ classes will emit an error if you try to use |
| 59 |
\linebreak\Verb|\subsubsection| and smaller headings. |
| 60 |
|
| 61 |
% let's start a new thought -- a new section |
| 62 |
\newthought{In his later books},\cite{Tufte2006} Tufte |
| 63 |
starts each section with a bit of vertical space, a non-indented paragraph, |
| 64 |
and sets the first few words of the sentence in \textsc{small caps}. To |
| 65 |
accomplish this using this style, use the \Verb|\newthought| command: |
| 66 |
\begin{docspec} |
| 67 |
\doccmd{newthought\{In his later books\}, Tufte starts\ldots} |
| 68 |
\end{docspec} |
| 69 |
|
| 70 |
\subsection{Sidenotes}\label{sec:sidenotes} |
| 71 |
One of the most prominent and distinctive features of this style is the |
| 72 |
extensive use of sidenotes. There is a wide margin to provide ample room |
| 73 |
for sidenotes and small figures. Any \Verb|\footnote|s will automatically |
| 74 |
be converted to sidenotes.\footnote{This is a sidenote that was entered |
| 75 |
using the \texttt{\textbackslash footnote} command.} If you'd like to place ancillary |
| 76 |
information in the margin without the sidenote mark (the superscript |
| 77 |
number), you can use the \Verb|\marginnote| command.\marginnote{This is a |
| 78 |
margin note. Notice that there isn't a number preceding the note, and |
| 79 |
there is no number in the main text where this note was written.} |
| 80 |
|
| 81 |
The specification of the \Verb|\sidenote| command is: |
| 82 |
\begin{docspec} |
| 83 |
\doccmd{sidenote[\docopt{number}][\docopt{offset}]\{\docarg{Sidenote text.}\}} |
| 84 |
\end{docspec} |
| 85 |
|
| 86 |
Both the \docopt{number} and \docopt{offset} arguments are optional. If you |
| 87 |
provide a \docopt{number} argument, then that number will be used as the |
| 88 |
sidenote number. It will change of the number of the current sidenote only and |
| 89 |
will not affect the numbering sequence of subsequent sidenotes. |
| 90 |
|
| 91 |
Sometimes a sidenote may run over the top of other text or graphics in the |
| 92 |
margin space. If this happens, you can adjust the vertical position of the |
| 93 |
sidenote by providing a dimension in the \docopt{offset} argument. Some |
| 94 |
examples of valid dimensions are: |
| 95 |
\begin{docspec} |
| 96 |
\ttfamily 1.0in \qquad 2.54cm \qquad 254mm \qquad 6\Verb|\baselineskip| |
| 97 |
\end{docspec} |
| 98 |
If the dimension is positive it will push the sidenote down the page; if the |
| 99 |
dimension is negative, it will move the sidenote up the page. |
| 100 |
|
| 101 |
While both the \docopt{number} and \docopt{offset} arguments are optional, they |
| 102 |
must be provided in order. To adjust the vertical position of the sidenote |
| 103 |
while leaving the sidenote number alone, use the following syntax: |
| 104 |
\begin{docspec} |
| 105 |
\doccmd{sidenote[][\docopt{offset}]\{\docarg{Sidenote text.}\}} |
| 106 |
\end{docspec} |
| 107 |
The empty brackets tell the \Verb|\sidenote| command to use the default |
| 108 |
sidenote number. |
| 109 |
|
| 110 |
If you \emph{only} want to change the sidenote number, however, you may |
| 111 |
completely omit the \docopt{offset} argument: |
| 112 |
\begin{docspec} |
| 113 |
\doccmd{sidenote[\docopt{number}]\{\docarg{Sidenote text.}\}} |
| 114 |
\end{docspec} |
| 115 |
|
| 116 |
The \Verb|\marginnote| command has a similar \docarg{offset} argument: |
| 117 |
\begin{docspec} |
| 118 |
\doccmd{marginnote[\docopt{offset}]\{\docarg{Margin note text.}\}} |
| 119 |
\end{docspec} |
| 120 |
|
| 121 |
\subsection{References} |
| 122 |
References are placed alongside their citations as sidenotes, |
| 123 |
as well. This can be accomplished using the normal \Verb|\cite| |
| 124 |
command.\sidenote{The first paragraph of this document includes a citation.} |
| 125 |
|
| 126 |
The complete list of references may also be printed automatically by using |
| 127 |
the \Verb|\bibliography| command. (See the end of this document for an |
| 128 |
example.) If you do not want to print a bibliography at the end of your |
| 129 |
document, use the \Verb|\nobibliography| command in its place. |
| 130 |
|
| 131 |
To enter multiple citations at one location,\cite{Tufte2006,Tufte1990} you can |
| 132 |
provide a list of keys separated by commas and the same optional vertical |
| 133 |
offset argument: \Verb|\cite{Tufte2006,Tufte1990}|. |
| 134 |
\begin{docspec} |
| 135 |
\doccmd{cite[\docopt{offset}]\{\docarg{bibkey1,bibkey2,\ldots}\}} |
| 136 |
\end{docspec} |
| 137 |
|
| 138 |
\section{Figures and Tables}\label{sec:figures-and-tables} |
| 139 |
Images and graphics play an integral role in Tufte's work. |
| 140 |
In addition to the standard \docenv{figure} and \docenv{tabular} environments, |
| 141 |
this style provides special figure and table environments for full-width |
| 142 |
floats. |
| 143 |
|
| 144 |
Full page--width figures and tables may be placed in \docenv{figure*} or |
| 145 |
\docenv{table*} environments. To place figures or tables in the margin, |
| 146 |
use the \docenv{marginfigure} or \docenv{margintable} environments as follows |
| 147 |
(see figure~\ref{fig:marginfig}): |
| 148 |
|
| 149 |
\begin{marginfigure}% |
| 150 |
\includegraphics[width=\linewidth]{helix} |
| 151 |
\caption{This is a margin figure. The helix is defined by |
| 152 |
$x = \cos(2\pi z)$, $y = \sin(2\pi z)$, and $z = [0, 2.7]$. The figure was |
| 153 |
drawn using Asymptote (\url{http://asymptote.sf.net/}).} |
| 154 |
\label{fig:marginfig} |
| 155 |
\end{marginfigure} |
| 156 |
\begin{Verbatim} |
| 157 |
\begin{marginfigure} |
| 158 |
\includegraphics{helix} |
| 159 |
\caption{This is a margin figure.} |
| 160 |
\end{marginfigure} |
| 161 |
\end{Verbatim} |
| 162 |
|
| 163 |
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: |
| 164 |
\begin{docspec} |
| 165 |
\doccmd{begin\{marginfigure\}[\docopt{offset}]}\\ |
| 166 |
\qquad\ldots\\ |
| 167 |
\doccmd{end\{marginfigure\}}\\ |
| 168 |
\mbox{}\\ |
| 169 |
\doccmd{begin\{margintable\}[\docopt{offset}]}\\ |
| 170 |
\qquad\ldots\\ |
| 171 |
\doccmd{end\{margintable\}}\\ |
| 172 |
\end{docspec} |
| 173 |
|
| 174 |
Figure~\ref{fig:fullfig} is an example of the \Verb|figure*| |
| 175 |
environment and figure~\ref{fig:textfig} is an example of the normal |
| 176 |
\Verb|figure| environment. |
| 177 |
|
| 178 |
\begin{figure*}[h] |
| 179 |
\includegraphics[width=\linewidth]{sine.pdf}% |
| 180 |
\caption{This graph shows $y = \sin x$ from about $x = [-10, 10]$. |
| 181 |
\emph{Notice that this figure takes up the full page width.}}% |
| 182 |
\label{fig:fullfig}% |
| 183 |
\end{figure*} |
| 184 |
|
| 185 |
\begin{figure} |
| 186 |
\includegraphics{hilbertcurves.pdf} |
| 187 |
% \checkparity This is an \pageparity\ page.% |
| 188 |
\caption{Hilbert curves of various degrees $n$. |
| 189 |
\emph{Notice that this figure only takes up the main textblock width.}} |
| 190 |
\label{fig:textfig} |
| 191 |
%\zsavepos{pos:textfig} |
| 192 |
\setfloatalignment{b} |
| 193 |
\end{figure} |
| 194 |
|
| 195 |
Table~\ref{tab:normaltab} shows table created with the \docpkg{booktabs} |
| 196 |
package. Notice the lack of vertical rules---they serve only to clutter |
| 197 |
the table's data. |
| 198 |
|
| 199 |
\begin{table}[ht] |
| 200 |
\centering |
| 201 |
\fontfamily{ppl}\selectfont |
| 202 |
\begin{tabular}{ll} |
| 203 |
\toprule |
| 204 |
Margin & Length \\ |
| 205 |
\midrule |
| 206 |
Paper width & \unit[8\nicefrac{1}{2}]{inches} \\ |
| 207 |
Paper height & \unit[11]{inches} \\ |
| 208 |
Textblock width & \unit[6\nicefrac{1}{2}]{inches} \\ |
| 209 |
Textblock/sidenote gutter & \unit[\nicefrac{3}{8}]{inches} \\ |
| 210 |
Sidenote width & \unit[2]{inches} \\ |
| 211 |
\bottomrule |
| 212 |
\end{tabular} |
| 213 |
\caption{Here are the dimensions of the various margins used in the Tufte-handout class.} |
| 214 |
\label{tab:normaltab} |
| 215 |
%\zsavepos{pos:normaltab} |
| 216 |
\end{table} |
| 217 |
|
| 218 |
\section{Full-width text blocks} |
| 219 |
|
| 220 |
In addition to the new float types, there is a \docenv{fullwidth} |
| 221 |
environment that stretches across the main text block and the sidenotes |
| 222 |
area. |
| 223 |
|
| 224 |
\begin{Verbatim} |
| 225 |
\begin{fullwidth} |
| 226 |
Lorem ipsum dolor sit amet... |
| 227 |
\end{fullwidth} |
| 228 |
\end{Verbatim} |
| 229 |
|
| 230 |
\begin{fullwidth} |
| 231 |
\small\itshape\lipsum[1] |
| 232 |
\end{fullwidth} |
| 233 |
|
| 234 |
\section{Typography}\label{sec:typography} |
| 235 |
|
| 236 |
\subsection{Typefaces}\label{sec:typefaces} |
| 237 |
If the Palatino, \textsf{Helvetica}, and \texttt{Bera Mono} typefaces are installed, this style |
| 238 |
will use them automatically. Otherwise, we'll fall back on the Computer Modern |
| 239 |
typefaces. |
| 240 |
|
| 241 |
\subsection{Letterspacing}\label{sec:letterspacing} |
| 242 |
This document class includes two new commands and some improvements on |
| 243 |
existing commands for letterspacing. |
| 244 |
|
| 245 |
When setting strings of \allcaps{ALL CAPS} or \smallcaps{small caps}, the |
| 246 |
letter\-spacing---that is, the spacing between the letters---should be |
| 247 |
increased slightly.\cite{Bringhurst2005} The \Verb|\allcaps| command has proper letterspacing for |
| 248 |
strings of \allcaps{FULL CAPITAL LETTERS}, and the \Verb|\smallcaps| command |
| 249 |
has letterspacing for \smallcaps{small capital letters}. These commands |
| 250 |
will also automatically convert the case of the text to upper- or |
| 251 |
lowercase, respectively. |
| 252 |
|
| 253 |
The \Verb|\textsc| command has also been redefined to include |
| 254 |
letterspacing. The case of the \Verb|\textsc| argument is left as is, |
| 255 |
however. This allows one to use both uppercase and lowercase letters: |
| 256 |
\textsc{The Initial Letters Of The Words In This Sentence Are Capitalized.} |
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
\section{Installation}\label{sec:installation} |
| 261 |
To install the Tufte-\LaTeX\ classes, simply drop the |
| 262 |
following files into the same directory as your \texttt{.tex} |
| 263 |
file: |
| 264 |
\begin{quote} |
| 265 |
\ttfamily |
| 266 |
tufte-book.cls\\ |
| 267 |
tufte-common.def\\ |
| 268 |
tufte-handout.cls\\ |
| 269 |
tufte.bst |
| 270 |
\end{quote} |
| 271 |
|
| 272 |
% TODO add instructions for installing it globally |
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
\section{More Documentation}\label{sec:more-doc} |
| 277 |
For more documentation on the Tufte-\LaTeX{} document classes (including commands not |
| 278 |
mentioned in this handout), please see the sample book. |
| 279 |
|
| 280 |
\section{Support}\label{sec:support} |
| 281 |
|
| 282 |
The website for the Tufte-\LaTeX\ packages is located at |
| 283 |
\url{http://code.google.com/p/tufte-latex/}. On our website, you'll find |
| 284 |
links to our \smallcaps{svn} repository, mailing lists, bug tracker, and documentation. |
| 285 |
|
| 286 |
\bibliography{sample-handout} |
| 287 |
\bibliographystyle{plainnat} |
| 288 |
|
| 289 |
|
| 290 |
|
| 291 |
\end{document} |