You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sample-handout.tex 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343
  1. \documentclass[nofonts]{tufte-handout}
  2. \usepackage{amsmath}
  3. % Set up the images/graphics package
  4. \usepackage{graphicx}
  5. \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}
  6. \graphicspath{{graphics/}}
  7. \usepackage{mcaption} % FIXME move to .cls file
  8. \title{An Example of the Usage of the Tufte-Handout Style\thanks{Inspired by Edward~R. Tufte!}}
  9. \author[The Tufte-LaTeX Developers]{The Tufte-\LaTeX\ Developers}
  10. \date{22 February 2008} % if the \date{} command is left out, the current date will be used
  11. %%
  12. % If we have Bergamo and Chantilly fonts (from www.fontsite.com) installed,
  13. % use them. Bergamo is a clone of Bembo and Chantilly is similar to Gill Sans.
  14. \makeatletter
  15. \ifthenelse{\NOT\boolean{@tufte@xetex}}
  16. {%
  17. \IfFileExists{bergamo.sty}{\usepackage[osf]{bergamo}}{}% Bembo clone
  18. \IfFileExists{chantill.sty}{\usepackage{chantill}}{}% Gill Sans clone
  19. }{% We're using XeTeX -- load fontspec, etc.
  20. \usepackage{fontspec}
  21. \usepackage{xltxtra}
  22. \setromanfont{Bergamo}% Bembo clone
  23. \setsansfont{Chantilly}% Gill Sans clone
  24. \setmonofont{Bitstream Vera Sans Mono}%
  25. }
  26. \makeatother
  27. % The following package makes prettier tables. We're all about the bling!
  28. \usepackage{booktabs}
  29. % The units package provides nice, non-stacked fractions and better spacing
  30. % for units.
  31. \usepackage{units}
  32. % The fancyvrb package lets us customize the formatting of verbatim
  33. % environments. We use a slightly smaller font.
  34. \usepackage{fancyvrb}
  35. \fvset{fontsize=\normalsize}
  36. % Small sections of multiple columns
  37. \usepackage{multicol}
  38. % Provides paragraphs of dummy text
  39. \usepackage{lipsum}
  40. \begin{document}
  41. \maketitle % this prints the handout title, author, and date
  42. \begin{abstract}
  43. \noindent This document describes the Tufte handout \LaTeX\ document style.
  44. It also provides examples and comments on the style's use.
  45. \end{abstract}
  46. %\printclassoptions
  47. The \Verb|tufte-handout| document class defines a style similar to the
  48. style Edward Tufte uses in his books and handouts. Tufte's style is known
  49. for its extensive use of sidenotes, tight integration of graphics with
  50. text, and well-set typography. This document aims to be at once a
  51. demonstration of the features of the \Verb|tufte-handout| document class
  52. and a style guide to its use.
  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. If you need more than two levels of section headings, you'll have to define
  58. them yourself at the moment;\sidenote{See see ``Defining new sections'' on
  59. page~\pageref{sec:defining-sections} for help with defining more heading
  60. levels.} there are no pre-defined styles for anything below a
  61. \Verb|\subsection|. As Bringhurst points out in \textit{The Elements of
  62. Typographic Style},\cite{Bringhurst2005} you should ``use as many levels of
  63. headings as you need: no more, and no fewer.''
  64. The Tufte-handout class will emit an error if you try to use
  65. \Verb|\subsubsection| and smaller headings.
  66. %\medskip
  67. %\begin{fullwidth}
  68. %\begin{Verbatim}
  69. %! Package tufte-handout Error: \subsubsection is undefined by this class.
  70. %(tufte-handout) See Robert Bringhurst's _The Elements of
  71. %(tufte-handout) Typographic Style_, section 4.2.2.
  72. %(tufte-handout) \subsubsection was used.
  73. %\end{Verbatim}
  74. %\end{fullwidth}
  75. %\medskip
  76. % let's start a new thought -- a new section
  77. \newthought{In his later books},\cite{Tufte2006} Tufte
  78. starts each section with a bit of vertical space, a non-indented paragraph,
  79. and sets the first few words of the sentence in \textsc{small caps}. To
  80. accomplish this using this style, use the \Verb|\newthought| command:
  81. \Verb|\newthought{In his later books}, Tufte starts|\ldots
  82. \subsection{Sidenotes}\label{sec:sidenotes}
  83. One of the most prominent and distinctive features of this style is the
  84. extensive use of sidenotes. There is a wide margin to provide ample room
  85. for sidenotes and small figures. Any \Verb|\footnote|s will automatically
  86. be converted to sidenotes.\footnote{This is a sidenote that was entered
  87. using the \texttt{\textbackslash footnote} command.} If you'd like to place ancillary
  88. information in the margin without the sidenote mark (the superscript
  89. number), you can use the \Verb|\marginnote| command.\marginnote{This is a
  90. margin note. Notice that there isn't a number preceding the note, and
  91. there is no number in the main text where this note was written.}
  92. \subsection{References}
  93. References are placed alongside their citations as sidenotes,
  94. as well. This can be accomplished using the normal \Verb|\cite|
  95. command.\footnote{The first paragraph of this document includes a citation.}
  96. The complete list of references may also be printed automatically by using
  97. the \Verb|\bibliography| command. (See the end of this document for an
  98. example.) If you do not want to print a bibliography at the end of your
  99. document, use the \Verb|\nobibliography| command in its place.
  100. To enter multiple citations at one
  101. location,\cite{Tufte2006,Tufte1990} you will need to use multiple
  102. \Verb|\cite| commands: \Verb|\cite{Tufte2006}| \Verb|\cite{Tufte1990}|. Each
  103. \Verb|\cite| command will generate its own sidenote and its own sidenote
  104. number.
  105. \section{Figures and Tables}\label{sec:figures-and-tables}
  106. Images and graphics play an integral role in Tufte's work.
  107. In addition to the standard \Verb|figure| and \Verb|tabular| environments,
  108. this style provides special figure and table environments for full-width
  109. floats.
  110. Full page width figures and tables may be placed in \texttt{figure*} or
  111. \texttt{table*} environments. To place figures or tables in the margin,
  112. use the \Verb|marginfigure| or \Verb|margintable| environments as follows
  113. (see figure~\ref{fig:marginfig}):
  114. \begin{marginfigure}
  115. \includegraphics[width=\marginparwidth]{helix}
  116. \caption{This is a margin figure. The helix is defined by
  117. $x = \cos(2\pi z)$, $y = \sin(2\pi z)$, and $z = [0, 2.7]$. The figure was
  118. drawn using Asymptote (\url{http://asymptote.sf.net/}).}
  119. \label{fig:marginfig}
  120. \end{marginfigure}
  121. \begin{Verbatim}
  122. \begin{marginfigure}
  123. \includegraphics{blah}
  124. \caption{This figure is in the margin.}
  125. \end{marginfigure}
  126. \end{Verbatim}
  127. Figure~\ref{fig:fullfig} is an example of the \Verb|figure*|
  128. environment and figure~\ref{fig:textfig} is an example of the normal
  129. \Verb|figure| environment.
  130. \begin{figure*}
  131. \includegraphics{sine.pdf}
  132. \caption{This graph shows $y = \sin x$ from about $x = [-10, 10]$.
  133. \emph{Notice that this figure takes up the full page width.}}
  134. \label{fig:fullfig}
  135. %\zsavepos{pos:fullfig}
  136. \end{figure*}
  137. \begin{figure}
  138. \includegraphics{hilbertcurves.pdf}
  139. \caption{Hilbert curves of various degrees $n$.
  140. \emph{Notice that this figure only takes up the main textblock width.}}
  141. \label{fig:textfig}
  142. %\zsavepos{pos:textfig}
  143. \end{figure}
  144. Table~\ref{tab:normaltab} shows table created with the \texttt{booktabs}
  145. package. Notice the lack of vertical rules---they serve only to clutter
  146. the table's data.
  147. \begin{table}[ht]
  148. \centering
  149. \fontfamily{ppl}\selectfont
  150. \begin{tabular}{ll}
  151. \toprule
  152. Margin & Length \\
  153. \midrule
  154. Paper width & \unit[8\nicefrac{1}{2}]{inches} \\
  155. Paper height & \unit[11]{inches} \\
  156. Textblock width & \unit[6\nicefrac{1}{2}]{inches} \\
  157. Textblock/sidenote gutter & \unit[\nicefrac{3}{8}]{inches} \\
  158. Sidenote width & \unit[2]{inches} \\
  159. \bottomrule
  160. \end{tabular}
  161. \caption{Here are the dimensions of the various margins used in the Tufte-handout class.}
  162. \label{tab:normaltab}
  163. %\zsavepos{pos:normaltab}
  164. \end{table}
  165. \section{Full-width text blocks}
  166. In addition to the new float types, there is a \texttt{fullwidth}
  167. environment that stretches across the main text block and the sidenotes
  168. area.
  169. \begin{Verbatim}
  170. \begin{fullwidth}
  171. Lorem ipsum dolor sit amet...
  172. \end{fullwidth}
  173. \end{Verbatim}
  174. \begin{fullwidth}
  175. \small\itshape\lipsum[1]
  176. \end{fullwidth}
  177. \section{Typography}\label{sec:typography}
  178. \subsection{Typefaces}\label{sec:typefaces}
  179. If the Palatino and Bera Mono typefaces are installed, this style will use
  180. them automatically. Otherwise, we'll fall back on the Computer Modern
  181. typefaces.
  182. \subsection{Letterspacing}\label{sec:letterspacing}
  183. This document class includes two new commands and some improvements on
  184. existing commands for letterspacing.
  185. When setting strings of \allcaps{ALL CAPS} or \smallcaps{small caps}, the
  186. letterspacing---that is, the spacing between the letters---should be
  187. increased slightly.\cite{Bringhurst2005} The \Verb|\allcaps| command has proper letterspacing for
  188. strings of \allcaps{FULL CAPITAL LETTERS}, and the \Verb|\smallcaps| command
  189. has letterspacing for \smallcaps{small capital letters}. These commands
  190. will also automatically convert the case of the text to upper- or
  191. lowercase, respectively.
  192. The \Verb|\textsc| command has also been redefined to include
  193. letterspacing. The case of the \Verb|\textsc| argument is left as is,
  194. however. This allows one to use both uppercase and lowercase letters:
  195. \textsc{The Initial Letters Of The Words In This Sentence Are Capitalized.}
  196. \section{Customization}\label{sec:customization}
  197. \subsection{Document class options}\label{sec:options}
  198. The \Verb|tufte-handout| class is based on the \LaTeX\ \Verb|article|
  199. document class. Therefore, you can pass any of the typical article
  200. options. There are a few options that are specific to the
  201. \Verb|tufte-handout| document class, however.
  202. The \Verb|a4paper| option will set the paper size to \smallcaps{A4} instead of
  203. the default \smallcaps{US} letter size.
  204. The \Verb|sfsidenotes| option will set the sidenotes in a \textsf{sans
  205. serif} typeface instead of the default roman.
  206. The \Verb|twoside| option will modify the running heads so that the page
  207. number is printed on the outside edge (as opposed to always printing the page
  208. number on the right-side edge in \Verb|oneside| mode).
  209. The \Verb|symmetric| option typesets the sidenotes on the outside edge of
  210. the page. This is how books are traditionally printed, but is contrary to
  211. Tufte's book design which sets the sidenotes on the right side of the page.
  212. This option implicitly sets the \Verb|twoside| option.
  213. The \Verb|justified| option sets all the text fully justified (flush left
  214. and right). The default is to set the text ragged right.
  215. The body text of Tufte's books are set ragged right. This prevents
  216. needless hyphenation and makes it easier to read the text in the slightly
  217. narrower column.
  218. \subsection{Defining new sections}\label{sec:defining-sections}
  219. As mentioned on page~\pageref{sec:headings}, the \Verb|tufte-handout|
  220. document class only defines \Verb|\section| and \Verb|\subsection|
  221. headings.
  222. If you wanted to define, say, a \Verb|\paragraph| heading, you could do it
  223. as follows:
  224. \begin{Verbatim}
  225. \makeatletter
  226. \renewcommand\paragraph{\@startsection{paragraph}% the name of the new section
  227. {4}% the section level number
  228. {0em}% indentation amount
  229. {\baselineskip}% amount of space to leave before heading
  230. {-1.5em}% amount of space to leave after heading
  231. {\normalfont\itshape}% style
  232. }
  233. \makeatother
  234. \end{Verbatim}
  235. Place that code in the preamble of your document and you'll now be able to use
  236. \Verb|\paragraph|.
  237. For more details on defining section levels, see \textit{The \LaTeX\
  238. Companion},\cite{Mittelbach2004} or use the \Verb|titlesec| package.
  239. \section{Installation}\label{sec:installation}
  240. To install the \Verb|tufte-handout| class, simply drop the
  241. \Verb|tufte-handout.cls| file into the same directory as your \Verb|.tex|
  242. file.
  243. % TODO add instructions for installing it globally
  244. \section{Support}\label{sec:support}
  245. \subsection{Package Dependencies}\label{sec:dependencies}
  246. The following is a list of packages that the \Verb|tufte-handout| document
  247. class relies upon. Packages marked with an asterisk are optional.
  248. \begin{multicols}{2}
  249. \begin{itemize}
  250. \item geometry
  251. \item ragged2e
  252. \item chngpage
  253. \item paralist
  254. \item textcase
  255. \item footmisc
  256. \item natbib and bibentry
  257. \item placeins
  258. \item caption
  259. \item fancyhdr
  260. \item microtype*
  261. \item soul*
  262. \item palatino*
  263. \item beramono*
  264. \end{itemize}
  265. \end{multicols}
  266. \subsection{Tufte-\LaTeX\ Website}\label{sec:website}
  267. The website for the Tufte-\LaTeX\ packages is located at
  268. \url{http://code.google.com/p/tufte-latex/}. On our website, you'll find
  269. links to our \smallcaps{svn} repository, mailing lists, bug tracker, and documentation.
  270. \bibliography{sample-handout}
  271. \bibliographystyle{plainnat}
  272. %\section{Float Positions---DEBUG}
  273. %Full figure: $x=\zposx{pos:fullfig}$, $y=\zposy{pos:fullfig}$
  274. %Text figure: $x=\zposx{pos:textfig}$, $y=\zposy{pos:textfig}$
  275. %Normal table: $x=\zposx{pos:normaltab}$, $y=\zposy{pos:normaltab}$
  276. \end{document}