Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

876 lines
33KB

  1. \documentclass{tufte-book}
  2. \hypersetup{colorlinks}% uncomment this line if you prefer colored hyperlinks (e.g., for onscreen viewing)
  3. %%
  4. % Book metadata
  5. \title{A Tufte-Style Book\thanks{Thanks to Edward R.~Tufte for his inspiration.}}
  6. \author[The Tufte-LaTeX Developers]{The Tufte-LaTeX\ Developers}
  7. \publisher{Publisher of This Book}
  8. %%
  9. % If they're installed, use Bergamo and Chantilly from www.fontsite.com.
  10. % They're clones of Bembo and Gill Sans, respectively.
  11. %\IfFileExists{bergamo.sty}{\usepackage[osf]{bergamo}}{}% Bembo
  12. %\IfFileExists{chantill.sty}{\usepackage{chantill}}{}% Gill Sans
  13. %\usepackage{microtype}
  14. %%
  15. % Just some sample text
  16. \usepackage{lipsum}
  17. %%
  18. % For nicely typeset tabular material
  19. \usepackage{booktabs}
  20. %%
  21. % For graphics / images
  22. \usepackage{graphicx}
  23. \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}
  24. \graphicspath{{graphics/}}
  25. % The fancyvrb package lets us customize the formatting of verbatim
  26. % environments. We use a slightly smaller font.
  27. \usepackage{fancyvrb}
  28. \fvset{fontsize=\normalsize}
  29. %%
  30. % Prints argument within hanging parentheses (i.e., parentheses that take
  31. % up no horizontal space). Useful in tabular environments.
  32. \newcommand{\hangp}[1]{\makebox[0pt][r]{(}#1\makebox[0pt][l]{)}}
  33. %%
  34. % Prints an asterisk that takes up no horizontal space.
  35. % Useful in tabular environments.
  36. \newcommand{\hangstar}{\makebox[0pt][l]{*}}
  37. %%
  38. % Prints a trailing space in a smart way.
  39. \usepackage{xspace}
  40. %%
  41. % Some shortcuts for Tufte's book titles. The lowercase commands will
  42. % produce the initials of the book title in italics. The all-caps commands
  43. % will print out the full title of the book in italics.
  44. \newcommand{\vdqi}{\textit{VDQI}\xspace}
  45. \newcommand{\ei}{\textit{EI}\xspace}
  46. \newcommand{\ve}{\textit{VE}\xspace}
  47. \newcommand{\be}{\textit{BE}\xspace}
  48. \newcommand{\VDQI}{\textit{The Visual Display of Quantitative Information}\xspace}
  49. \newcommand{\EI}{\textit{Envisioning Information}\xspace}
  50. \newcommand{\VE}{\textit{Visual Explanations}\xspace}
  51. \newcommand{\BE}{\textit{Beautiful Evidence}\xspace}
  52. \newcommand{\TL}{Tufte-\LaTeX\xspace}
  53. % Prints the month name (e.g., January) and the year (e.g., 2008)
  54. \newcommand{\monthyear}{%
  55. \ifcase\month\or January\or February\or March\or April\or May\or June\or
  56. July\or August\or September\or October\or November\or
  57. December\fi\space\number\year
  58. }
  59. % Prints an epigraph and speaker in sans serif, all-caps type.
  60. \newcommand{\openepigraph}[2]{%
  61. %\sffamily\fontsize{14}{16}\selectfont
  62. \begin{fullwidth}
  63. \sffamily\large
  64. \begin{doublespace}
  65. \noindent\allcaps{#1}\\% epigraph
  66. \noindent\allcaps{#2}% author
  67. \end{doublespace}
  68. \end{fullwidth}
  69. }
  70. % Inserts a blank page
  71. \newcommand{\blankpage}{\newpage\hbox{}\thispagestyle{empty}\newpage}
  72. \usepackage{units}
  73. % Typesets the font size, leading, and measure in the form of 10/12x26 pc.
  74. \newcommand{\measure}[3]{#1/#2$\times$\unit[#3]{pc}}
  75. % Macros for typesetting the documentation
  76. \newcommand{\hlred}[1]{\textcolor{Maroon}{#1}}% prints in red
  77. \newcommand{\hangleft}[1]{\makebox[0pt][r]{#1}}
  78. \newcommand{\hairsp}{\hspace{1pt}}% hair space
  79. \newcommand{\hquad}{\hskip0.5em\relax}% half quad space
  80. \newcommand{\TODO}{\textcolor{red}{\bf TODO!}\xspace}
  81. \newcommand{\ie}{\textit{i.\hairsp{}e.}\xspace}
  82. \newcommand{\eg}{\textit{e.\hairsp{}g.}\xspace}
  83. \providecommand{\XeLaTeX}{X\lower.5ex\hbox{\kern-0.15em\reflectbox{E}}\kern-0.1em\LaTeX}
  84. \newcommand{\tXeLaTeX}{\XeLaTeX\index{XeLaTeX@\protect\XeLaTeX}}
  85. % \index{\texttt{\textbackslash xyz}@\hangleft{\texttt{\textbackslash}}\texttt{xyz}}
  86. \newcommand{\tuftebs}{\symbol{'134}}% a backslash in tt type in OT1/T1
  87. \newcommand{\doccmd}[1]{%
  88. \texttt{\tuftebs#1}%
  89. \index{#1@\protect\hangleft{\texttt{\tuftebs}}\texttt{#1}}%
  90. }% command name -- adds backslash automatically
  91. \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument
  92. \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument
  93. \newenvironment{docspec}{\begin{quotation}\ttfamily\parskip0pt\parindent0pt\ignorespaces}{\end{quotation}}% command specification environment
  94. \newcommand{\docenv}[1]{\texttt{#1}\index{#1@\texttt{#1} environment}\index{environments!#1@\texttt{#1}}}% environment name
  95. \newcommand{\docpkg}[1]{\texttt{#1}\index{#1@\texttt{#1} package}\index{packages!#1@\texttt{#1}}}% package name
  96. \newcommand{\doccls}[1]{\texttt{#1}}% document class name
  97. \newcommand{\docclsopt}[1]{\texttt{#1}\index{#1@\texttt{#1} class option}\index{class options!#1@\texttt{#1}}}% document class option name
  98. \newcommand{\docmsg}[2]{\bigskip\begin{fullwidth}\noindent\ttfamily#1\end{fullwidth}\medskip\par\noindent#2}
  99. % Generates the index
  100. \usepackage{makeidx}
  101. \makeindex
  102. \begin{document}
  103. % Front matter
  104. \frontmatter
  105. % r.1 blank page
  106. \blankpage
  107. % v.2 epigraphs
  108. \newpage\thispagestyle{empty}
  109. \openepigraph{%
  110. The public is more familiar with bad design than good design.
  111. It is, in effect, conditioned to prefer bad design,
  112. because that is what it lives with.
  113. The new becomes threatening, the old reassuring.
  114. }{Paul Rand%, {\itshape Design, Form, and Chaos}
  115. }
  116. \vfill
  117. \openepigraph{%
  118. A designer knows that he has achieved perfection
  119. not when there is nothing left to add,
  120. but when there is nothing left to take away.
  121. }{Antoine de Saint-Exup\'{e}ry}
  122. \vfill
  123. \openepigraph{%
  124. \ldots the designer of a new system must not only be the implementor and the first
  125. large-scale user; the designer should also write the first user manual\ldots
  126. If I had not participated fully in all these activities,
  127. literally hundreds of improvements would never have been made,
  128. because I would never have thought of them or perceived
  129. why they were important.
  130. }{Donald E. Knuth}
  131. % r.3 full title page
  132. \maketitle
  133. % v.4 copyright page
  134. \newpage
  135. \begin{fullwidth}
  136. ~\vfill
  137. \thispagestyle{empty}
  138. \setlength{\parindent}{0pt}
  139. \setlength{\parskip}{\baselineskip}
  140. Copyright \copyright\ \the\year\ \thanklessauthor
  141. \par\smallcaps{Published by \thanklesspublisher}
  142. \par\smallcaps{tufte-latex.googlecode.com}
  143. \par Licensed under the Apache License, Version 2.0 (the ``License''); you may not
  144. use this file except in compliance with the License. You may obtain a copy
  145. of the License at \url{http://www.apache.org/licenses/LICENSE-2.0}. Unless
  146. required by applicable law or agreed to in writing, software distributed
  147. under the License is distributed on an \smallcaps{``AS IS'' BASIS, WITHOUT
  148. WARRANTIES OR CONDITIONS OF ANY KIND}, either express or implied. See the
  149. License for the specific language governing permissions and limitations
  150. under the License.\index{license}
  151. \par\textit{First printing, \monthyear}
  152. \end{fullwidth}
  153. % r.5 contents
  154. \tableofcontents
  155. \listoffigures
  156. \listoftables
  157. % r.7 dedication
  158. \cleardoublepage
  159. ~\vfill
  160. \begin{doublespace}
  161. \noindent\fontsize{18}{22}\selectfont\itshape
  162. \nohyphenation
  163. Dedicated to those who appreciate \LaTeX{}
  164. and the work of \mbox{Edward R.~Tufte}
  165. and \mbox{Donald E.~Knuth}.
  166. \end{doublespace}
  167. \vfill
  168. \vfill
  169. % r.9 introduction
  170. \cleardoublepage
  171. \chapter*{Introduction}
  172. This sample book discusses the design of Edward Tufte's
  173. books\cite{Tufte2001,Tufte1990,Tufte1997,Tufte2006}
  174. and the use of the \doccls{tufte-book} and \doccls{tufte-handout} document classes.
  175. %%
  176. % Start the main matter (normal chapters)
  177. \mainmatter
  178. \chapter{The Design of Tufte's Books}
  179. \label{ch:tufte-design}
  180. \newthought{The pages} of a book are usually divided into three major
  181. sections: the front matter (also called preliminary matter or prelim), the
  182. main matter (the core text of the book), and the back matter (or end
  183. matter).
  184. \newthought{The front matter} of a book refers to all of the material that
  185. comes before the main text. The following table from shows a list of
  186. material that appears in the front matter of \VDQI, \EI, \VE, and \BE
  187. along with its page number. Page numbers that appear in parentheses refer
  188. to folios that do not have a printed page number (but they are still
  189. counted in the page number sequence).
  190. \bigskip
  191. \begin{minipage}{\textwidth}
  192. \begin{center}
  193. \begin{tabular}{lcccc}
  194. \toprule
  195. & \multicolumn{4}{c}{Books} \\
  196. \cmidrule(l){2-5}
  197. Page content & \vdqi & \ei & \ve & \be \\
  198. \midrule
  199. Blank half title page & \hangp{1} & \hangp{1} & \hangp{1} & \hangp{1} \\
  200. Frontispiece\footnotemark{}
  201. & \hangp{2} & \hangp{2} & \hangp{2} & \hangp{2} \\
  202. Full title page & \hangp{3} & \hangp{3} & \hangp{3} & \hangp{3} \\
  203. Copyright page & \hangp{4} & \hangp{4} & \hangp{4} & \hangp{4} \\
  204. Contents & \hangp{5} & \hangp{5} & \hangp{5} & \hangp{5} \\
  205. %Blank & -- & \hangp{6} & \hangp{6} & \hangp{6} \\
  206. Dedication & \hangp{6} & \hangp{7} & \hangp{7} & 7 \\
  207. %Blank & -- & \hangp{8} & -- & \hangp{8} \\
  208. Epigraph & -- & -- & \hangp{8} & -- \\
  209. Introduction & \hangp{7} & \hangp{9} & \hangp{9} & 9 \\
  210. \bottomrule
  211. \end{tabular}
  212. \end{center}
  213. \end{minipage}
  214. \vspace{-7\baselineskip}\footnotetext{The contents of this page vary from book to book. In
  215. \vdqi this page is blank; in \ei and \ve this page holds a frontispiece;
  216. and in \be this page contains three epigraphs.}
  217. \vspace{7\baselineskip}
  218. \bigskip
  219. The design of the front matter in Tufte's books varies slightly from the
  220. traditional design of front matter. First, the pages in front matter are
  221. traditionally numbered with lowercase roman numerals (\eg, i, ii, iii,
  222. iv,~\ldots). Second, the front matter page numbering sequence is usually
  223. separate from the main matter page numbering. That is, the page numbers
  224. restart at 1 when the main matter begins. In contrast, Tufte has
  225. enumerated his pages with arabic numerals that share the same page counting
  226. sequence as the main matter.
  227. There are also some variations in design across Tufte's four books. The
  228. page opposite the full title page (labeled ``frontispiece'' in the above
  229. table) has different content in each of the books. In \VDQI, this page is
  230. blank; in \EI and \VE, this page holds a frontispiece; and in \BE, this
  231. page contains three epigraphs.
  232. The dedication appears on page~6 in \vdqi (opposite the introduction), and
  233. is placed on its own spread in the other books. In \ve, an epigraph shares
  234. the spread with the opening page of the introduction.
  235. None of the page numbers (folios) of the front matter are expressed except in
  236. \be, where the folios start to appear on the dedication page.
  237. \newthought{The full title page} of each of the books varies slightly in
  238. design. In all the books, the author's name appears at the top of the
  239. page, the title it set just above the center line, and the publisher is
  240. printed along the bottom margin. Some of the differences are outlined in
  241. the following table.
  242. \bigskip
  243. \begin{center}
  244. \footnotesize
  245. \begin{tabular}{lllll}
  246. \toprule
  247. Feature & \vdqi & \ei & \ve & \be \\
  248. \midrule
  249. Author & & & & \\
  250. \quad Typeface & serif & serif & serif & sans serif \\
  251. \quad Style & italics & italics & italics & upright, caps \\
  252. \quad Size & 24 pt & 20 pt & 20 pt & 20 pt \\
  253. \addlinespace
  254. Title & & & & \\
  255. \quad Typeface & serif & serif & serif & sans serif \\
  256. \quad Style & upright & italics & upright & upright, caps \\
  257. \quad Size & 36 pt & 48 pt & 48 pt & 36 pt \\
  258. \addlinespace
  259. Subtitle & & & & \\
  260. \quad Typeface & -- & -- & serif & -- \\
  261. \quad Style & -- & -- & upright & -- \\
  262. \quad Size & -- & -- & 20 pt & -- \\
  263. \addlinespace
  264. Edition & & & & \\
  265. \quad Typeface & sans serif & -- & -- & -- \\
  266. \quad Style & upright, caps & -- & -- & -- \\
  267. \quad Size & 14 pt & -- & -- & -- \\
  268. \addlinespace
  269. Publisher & & & & \\
  270. \quad Typeface & serif & serif & serif & sans serif \\
  271. \quad Style & italics & italics & italics & upright, caps \\
  272. \quad Size & 14 pt & 14 pt & 14 pt & 14 pt \\
  273. \bottomrule
  274. \end{tabular}
  275. \end{center}
  276. \begin{figure*}[p]
  277. \fbox{\includegraphics[width=0.45\linewidth]{graphics/vdqi-title.pdf}}
  278. \hfill
  279. \fbox{\includegraphics[width=0.45\linewidth]{graphics/ei-title.pdf}}
  280. \\\vspace{\baselineskip}
  281. \fbox{\includegraphics[width=0.45\linewidth]{graphics/ve-title.pdf}}
  282. \hfill
  283. \fbox{\includegraphics[width=0.45\linewidth]{graphics/be-title.pdf}}
  284. \end{figure*}
  285. \newthought{The tables of contents} in Tufte's books give us our first
  286. glimpse of the structure of the main matter. \VDQI is split into two
  287. parts, each containing some number of chapters. His other three books only
  288. contain chapters---they're not broken into parts.
  289. \begin{figure*}[p]\index{table of contents}
  290. \fbox{\includegraphics[width=0.45\linewidth]{graphics/vdqi-contents.pdf}}
  291. \hfill
  292. \fbox{\includegraphics[width=0.45\linewidth]{graphics/ei-contents.pdf}}
  293. \\\vspace{\baselineskip}
  294. \fbox{\includegraphics[width=0.45\linewidth]{graphics/ve-contents.pdf}}
  295. \hfill
  296. \fbox{\includegraphics[width=0.45\linewidth]{graphics/be-contents.pdf}}
  297. \end{figure*}
  298. \section{Typefaces}\label{sec:typefaces1}\index{typefaces}
  299. \index{fonts|see{typefaces}}
  300. Tufte's books primarily use two typefaces: Bembo and Gill Sans. Bembo is used
  301. for the headings and body text, while Gill Sans is used for the title page and
  302. opening epigraphs in \BE.
  303. Since neither Bembo nor Gill Sans are available in default \LaTeX{}
  304. installations, the \TL document classes default to using Palatino and
  305. Helvetica, respectively. In addition, the Bera Mono typeface is used for
  306. \texttt{monospaced} type.
  307. The following font sizes are defined by the \TL classes:
  308. \begin{table}[h]\index{typefaces!sizes}
  309. \footnotesize%
  310. \begin{center}
  311. \begin{tabular}{lccl}
  312. \toprule
  313. \LaTeX{} size & Font size & Leading & Used for \\
  314. \midrule
  315. \verb+\tiny+ & 5 & 6 & sidenote numbers \\
  316. \verb+\scriptsize+ & 7 & 8 & --- \\
  317. \verb+\footnotesize+ & 8 & 10 & sidenotes, captions \\
  318. \verb+\small+ & 9 & 12 & quote, quotation, and verse environments \\
  319. \verb+\normalsize+ & 10 & 14 & body text \\
  320. \verb+\large+ & 11 & 15 & \textsc{b}-heads \\
  321. \verb+\Large+ & 12 & 16 & \textsc{a}-heads, \textsc{toc} entries, author, date \\
  322. \verb+\LARGE+ & 14 & 18 & handout title \\
  323. \verb+\huge+ & 20 & 30 & chapter heads \\
  324. \verb+\Huge+ & 24 & 36 & part titles \\
  325. \bottomrule
  326. \end{tabular}
  327. \end{center}
  328. \caption{A list of \LaTeX{} font sizes as defined by the \TL document classes.}
  329. \label{tab:font-sizes}
  330. \end{table}
  331. \section{Headings}\label{sec:headings1}\index{headings}
  332. Tufte's books include the following heading levels: parts,
  333. chapters,\sidenote{Parts and chapters are defined for the \texttt{tufte-book}
  334. class only.} sections, subsections, and paragraphs. Not defined by default
  335. are: sub-subsections and subparagraphs.
  336. \begin{table}[h]
  337. \begin{center}
  338. \footnotesize%
  339. \begin{tabular}{lcr}
  340. \toprule
  341. Heading & Style & Size \\
  342. \midrule
  343. Part & roman & \measure{24}{36}{40} \\
  344. Chapter & italic & \measure{20}{30}{40} \\
  345. Section & italic & \measure{12}{16}{26} \\
  346. Subsection & italic & \measure{11}{15}{26} \\
  347. Paragraph & italic & 10/14 \\
  348. \bottomrule
  349. \end{tabular}
  350. \end{center}
  351. \caption{Heading styles used in \BE.}
  352. \label{tab:heading-styles}
  353. \end{table}
  354. \paragraph{Paragraph} Paragraph headings (as shown here) are introduced by
  355. italicized text and separated from the main paragraph by a bit of space.
  356. \section{Environments}
  357. The following characteristics define the various environments:
  358. \begin{table}[h]
  359. \begin{center}
  360. \footnotesize%
  361. \begin{tabular}{lcl}
  362. \toprule
  363. Environment & Font size & Notes \\
  364. \midrule
  365. Body text & \measure{10}{14}{26} & \\
  366. Block quote & \measure{9}{12}{24} & Block indent (left and right) by \unit[1]{pc} \\
  367. Sidenotes & \measure{8}{10}{12} & Sidenote number is set inline, followed by word space \\
  368. Captions & \measure{8}{10}{12} & \\
  369. \bottomrule
  370. \end{tabular}
  371. \end{center}
  372. \caption{Environment styles used in \BE.}
  373. \label{tab:environment-styles}
  374. \end{table}
  375. \chapter[On the Use of the tufte-book Document Class]{On the Use of the \texttt{tufte-book} Document Class}
  376. \label{ch:tufte-book}
  377. The Tufte-\LaTeX\ document classes define a style similar to the
  378. style Edward Tufte uses in his books and handouts. Tufte's style is known
  379. for its extensive use of sidenotes, tight integration of graphics with
  380. text, and well-set typography. This document aims to be at once a
  381. demonstration of the features of the Tufte-\LaTeX\ document classes
  382. and a style guide to their use.
  383. \section{Page Layout}\label{sec:page-layout}
  384. \subsection{Headings}\label{sec:headings}\index{headings}
  385. This style provides \textsc{a}- and \textsc{b}-heads (that is,
  386. \Verb|\section| and \Verb|\subsection|), demonstrated above.
  387. If you need more than two levels of section headings, you'll have to define
  388. them yourself at the moment; there are no pre-defined styles for anything below
  389. a \Verb|\subsection|. As Bringhurst points out in \textit{The Elements of
  390. Typographic Style},\cite{Bringhurst2005} you should ``use as many levels of
  391. headings as you need: no more, and no fewer.''
  392. The Tufte-\LaTeX\ classes will emit an error if you try to use
  393. \linebreak\Verb|\subsubsection| and smaller headings.
  394. % let's start a new thought -- a new section
  395. \newthought{In his later books},\cite{Tufte2006} Tufte
  396. starts each section with a bit of vertical space, a non-indented paragraph,
  397. and sets the first few words of the sentence in \textsc{small caps}. To
  398. accomplish this using this style, use the \hlred{\doccmd{newthought}} command:
  399. \begin{docspec}
  400. \doccmd{newthought}\{In his later books\}, Tufte starts\ldots
  401. \end{docspec}
  402. \section{Sidenotes}\label{sec:sidenotes}
  403. One of the most prominent and distinctive features of this style is the
  404. extensive use of sidenotes. There is a wide margin to provide ample room
  405. for sidenotes and small figures. Any \doccmd{footnote}s will automatically
  406. be converted to sidenotes.\footnote{This is a sidenote that was entered
  407. using the \texttt{\textbackslash footnote} command.} If you'd like to place ancillary
  408. information in the margin without the sidenote mark (the superscript
  409. number), you can use the \hlred{\doccmd{marginnote}} command.\marginnote{This is a
  410. margin note. Notice that there isn't a number preceding the note, and
  411. there is no number in the main text where this note was written.}
  412. The specification of the \hlred{\doccmd{sidenote}} command is:
  413. \begin{docspec}
  414. \doccmd{sidenote}[\docopt{number}][\docopt{offset}]\{\docarg{Sidenote text.}\}
  415. \end{docspec}
  416. Both the \docopt{number} and \docopt{offset} arguments are optional. If you
  417. provide a \docopt{number} argument, then that number will be used as the
  418. sidenote number. It will change of the number of the current sidenote only and
  419. will not affect the numbering sequence of subsequent sidenotes.
  420. Sometimes a sidenote may run over the top of other text or graphics in the
  421. margin space. If this happens, you can adjust the vertical position of the
  422. sidenote by providing a dimension in the \docopt{offset} argument. Some
  423. examples of valid dimensions are:
  424. \begin{docspec}
  425. \ttfamily 1.0in \qquad 2.54cm \qquad 254mm \qquad 6\Verb|\baselineskip|
  426. \end{docspec}
  427. If the dimension is positive it will push the sidenote down the page; if the
  428. dimension is negative, it will move the sidenote up the page.
  429. While both the \docopt{number} and \docopt{offset} arguments are optional, they
  430. must be provided in order. To adjust the vertical position of the sidenote
  431. while leaving the sidenote number alone, use the following syntax:
  432. \begin{docspec}
  433. \doccmd{sidenote}[][\docopt{offset}]\{\docarg{Sidenote text.}\}
  434. \end{docspec}
  435. The empty brackets tell the \Verb|\sidenote| command to use the default
  436. sidenote number.
  437. If you \emph{only} want to change the sidenote number, however, you may
  438. completely omit the \docopt{offset} argument:
  439. \begin{docspec}
  440. \doccmd{sidenote}[\docopt{number}]\{\docarg{Sidenote text.}\}
  441. \end{docspec}
  442. The \doccmd{marginnote} command has a similar \docarg{offset} argument:
  443. \begin{docspec}
  444. \doccmd{marginnote}[\docopt{offset}]\{\docarg{Margin note text.}\}
  445. \end{docspec}
  446. \section{References}
  447. References are placed alongside their citations as sidenotes,
  448. as well. This can be accomplished using the normal \hlred{\doccmd{cite}}
  449. command.\sidenote{The first paragraph of this document includes a citation.}
  450. The complete list of references may also be printed automatically by using
  451. the \hlred{\doccmd{bibliography}} command. (See the end of this document for an
  452. example.) If you do not want to print a bibliography at the end of your
  453. document, use the \hlred{\doccmd{nobibliography}} command in its place.
  454. To enter multiple citations at one location,\cite[-3\baselineskip]{Tufte2006,Tufte1990} you can
  455. provide a list of keys separated by commas and the same optional vertical
  456. offset argument: \Verb|\cite{Tufte2006,Tufte1990}|.
  457. \begin{docspec}
  458. \doccmd{cite}[\docopt{offset}]\{\docarg{bibkey1,bibkey2,\ldots}\}
  459. \end{docspec}
  460. \section{Figures and Tables}\label{sec:figures-and-tables}
  461. Images and graphics play an integral role in Tufte's work.
  462. In addition to the standard \hlred{\docenv{figure}} and \hlred{\docenv{tabular}} environments,
  463. this style provides special figure and table environments for full-width
  464. floats.
  465. Full page--width figures and tables may be placed in \hlred{\docenv{figure*}} or
  466. \hlred{\docenv{table*}} environments. To place figures or tables in the margin,
  467. use the \hlred{\docenv{marginfigure}} or \hlred{\docenv{margintable}} environments as follows
  468. (see figure~\ref{fig:marginfig}):
  469. \begin{marginfigure}%
  470. \includegraphics[width=\linewidth]{helix}
  471. \caption{This is a margin figure. The helix is defined by
  472. $x = \cos(2\pi z)$, $y = \sin(2\pi z)$, and $z = [0, 2.7]$. The figure was
  473. drawn using Asymptote (\url{http://asymptote.sf.net/}).}
  474. \label{fig:marginfig}
  475. \end{marginfigure}
  476. \begin{docspec}
  477. \textbackslash begin\{marginfigure\}\\
  478. \qquad\textbackslash includegraphics\{helix\}\\
  479. \qquad\textbackslash caption\{This is a margin figure.\}\\
  480. \qquad\textbackslash label\{fig:marginfig\}\\
  481. \textbackslash end\{marginfigure\}\\
  482. \end{docspec}
  483. 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:
  484. \begin{docspec}
  485. \textbackslash{begin\{marginfigure\}[\docopt{offset}]}\\
  486. \qquad\ldots\\
  487. \textbackslash{end\{marginfigure\}}\\
  488. \mbox{}\\
  489. \textbackslash{begin\{margintable\}[\docopt{offset}]}\\
  490. \qquad\ldots\\
  491. \textbackslash{end\{margintable\}}\\
  492. \end{docspec}
  493. Figure~\ref{fig:fullfig} is an example of the \docenv{figure*}
  494. environment and figure~\ref{fig:textfig} is an example of the normal
  495. \docenv{figure} environment.
  496. \begin{figure*}[h]
  497. \includegraphics[width=\linewidth]{sine.pdf}%
  498. \caption{This graph shows $y = \sin x$ from about $x = [-10, 10]$.
  499. \emph{Notice that this figure takes up the full page width.}}%
  500. \label{fig:fullfig}%
  501. \end{figure*}
  502. \begin{figure}
  503. \includegraphics{hilbertcurves.pdf}
  504. % \checkparity This is an \pageparity\ page.%
  505. \caption{Hilbert curves of various degrees $n$.
  506. \emph{Notice that this figure only takes up the main textblock width.}}
  507. \label{fig:textfig}
  508. %\zsavepos{pos:textfig}
  509. \end{figure}
  510. Table~\ref{tab:normaltab} shows table created with the \docpkg{booktabs}
  511. package. Notice the lack of vertical rules---they serve only to clutter
  512. the table's data.
  513. \begin{table}[ht]
  514. \centering
  515. \fontfamily{ppl}\selectfont
  516. \begin{tabular}{ll}
  517. \toprule
  518. Margin & Length \\
  519. \midrule
  520. Paper width & \unit[8\nicefrac{1}{2}]{inches} \\
  521. Paper height & \unit[11]{inches} \\
  522. Textblock width & \unit[6\nicefrac{1}{2}]{inches} \\
  523. Textblock/sidenote gutter & \unit[\nicefrac{3}{8}]{inches} \\
  524. Sidenote width & \unit[2]{inches} \\
  525. \bottomrule
  526. \end{tabular}
  527. \caption{Here are the dimensions of the various margins used in the Tufte-handout class.}
  528. \label{tab:normaltab}
  529. %\zsavepos{pos:normaltab}
  530. \end{table}
  531. \section{Full-width text blocks}
  532. In addition to the new float types, there is a \hlred{\docenv{fullwidth}}
  533. environment that stretches across the main text block and the sidenotes
  534. area.
  535. \begin{Verbatim}
  536. \begin{fullwidth}
  537. Lorem ipsum dolor sit amet...
  538. \end{fullwidth}
  539. \end{Verbatim}
  540. \begin{fullwidth}
  541. \small\itshape\lipsum[1]
  542. \end{fullwidth}
  543. \section{Typography}\label{sec:typography}
  544. \subsection{Typefaces}\label{sec:typefaces}\index{typefaces}
  545. If the Palatino, \textsf{Helvetica}, and \texttt{Bera Mono} typefaces are installed, this style
  546. will use them automatically. Otherwise, we'll fall back on the Computer Modern
  547. typefaces.
  548. \subsection{Letterspacing}\label{sec:letterspacing}
  549. This document class includes two new commands and some improvements on
  550. existing commands for letterspacing.
  551. When setting strings of \allcaps{ALL CAPS} or \smallcaps{small caps}, the
  552. letter\-spacing---that is, the spacing between the letters---should be
  553. increased slightly.\cite{Bringhurst2005} The \hlred{\doccmd{allcaps}} command has proper letterspacing for
  554. strings of \allcaps{FULL CAPITAL LETTERS}, and the \hlred{\doccmd{smallcaps}} command
  555. has letterspacing for \smallcaps{small capital letters}. These commands
  556. will also automatically convert the case of the text to upper- or
  557. lowercase, respectively.
  558. The \hlred{\doccmd{textsc}} command has also been redefined to include
  559. letterspacing. The case of the \doccmd{textsc} argument is left as is,
  560. however. This allows one to use both uppercase and lowercase letters:
  561. \textsc{The Initial Letters Of The Words In This Sentence Are Capitalized.}
  562. \section{Document Class Options}\label{sec:options}
  563. \index{class options|(}
  564. The \doccls{tufte-book} class is based on the \LaTeX\ \doccls{book}
  565. document class. Therefore, you can pass any of the typical book
  566. options. There are a few options that are specific to the
  567. \doccls{tufte-book} document class, however.
  568. The \hlred{\docclsopt{a4paper}} option will set the paper size to \smallcaps{A4} instead of
  569. the default \smallcaps{US} letter size.
  570. The \hlred{\docclsopt{sfsidenotes}} option will set the sidenotes and title block in a
  571. \textsf{sans serif} typeface instead of the default roman.
  572. The \hlred{\docclsopt{twoside}} option will modify the running heads so that the page
  573. number is printed on the outside edge (as opposed to always printing the page
  574. number on the right-side edge in \hlred{\docclsopt{oneside}} mode).
  575. The \hlred{\docclsopt{symmetric}} option typesets the sidenotes on the outside edge of
  576. the page. This is how books are traditionally printed, but is contrary to
  577. Tufte's book design which sets the sidenotes on the right side of the page.
  578. This option implicitly sets the \docclsopt{twoside} option.
  579. The \hlred{\docclsopt{justified}} option sets all the text fully justified (flush left
  580. and right). The default is to set the text ragged right.
  581. The body text of Tufte's books are set ragged right. This prevents
  582. needless hyphenation and makes it easier to read the text in the slightly
  583. narrower column.
  584. The \hlred{\docclsopt{bidi}} option loads the \docpkg{bidi} package which is used with
  585. \tXeLaTeX\ to typeset bi-directional text. Since the \docpkg{bidi}
  586. package needs to be loaded before the sidenotes and cite commands are defined,
  587. it can't be loaded in the document preamble.
  588. The \hlred{\docclsopt{debug}} option causes the Tufte-\LaTeX\ classes to output debug
  589. information to the log file which is useful in troubleshooting bugs. It will
  590. also cause the graphics to be replaced by outlines.
  591. The \hlred{\docclsopt{nofonts}} option prevents the Tufte-\LaTeX\ classes from
  592. automatically loading the Palatino and Helvetica typefaces. You should use
  593. this option if you wish to load your own fonts. If you're using \tXeLaTeX, this
  594. option is implied (\ie, the Palatino and Helvetica fonts aren't loaded if you
  595. use \tXeLaTeX).
  596. The \hlred{\docclsopt{nols}} option inhibits the letterspacing code. The Tufte-\LaTeX\
  597. classes try to load the appropriate letterspacing package (either pdf\TeX's
  598. \docpkg{letterspace} package or the \docpkg{soul} package). If you're using
  599. \tXeLaTeX\ with \docpkg{fontenc}, however, you should configure your own
  600. letterspacing.
  601. The \hlred{\docclsopt{notitlepage}} option causes \verb|\maketitle| to generate a title
  602. block instead of a title page. The \doccls{book} class defaults to a title
  603. page and the \doccls{handout} class defaults to the title block. There is an
  604. analogous \hlred{\docclsopt{titlepage}} option that forces \verb|\maketitle| to
  605. generate a full title page instead of the title block.
  606. The \hlred{\docclsopt{notoc}} option suppresses Tufte-\LaTeX's custom table of contents
  607. (\textsc{toc}) design. The current \textsc{toc} design only shows unnumbered
  608. chapter titles; it doesn't show sections or subsections. The \docclsopt{notoc}
  609. option will revert to \LaTeX's \textsc{toc} design.
  610. The \hlred{\docclsopt{nohyper}} option prevents the \docpkg{hyperref} package from
  611. being loaded. The default is to load the \docpkg{hyperref} package and use the
  612. \doccmd{title} and \doccmd{author} contents as metadata for the generated
  613. \textsc{pdf}.
  614. \index{class options|)}
  615. \chapter{Compatibility Issues}
  616. \label{ch:compatibility}
  617. When switching an existing document from one document class to a \TL document class, a few changes to the document may have to be made.
  618. \section{Converting from \doccls{article} to \doccls{tufte-handout}}
  619. The following \doccls{article} class options are unsupported: \docclsopt{10pt}, \docclsopt{11pt}, \docclsopt{12pt}, \docclsopt{a5paper}, \docclsopt{b5paper}, \docclsopt{executivepaper}, \docclsopt{legalpaper}, \docclsopt{landscape}, \docclsopt{onecolumn}, and \doccls{twocolumn}.
  620. The following headings are not supported: \doccmd{subsubsection} and \doccmd{subparagraph}.
  621. \section{Converting from \doccls{book} to \doccls{tufte-book}}
  622. The following \doccls{report} class options are unsupported: \docclsopt{10pt}, \docclsopt{11pt}, \docclsopt{12pt}, \docclsopt{a5paper}, \docclsopt{b5paper}, \docclsopt{executivepaper}, \docclsopt{legalpaper}, \docclsopt{landscape}, \docclsopt{onecolumn}, and \doccls{twocolumn}.
  623. The following headings are not supported: \doccmd{subsubsection} and \doccmd{subparagraph}.
  624. \chapter{Troubleshooting and Support}
  625. \label{ch:troubleshooting}
  626. \section{Tufte-\LaTeX\ Website}\label{sec:website}
  627. The website for the Tufte-\LaTeX\ packages is located at
  628. \url{http://code.google.com/p/tufte-latex/}. On our website, you'll find
  629. links to our \smallcaps{svn} repository, mailing lists, bug tracker, and documentation.
  630. \section{Tufte-\LaTeX\ Mailing Lists}\label{sec:mailing-lists}
  631. There are two mailing lists for the \TL project:
  632. \paragraph{Discussion list}
  633. The \texttt{tufte-latex} discussion list is for asking questions, getting
  634. assistance with problems, and help with troubleshooting. Release announcements
  635. are also posted to this list. You can subscribe to the \texttt{tufte-latex}
  636. discussion list at \url{http://groups.google.com/group/tufte-latex}.
  637. \paragraph{Commits list}
  638. The \texttt{tufte-latex-commits} list is a read-only mailing list. A message
  639. is sent to the list any time the \TL code has been updated. If you'd like to
  640. keep up with the latest code developments, you may subscribe to this list. You
  641. can subscribe to the \texttt{tufte-latex-commits} mailing list at
  642. \url{http://groups.google.com/group/tufte-latex-commits}.
  643. \section{Getting Help}\label{sec:getting-help}
  644. If you've encountered a problem with one of the \TL document classes, have a
  645. question, or would like to report a bug, please send an email to our
  646. mailing list or visit our website.
  647. To help us troubleshoot the problem more quickly, please try to compile your
  648. document using the \docclsopt{debug} class option and send the generated
  649. \texttt{.log} file to the mailing list with a brief description of the problem.
  650. \section{Errors, Warnings, and Informational Messages}\label{sec:tl-messages}
  651. The following is a list of all of the errors, warnings, and other messages generated by the \TL classes and a brief description of their meanings.
  652. \docmsg{Error: \doccmd{subparagraph} is undefined by this class.}{%
  653. The \doccmd{subparagraph} command is not defined in the \TL document classes.
  654. If you'd like to use the \doccmd{subparagraph} command, you'll need to redefine
  655. it yourself. See the ``Headings'' section on page~\pageref{sec:headings} for a
  656. description of the heading styles availaboe in the \TL document classes.}
  657. \docmsg{Error: \doccmd{subsubsection} is undefined by this class.}{%
  658. The \doccmd{subsubsection} command is not defined in the \TL document classes.
  659. If you'd like to use the \doccmd{subsubsection} command, you'll need to
  660. redefine it yourself. See the ``Headings'' section on
  661. page~\pageref{sec:headings} for a description of the heading styles availaboe
  662. in the \TL document classes.}
  663. \docmsg{Warning: Option `\docopt{class option}' is not supported -{}- ignoring option.}{%
  664. This warning appears when you've tried to use \docopt{class option} with a \TL
  665. document class, but \docopt{class option} isn't supported by the \TL document
  666. class. In this situation, \docopt{class option} is ignored.}
  667. \section{Package Dependencies}\label{sec:dependencies}
  668. The following is a list of packages that the Tufte-\LaTeX\ document
  669. classes rely upon. Packages marked with an asterisk are optional.
  670. \begin{multicols}{2}
  671. \begin{itemize}
  672. \item xifthen
  673. \item ifpdf*
  674. \item ifxetex*
  675. \item hyperref
  676. \item geometry
  677. \item ragged2e
  678. \item chngpage \emph{or} changepage
  679. \item paralist
  680. \item textcase
  681. \item soul*
  682. \item letterspace*
  683. \item setspace
  684. \item natbib \emph{and} bibentry
  685. \item optparams
  686. \item placeins
  687. \item mathpazo*
  688. \item helvet*
  689. \item fontenc
  690. \item beramono*
  691. \item fancyhdr
  692. \item xcolor
  693. \item textcomp
  694. \item titlesec
  695. \item titletoc
  696. \end{itemize}
  697. \end{multicols}
  698. %%
  699. % The back matter contains appendices, bibliographies, indices, glossaries, etc.
  700. \backmatter
  701. \bibliography{sample-handout}
  702. \bibliographystyle{plainnat}
  703. \printindex
  704. \end{document}