No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

292 líneas
11KB

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