25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

383 satır
15KB

  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.
  38. \end{abstract}
  39. %\printclassoptions
  40. The Tufte-\LaTeX\ document classes define a style similar to the
  41. style Edward Tufte uses in his books and handouts. Tufte's style is known
  42. for its extensive use of sidenotes, tight integration of graphics with
  43. text, and well-set typography. This document aims to be at once a
  44. demonstration of the features of the Tufte-\LaTeX\ document classes
  45. and a style guide to their use.
  46. \section{Page Layout}\label{sec:page-layout}
  47. \subsection{Headings}\label{sec:headings}
  48. This style provides \textsc{a}- and \textsc{b}-heads (that is,
  49. \Verb|\section| and \Verb|\subsection|), demonstrated above.
  50. If you need more than two levels of section headings, you'll have to define
  51. them yourself at the moment;\sidenote{See see ``\nameref{sec:defining-sections}'' on
  52. page~\pageref{sec:defining-sections} for help with defining more heading
  53. levels.} there are no pre-defined styles for anything below a
  54. \Verb|\subsection|. As Bringhurst points out in \textit{The Elements of
  55. Typographic Style},\cite{Bringhurst2005} you should ``use as many levels of
  56. headings as you need: no more, and no fewer.''
  57. The Tufte-\LaTeX\ classes will emit an error if you try to use
  58. \linebreak\Verb|\subsubsection| and smaller headings.
  59. %\medskip
  60. %\begin{fullwidth}
  61. %\begin{Verbatim}
  62. %! Package tufte-handout Error: \subsubsection is undefined by this class.
  63. %(tufte-handout) See Robert Bringhurst's _The Elements of
  64. %(tufte-handout) Typographic Style_, section 4.2.2.
  65. %(tufte-handout) \subsubsection was used.
  66. %\end{Verbatim}
  67. %\end{fullwidth}
  68. %\medskip
  69. % let's start a new thought -- a new section
  70. \newthought{In his later books},\cite{Tufte2006} Tufte
  71. starts each section with a bit of vertical space, a non-indented paragraph,
  72. and sets the first few words of the sentence in \textsc{small caps}. To
  73. accomplish this using this style, use the \Verb|\newthought| command:
  74. \begin{docspec}
  75. \doccmd{newthought\{In his later books\}, Tufte starts\ldots}
  76. \end{docspec}
  77. \subsection{Sidenotes}\label{sec:sidenotes}
  78. One of the most prominent and distinctive features of this style is the
  79. extensive use of sidenotes. There is a wide margin to provide ample room
  80. for sidenotes and small figures. Any \Verb|\footnote|s will automatically
  81. be converted to sidenotes.\footnote{This is a sidenote that was entered
  82. using the \texttt{\textbackslash footnote} command.} If you'd like to place ancillary
  83. information in the margin without the sidenote mark (the superscript
  84. number), you can use the \Verb|\marginnote| command.\marginnote{This is a
  85. margin note. Notice that there isn't a number preceding the note, and
  86. there is no number in the main text where this note was written.}
  87. The specification of the \Verb|\sidenote| command is:
  88. \begin{docspec}
  89. \doccmd{sidenote[\docopt{number}][\docopt{offset}]\{\docarg{Sidenote text.}\}}
  90. \end{docspec}
  91. Both the \docopt{number} and \docopt{offset} arguments are optional. If you
  92. provide a \docopt{number} argument, then that number will be used as the
  93. sidenote number. It will change of the number of the current sidenote only and
  94. will not affect the numbering sequence of subsequent sidenotes.
  95. Sometimes a sidenote may run over the top of other text or graphics in the
  96. margin space. If this happens, you can adjust the vertical position of the
  97. sidenote by providing a dimension in the \docopt{offset} argument. Some
  98. examples of valid dimensions are:
  99. \begin{docspec}
  100. \ttfamily 1.0in \qquad 2.54cm \qquad 254mm \qquad 6\Verb|\baselineskip|
  101. \end{docspec}
  102. If the dimension is positive it will push the sidenote down the page; if the
  103. dimension is negative, it will move the sidenote up the page.
  104. While both the \docopt{number} and \docopt{offset} arguments are optional, they
  105. must be provided in order. To adjust the vertical position of the sidenote
  106. while leaving the sidenote number alone, use the following syntax:
  107. \begin{docspec}
  108. \doccmd{sidenote[][\docopt{offset}]\{\docarg{Sidenote text.}\}}
  109. \end{docspec}
  110. The empty brackets tell the \Verb|\sidenote| command to use the default
  111. sidenote number.
  112. If you \emph{only} want to change the sidenote number, however, you may
  113. completely omit the \docopt{offset} argument:
  114. \begin{docspec}
  115. \doccmd{sidenote[\docopt{number}]\{\docarg{Sidenote text.}\}}
  116. \end{docspec}
  117. The \Verb|\marginnote| command has a similar \docarg{offset} argument:
  118. \begin{docspec}
  119. \doccmd{marginnote[\docopt{offset}]\{\docarg{Margin note text.}\}}
  120. \end{docspec}
  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. The complete list of references may also be printed automatically by using
  126. the \Verb|\bibliography| command. (See the end of this document for an
  127. example.) If you do not want to print a bibliography at the end of your
  128. document, use the \Verb|\nobibliography| command in its place.
  129. To enter multiple citations at one location,\cite[-3\baselineskip]{Tufte2006,Tufte1990} you can
  130. provide a list of keys separated by commas and the same optional vertical
  131. offset argument: \Verb|\cite{Tufte2006,Tufte1990}|.
  132. \begin{docspec}
  133. \doccmd{cite[\docopt{offset}]\{\docarg{bibkey1,bibkey2,\ldots}\}}
  134. \end{docspec}
  135. \section{Figures and Tables}\label{sec:figures-and-tables}
  136. Images and graphics play an integral role in Tufte's work.
  137. In addition to the standard \docenv{figure} and \docenv{tabular} environments,
  138. this style provides special figure and table environments for full-width
  139. floats.
  140. Full page--width figures and tables may be placed in \docenv{figure*} or
  141. \docenv{table*} environments. To place figures or tables in the margin,
  142. use the \docenv{marginfigure} or \docenv{margintable} environments as follows
  143. (see figure~\ref{fig:marginfig}):
  144. \begin{marginfigure}%
  145. \includegraphics[width=\linewidth]{helix}
  146. \caption{This is a margin figure. The helix is defined by
  147. $x = \cos(2\pi z)$, $y = \sin(2\pi z)$, and $z = [0, 2.7]$. The figure was
  148. drawn using Asymptote (\url{http://asymptote.sf.net/}).}
  149. \label{fig:marginfig}
  150. \end{marginfigure}
  151. \begin{Verbatim}
  152. \begin{marginfigure}
  153. \includegraphics{helix}
  154. \caption{This is a margin figure.}
  155. \end{marginfigure}
  156. \end{Verbatim}
  157. 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:
  158. \begin{docspec}
  159. \doccmd{begin\{marginfigure\}[\docopt{offset}]}\\
  160. \qquad\ldots\\
  161. \doccmd{end\{marginfigure\}}\\
  162. \mbox{}\\
  163. \doccmd{begin\{margintable\}[\docopt{offset}]}\\
  164. \qquad\ldots\\
  165. \doccmd{end\{margintable\}}\\
  166. \end{docspec}
  167. Figure~\ref{fig:fullfig} is an example of the \Verb|figure*|
  168. environment and figure~\ref{fig:textfig} is an example of the normal
  169. \Verb|figure| environment.
  170. \begin{figure*}[h]
  171. \includegraphics[width=\linewidth]{sine.pdf}%
  172. \caption{This graph shows $y = \sin x$ from about $x = [-10, 10]$.
  173. \emph{Notice that this figure takes up the full page width.}}%
  174. \label{fig:fullfig}%
  175. \end{figure*}
  176. \begin{figure}
  177. \includegraphics{hilbertcurves.pdf}
  178. % \checkparity This is an \pageparity\ page.%
  179. \caption{Hilbert curves of various degrees $n$.
  180. \emph{Notice that this figure only takes up the main textblock width.}}
  181. \label{fig:textfig}
  182. %\zsavepos{pos:textfig}
  183. \end{figure}
  184. Table~\ref{tab:normaltab} shows table created with the \docpkg{booktabs}
  185. package. Notice the lack of vertical rules---they serve only to clutter
  186. the table's data.
  187. \begin{table}[ht]
  188. \centering
  189. \fontfamily{ppl}\selectfont
  190. \begin{tabular}{ll}
  191. \toprule
  192. Margin & Length \\
  193. \midrule
  194. Paper width & \unit[8\nicefrac{1}{2}]{inches} \\
  195. Paper height & \unit[11]{inches} \\
  196. Textblock width & \unit[6\nicefrac{1}{2}]{inches} \\
  197. Textblock/sidenote gutter & \unit[\nicefrac{3}{8}]{inches} \\
  198. Sidenote width & \unit[2]{inches} \\
  199. \bottomrule
  200. \end{tabular}
  201. \caption{Here are the dimensions of the various margins used in the Tufte-handout class.}
  202. \label{tab:normaltab}
  203. %\zsavepos{pos:normaltab}
  204. \end{table}
  205. \section{Full-width text blocks}
  206. In addition to the new float types, there is a \docenv{fullwidth}
  207. environment that stretches across the main text block and the sidenotes
  208. area.
  209. \begin{Verbatim}
  210. \begin{fullwidth}
  211. Lorem ipsum dolor sit amet...
  212. \end{fullwidth}
  213. \end{Verbatim}
  214. \begin{fullwidth}
  215. \small\itshape\lipsum[1]
  216. \end{fullwidth}
  217. \section{Typography}\label{sec:typography}
  218. \subsection{Typefaces}\label{sec:typefaces}
  219. If the Palatino, \textsf{Helvetica}, and \texttt{Bera Mono} typefaces are installed, this style
  220. will use them automatically. Otherwise, we'll fall back on the Computer Modern
  221. typefaces.
  222. \subsection{Letterspacing}\label{sec:letterspacing}
  223. This document class includes two new commands and some improvements on
  224. existing commands for letterspacing.
  225. When setting strings of \allcaps{ALL CAPS} or \smallcaps{small caps}, the
  226. letter\-spacing---that is, the spacing between the letters---should be
  227. increased slightly.\cite{Bringhurst2005} The \Verb|\allcaps| command has proper letterspacing for
  228. strings of \allcaps{FULL CAPITAL LETTERS}, and the \Verb|\smallcaps| command
  229. has letterspacing for \smallcaps{small capital letters}. These commands
  230. will also automatically convert the case of the text to upper- or
  231. lowercase, respectively.
  232. The \Verb|\textsc| command has also been redefined to include
  233. letterspacing. The case of the \Verb|\textsc| argument is left as is,
  234. however. This allows one to use both uppercase and lowercase letters:
  235. \textsc{The Initial Letters Of The Words In This Sentence Are Capitalized.}
  236. \section{Customization}\label{sec:customization}
  237. \subsection{Document class options}\label{sec:options}
  238. The \doccls{tufte-handout} class is based on the \LaTeX\ \doccls{article}
  239. document class. Therefore, you can pass any of the typical article
  240. options. There are a few options that are specific to the
  241. \doccls{tufte-handout} document class, however.
  242. The \docclsopt{a4paper} option will set the paper size to \smallcaps{A4} instead of
  243. the default \smallcaps{US} letter size.
  244. The \docclsopt{sfsidenotes} option will set the sidenotes and title block in a
  245. \textsf{sans serif} typeface instead of the default roman.
  246. The \docclsopt{twoside} option will modify the running heads so that the page
  247. number is printed on the outside edge (as opposed to always printing the page
  248. number on the right-side edge in \docclsopt{oneside} mode).
  249. The \docclsopt{symmetric} option typesets the sidenotes on the outside edge of
  250. the page. This is how books are traditionally printed, but is contrary to
  251. Tufte's book design which sets the sidenotes on the right side of the page.
  252. This option implicitly sets the \docclsopt{twoside} option.
  253. The \docclsopt{justified} option sets all the text fully justified (flush left
  254. and right). The default is to set the text ragged right.
  255. The body text of Tufte's books are set ragged right. This prevents
  256. needless hyphenation and makes it easier to read the text in the slightly
  257. narrower column.
  258. \subsection{Defining new sections}\label{sec:defining-sections}
  259. As mentioned in the ``\nameref{sec:headings}'' section (see
  260. page~\pageref{sec:headings}), the \doccls{tufte\-handout} document class only
  261. defines \doccmd{section} and \doccmd{subsection} headings.
  262. We use the \docpkg{titlesec} package to define the appearance of the headings.
  263. To modify an existing section or to add a new section, see the documentation of
  264. the \docpkg{titlesec} package.
  265. \section{Installation}\label{sec:installation}
  266. To install the Tufte-\LaTeX\ classes, simply drop the
  267. following files into the same directory as your \texttt{.tex}
  268. file:
  269. \begin{quote}
  270. \ttfamily
  271. tufte-common.sty\\
  272. tufte-handout.cls\\
  273. tufte-book.cls
  274. \end{quote}
  275. % TODO add instructions for installing it globally
  276. \section{Support}\label{sec:support}
  277. \subsection{Package Dependencies}\label{sec:dependencies}
  278. The following is a list of packages that the Tufte-\LaTeX\ document
  279. classes rely upon. Packages marked with an asterisk are optional.
  280. \begin{multicols}{2}
  281. \begin{itemize}
  282. \item xifthen
  283. \item ifpdf*
  284. \item ifxetex*
  285. \item hyperref
  286. \item geometry
  287. \item ragged2e
  288. \item chngpage \emph{or} changepage
  289. \item paralist
  290. \item textcase
  291. \item soul*
  292. \item letterspace*
  293. \item setspace
  294. \item natbib \emph{and} bibentry
  295. \item optparams
  296. \item placeins
  297. \item mathpazo*
  298. \item helvet*
  299. \item fontenc
  300. \item beramono*
  301. \item fancyhdr
  302. \item xcolor
  303. \item textcomp
  304. \item titlesec
  305. \item titletoc
  306. \end{itemize}
  307. \end{multicols}
  308. \subsection{Tufte-\LaTeX\ Website}\label{sec:website}
  309. The website for the Tufte-\LaTeX\ packages is located at
  310. \url{http://code.google.com/p/tufte-latex/}. On our website, you'll find
  311. links to our \smallcaps{svn} repository, mailing lists, bug tracker, and documentation.
  312. \bibliography{sample-handout}
  313. \bibliographystyle{plainnat}
  314. \end{document}