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

297 satır
12KB

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