Debian Codegraph @

texmf-dist/doc/latex/xtufte/sample-book.tex

raw
1 %! HV lualatex
2 %! HV biber
3 %! HV lualatex
4 %! HV xindex
5 %! HV lualatex
6 %! HV lualatex
7
8
9 \begin{filecontents}[overwrite,noheader]{tufte-common-local-before-hyperref.tex}
10 \usepackage{amsmath}
11 \usepackage{graphicx} % allow embedded images
12 \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}
13 \graphicspath{{graphics/}} % set of paths to search for images
14 \usepackage{booktabs} % book-quality tables
15 \usepackage{multicol} % multiple column layout facilities
16 \usepackage{lipsum} % filler text
17 \usepackage{fancyvrb} % extended verbatim environments
18 \fvset{fontsize=\normalsize}% default font size for fancy-verbatim environments
19 \usepackage{minted-code}
20 \usepackage{xspace}
21 \usepackage{siunitx}
22
23 \usepackage{makeidx}\makeindex
24 \end{filecontents}
25
26
27 \documentclass[
28 sidenote=raggedright,
29 marginnote=raggedright,
30 caption=raggedright,
31 marginals=raggedright,
32 origFonts,
33 natbib=false,
34 hyperref]{xtufte-book}
35
36 \hypersetup{colorlinks}% uncomment this line if you prefer colored hyperlinks (e.g., for onscreen viewing)
37
38 \addbibresource{sample-handout.bib}
39 \addbibresource[location=remote]{https://mirror.ctan.org/biblio/ctan-bibdata/ctan.bib}
40
41 %%
42 % Just some sample text
43 \usepackage{lipsum}
44 %%
45 % Book metadata
46 \title{A Tufte-Style Book\thanks{Thanks to Edward R.~Tufte for his inspiration.}}
47 \author[The Tufte-LaTeX Developers]{The Tufte-LaTeX\ Developers}
48 \publisher{Publisher of This Book}
49
50 %%
51 % Prints argument within hanging parentheses (i.e., parentheses that take
52 % up no horizontal space). Useful in tabular environments.
53 \newcommand\hangp[1]{\makebox[0pt][r]{(}#1\makebox[0pt][l]{)}}
54
55 %%
56 % Prints an asterisk that takes up no horizontal space.
57 % Useful in tabular environments.
58 \newcommand\hangstar{\makebox[0pt][l]{*}}
59
60 %\usepackage[style=authoryear]{biblatex}
61 %\addbibresource[location=remote]{https://mirror.ctan.org/biblio/ctan-bibdata/ctan.bib}
62
63 %%
64 % Some shortcuts for Tufte's book titles. The lowercase commands will
65 % produce the initials of the book title in italics. The all-caps commands
66 % will print out the full title of the book in italics.
67 \newcommand\xPack[1]{\texttt{#1}\index{#1 (package)}}
68 \newcommand{\vdqi}{\textit{VDQI}\xspace}
69 \newcommand{\ei}{\textit{EI}\xspace}
70 \newcommand{\ve}{\textit{VE}\xspace}
71 \newcommand{\be}{\textit{BE}\xspace}
72 \newcommand{\VDQI}{\textit{The Visual Display of Quantitative Information}\xspace}
73 \newcommand{\EI}{\textit{Envisioning Information}\xspace}
74 \newcommand{\VE}{\textit{Visual Explanations}\xspace}
75 \newcommand{\BE}{\textit{Beautiful Evidence}\xspace}
76
77 \newcommand{\TL}{Tufte-\LaTeX\xspace}
78
79 % Prints the month name (e.g., January) and the year (e.g., 2008)
80 \newcommand\monthyear{%
81 \ifcase\month\or January\or February\or March\or April\or May\or June\or
82 July\or August\or September\or October\or November\or
83 December\fi\space\number\year
84 }
85
86
87 % Prints an epigraph and speaker in sans serif, all-caps type.
88 \newcommand\openepigraph[2]{%
89 \begin{fullwidth}
90 \sffamily\fontsize{14}{16}\selectfont
91 \begin{doublespace}
92 \noindent\allcaps{#1}\\% epigraph
93 \noindent\allcaps{#2}% author
94 \end{doublespace}
95 \end{fullwidth}
96 }
97
98 % Inserts a blank page
99 \newcommand{\blankpage}{\newpage\hbox{}\thispagestyle{empty}\newpage}
100
101
102 % Typesets the font size, leading, and measure in the form of 10/12x26 pc.
103 \newcommand\measure[3]{#1/#2$\times$#3\,{pc}}
104
105 % Macros for typesetting the documentation
106 \newcommand{\hlred}[1]{\textcolor{Maroon}{#1}}% prints in red
107 \newcommand{\hangleft}[1]{\makebox[0pt][r]{#1}}
108 \newcommand{\hairsp}{\hspace{1pt}}% hair space
109 \newcommand{\hquad}{\hskip0.5em\relax}% half quad space
110 \newcommand{\TODO}{\textcolor{red}{\bf TODO!}\xspace}
111 \newcommand{\ie}{\textit{i.\hairsp{}e.}\xspace}
112 \newcommand{\eg}{\textit{e.\hairsp{}g.}\xspace}
113 \newcommand{\na}{\quad--}% used in tables for N/A cells
114 \newcommand\tXeLaTeX{\XeLaTeX\index{XeLaTeX@\XeLaTeX}}
115 % \index{\texttt{\textbackslash xyz}@\hangleft{\texttt{\textbackslash}}\texttt{xyz}}
116 \newcommand{\tuftebs}{\symbol{'134}}% a backslash in tt type in OT1/T1
117 \newcommand{\doccmdnoindex}[2][]{\texttt{\tuftebs#2}}% command name -- adds backslash automatically (and doesn't add cmd to the index)
118 \newcommand{\doccmddef}[2][]{%
119 \hlred{\texttt{\tuftebs#2}}\label{cmd:#2}%
120 \ifthenelse{\isempty{#1}}%
121 {% add the command to the index
122 \index{#2 command@\protect\hangleft{\texttt{\tuftebs}}\texttt{#2}}% command name
123 }%
124 {% add the command and package to the index
125 \index{#2 command@\protect\hangleft{\texttt{\tuftebs}}\texttt{#2} (\texttt{#1} package)}% command name
126 \index{#1 package@\texttt{#1} package}\index{packages!#1@\texttt{#1}}% package name
127 }%
128 }% command name -- adds backslash automatically
129 \newcommand\doccmd[2][]{%
130 \texttt{\tuftebs#2}%
131 \ifthenelse{\isempty{#1}}%
132 {% add the command to the index
133 \index{#2 command@\protect\hangleft{\texttt{\tuftebs}}\texttt{#2}}% command name
134 }%
135 {% add the command and package to the index
136 \index{#2 command@\protect\hangleft{\texttt{\tuftebs}}\texttt{#2} (\texttt{#1} package)}% command name
137 \index{#1 package@\texttt{#1} package}\index{packages!#1@\texttt{#1}}% package name
138 }%
139 }% command name -- adds backslash automatically
140 \newcommand{\docopt}[1]{\ensuremath{\langle}\textrm{\textit{#1}}\ensuremath{\rangle}}% optional command argument
141 \newcommand{\docarg}[1]{\textrm{\textit{#1}}}% (required) command argument
142 \newenvironment{docspec}{\begin{quotation}\ttfamily\parskip0pt\parindent0pt\ignorespaces}{\end{quotation}}% command specification environment
143 \newcommand{\docenv}[1]{\texttt{#1}\index{#1 environment@\texttt{#1} environment}\index{environments!#1@\texttt{#1}}}% environment name
144 \newcommand{\docenvdef}[1]{\hlred{\texttt{#1}}\label{env:#1}\index{#1 environment@\texttt{#1} environment}\index{environments!#1@\texttt{#1}}}% environment name
145 \newcommand{\docpkg}[1]{\texttt{#1}\index{#1 package@\texttt{#1} package}\index{packages!#1@\texttt{#1}}}% package name
146 \newcommand{\doccls}[1]{\texttt{#1}}% document class name
147 \newcommand{\docclsopt}[1]{\texttt{#1}\index{#1 class option@\texttt{#1} class option}\index{class options!#1@\texttt{#1}}}% document class option name
148 \newcommand{\docclsoptdef}[1]{\hlred{\texttt{#1}}\label{clsopt:#1}\index{#1 class option@\texttt{#1} class option}\index{class options!#1@\texttt{#1}}}% document class option name defined
149 \newcommand{\docmsg}[2]{\bigskip\begin{fullwidth}\noindent\ttfamily#1\end{fullwidth}\medskip\par\noindent#2}
150 \newcommand{\docfilehook}[2]{\texttt{#1}\index{file hooks!#2}\index{#1@\texttt{#1}}}
151 \newcommand{\doccounter}[1]{\texttt{#1}\index{#1 counter@\texttt{#1} counter}}
152
153
154 \begin{document}
155
156 % Front matter
157 \frontmatter
158
159 % r.1 blank page
160 \blankpage
161
162 % v.2 epigraphs
163 \newpage\thispagestyle{empty}
164 \openepigraph{%
165 The public is more familiar with bad design than good design.
166 It is, in effect, conditioned to prefer bad design,
167 because that is what it lives with.
168 The new becomes threatening, the old reassuring.
169 }{Paul Rand%, {\itshape Design, Form, and Chaos}
170 }
171 \vfill
172 \openepigraph{%
173 A designer knows that he has achieved perfection
174 not when there is nothing left to add,
175 but when there is nothing left to take away.
176 }{Antoine de Saint-Exup\'{e}ry}
177 \vfill
178 \openepigraph{%
179 \ldots the designer of a new system must not only be the implementor and the first
180 large-scale user; the designer should also write the first user manual\ldots
181 If I had not participated fully in all these activities,
182 literally hundreds of improvements would never have been made,
183 because I would never have thought of them or perceived
184 why they were important.
185 }{Donald E. Knuth}
186
187
188 % r.3 full title page
189 \maketitle
190
191
192 % v.4 copyright page
193 \newpage
194 \begin{fullwidth}
195 ~\vfill
196 \thispagestyle{empty}
197 \setlength{\parindent}{0pt}
198 \setlength{\parskip}{\baselineskip}
199 Copyright \copyright\ \the\year\ \thanklessauthor
200
201 \par\smallcaps{Published by \thanklesspublisher}
202
203
204 \par\url{tufte-latex.googlecode.com}
205
206 \par Licensed under the Apache License, Version 2.0 (the ``License''); you may not
207 use this file except in compliance with the License. You may obtain a copy
208 of the License at \url{http://www.apache.org/licenses/LICENSE-2.0}. Unless
209 required by applicable law or agreed to in writing, software distributed
210 under the License is distributed on an \textsc{``AS IS'' BASIS, WITHOUT
211 WARRANTIES OR CONDITIONS OF ANY KIND}, either express or implied. See the
212 License for the specific language governing permissions and limitations
213 under the License.\index{license}
214
215 \par\textit{First printing, \monthyear}
216 \end{fullwidth}
217
218 % r.5 contents
219 \tableofcontents
220
221 \listoffigures
222
223 \listoftables
224
225 % r.7 dedication
226 \cleardoublepage
227 ~\vfill
228 \begin{doublespace}
229 \noindent\fontsize{18}{22}\selectfont\itshape
230 \nohyphenation
231 Dedicated to those who appreciate \LaTeX{}
232 and the work of \mbox{Edward R.~Tufte}
233 and \mbox{Donald E.~Knuth}.
234 \end{doublespace}
235 \vfill
236 \vfill
237
238
239 % r.9 introduction
240 \cleardoublepage
241 \chapter*{Introduction}
242
243 This sample book discusses the design of Edward Tufte's
244 books
245 and the use of the \doccls{tufte-book} and \doccls{tufte-handout} document
246 classes.~\parencite{Tufte2001,Tufte1990,Tufte1997,Tufte2006}
247
248
249 %%
250 % Start the main matter (normal chapters)
251 \mainmatter
252
253
254 \chapter{The Design of Tufte's Books}
255 \label{ch:tufte-design}
256
257
258 \newthought{The pages} of a book are usually divided into three major
259 sections: the front matter (also called preliminary matter or prelim), the
260 main matter (the core text of the book), and the back matter (or end
261 matter).
262
263 \newthought{The front matter} of a book refers to all of the material that
264 comes before the main text. The following table from shows a list of
265 material that appears in the front matter of \VDQI, \EI, \VE, and \BE
266 along with its page number. Page numbers that appear in parentheses refer
267 to folios that do not have a printed page number (but they are still
268 counted in the page number sequence).%~\parencite{aksin}
269
270 \bigskip
271 \begin{minipage}{\textwidth}
272 \begin{center}
273 \begin{tabular}{lcccc}
274 \toprule
275 & \multicolumn{4}{c}{Books} \\
276 \cmidrule(l){2-5}
277 Page content & \vdqi & \ei & \ve & \be \\
278 \midrule
279 Blank half title page & \hangp{1} & \hangp{1} & \hangp{1} & \hangp{1} \\
280 Frontispiece\footnotemark{}
281 & \hangp{2} & \hangp{2} & \hangp{2} & \hangp{2} \\
282 Full title page & \hangp{3} & \hangp{3} & \hangp{3} & \hangp{3} \\
283 Copyright page & \hangp{4} & \hangp{4} & \hangp{4} & \hangp{4} \\
284 Contents & \hangp{5} & \hangp{5} & \hangp{5} & \hangp{5} \\
285 %Blank & -- & \hangp{6} & \hangp{6} & \hangp{6} \\
286 Dedication & \hangp{6} & \hangp{7} & \hangp{7} & 7 \\
287 %Blank & -- & \hangp{8} & -- & \hangp{8} \\
288 Epigraph & -- & -- & \hangp{8} & -- \\
289 Introduction & \hangp{7} & \hangp{9} & \hangp{9} & 9 \\
290 \bottomrule
291 \end{tabular}
292 \end{center}
293 \end{minipage}
294 \vspace{-7\baselineskip}\footnotetext{The contents of this page vary from book to book. In
295 \vdqi this page is blank; in \ei and \ve this page holds a frontispiece;
296 and in \be this page contains three epigraphs.}
297 \vspace{7\baselineskip}
298
299 \bigskip
300 The design of the front matter in Tufte's books varies slightly from the
301 traditional design of front matter. First, the pages in front matter are
302 traditionally numbered with lowercase roman numerals (\eg, i, ii, iii,
303 iv,~\ldots). Second, the front matter page numbering sequence is usually
304 separate from the main matter page numbering. That is, the page numbers
305 restart at 1 when the main matter begins. In contrast, Tufte has
306 enumerated his pages with arabic numerals that share the same page counting
307 sequence as the main matter.
308
309 There are also some variations in design across Tufte's four books. The
310 page opposite the full title page (labeled ``frontispiece'' in the above
311 table) has different content in each of the books. In \VDQI, this page is
312 blank; in \EI and \VE, this page holds a frontispiece; and in \BE, this
313 page contains three epigraphs.
314
315 The dedication appears on page~6 in \vdqi (opposite the introduction), and
316 is placed on its own spread in the other books. In \ve, an epigraph shares
317 the spread with the opening page of the introduction.
318
319 None of the page numbers (folios) of the front matter are expressed except in
320 \be, where the folios start to appear on the dedication page.
321
322 \newthought{The full title page} of each of the books varies slightly in
323 design. In all the books, the author's name appears at the top of the
324 page, the title it set just above the center line, and the publisher is
325 printed along the bottom margin. Some of the differences are outlined in
326 the following table.
327
328 \bigskip
329 \begin{center}
330 \footnotesize
331 \begin{tabular}{lllll}
332 \toprule
333 Feature & \vdqi & \ei & \ve & \be \\
334 \midrule
335 Author & & & & \\
336 \quad Typeface & serif & serif & serif & sans serif \\
337 \quad Style & italics & italics & italics & upright, caps \\
338 \quad Size & 24 pt & 20 pt & 20 pt & 20 pt \\
339 \addlinespace
340 Title & & & & \\
341 \quad Typeface & serif & serif & serif & sans serif \\
342 \quad Style & upright & italics & upright & upright, caps \\
343 \quad Size & 36 pt & 48 pt & 48 pt & 36 pt \\
344 \addlinespace
345 Subtitle & & & & \\
346 \quad Typeface & \na & \na & serif & \na \\
347 \quad Style & \na & \na & upright & \na \\
348 \quad Size & \na & \na & 20 pt & \na \\
349 \addlinespace
350 Edition & & & & \\
351 \quad Typeface & sans serif & \na & \na & \na \\
352 \quad Style & upright, caps & \na & \na & \na \\
353 \quad Size & 14 pt & \na & \na & \na \\
354 \addlinespace
355 Publisher & & & & \\
356 \quad Typeface & serif & serif & serif & sans serif \\
357 \quad Style & italics & italics & italics & upright, caps \\
358 \quad Size & 14 pt & 14 pt & 14 pt & 14 pt \\
359 \bottomrule
360 \end{tabular}
361 \end{center}
362
363 \begin{figure*}[p]
364 \fbox{\includegraphics[width=0.45\linewidth]{graphics/vdqi-title.pdf}}
365 \hfill
366 \fbox{\includegraphics[width=0.45\linewidth]{graphics/ei-title.pdf}}
367 \\\vspace{\baselineskip}
368 \fbox{\includegraphics[width=0.45\linewidth]{graphics/ve-title.pdf}}
369 \hfill
370 \fbox{\includegraphics[width=0.45\linewidth]{graphics/be-title.pdf}}
371 \end{figure*}
372
373 \newthought{The tables of contents} in Tufte's books give us our first
374 glimpse of the structure of the main matter. \VDQI is split into two
375 parts, each containing some number of chapters. His other three books only
376 contain chapters---they're not broken into parts.
377
378 \begin{figure*}[p]\index{table of contents}
379 \fbox{\includegraphics[width=0.45\linewidth]{graphics/vdqi-contents.pdf}}
380 \hfill
381 \fbox{\includegraphics[width=0.45\linewidth]{graphics/ei-contents.pdf}}
382 \\\vspace{\baselineskip}
383 \fbox{\includegraphics[width=0.45\linewidth]{graphics/ve-contents.pdf}}
384 \hfill
385 \fbox{\includegraphics[width=0.45\linewidth]{graphics/be-contents.pdf}}
386 \end{figure*}
387
388
389 \section{Typefaces}\label{sec:typefaces1}\index{typefaces}
390 \index{fonts|see{typefaces}}
391
392 Tufte's books primarily use two typefaces: Bembo and Gill Sans. Bembo is used
393 for the headings and body text, while Gill Sans is used for the title page and
394 opening epigraphs in \BE.
395
396 Since neither Bembo nor Gill Sans are available in default \LaTeX{}
397 installations, the \TL document classes default to using Palatino and
398 Helvetica, respectively. In addition, the Bera Mono typeface is used for
399 \texttt{monospaced} type.
400
401 The following font sizes are defined by the \TL classes:
402
403 \begin{table}[h]\index{typefaces!sizes}
404 \footnotesize%
405 \begin{center}
406 \begin{tabular}{lccl}
407 \toprule
408 \LaTeX{} size & Font size & Leading & Used for \\
409 \midrule
410 \verb+\tiny+ & 5 & 6 & sidenote numbers \\
411 \verb+\scriptsize+ & 7 & 8 & \na \\
412 \verb+\footnotesize+ & 8 & 10 & sidenotes, captions \\
413 \verb+\small+ & 9 & 12 & quote, quotation, and verse environments \\
414 \verb+\normalsize+ & 10 & 14 & body text \\
415 \verb+\large+ & 11 & 15 & \textsc{b}-heads \\
416 \verb+\Large+ & 12 & 16 & \textsc{a}-heads, \textsc{toc} entries, author, date \\
417 \verb+\LARGE+ & 14 & 18 & handout title \\
418 \verb+\huge+ & 20 & 30 & chapter heads \\
419 \verb+\Huge+ & 24 & 36 & part titles \\
420 \bottomrule
421 \end{tabular}
422 \end{center}
423 \caption{A list of \LaTeX{} font sizes as defined by the \TL document classes.}
424 \label{tab:font-sizes}
425 \end{table}
426
427 \section{Headings}\label{sec:headings1}\index{headings}
428
429 Tufte's books include the following heading levels: parts,
430 chapters,\sidenote{Parts and chapters are defined for the \texttt{tufte-book}
431 class only.} sections, subsections, and paragraphs. Not defined by default
432 are: sub-subsections and subparagraphs.
433
434 \begin{table}[h]
435 \begin{center}
436 \footnotesize%
437 \begin{tabular}{lcr}
438 \toprule
439 Heading & Style & Size \\
440 \midrule
441 Part & roman & \measure{24}{36}{40} \\
442 Chapter & italic & \measure{20}{30}{40} \\
443 Section & italic & \measure{12}{16}{26} \\
444 Subsection & italic & \measure{11}{15}{26} \\
445 Paragraph & italic & 10/14 \\
446 \bottomrule
447 \end{tabular}
448 \end{center}
449 \caption{Heading styles used in \BE.}
450 \label{tab:heading-styles}
451 \end{table}
452
453 \paragraph{Paragraph} Paragraph headings (as shown here) are introduced by
454 italicized text and separated from the main paragraph by a bit of space.
455
456 \section{Environments}
457
458 The following characteristics define the various environments:
459
460
461 \begin{table}[h]
462 \begin{center}
463 \footnotesize%
464 \begin{tabular}{lcl}
465 \toprule
466 Environment & Font size & Notes \\
467 \midrule
468 Body text & \measure{10}{14}{26} & \\
469 Block quote & \measure{9}{12}{24} & Block indent (left and right) by \num{1}\unit{pc} \\
470 Sidenotes & \measure{8}{10}{12} & Sidenote number is set inline, followed by word space \\
471 Captions & \measure{8}{10}{12} & \\
472 \bottomrule
473 \end{tabular}
474 \end{center}
475 \caption{Environment styles used in \BE.}
476 \label{tab:environment-styles}
477 \end{table}
478
479
480 \chapter[On the Use of the tufte-book Document Class]{On the Use of the \texttt{tufte-book} Document Class}
481 \label{ch:tufte-book}
482
483 The \TL document classes define a style similar to the
484 style Edward Tufte uses in his books and handouts. Tufte's style is known
485 for its extensive use of sidenotes, tight integration of graphics with
486 text, and well-set typography. This document aims to be at once a
487 demonstration of the features of the \TL document classes
488 and a style guide to their use.
489
490 \section{Page Layout}\label{sec:page-layout}
491 \subsection{Headings}\label{sec:headings}\index{headings}
492 This style provides \textsc{a}- and \textsc{b}-heads (that is,
493 \Verb|\section| and \Verb|\subsection|), demonstrated above.
494
495 If you need more than two levels of section headings, you'll have to define
496 them yourself at the moment; there are no pre-defined styles for anything below
497 a \Verb|\subsection|. As Bringhurst points out in \textit{The Elements of
498 Typographic Style}, you should ``use as many levels of
499 headings as you need: no more, and no fewer.~\parencite{Bringhurst2005}''
500
501 The \TL classes will emit an error if you try to use
502 \linebreak\Verb|\subsubsection| and smaller headings.
503
504 % let's start a new thought -- a new section
505 \newthought{In his later books}, Tufte
506 starts each section with a bit of vertical space, a non-indented paragraph,
507 and sets the first few words of the sentence in
508 \textsc{small caps}.~\parencite{Tufte2006}
509 To
510 accomplish this using this style, use the \doccmddef{newthought} command:
511 \begin{docspec}
512 \doccmd{newthought}\{In his later books\}, Tufte starts\ldots
513 \end{docspec}
514
515
516 \section{Sidenotes}\label{sec:sidenotes}
517 One of the most prominent and distinctive features of this style is the
518 extensive use of sidenotes. There is a wide margin to provide ample room
519 for sidenotes and small figures. Any \doccmd{footnote}s will automatically
520 be converted to sidenotes.\footnote{This is a sidenote that was entered
521 using the \texttt{\textbackslash footnote} command.} If you'd like to place ancillary
522 information in the margin without the sidenote mark (the superscript
523 number), you can use the \doccmd{marginnote} command.\marginnote{This is a
524 margin note. Notice that there isn't a number preceding the note, and
525 there is no number in the main text where this note was written.}
526
527 The specification of the \doccmddef{sidenote} command is:
528 \begin{docspec}
529 \doccmd{sidenote}[\docopt{number}][\docopt{offset}]\{\docarg{Sidenote text.}\}
530 \end{docspec}
531
532 Both the \docopt{number} and \docopt{offset} arguments are optional. If you
533 provide a \docopt{number} argument, then that number will be used as the
534 sidenote number. It will change of the number of the current sidenote only and
535 will not affect the numbering sequence of subsequent sidenotes.
536
537 Sometimes a sidenote may run over the top of other text or graphics in the
538 margin space. If this happens, you can adjust the vertical position of the
539 sidenote by providing a dimension in the \docopt{offset} argument. Some
540 examples of valid dimensions are:
541 \begin{docspec}
542 \ttfamily 1.0in \qquad 2.54cm \qquad 254mm \qquad 6\Verb|\baselineskip|
543 \end{docspec}
544 If the dimension is positive it will push the sidenote down the page; if the
545 dimension is negative, it will move the sidenote up the page.
546
547 While both the \docopt{number} and \docopt{offset} arguments are optional, they
548 must be provided in order. To adjust the vertical position of the sidenote
549 while leaving the sidenote number alone, use the following syntax:
550 \begin{docspec}
551 \doccmd{sidenote}[][\docopt{offset}]\{\docarg{Sidenote text.}\}
552 \end{docspec}
553 The empty brackets tell the \Verb|\sidenote| command to use the default
554 sidenote number.
555
556 If you \emph{only} want to change the sidenote number, however, you may
557 completely omit the \docopt{offset} argument:
558 \begin{docspec}
559 \doccmd{sidenote}[\docopt{number}]\{\docarg{Sidenote text.}\}
560 \end{docspec}
561
562 The \doccmddef{marginnote} command has a similar \docarg{offset} argument:
563 \begin{docspec}
564 \doccmd{marginnote}[\docopt{offset}]\{\docarg{Margin note text.}\}
565 \end{docspec}
566
567 \section{References}
568 References are placed alongside their citations as sidenotes,
569 as well. This can be accomplished using the normal \doccmddef{cite}
570 command.\sidenote{The first paragraph of this document includes a citation.}
571
572 The complete list of references may also be printed automatically by using
573 the \doccmddef{bibliography} command. (See the end of this document for an
574 example.) If you do not want to print a bibliography at the end of your
575 document, use the \doccmddef{nobibliography} command in its place.
576
577 To enter multiple citations at one location,\margincite{Tufte2006,Tufte1990} you can
578 provide a list of keys separated by commas and the same optional vertical
579 offset argument: \Verb|\margincite{Tufte2006,Tufte1990}|.
580 \begin{docspec}
581 \doccmd{cite}[\docopt{offset}]\{\docarg{bibkey1,bibkey2,\ldots}\}
582 \end{docspec}
583
584 \section{Figures and Tables}\label{sec:figures-and-tables}
585 Images and graphics play an integral role in Tufte's work.
586 In addition to the standard \docenvdef{figure} and \docenvdef{tabular} environments,
587 this style provides special figure and table environments for full-width
588 floats.
589
590 Full page--width figures and tables may be placed in \docenvdef{figure*} or
591 \docenvdef{table*} environments. To place figures or tables in the margin,
592 use the \docenvdef{marginfigure} or \docenvdef{margintable} environments as follows
593 (see figure~\ref{fig:marginfig}):
594
595 \begin{codeblock}[title=A figure in the margin.]
596 \begin{marginfigure}%
597 \includegraphics[width=\linewidth]{helix}
598 \caption{This is a margin figure. The helix is defined by
599 $x = \cos(2\pi z)$, $y = \sin(2\pi z)$, and $z = [0, 2.7]$. The figure was
600 drawn using Asymptote (\url{http://asymptote.sf.net/}).\label{fig:marginfig}}
601 \end{marginfigure}
602 \end{codeblock}
603
604
605 \begin{marginfigure}%
606 \includegraphics[width=\linewidth]{helix}
607 \caption{This is a margin figure. The helix is defined by
608 $x = \cos(2\pi z)$, $y = \sin(2\pi z)$, and $z = [0, 2.7]$. The figure was
609 drawn using Asymptote (\url{http://asymptote.sf.net/}).\label{fig:marginfig}}
610 \end{marginfigure}
611
612
613 The \docenv{marginfigure} and \docenv{margintable} environments accept an optional
614 parameter \docopt{offset} that adjusts the vertical position of the figure or table.
615 See the ``\nameref{sec:sidenotes}'' section above for examples. The specifications are:
616
617 \begin{codeblock}[title=The syntax of \docenv{marginfigure}.,colback=red!50!yellow!15!white,]
618 \begin{marginfigure}[<offset>]
619 ...
620 \end{marginfigure}
621 ...
622 \begin{margintable}[<offset>]
623 ...
624 \end{margintable}
625 \end{codeblock}
626
627
628 Figure~\ref{fig:fullfig} is an example of the \docenv{figure*}
629 environment and figure~\ref{fig:textfig} is an example of the normal
630 \docenv{figure} environment.
631
632 \begin{figure*}[h]
633 \includegraphics[width=\linewidth]{sine.pdf}%
634 \caption{This graph shows the function $y=\sin x\textsf{ with }x=[-10, 10]$.
635 \emph{Notice that this figure takes up the full page width.}\label{fig:fullfig}}%
636 \end{figure*}
637
638 \vspace{3\normalbaselineskip}
639
640 \begin{figure}
641 \includegraphics{hilbertcurves.pdf}
642 % \checkparity This is an \pageparity\ page.%
643 \caption[Hilbert curves of various degrees $n$.][6pt]{Hilbert curves of
644 various degrees $n$. \emph{Notice that this figure only takes up the main textblock width.}%
645 \label{fig:textfig}}%
646 \end{figure}
647
648 As with sidenotes and marginnotes, a caption may sometimes require vertical
649 adjustment. The \doccmddef{caption} command now takes a second optional
650 argument that enables you to do this by providing a dimension \docopt{offset}.
651 You may specify the caption in any one of the following forms:
652
653 \begin{codeblock}[title=The syntax of \docenv{marginfigure}.,colback=red!50!yellow!15!white,]
654 \caption{long caption}
655 \caption[<short caption>]{long caption}
656 \caption[][<offset>]{long caption}
657 \caption[<short caption>][<offset>]{long caption}
658 \end{codeblock}
659
660 A positive \docopt{offset} will push the caption down the page. The short
661 caption, if provided, is what appears in the list of figures/tables, otherwise
662 the ``long'' caption appears there. Note that although the arguments
663 \docopt{short caption} and \docopt{offset} are both optional, they must be
664 provided in order. Thus, to specify an \docopt{offset} without specifying a
665 \docopt{short caption}, you must include the first set of empty brackets
666 \Verb|[]|, which tell \doccmd{caption} to use the default ``long'' caption. As
667 an example, the caption to figure~\ref{fig:textfig} above was given in the form
668
669 \begin{docspec}
670 \doccmd{caption}[Hilbert curves...][6pt]\{Hilbert curves...\}
671 \end{docspec}
672
673 Table~\ref{tab:normaltab} shows table created with the \docpkg{booktabs}
674 package. Notice the lack of vertical rules---they serve only to clutter
675 the table's data.
676
677 Important: All \verb|\label| commands for figures must be \emph{inside} the \verb|\caption| command.
678 For example:
679
680
681 \begin{docspec}
682 \doccmd{caption}[Hilbert curves...][6pt]\{Hilbert curves... \doccmd{label}\{<name>\}\}
683 \end{docspec}
684
685
686
687
688 \begin{table}[ht]
689 \centering
690 \rmfamily\selectfont
691 \begin{tabular}{ll}
692 \toprule
693 Margin & Length \\
694 \midrule
695 Paper width & \num{8.5}\unit{inch} \\
696 Paper height & 11\unit{inch} \\
697 Textblock width & 6.5\unit{inch} \\
698 Textblock/sidenote gutter & \qty[mode = text]{0.375}{inch} \\
699 Sidenote width & 2\unit{inch} \\
700 \bottomrule
701 \end{tabular}
702 \caption{Here are the dimensions of the various margins used in the Tufte-handout class.}
703 \label{tab:normaltab}
704 %\zsavepos{pos:normaltab}
705 \end{table}
706
707 \newthought{Occasionally} \LaTeX{} will generate an error message:\label{err:too-many-floats}
708 \begin{docspec}
709 Error: Too many unprocessed floats
710 \end{docspec}
711 \LaTeX{} tries to place floats in the best position on the page. Until it's
712 finished composing the page, however, it won't know where those positions are.
713 If you have a lot of floats on a page (including sidenotes, margin notes,
714 figures, tables, etc.), \LaTeX{} may run out of ``slots'' to keep track of them
715 and will generate the above error.
716
717 \LaTeX{} initially allocates 18 slots for storing floats. To work around this
718 limitation, the \TL document classes provide a \doccmddef{morefloats} command
719 that will reserve more slots.
720
721 The first time \doccmd{morefloats} is called, it allocates an additional 34
722 slots. The second time \doccmd{morefloats} is called, it allocates another 26
723 slots.
724
725 The \doccmd{morefloats} command may only be used two times. Calling it a
726 third time will generate an error message. (This is because we can't safely
727 allocate many more floats or \LaTeX{} will run out of memory.)
728
729 If, after using the \doccmd{morefloats} command twice, you continue to get the
730 \texttt{Too many unprocessed floats} error, there are a couple things you can
731 do.
732
733 The \doccmddef{FloatBarrier} command will immediately process all the floats
734 before typesetting more material. Since \doccmd{FloatBarrier} will start a new
735 paragraph, you should place this command at the beginning or end of a
736 paragraph.
737
738 The \doccmddef{clearpage} command will also process the floats before
739 continuing, but instead of starting a new paragraph, it will start a new page.
740
741 You can also try moving your floats around a bit: move a figure or table to the
742 next page or reduce the number of sidenotes. (Each sidenote actually uses
743 \emph{two} slots.)
744
745 After the floats have placed, \LaTeX{} will mark those slots as unused so they
746 are available for the next page to be composed.
747
748 \section{Captions}
749 You may notice that the captions are sometimes misaligned.
750 Due to the way \LaTeX's float mechanism works, we can't know for sure where it
751 decided to put a float. Therefore, the \TL document classes provide commands to
752 override the caption position.
753
754 \paragraph{Vertical alignment} To override the vertical alignment, use the
755 \doccmd{setfloatalignment} command inside the float environment. For
756 example:
757
758 \begin{fullwidth}
759 \begin{docspec}
760 \textbackslash begin\{figure\}[btp]\\
761 \qquad \textbackslash includegraphics\{sinewave\}\\
762 \qquad \textbackslash caption\{This is an example of a sine wave.\}\\
763 \qquad \textbackslash label\{fig:sinewave\}\\
764 \qquad \hlred{\textbackslash setfloatalignment\{b\}\% forces caption to be bottom-aligned}\\
765 \textbackslash end\{figure\}
766 \end{docspec}
767 \end{fullwidth}
768
769 \noindent The syntax of the \doccmddef{setfloatalignment} command is:
770
771 \begin{docspec}
772 \doccmd{setfloatalignment}\{\docopt{pos}\}
773 \end{docspec}
774
775 \noindent where \docopt{pos} can be either \texttt{b} for bottom-aligned
776 captions, or \texttt{t} for top-aligned captions.
777
778 \paragraph{Horizontal alignment}\label{par:overriding-horizontal}
779 To override the horizontal alignment, use either the \doccmd{forceversofloat}
780 or the \doccmd{forcerectofloat} command inside of the float environment. For
781 example:
782
783 \begin{fullwidth}
784 \begin{docspec}
785 \textbackslash begin\{figure\}[btp]\\
786 \qquad \textbackslash includegraphics\{sinewave\}\\
787 \qquad \textbackslash caption\{This is an example of a sine wave.\}\\
788 \qquad \textbackslash label\{fig:sinewave\}\\
789 \qquad \hlred{\textbackslash forceversofloat\% forces caption to be set to the left of the float}\\
790 \textbackslash end\{figure\}
791 \end{docspec}
792 \end{fullwidth}
793
794 The \doccmddef{forceversofloat} command causes the algorithm to assume the
795 float has been placed on a verso page---that is, a page on the left side of a
796 two-page spread. Conversely, the \doccmddef{forcerectofloat} command causes
797 the algorithm to assume the float has been placed on a recto page---that is, a
798 page on the right side of a two-page spread.
799
800
801 \section{Full-width text blocks}
802
803 In addition to the new float types, there is a \docenvdef{fullwidth}
804 environment that stretches across the main text block and the sidenotes
805 area.
806
807 \begin{Verbatim}
808 \begin{fullwidth}
809 Lorem ipsum dolor sit amet...
810 \end{fullwidth}
811 \end{Verbatim}
812
813 \begin{fullwidth}
814 \small\itshape\lipsum[1]
815 \end{fullwidth}
816
817 \section{Typography}\label{sec:typography}
818
819 \subsection{Typefaces}\label{sec:typefaces}\index{typefaces}
820 If the Palatino, \textsf{Helvetica}, and \texttt{Bera Mono} typefaces are installed, this style
821 will use them automatically. Otherwise, we'll fall back on the Computer Modern
822 typefaces.
823
824 \subsection{Letterspacing}\label{sec:letterspacing}
825 This document class includes two new commands and some improvements on
826 existing commands for letterspacing.
827
828 When setting strings of \allcaps{ALL CAPS} or \smallcaps{small caps}, the
829 letter\-spacing---that is, the spacing between the letters---should be
830 increased slightly.~\parencite{Bringhurst2005} The \doccmddef{allcaps} command has proper letterspacing for
831 strings of \allcaps{FULL CAPITAL LETTERS}, and the \doccmddef{smallcaps} command
832 has letterspacing for \smallcaps{small capital letters}. These commands
833 will also automatically convert the case of the text to upper- or
834 lowercase, respectively.
835
836 The \doccmddef{textsc} command has also been redefined to include
837 letterspacing. The case of the \doccmd{textsc} argument is left as is,
838 however. This allows one to use both uppercase and lowercase letters:
839 \textsc{The Initial Letters Of The Words In This Sentence Are Capitalized.}
840
841
842
843 \section{Document Class Options}\label{sec:options}
844
845 \index{class options|(}
846 The \doccls{tufte-book} class is based on the \LaTeX\ \doccls{book}
847 document class. Therefore, you can pass any of the typical book
848 options. There are a few options that are specific to the
849 \doccls{tufte-book} document class, however.
850
851 The \docclsoptdef{a4paper} option will set the paper size to \smallcaps{A4} instead of
852 the default \smallcaps{US} letter size.
853
854 The \docclsoptdef{sfsidenotes} option will set the sidenotes and title block in a
855 \textsf{sans serif} typeface instead of the default roman.
856
857 The \docclsoptdef{twoside} option will modify the running heads so that the page
858 number is printed on the outside edge (as opposed to always printing the page
859 number on the right-side edge in \docclsoptdef{oneside} mode).
860
861 The \docclsoptdef{symmetric} option typesets the sidenotes on the outside edge of
862 the page. This is how books are traditionally printed, but is contrary to
863 Tufte's book design which sets the sidenotes on the right side of the page.
864 This option implicitly sets the \docclsopt{twoside} option.
865
866 The \docclsoptdef{justified} option sets all the text fully justified (flush left
867 and right). The default is to set the text ragged right.
868 The body text of Tufte's books are set ragged right. This prevents
869 needless hyphenation and makes it easier to read the text in the slightly
870 narrower column.
871
872 The \docclsoptdef{bidi} option loads the \docpkg{bidi} package which is used with
873 \tXeLaTeX\ to typeset bi-directional text. Since the \docpkg{bidi}
874 package needs to be loaded before the sidenotes and cite commands are defined,
875 it can't be loaded in the document preamble.
876
877 The \docclsoptdef{debug} option causes the \TL classes to output debug
878 information to the log file which is useful in troubleshooting bugs. It will
879 also cause the graphics to be replaced by outlines.
880
881 The \docclsoptdef{nofonts} option prevents the \TL classes from
882 automatically loading the Palatino and Helvetica typefaces. You should use
883 this option if you wish to load your own fonts. If you're using \tXeLaTeX, this
884 option is implied (\ie, the Palatino and Helvetica fonts aren't loaded if you
885 use \tXeLaTeX).
886
887 The \docclsoptdef{nols} option inhibits the letterspacing code. The \TL\
888 classes try to load the appropriate letterspacing package (either pdf\TeX's
889 \docpkg{letterspace} package or the \docpkg{soul} package). If you're using
890 \tXeLaTeX\ with \docpkg{fontenc}, however, you should configure your own
891 letterspacing.
892
893 The \docclsoptdef{notitlepage} option causes \doccmd{maketitle} to generate a title
894 block instead of a title page. The \doccls{book} class defaults to a title
895 page and the \doccls{handout} class defaults to the title block. There is an
896 analogous \docclsoptdef{titlepage} option that forces \doccmd{maketitle} to
897 generate a full title page instead of the title block.
898
899 The \docclsoptdef{notoc} option suppresses \TL's custom table of contents
900 (\textsc{toc}) design. The current \textsc{toc} design only shows unnumbered
901 chapter titles; it doesn't show sections or subsections. The \docclsopt{notoc}
902 option will revert to \LaTeX's \textsc{toc} design.
903
904 The \docclsoptdef{nohyper} option prevents the \docpkg{hyperref} package from
905 being loaded. The default is to load the \docpkg{hyperref} package and use the
906 \doccmd{title} and \doccmd{author} contents as metadata for the generated
907 \textsc{pdf}.
908
909 \index{class options|)}
910
911
912
913 \chapter[Customizing Tufte-LaTeX]{Customizing \TL}
914 \label{ch:customizing}
915
916 The \TL document classes are designed to closely emulate Tufte's book
917 design by default. However, each document is different and you may encounter
918 situations where the default settings are insufficient. This chapter explores
919 many of the ways you can adjust the \TL document classes to better fit
920 your needs.
921
922 \section{File Hooks}
923 \label{sec:filehooks}
924
925 \index{file hooks|(}
926 If you create many documents using the \TL classes, it's easier to
927 store your customizations in a separate file instead of copying them into the
928 preamble of each document. The \TL classes provide three file hooks:
929 \docfilehook{tufte-common-local.tex}{common}, \docfilehook{tufte-book-local.tex}{book}, and
930 \docfilehook{tufte-handout-local.tex}{handout}.\sloppy
931
932 \begin{description}
933 \item[\docfilehook{tufte-common-local.tex}{common}]
934 If this file exists, it will be loaded by all of the \TL document
935 classes just prior to any document-class-specific code. If your
936 customizations or code should be included in both the book and handout
937 classes, use this file hook.
938 \item[\docfilehook{tufte-book-local.tex}{book}]
939 If this file exists, it will be loaded after all of the common and
940 book-specific code has been read. If your customizations apply only to the
941 book class, use this file hook.
942 \item[\docfilehook{tufte-common-handout.tex}{handout}]
943 If this file exists, it will be loaded after all of the common and
944 handout-specific code has been read. If your customizations apply only to
945 the handout class, use this file hook.
946 \end{description}
947
948 \index{file hooks|)}
949
950 \section{Numbered Section Headings}
951 \label{sec:numbered-sections}
952 \index{headings!numbered}
953
954 While Tufte dispenses with numbered headings in his books, if you require them,
955 they can be anabled by changing the value of the \doccounter{secnumdepth}
956 counter. From the table below, select the heading level at which numbering
957 should stop and set the \doccounter{secnumdepth} counter to that value. For
958 example, if you want parts and chapters numbered, but don't want numbering for
959 sections or subsections, use the command:
960 \begin{docspec}
961 \doccmd{setcounter}\{secnumdepth\}\{0\}
962 \end{docspec}
963
964 The default \doccounter{secnumdepth} for the \TL document classes is $-1$.
965
966 \begin{table}
967 \footnotesize
968 \begin{center}
969 \begin{tabular}{lr}
970 \toprule
971 Heading level & Value \\
972 \midrule
973 Part (in \doccls{tufte-book}) & $-1$ \\
974 Part (in \doccls{tufte-handout}) & $0$ \\
975 Chapter (only in \doccls{tufte-book}) & $0$ \\
976 Section & $1$ \\
977 Subsection & $2$ \\
978 Subsubsection & $3$ \\
979 Paragraph & $4$ \\
980 Subparagraph & $5$ \\
981 \bottomrule
982 \end{tabular}
983 \end{center}
984 \caption{Heading levels used with the \texttt{secnumdepth} counter.}
985 \end{table}
986
987 \section{Changing the Paper Size}
988 \label{sec:paper-size}
989
990 The \TL classes currently only provide three paper sizes: \textsc{a4},
991 \textsc{b5}, and \textsc{us} letter. To specify a different paper size (and/or
992 margins), use the \doccmd[geometry]{geometry} command in the preamble of your
993 document (or one of the file hooks). The full documentation of the
994 \doccmd{geometry} command may be found in the \docpkg{geometry} package
995 documentation.~\parencite{pkg-geometry}
996
997
998 \section{Customizing Marginal Material}
999 \label{sec:marginal-material}
1000
1001 Marginal material includes sidenotes, citations, margin notes, and captions.
1002 Normally, the justification of the marginal material follows the justification
1003 of the body text. If you specify the \docclsopt{justified} document class
1004 option, all of the margin material will be fully justified as well. If you
1005 don't specify the \docclsopt{justified} option, then the marginal material will
1006 be set ragged right.
1007
1008 You can set the justification of the marginal material separately from the body
1009 text using the following document class options: \docclsopt{sidenote},
1010 \docclsopt{marginnote}, \docclsopt{caption}, \docclsopt{citation}, and
1011 \docclsopt{marginals}. Each option refers to its obviously corresponding
1012 marginal material type. The \docclsopt{marginals} option simultaneously sets
1013 the justification on all four marginal material types.
1014
1015 Each of the document class options takes one of five justification types:
1016 \begin{description}
1017 \item[\docclsopt{justified}] Fully justifies the text (sets it flush left and
1018 right).
1019 \item[\docclsopt{raggedleft}] Sets the text ragged left, regardless of which
1020 page it falls on.
1021 \item[\docclsopt{raggedright}] Sets the text ragged right, regardless of
1022 which page it falls on.
1023 \item[\doccls{raggedouter}] Sets the text ragged left if it falls on the
1024 left-hand (verso) page of the spread and otherwise sets it ragged right.
1025 This is useful in conjunction with the \docclsopt{symmetric} document class
1026 option.
1027 \item[\docclsopt{auto}] If the \docclsopt{justified} document class option
1028 was specified, then set the text fully justified; otherwise the text is set
1029 ragged right. This is the default justification option if one is not
1030 explicitly specified.
1031 \end{description}
1032
1033 \noindent For example,
1034 \begin{docspec}
1035 \doccmdnoindex{documentclass}[symmetric,justified,marginals=raggedouter]\{tufte-book\}
1036 \end{docspec}
1037 will set the body text of the document to be fully justified and all of the
1038 margin material (sidenotes, margin notes, captions, and citations) to be flush
1039 against the body text with ragged outer edges.
1040
1041 \newthought{The font and style} of the marginal material may also be modified using the following commands:
1042
1043 \begin{docspec}
1044 \doccmd{setsidenotefont}\{\docopt{font commands}\}\\
1045 \doccmd{setcaptionfont}\{\docopt{font commands}\}\\
1046 \doccmd{setmarginnotefont}\{\docopt{font commands}\}\\
1047 \doccmd{setcitationfont}\{\docopt{font commands}\}
1048 \end{docspec}
1049
1050 The \doccmddef{setsidenotefont} sets the font and style for sidenotes, the
1051 \doccmddef{setcaptionfont} for captions, the \doccmddef{setmarginnotefont} for
1052 margin notes, and the \doccmddef{setcitationfont} for citations. The
1053 \docopt{font commands} can contain font size changes (e.g.,
1054 \doccmdnoindex{footnotesize}, \doccmdnoindex{Huge}, etc.), font style changes (e.g.,
1055 \doccmdnoindex{sffamily}, \doccmdnoindex{ttfamily}, \doccmdnoindex{itshape}, etc.), color changes (e.g.,
1056 \doccmdnoindex{color}\texttt{\{blue\}}), and many other adjustments.
1057
1058 If, for example, you wanted the captions to be set in italic sans serif, you could use:
1059 \begin{docspec}
1060 \doccmd{setcaptionfont}\{\doccmdnoindex{itshape}\doccmdnoindex{sffamily}\}
1061 \end{docspec}
1062
1063 \chapter{Compatibility Issues}
1064 \label{ch:compatibility}
1065
1066 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.
1067
1068 \section{Converting from \doccls{article} to \doccls{tufte-handout}}
1069
1070 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}.
1071
1072 The following headings are not supported: \doccmd{subsubsection} and \doccmd{subparagraph}.
1073
1074 \section{Converting from \doccls{book} to \doccls{tufte-book}}
1075
1076 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}.
1077
1078 The following headings are not supported: \doccmd{subsubsection} and \doccmd{subparagraph}.
1079
1080
1081
1082 \chapter{Troubleshooting and Support}
1083 \label{ch:troubleshooting}
1084
1085 \section{\TL Website}\label{sec:website}
1086 The website for the \TL packages is located at
1087 \url{http://code.google.com/p/tufte-latex/}. On our website, you'll find
1088 links to our \smallcaps{svn} repository, mailing lists, bug tracker, and documentation.
1089
1090 \section{\TL Mailing Lists}\label{sec:mailing-lists}
1091 There are two mailing lists for the \TL project:
1092
1093 \paragraph{Discussion list}
1094 The \texttt{tufte-latex} discussion list is for asking questions, getting
1095 assistance with problems, and help with troubleshooting. Release announcements
1096 are also posted to this list. You can subscribe to the \texttt{tufte-latex}
1097 discussion list at \url{http://groups.google.com/group/tufte-latex}.
1098
1099 \paragraph{Commits list}
1100 The \texttt{tufte-latex-commits} list is a read-only mailing list. A message
1101 is sent to the list any time the \TL code has been updated. If you'd like to
1102 keep up with the latest code developments, you may subscribe to this list. You
1103 can subscribe to the \texttt{tufte-latex-commits} mailing list at
1104 \url{http://groups.google.com/group/tufte-latex-commits}.
1105
1106 \section{Getting Help}\label{sec:getting-help}
1107 If you've encountered a problem with one of the \TL document classes, have a
1108 question, or would like to report a bug, please send an email to our
1109 mailing list or visit our website.
1110
1111 To help us troubleshoot the problem more quickly, please try to compile your
1112 document using the \docclsopt{debug} class option and send the generated
1113 \texttt{.log} file to the mailing list with a brief description of the problem.
1114
1115
1116 \section{Errors, Warnings, and Informational Messages}\label{sec:tl-messages}
1117 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.
1118 \index{error messages}\index{warning messages}\index{debug messages}
1119
1120 % Errors
1121 \docmsg{Error: \doccmd{subparagraph} is undefined by this class.}{%
1122 The \doccmd{subparagraph} command is not defined in the \TL document classes.
1123 If you'd like to use the \doccmd{subparagraph} command, you'll need to redefine
1124 it yourself. See the ``Headings'' section on page~\pageref{sec:headings} for a
1125 description of the heading styles available in the \TL document classes.}
1126
1127 \docmsg{Error: \doccmd{subsubsection} is undefined by this class.}{%
1128 The \doccmd{subsubsection} command is not defined in the \TL document classes.
1129 If you'd like to use the \doccmd{subsubsection} command, you'll need to
1130 redefine it yourself. See the ``Headings'' section on
1131 page~\pageref{sec:headings} for a description of the heading styles available
1132 in the \TL document classes.}
1133
1134 \docmsg{Error: You may only call \doccmd{morefloats} twice. See the\par\noindent\ \ \ \ \ \ \ \ Tufte-LaTeX documentation for other workarounds.}{%
1135 \LaTeX{} allocates 18 slots for storing floats. The first time
1136 \doccmd{morefloats} is called, it allocates an additional 34 slots. The second
1137 time \doccmd{morefloats} is called, it allocates another 26 slots.
1138
1139 The \doccmd{morefloats} command may only be called two times. Calling it a
1140 third time will generate this error message. See
1141 page~\pageref{err:too-many-floats} for more information.}
1142
1143 % Warnings
1144 \docmsg{Warning: Option `\docopt{class option}' is not supported -{}- ignoring option.}{%
1145 This warning appears when you've tried to use \docopt{class option} with a \TL
1146 document class, but \docopt{class option} isn't supported by the \TL document
1147 class. In this situation, \docopt{class option} is ignored.}
1148
1149 % Info / Debug messages
1150 \docmsg{Info: The `\docclsopt{symmetric}' option implies `\docclsopt{twoside}'}{%
1151 You specified the \docclsopt{symmetric} document class option. This option automatically forces the \docclsopt{twoside} option as well. See page~\pageref{clsopt:symmetric} for more information on the \docclsopt{symmetric} class option.}
1152
1153
1154 \section{Package Dependencies}\label{sec:dependencies}
1155 The following is a list of packages that the \TL document
1156 classes rely upon. Packages marked with an asterisk are optional.
1157 \begin{multicols}{2}
1158 \begin{itemize}
1159 \item xifthen
1160 \item ifpdf*
1161 \item ifxetex*
1162 \item hyperref
1163 \item geometry
1164 \item ragged2e
1165 \item chngpage \emph{or} changepage
1166 \item paralist
1167 \item textcase
1168 \item soul*
1169 \item letterspace*
1170 \item setspace
1171 \item natbib \emph{and} bibentry
1172 \item optparams
1173 \item placeins
1174 \item mathpazo*
1175 \item helvet*
1176 \item fontenc
1177 \item beramono*
1178 \item fancyhdr
1179 \item xcolor
1180 \item textcomp
1181 \item titlesec
1182 \item titletoc
1183 \end{itemize}
1184 \end{multicols}
1185
1186 %%
1187 % The back matter contains appendices, bibliographies, indices, glossaries, etc.
1188
1189
1190 \section{hyperref}\label{sec:hyperref}
1191 The optional argument \textsf{nohyperref} allows to deactivate package
1192 \xPack{hyperref}.~\parencite{ctan-hyperref} In a lot of cases the package
1193 \xPack{hyperref} should be loaded as last package. You can define external files
1194
1195 \begin{verbatim}
1196 tufte-common-local-before-hyperref.tex
1197 tufte-common-local-after-hyperref.tex
1198 \end{verbatim}
1199
1200 The contents of these optional files will be loaded before or after \xPack{hyperref}.
1201 You can use the environment \docenv{filecontents} to write code into these
1202 files on-the-fly.~\nocite{ctan-hyperref}
1203 For example for this document:
1204
1205 \begin{codeblock}[title=Before \texttt{hyperref} loaded Code.]
1206 \begin{filecontents}[overwrite,noheader]{tufte-common-local-before-hyperref.tex}
1207 \usepackage{amsmath}
1208 \usepackage{graphicx} % allow embedded images
1209 \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}
1210 \graphicspath{{graphics/}} % set of paths to search for images
1211 \usepackage{booktabs} % book-quality tables
1212 \usepackage{multicol} % multiple column layout facilities
1213 \usepackage{lipsum} % filler text
1214 \usepackage{fancyvrb} % extended verbatim environments
1215 \fvset{fontsize=\normalsize}% default font size for fancy-verbatim environments
1216 \usepackage{minted-code}
1217 \usepackage{xspace}
1218 \usepackage{siunitx}
1219
1220 \usepackage{makeidx}\makeindex
1221 \end{filecontents}
1222 \end{codeblock}
1223
1224
1225
1226 \backmatter
1227
1228 \section{Support}\label{sec:support}
1229
1230 The website for the Tufte-\LaTeX\ packages is located at
1231 \url{http://code.google.com/p/tufte-latex/}. On this website, you'll find
1232 links to the \smallcaps{svn} repository, mailing lists, bug tracker, and documentation.
1233
1234 Questions or problems to the \XeLaTeX/\LuaLaTeX-version write to
1235 \url{mailto:[email protected]}.
1236
1237 \printbibliography
1238
1239 \printindex
1240
1241 \end{document}
1242