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.

301 lines
12KB

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