Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

tufte-handout.cls 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. \NeedsTeXFormat{LaTeX2e}[1994/06/01]
  2. \ProvidesClass{tufte-handout}[2008/02/11 v1.2.3 Tufte-handout class]
  3. %%
  4. % a4paper option
  5. \newif\if@tufteh@afourpaper \@tufteh@afourpaperfalse
  6. \DeclareOption{a4paper}{\@tufteh@afourpapertrue}
  7. %%
  8. % sfsidenotes option -- typesets sidenotes in sans serif typeface
  9. \newif\if@tufteh@sfsidenotes \@tufteh@sfsidenotesfalse
  10. \DeclareOption{sfsidenotes}{\@tufteh@sfsidenotestrue}
  11. % FIXME: should probably specify options not supported like Mittelbach's aipproc.cls
  12. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
  13. \ProcessOptions
  14. \LoadClass{article}%
  15. %%
  16. % Set page layout geometry
  17. \if@tufteh@afourpaper
  18. \RequirePackage[a4paper,includemp,width=170mm,marginparsep=10mm,marginparwidth=50mm]{geometry}
  19. \else
  20. \RequirePackage[letterpaper,includemp,width=6.5in,marginparsep=0.375in,marginparwidth=2in]{geometry}
  21. \fi
  22. %%
  23. % Separation marginpars by a line's worth of space.
  24. \setlength\marginparpush{\baselineskip}
  25. %%
  26. % Font for margin items
  27. \if@tufteh@sfsidenotes
  28. \newcommand{\@tufteh@marginfont}{\normalfont\scriptsize\sffamily}
  29. \else
  30. \newcommand{\@tufteh@marginfont}{\normalfont\scriptsize}
  31. \fi
  32. %%
  33. % Modify \raggedright from latex.ltx to allow hyphenation per Donald Arseneau
  34. \def\@tufteh@raggedright{%
  35. \let\\\@centercr\@rightskip\z@ plus 0.08\hsize
  36. \rightskip\@rightskip
  37. \leftskip\z@skip}
  38. %%
  39. % Turn off section numbering
  40. \setcounter{secnumdepth}{-1}
  41. %%
  42. % Tighten up space between displays (e.g., a figure or table) and make symmetric
  43. \setlength\abovedisplayskip{6pt plus 2pt minus 4pt}
  44. \setlength\belowdisplayskip{6pt plus 2pt minus 4pt}
  45. %%
  46. % To implement full-width display environments
  47. \RequirePackage{chngpage}
  48. % Compute length used for full-width displays
  49. \newlength{\@tufteh@overhang}
  50. \setlength{\@tufteh@overhang}{\marginparwidth}
  51. \addtolength{\@tufteh@overhang}{\marginparsep}
  52. %%
  53. % Alter \maketitle from article.cls
  54. \renewcommand\maketitle{\par
  55. \global\let\and\relax
  56. \begingroup
  57. \renewcommand\thefootnote{\@fnsymbol\c@footnote}%
  58. \def\@makefnmark{\rlap{\@textsuperscript{\normalfont\@thefnmark}}}%
  59. \long\def\@makefntext##1{\parindent 1em\noindent
  60. \hb@xt@1.8em{%
  61. \hss\@textsuperscript{\normalfont\@thefnmark}}##1}%
  62. \newpage
  63. \global\@topnum\z@
  64. \@maketitle
  65. \@thanks
  66. \endgroup
  67. \global\let\thanks\relax
  68. \global\let\maketitle\relax
  69. \global\let\@maketitle\relax
  70. \global\let\@thanks\@empty
  71. \global\let\@author\@empty
  72. \global\let\@date\@empty
  73. \global\let\@title\@empty
  74. \global\let\title\relax
  75. \global\let\author\relax
  76. \global\let\date\relax
  77. }
  78. \def\@maketitle{%
  79. \newpage
  80. \let\footnote\sidenote
  81. {\noindent\large\bfseries \@title\par}%
  82. \vskip 3pt%
  83. {\small \@date\par}%
  84. \vskip 3pt%
  85. {\small \@author\par}
  86. }
  87. %%
  88. % Abstract
  89. \renewenvironment{abstract}%
  90. {\begin{quotation}
  91. \begin{sffamily}
  92. \begin{small}}%
  93. { \end{small}
  94. \end{sffamily}
  95. \end{quotation}}
  96. %%
  97. % Require paralist package for tighter lists
  98. \RequirePackage{paralist}
  99. % Add rightmargin to compactenum
  100. \def\@compactenum@{%
  101. \expandafter\list\csname label\@enumctr\endcsname{%
  102. \usecounter{\@enumctr}%
  103. \rightmargin=2em% added this
  104. \parsep\plparsep
  105. \itemsep\plitemsep
  106. \topsep\pltopsep
  107. \partopsep\plpartopsep
  108. \def\makelabel##1{\hss\llap{##1}}}}
  109. %%
  110. % An environment for paragraph-style section
  111. \providecommand\newthought[1]{\vspace{1.8\baselineskip plus 3pt minus 2pt}%
  112. {\noindent\scshape #1}}
  113. %%
  114. % Transform existing \footnotes into \sidenotes
  115. % Sidenote: ``Where God meant footnotes to go.'' ---Tufte
  116. \RequirePackage[side,multiple,marginal]{footmisc}
  117. \setlength{\footnotemargin}{0.8em}
  118. \newcommand{\footnotelayout}{\@tufteh@marginfont\@tufteh@raggedright}
  119. \let\sidenote\footnote
  120. % Set the footnote mark (adjacent to the footnote) in the same typeface as the footenote itself.
  121. \def\@makefnmark{\hbox{\@textsuperscript{\@tufteh@marginfont\tiny\@thefnmark}}}
  122. % TODO: Automatically determine the \footnotemargin value based on the width of the footnote mark.
  123. %%
  124. % Sidenote without the footnote mark
  125. \providecommand\marginnote[1]%
  126. {\marginpar{\@tufteh@marginfont\raggedright #1}}
  127. %%
  128. % Citations should go in the margin as well
  129. \RequirePackage{natbib}
  130. \RequirePackage{bibentry} % allows bibitems to be typeset outside thebibliography environment
  131. \nobibliography* % pre-loads the bibliography keys
  132. \renewcommand{\cite}[1]{\sidenote{\bibentry{#1}.}}
  133. \providecommand{\doi}[1]{\textsc{doi:} #1} % pre-defining this so it may be used before the \bibliography command it issued
  134. % TODO: Rewrite \cite so that you can specify multiple bib keys
  135. % at once. For example, \cite{Author01,Author02}
  136. % TODO: Combine sequences of citations so that 2,3,4,6 becomes 2-4,6
  137. % but be careful of hypperref interaction
  138. %%
  139. % Margin figure
  140. \newcommand{\marginfigure}[2]%
  141. [-1.2ex]%
  142. {\marginpar{\@tufteh@marginfont
  143. \def\@captype{figure}
  144. \vspace*{#1}
  145. \@tufteh@raggedright #2}}
  146. % FIXME: if anyone can make this an environment instead -- patch welcome!
  147. %%
  148. % Margin table
  149. \newcommand{\margintable}[2]%
  150. [-1.2ex]%
  151. {\marginpar{\@tufteh@marginfont
  152. \def\@captype{table}
  153. \vspace*{#1}
  154. \@tufteh@raggedright #2}}
  155. % FIXME: if anyone can make this an environment instead -- patch welcome!
  156. %%
  157. % Full-width figure
  158. \renewenvironment{figure*}[1]%
  159. [htbp]%
  160. {\@float{figure}[#1]%
  161. \begin{adjustwidth}{}{-\@tufteh@overhang}%
  162. \begin{minipage}{\linewidth}}%
  163. {\end{minipage}%
  164. \end{adjustwidth}%
  165. \end@float}
  166. %%
  167. % Full-width table
  168. \renewenvironment{table*}[1]
  169. [htbp]%
  170. {\@float{table}[#1]%
  171. \begin{adjustwidth}{}{-\@tufteh@overhang}%
  172. \begin{minipage}{\linewidth}}%
  173. {\end{minipage}%
  174. \end{adjustwidth}%
  175. \end@float}
  176. %%
  177. % Full-page-width area
  178. \newenvironment{fullwidth}
  179. {\begin{adjustwidth}{}{-\@tufteh@overhang}}%
  180. {\end{adjustwidth}}
  181. %%
  182. % Format the captions in a style similar to the sidenotes
  183. % if 'sfsidenotes' option is specified, set the captions in sf, too.
  184. \if@tufteh@sfsidenotes
  185. \RequirePackage[format=default,font={sf,scriptsize},justification=raggedright,singlelinecheck=false]{caption}
  186. \else
  187. \RequirePackage[format=default,font={rm,scriptsize},justification=raggedright,singlelinecheck=false]{caption}
  188. \fi
  189. %%
  190. % Set raggedright and paragraph indentation for document
  191. \AtBeginDocument{\@tufteh@raggedright\setlength\parindent{1em}}
  192. \endinput