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.

328 line
12KB

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