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.

tufte-common.sty 34KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101
  1. \NeedsTeXFormat{LaTeX2e}[1994/06/01]
  2. \ProvidesPackage{tufte-common}[2008/11/16 v3.0.0 Common code for the Tufte-LaTeX styles]
  3. %%
  4. % We use the `xifthen' package to handle our package option switches
  5. \RequirePackage{xifthen}
  6. %%
  7. % `debug' option -- provides more information in the .log file for use in
  8. % troubleshooting problems
  9. \newboolean{@tufte@debug}
  10. \DeclareOption{debug}{\setboolean{@tufte@debug}{true}}
  11. %%
  12. % `nofonts' option -- doesn't load any fonts
  13. % `fonts' option -- tries to load fonts
  14. \newboolean{@tufte@loadfonts}\setboolean{@tufte@loadfonts}{true}
  15. \DeclareOption{fonts}{\setboolean{@tufte@loadfonts}{true}}
  16. \DeclareOption{nofonts}{\setboolean{@tufte@loadfonts}{false}}
  17. %%
  18. % `nols' option -- doesn't configure letterspacing
  19. % `ls' option -- configures letterspacing
  20. \newboolean{@tufte@letterspace}\setboolean{@tufte@letterspace}{true}
  21. \DeclareOption{ls}{\setboolean{@tufte@letterspace}{true}}
  22. \DeclareOption{nols}{\setboolean{@tufte@letterspace}{false}}
  23. %%
  24. % `book' and `handout' options
  25. \newcommand{\@tufte@class}{article}% the base LaTeX class (defaults to the article/handout style)
  26. \newcommand{\@tufte@pkgname}{tufte-handout}% the name of the package (defaults to tufte-handout)
  27. \DeclareOption{book}{%
  28. \renewcommand{\@tufte@class}{book}
  29. \renewcommand{\@tufte@pkgname}{tufte-book}
  30. \setboolean{@tufte@titlepage}{true}
  31. }
  32. \DeclareOption{handout}{%
  33. \renewcommand{\@tufte@class}{article}
  34. \renewcommand{\@tufte@pkgname}{tufte-handout}
  35. \setboolean{@tufte@titlepage}{false}
  36. }
  37. \DeclareOption{article}{% `article' is just an alias for `handout'
  38. \renewcommand{\@tufte@class}{article}
  39. \renewcommand{\@tufte@pkgname}{tufte-handout}
  40. \setboolean{@tufte@titlepage}{false}
  41. }
  42. %%
  43. % `titlepage' option -- creates a full title page with \maketitle
  44. \newboolean{@tufte@titlepage}
  45. \DeclareOption{titlepage}{\setboolean{@tufte@titlepage}{true}}
  46. \DeclareOption{notitlepage}{\setboolean{@tufte@titlepage}{false}}
  47. %%
  48. % `a4paper' option
  49. \newboolean{@tufte@afourpaper}
  50. \DeclareOption{a4paper}{\setboolean{@tufte@afourpaper}{true}}
  51. %%
  52. % `sfsidenotes' option -- typesets sidenotes in sans serif typeface
  53. \newboolean{@tufte@sfsidenotes}
  54. \DeclareOption{sfsidenotes}{\setboolean{@tufte@sfsidenotes}{true}}
  55. %%
  56. % `symmetric' option -- puts marginpar space to the outside edge of the page
  57. % Note: this option forces the twoside option (see the .cls files)
  58. \newboolean{@tufte@symmetric}
  59. \DeclareOption{symmetric}{
  60. \setboolean{@tufte@symmetric}{true}
  61. \PackageInfo{\@tufte@pkgname}{The `symmetric' option implies `twoside'}
  62. %\ExecuteOptions{twoside}
  63. }
  64. %%
  65. % `twoside' option -- alternates running heads
  66. \newboolean{@tufte@twoside}
  67. \DeclareOption{twoside}{\setboolean{@tufte@twoside}{true}}
  68. %%
  69. % `notoc' option -- suppresses the Tufte-style table of contents
  70. \newboolean{@tufte@toc}
  71. \setboolean{@tufte@toc}{true}
  72. \DeclareOption{notoc}{\setboolean{@tufte@toc}{false}}
  73. \DeclareOption{toc}{\setboolean{@tufte@toc}{true}}
  74. %%
  75. % `justified' option -- uses fully justified text (flush left and flush
  76. % right) instead of ragged right.
  77. \newboolean{@tufte@justified}
  78. \DeclareOption{justified}{\setboolean{@tufte@justified}{true}}
  79. %%
  80. % `bidi' option -- loads the bidi package for bi-directional text
  81. \newboolean{@tufte@loadbidi}
  82. \DeclareOption{bidi}{\setboolean{@tufte@loadbidi}{true}}
  83. \DeclareOption{nobidi}{\setboolean{@tufte@loadbibi}{false}}
  84. % FIXME: should probably specify options not supported like Mittelbach's aipproc.cls
  85. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\@tufte@class}}
  86. \ProcessOptions
  87. %%
  88. % Detect whether we're in two-side mode or not. (Used to set up running
  89. % heads later.)
  90. \ifthenelse{\boolean{@twoside}}
  91. {\setboolean{@tufte@twoside}{true}}
  92. {}
  93. %%
  94. % Detect if we're using pdfLaTeX
  95. \newboolean{@tufte@pdf}
  96. \IfFileExists{ifpdf.sty}{%
  97. \RequirePackage{ifpdf}
  98. \ifthenelse{\boolean{pdf}}
  99. {\setboolean{@tufte@pdf}{true}}
  100. {\setboolean{@tufte@pdf}{false}}
  101. }{% assume we're not using pdfTex?
  102. \setboolean{@tufte@pdf}{false}
  103. }
  104. %%
  105. % Detect if we're using XeLaTeX
  106. \newboolean{@tufte@xetex}
  107. \IfFileExists{ifxetex.sty}{%
  108. \RequirePackage{ifxetex}
  109. \ifthenelse{\boolean{xetex}}
  110. {\setboolean{@tufte@xetex}{true}}
  111. {\setboolean{@tufte@xetex}{false}}
  112. }{% not using xelatex
  113. \setboolean{@tufte@xetex}{false}
  114. }
  115. %%
  116. % Load the `hyperref' package. We will set more options later.
  117. % TODO Set nice defaults for hyperref options
  118. \ifthenelse{\boolean{@tufte@xetex}}
  119. {\RequirePackage[hyperfootnotes=false,xetex]{hyperref}}
  120. {\RequirePackage[hyperfootnotes=false]{hyperref}}
  121. \hypersetup{%
  122. pdfborder = {0 0 0},
  123. bookmarksdepth = section,
  124. }
  125. %%
  126. % Set the font sizes and baselines to match Tufte's books
  127. \renewcommand\normalsize{%
  128. \@setfontsize\normalsize\@xpt{14}%
  129. \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
  130. \abovedisplayshortskip \z@ \@plus3\p@
  131. \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
  132. \belowdisplayskip \abovedisplayskip
  133. \let\@listi\@listI}
  134. \normalbaselineskip=14pt
  135. \normalsize
  136. \renewcommand\small{%
  137. \@setfontsize\small\@ixpt{12}%
  138. \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
  139. \abovedisplayshortskip \z@ \@plus2\p@
  140. \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
  141. \def\@listi{\leftmargin\leftmargini
  142. \topsep 4\p@ \@plus2\p@ \@minus2\p@
  143. \parsep 2\p@ \@plus\p@ \@minus\p@
  144. \itemsep \parsep}%
  145. \belowdisplayskip \abovedisplayskip
  146. }
  147. \renewcommand\footnotesize{%
  148. \@setfontsize\footnotesize\@viiipt{10}%
  149. \abovedisplayskip 6\p@ \@plus2\p@ \@minus4\p@
  150. \abovedisplayshortskip \z@ \@plus\p@
  151. \belowdisplayshortskip 3\p@ \@plus\p@ \@minus2\p@
  152. \def\@listi{\leftmargin\leftmargini
  153. \topsep 3\p@ \@plus\p@ \@minus\p@
  154. \parsep 2\p@ \@plus\p@ \@minus\p@
  155. \itemsep \parsep}%
  156. \belowdisplayskip \abovedisplayskip
  157. }
  158. \renewcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt}
  159. \renewcommand\tiny{\@setfontsize\tiny\@vpt\@vipt}
  160. \renewcommand\large{\@setfontsize\large\@xiipt{14}}
  161. \renewcommand\Large{\@setfontsize\Large\@xivpt{18}}
  162. \renewcommand\LARGE{\@setfontsize\LARGE\@xviipt{22}}
  163. \renewcommand\huge{\@setfontsize\huge\@xxpt{25}}
  164. \renewcommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
  165. \setlength\leftmargini {1pc}
  166. \setlength\leftmarginii {1pc}
  167. \setlength\leftmarginiii {1pc}
  168. \setlength\leftmarginiv {1pc}
  169. \setlength\leftmarginv {1pc}
  170. \setlength\leftmarginvi {1pc}
  171. \setlength\labelsep {.5pc}
  172. \setlength\labelwidth {\leftmargini}
  173. \addtolength\labelwidth{-\labelsep}
  174. \setlength{\parindent}{1pc}
  175. \setlength{\parskip}{0pt}
  176. %%
  177. % Set page layout geometry
  178. \RequirePackage[letterpaper,left=1in,top=1in,headsep=2\baselineskip,textwidth=26pc,marginparsep=2pc,marginparwidth=12pc,textheight=44\baselineskip,headheight=\baselineskip]{geometry}
  179. % FIXME adjust A4 geometry to match letter paper geometry (except for outside margins)
  180. \ifthenelse{\boolean{@tufte@afourpaper}}
  181. {\geometry{a4paper,includemp,width=170mm,marginparsep=10mm,marginparwidth=50mm,headheight=\baselineskip}}
  182. {}
  183. \ifthenelse{\boolean{@tufte@symmetric}}
  184. {}
  185. {\geometry{asymmetric}}% forces internal LaTeX `twoside'
  186. %%
  187. % Separation marginpars by a line's worth of space.
  188. \setlength\marginparpush{10pt}
  189. %%
  190. % Font for margin items
  191. \ifthenelse{\boolean{@tufte@sfsidenotes}}
  192. {\newcommand{\@tufte@marginfont}{\normalfont\footnotesize\sffamily}}
  193. {\newcommand{\@tufte@marginfont}{\normalfont\footnotesize}}
  194. %%
  195. % \RaggedRight allows hyphenation
  196. \RequirePackage{ragged2e}
  197. \setlength{\RaggedRightRightskip}{\z@ plus 0.08\hsize}
  198. %%
  199. % Set the justification baesed on the `justified' class option
  200. \newcommand{\@tufte@justification}{%
  201. \ifthenelse{\boolean{@tufte@justified}}
  202. {\justifying}
  203. {\RaggedRight}
  204. }
  205. %%
  206. % Turn off section numbering
  207. \setcounter{secnumdepth}{-1}
  208. %%
  209. % Tighten up space between displays (e.g., a figure or table) and make symmetric
  210. \setlength\abovedisplayskip{6pt plus 2pt minus 4pt}
  211. \setlength\belowdisplayskip{6pt plus 2pt minus 4pt}
  212. %%
  213. % To implement full-width display environments
  214. \newboolean{@tufte@changepage}
  215. \IfFileExists{changepage.sty}{%
  216. \RequirePackage[strict]{changepage}
  217. \setboolean{@tufte@changepage}{true}
  218. }{%
  219. \RequirePackage[strict]{chngpage}
  220. \setboolean{@tufte@changepage}{false}
  221. }
  222. % Compute length used for full-width displays
  223. \newlength{\@tufte@overhang}
  224. \setlength{\@tufte@overhang}{\marginparwidth}
  225. \addtolength{\@tufte@overhang}{\marginparsep}
  226. %%
  227. % Modified \title, \author, and \date commands. These store the
  228. % (footnote-less) values in \thetitle, \theauthor, and \thedate, respectively.
  229. \newcommand{\thetitle}{}% plain-text-only title
  230. \newcommand{\theauthor}{}% plain-text-only author
  231. \newcommand{\thepublisher}{}% plain-text-only publisher
  232. \newcommand{\thanklesstitle}{}% full title text minus \thanks{}
  233. \newcommand{\thanklessauthor}{}% full author text minus \thanks{}
  234. \newcommand{\thanklesspublisher}{}% full publisher minus \thanks{}
  235. \newcommand{\@publisher}{}% full publisher with \thanks{}
  236. \newcommand{\thedate}{\today}
  237. % TODO Fix it so that \thanks is not spaced out (with `soul') and can be
  238. % used in \maketitle when the `sfsidenotes' option is provided.
  239. \renewcommand{\thanks}[1]{\NoCaseChange{\footnote{#1}}}
  240. \renewcommand{\title}[2][]{%
  241. \gdef\@title{#2}%
  242. \begingroup%
  243. % TODO store contents of \thanks command
  244. \renewcommand{\thanks}[1]{}% swallow \thanks contents
  245. \protected@xdef\thanklesstitle{#2}%
  246. \endgroup%
  247. \ifthenelse{\isempty{#1}}%
  248. {\renewcommand{\thetitle}{\thanklesstitle}}% use thankless title
  249. {\renewcommand{\thetitle}{#1}}% use provided plain-text title
  250. \hypersetup{pdftitle={\thetitle}}% set the PDF metadata title
  251. }
  252. \def\@author{}% default author is empty (suppresses LaTeX's ``no author'' warning)
  253. \renewcommand*{\author}[2][]{%
  254. \gdef\@author{#2}%
  255. \begingroup%
  256. % TODO store contents of \thanks command
  257. \renewcommand{\thanks}[1]{}% swallow \thanks contents
  258. \protected@xdef\thanklessauthor{#2}%
  259. \endgroup%
  260. \ifthenelse{\isempty{#1}}
  261. {\renewcommand{\theauthor}{\thanklessauthor}}% use thankless author
  262. {\renewcommand{\theauthor}{#1}}% use provided plain-text author
  263. \hypersetup{pdfauthor={\theauthor}}% set the PDF metadata author
  264. }
  265. \renewcommand*{\date}[1]{%
  266. \gdef\@date{#1}%
  267. \begingroup%
  268. % TODO store contents of \thanks command
  269. \renewcommand{\thanks}[1]{}% swallow \thanks contents
  270. \protected@xdef\thedate{#1}%
  271. \endgroup%
  272. }
  273. %%
  274. % Provides a \publisher command to set the publisher
  275. \newcommand{\publisher}[2][]{%
  276. \gdef\@publisher{#2}%
  277. \begingroup%
  278. \renewcommand{\thanks}[1]{}% swallow \thanks contents
  279. \protected@xdef\thanklesspublisher{#2}%
  280. \endgroup%
  281. \ifthenelse{\isempty{#1}}
  282. {\renewcommand{\thepublisher}{\thanklesspublisher}}% use thankless publisher
  283. {\renewcommand{\thepublisher}{#1}}% use provided plain-text publisher
  284. }
  285. % TODO: Test \hypersetup{pdfauthor,pdftitle} with DVI and XeTeX
  286. %%
  287. % Require paralist package for tighter lists
  288. \RequirePackage{paralist}
  289. % Add rightmargin to compactenum
  290. \def\@compactenum@{%
  291. \expandafter\list\csname label\@enumctr\endcsname{%
  292. \usecounter{\@enumctr}%
  293. \rightmargin=2em% added this
  294. \parsep\plparsep
  295. \itemsep\plitemsep
  296. \topsep\pltopsep
  297. \partopsep\plpartopsep
  298. \def\makelabel##1{\hss\llap{##1}}}}
  299. %%
  300. % Improved letterspacing of small caps and all-caps text.
  301. %
  302. % First, try to use the `microtype' package, if it's available.
  303. % Failing that, try to use the `soul' package, if it's available.
  304. % Failing that, well, I give up.
  305. \RequirePackage{textcase} % provides \MakeTextUppercase and \MakeTextLowercase
  306. \def\allcapsspacing{\relax}
  307. \def\smallcapsspacing{\relax}
  308. \newcommand{\allcaps}[1]{\MakeTextUppercase{\allcapsspacing{#1}}}
  309. \newcommand{\smallcaps}[1]{\MakeTextLowercase{\textsc{#1}}}
  310. \newcommand{\@tufte@loadsoul}{%
  311. \IfFileExists{soul.sty}{%
  312. \RequirePackage{soul}
  313. \sodef\allcapsspacing{\upshape}{0.15em}{0.65em}{0.6em}
  314. \sodef\smallcapsspacing{\scshape}{0.075em}{0.5em}{0.6em}
  315. }{
  316. \PackageWarningNoLine{\@tufte@pkgname}{Couldn't locate `soul' package.}
  317. }% soul not installed... giving up.
  318. }
  319. % If we're using pdfLaTeX v1.40+, use the letterspace package.
  320. % If we're using pdfLaTex < v1.40, use the soul package.
  321. % If we're using XeLaTeX, use XeLaTeX letterspacing options.
  322. % Otherwise fall back on the soul package.
  323. \ifthenelse{\boolean{@tufte@pdf}}
  324. {\PackageInfo{\@tufte@pkgname}{ifpdf = true}}
  325. {\PackageInfo{\@tufte@pkgname}{ifpdf = false}}
  326. \ifthenelse{\boolean{@tufte@xetex}}
  327. {\PackageInfo{\@tufte@pkgname}{ifxetex = true}}
  328. {\PackageInfo{\@tufte@pkgname}{ifxetex = false}}
  329. % Check pdfLaTeX version
  330. \def\@tufte@pdftexversion{0}
  331. \ifx\normalpdftexversion\@undefined \else
  332. \let\pdftexversion \normalpdftexversion
  333. \let\pdftexrevision\normalpdftexrevision
  334. \let\pdfoutput \normalpdfoutput
  335. \fi
  336. \ifx\pdftexversion\@undefined \else
  337. \ifx\pdftexversion\relax \else
  338. \def\@tufte@pdftexversion{6}
  339. \ifnum\pdftexversion < 140
  340. \def\@tufte@pdftexversion{5}
  341. \fi
  342. \fi
  343. \fi
  344. \ifthenelse{\boolean{@tufte@letterspace}}
  345. {%
  346. \ifnum\@tufte@pdftexversion<6
  347. % pdfLaTeX version is too old or not using pdfLaTeX
  348. \ifthenelse{\boolean{@tufte@xetex}}
  349. {% TODO use xetex letterspacing
  350. \PackageInfo{\@tufte@pkgname}{XeTeX detected. Reverting to `soul' package for letterspacing.}
  351. \@tufte@loadsoul}
  352. {% use `soul' package for letterspacing
  353. \PackageInfo{\@tufte@pkgname}{Old version of pdfTeX detected. Reverting to `soul' package for letterspacing.}
  354. \@tufte@loadsoul}
  355. \else
  356. \IfFileExists{letterspace.sty}{%
  357. \PackageInfo{\@tufte@pkgname}{Modern version of pdfTeX detected. Using `letterspace' package.}
  358. \RequirePackage{letterspace}
  359. % Set up letterspacing (using microtype package) -- requires pdfTeX v1.40+
  360. \renewcommand{\allcapsspacing}[1]{\textls[200]{##1}}
  361. \renewcommand{\smallcapsspacing}[1]{\textls[50]{##1}}
  362. \renewcommand{\allcaps}[1]{\textls[200]{\MakeTextUppercase{##1}}}
  363. \renewcommand{\smallcaps}[1]{\textsc{\MakeTextLowercase{##1}}}
  364. }{% microtype failed, check for soul
  365. \PackageInfo{\@tufte@pkgname}{Modern version of pdfTeX detected, but `letterspace' package not installed. Reverting to `soul' package for letterspacing.}
  366. \@tufte@loadsoul
  367. }
  368. \fi}
  369. {}
  370. \DeclareTextFontCommand{\textsmallcaps}{\scshape}
  371. \renewcommand{\textsc}[1]{\textsmallcaps{\smallcapsspacing{#1}}}
  372. %%
  373. % An environment for paragraph-style section
  374. \providecommand\newthought[1]{%
  375. \addvspace{1.0\baselineskip plus 0.5ex minus 0.2ex}%
  376. \noindent\textsc{#1}%
  377. }
  378. %%
  379. % Redefine the display environments (quote, quotation, etc.)
  380. \renewenvironment{verse}
  381. {\let\\\@centercr
  382. \list{}{\itemsep \z@
  383. \itemindent -1pc%
  384. \listparindent\itemindent
  385. \rightmargin \leftmargin
  386. \advance\leftmargin 1pc}%
  387. \small%
  388. \item\relax}
  389. {\endlist}
  390. \renewenvironment{quotation}
  391. {\list{}{\listparindent 1pc%
  392. \itemindent \listparindent
  393. \rightmargin \leftmargin
  394. \parsep \z@ \@plus\p@}%
  395. \small%
  396. \item\relax\noindent\ignorespaces}
  397. {\endlist}
  398. \renewenvironment{quote}
  399. {\list{}{\rightmargin\leftmargin}%
  400. \small%
  401. \item\relax}
  402. {\endlist}
  403. %%
  404. % Used for doublespacing, and other linespacing
  405. \RequirePackage{setspace}
  406. %%
  407. % Load the bidi package if instructed to do so. This package must be loaded
  408. % prior to our redefining the \footnote and \cite commands.
  409. \ifthenelse{\boolean{@tufte@loadbidi}}{\RequirePackage{bidi}}{}
  410. %%
  411. % Citations should go in the margin as sidenotes
  412. \RequirePackage[numbers]{natbib}
  413. \RequirePackage{bibentry} % allows bibitems to be typeset outside thebibliography environment
  414. % Redefine the \BR@b@bibitem command to fix a bug with bibentry+chicago style
  415. \renewcommand\BR@b@bibitem[2][]{%
  416. \ifthenelse{\isempty{#1}}%
  417. {\BR@bibitem{#2}}%
  418. {\BR@bibitem[#1]{#2}}%
  419. \BR@c@bibitem{#2}%
  420. }
  421. \nobibliography* % pre-loads the bibliography keys
  422. \providecommand{\doi}[1]{\textsc{doi:} #1} % pre-defining this so it may be used before the \bibliography command it issued
  423. %%
  424. % Normal \cite behavior
  425. \newcounter{@tufte@num@bibkeys}%
  426. \newcommand{\@tufte@normal@cite}[2][0pt]{%
  427. % Snag the last bibentry in the list for later comparison
  428. \let\@temp@last@bibkey\@empty%
  429. \@for\@temp@bibkey:=#2\do{\let\@temp@last@bibkey\@temp@bibkey}%
  430. \sidenote[][#1]{%
  431. % Loop through all the bibentries, separating them with semicolons and spaces
  432. \setcounter{@tufte@num@bibkeys}{0}%
  433. \@for\@temp@bibkeyx:=#2\do{%
  434. \ifthenelse{\equal{\@temp@last@bibkey}{\@temp@bibkeyx}}%
  435. {\ifthenelse{\equal{\value{@tufte@num@bibkeys}}{0}}{}{and\ }%
  436. \bibentry{\@temp@bibkeyx}}%
  437. {\bibentry{\@temp@bibkeyx};\ }%
  438. \stepcounter{@tufte@num@bibkeys}%
  439. }%
  440. }%
  441. }
  442. %%
  443. % Macros for holding the list of cite keys until after the \sidenote
  444. \gdef\@tufte@citations{}% list of cite keys
  445. \newcommand\@tufte@add@citation[1]{\relax% adds a new bibkey to the list of cite keys
  446. \ifx\@tufte@citations\@empty\else
  447. \g@addto@macro\@tufte@citations{,}% separate by commas
  448. \fi
  449. \g@addto@macro\@tufte@citations{#1}
  450. }
  451. \newcommand{\@tufte@print@citations}[1][0pt]{% puts the citations in a margin note
  452. % Snag the last bibentry in the list for later comparison
  453. \let\@temp@last@bibkey\@empty%
  454. \@for\@temp@bibkey:=\@tufte@citations\do{\let\@temp@last@bibkey\@temp@bibkey}%
  455. \marginpar{%
  456. \vspace*{#1}%
  457. \@tufte@marginfont%
  458. \@tufte@justification%
  459. % Loop through all the bibentries, separating them with semicolons and spaces
  460. \setcounter{@tufte@num@bibkeys}{0}%
  461. \@for\@temp@bibkeyx:=\@tufte@citations\do{%
  462. \ifthenelse{\equal{\@temp@last@bibkey}{\@temp@bibkeyx}}%
  463. {\ifthenelse{\equal{\value{@tufte@num@bibkeys}}{0}}{}{and\ }%
  464. \bibentry{\@temp@bibkeyx}}%
  465. {\bibentry{\@temp@bibkeyx};\ }%
  466. \stepcounter{@tufte@num@bibkeys}%
  467. }%
  468. }%
  469. }
  470. %%
  471. % \cite behavior when executed within a sidenote
  472. \newcommand{\@tufte@sidenote@citations}{}% contains list of \cites in sidenote
  473. \newcommand{\@tufte@infootnote@cite}[1]{%
  474. \@tufte@add@citation{#1}
  475. }
  476. %%
  477. % Set the default \cite style. This is set and reset by the \sidenote command.
  478. \let\cite\@tufte@normal@cite
  479. %%
  480. % Transform existing \footnotes into \sidenotes
  481. % Sidenote: ``Where God meant footnotes to go.'' ---Tufte
  482. \RequirePackage{optparams}% for our new sidenote commands -- provides multiple optional arguments for commands
  483. \providecommand*{\footnotelayout}{\@tufte@marginfont\@tufte@justification}
  484. \renewcommand{\footnotelayout}{\@tufte@marginfont\@tufte@justification}
  485. % Override footmisc's definition to set the sidenote marks (numbers) inside the
  486. % sidenote's text block.
  487. \long\def\@makefntext#1{\@textsuperscript{\@tufte@marginfont\tiny\@thefnmark}\,\footnotelayout#1}
  488. % Set the in-text footnote mark in the same typeface as the body text itself.
  489. \def\@makefnmark{\hbox{\@textsuperscript{\normalfont\footnotesize\@thefnmark}}}
  490. \providecommand*{\multiplefootnotemarker}{3sp}
  491. \providecommand*{\multfootsep}{,}
  492. \renewcommand*\@footnotemark{%
  493. \leavevmode%
  494. \ifhmode%
  495. \edef\@x@sf{\the\spacefactor}%
  496. \@tufte@check@multiple@sidenotes%
  497. \nobreak%
  498. \fi%
  499. \@makefnmark%
  500. \ifhmode\spacefactor\@x@sf\fi%
  501. \relax%
  502. }
  503. \newcommand{\@tufte@check@multiple@sidenotes}{%
  504. \ifdim\lastkern=\multiplefootnotemarker\relax
  505. \edef\@x@sf{\the\spacefactor}%
  506. \unkern
  507. \textsuperscript{\multfootsep}%
  508. \spacefactor\@x@sf\relax
  509. \fi
  510. }
  511. \renewcommand\@footnotetext[2][0pt]{%
  512. \marginpar{%
  513. \vspace*{#1}%
  514. \def\baselinestretch {\setspace@singlespace}%
  515. \ifthenelse{\boolean{@tufte@loadbidi}}{\if@rl@footnote\@rltrue\else\@rlfalse\fi}{}%
  516. \reset@font\footnotesize%
  517. \protected@edef\@currentlabel{%
  518. \csname p@footnote\endcsname\@thefnmark%
  519. }%
  520. \color@begingroup%
  521. \@makefntext{%
  522. \ignorespaces#2%
  523. }%
  524. \color@endgroup%
  525. }%
  526. }%
  527. %
  528. % Define \sidenote command. Can handle \cite.
  529. \newcommand{\@tufte@sidenote@vertical@offset}{0pt}
  530. % #1 = footnote num, #2 = vertical offset, #3 = footnote text
  531. \long\def\@tufte@sidenote[#1][#2]#3{%
  532. \let\cite\@tufte@infootnote@cite% use the in-sidenote \cite command
  533. \gdef\@tufte@citations{}% clear out any old citations
  534. \ifthenelse{\NOT\isempty{#2}}{\renewcommand{\@tufte@sidenote@vertical@offset}{#2}}{}%
  535. \ifthenelse{\isempty{#1}}{%
  536. % % no footnote number
  537. \stepcounter\@mpfn%
  538. \protected@xdef\@thefnmark{\thempfn}%
  539. \@footnotemark\@footnotetext[\@tufte@sidenote@vertical@offset]{#3}%
  540. }{%
  541. % % footnote number
  542. \begingroup%
  543. \csname c@\@mpfn\endcsname #1\relax%
  544. \unrestored@protected@xdef\@thefnmark{\thempfn}%
  545. \endgroup%
  546. \@footnotemark\@footnotetext[\@tufte@sidenote@vertical@offset]{#3}%
  547. }%
  548. \@tufte@print@citations% print any citations
  549. \let\cite\@tufte@normal@cite% go back to using normal in-text \cite command
  550. \unskip\ignorespaces% remove extra white space
  551. \kern-\multiplefootnotemarker% remove \kern left behind by sidenote
  552. \kern\multiplefootnotemarker\relax% add new \kern here to replace the one we yanked
  553. }
  554. \newcommand*{\sidenote}{\optparams{\@tufte@sidenote}{[][0pt]}}
  555. \renewcommand*{\footnote}{\optparams{\@tufte@sidenote}{[][0pt]}}
  556. %%
  557. % Sidenote without the footnote mark
  558. \newcommand\marginnote[2][0pt]{%
  559. \let\cite\@tufte@infootnote@cite% use the in-sidenote \cite command
  560. \gdef\@tufte@citations{}% clear out any old citations
  561. \marginpar{\vspace*{#1}\@tufte@marginfont\@tufte@justification #2}%
  562. \@tufte@print@citations% print any citations
  563. \let\cite\@tufte@normal@cite% go back to using normal in-text \cite command
  564. }
  565. %%
  566. % The placeins package provides the \FloatBarrier command. This forces
  567. % LaTeX to place all of the floats before proceeding. We'll use this to
  568. % keep the float (figure and table) numbers in sequence.
  569. \RequirePackage{placeins}
  570. %%
  571. % Margin figure environment
  572. \newsavebox{\@tufte@marginfigbox}
  573. \newenvironment{marginfigure}[1][-1.2ex]
  574. {\FloatBarrier% process all floats before this point so the figure numbers stay in order.
  575. \begin{lrbox}{\@tufte@marginfigbox}%
  576. \begin{minipage}{\marginparwidth}%
  577. \captionsetup{type=figure}%
  578. \@tufte@marginfont%
  579. \def\@captype{figure}%
  580. \vspace*{#1}%
  581. \@tufte@justification%
  582. }
  583. {\end{minipage}%
  584. \end{lrbox}%
  585. \marginpar{\usebox{\@tufte@marginfigbox}}}
  586. %%
  587. % Margin table environment
  588. \newsavebox{\@tufte@margintablebox}
  589. \newenvironment{margintable}[1][-1.2ex]
  590. {\FloatBarrier% process all floats before this point so the figure numbers stay in order.
  591. \begin{lrbox}{\@tufte@margintablebox}%
  592. \begin{minipage}{\marginparwidth}%
  593. \captionsetup{type=table}%
  594. \@tufte@marginfont%
  595. \def\@captype{table}%
  596. \vspace*{#1}%
  597. \@tufte@justification%
  598. }
  599. {\end{minipage}%
  600. \end{lrbox}%
  601. \marginpar{\usebox{\@tufte@margintablebox}}}
  602. %%
  603. % Full-width figure
  604. \renewenvironment{figure*}[1]%
  605. [htbp]%
  606. {\@float{figure}[#1]%
  607. \ifthenelse{\boolean{@tufte@symmetric}}
  608. {\ifthenelse{\boolean{@tufte@changepage}}{\begin{adjustwidth*}{}{-\@tufte@overhang}}{\begin{adjustwidth}[]{}{-\@tufte@overhang}}}
  609. {\begin{adjustwidth}{}{-\@tufte@overhang}}
  610. \begin{minipage}{\linewidth}%
  611. }%
  612. {\end{minipage}%
  613. \end{adjustwidth}%
  614. \end@float}
  615. %%
  616. % Full-width table
  617. \renewenvironment{table*}[1]
  618. [htbp]%
  619. {\@float{table}[#1]%
  620. \ifthenelse{\boolean{@tufte@symmetric}}
  621. {\ifthenelse{\boolean{@tufte@changepage}}{\begin{adjustwidth*}{}{-\@tufte@overhang}}{\begin{adjustwidth}[]{}{-\@tufte@overhang}}}
  622. {\begin{adjustwidth}{}{-\@tufte@overhang}}
  623. \begin{minipage}{\linewidth}%
  624. }%
  625. {\end{minipage}%
  626. \end{adjustwidth}%
  627. \end@float}
  628. %%
  629. % Full-page-width area
  630. \newenvironment{fullwidth}
  631. {\ifthenelse{\boolean{@tufte@symmetric}}
  632. {\ifthenelse{\boolean{@tufte@changepage}}{\begin{adjustwidth*}{}{-\@tufte@overhang}}{\begin{adjustwidth}[]{}{-\@tufte@overhang}}}
  633. {\begin{adjustwidth}{}{-\@tufte@overhang}}%
  634. }
  635. {\end{adjustwidth}}
  636. %%
  637. % Format the captions in a style similar to the sidenotes
  638. \RequirePackage[format=default,font={rm,footnotesize},justification=raggedright,singlelinecheck=false]{caption}
  639. % if the `sfsidenotes' option is specified, set the captions in sf, too.
  640. \ifthenelse{\boolean{@tufte@sfsidenotes}}
  641. {\captionsetup{font={sf,footnotesize}}}
  642. {\captionsetup{font={rm,footnotesize}}}
  643. % if the `justified' option is specified, set the captions in flush left
  644. % and flush right
  645. \ifthenelse{\boolean{@tufte@justified}}
  646. {\captionsetup{justification=justified}}
  647. {\captionsetup{justification=raggedright}}
  648. %%
  649. % If we're NOT using XeLaTeX and the `nofonts' class option was NOT provided,
  650. % we should load the Palatino, Helvetica, and Bera Mono fonts (if they are
  651. % installed.)
  652. \ifthenelse{\boolean{@tufte@loadfonts}\AND\NOT\boolean{@tufte@xetex}}{%
  653. \IfFileExists{mathpazo.sty}{\RequirePackage[osf,sc]{mathpazo}}{}
  654. \IfFileExists{helvet.sty}{\RequirePackage[scaled=0.90]{helvet}}{}
  655. \IfFileExists{beramono.sty}{\RequirePackage[scaled=0.85]{beramono}}{}
  656. \RequirePackage[T1]{fontenc}
  657. \RequirePackage{textcomp}
  658. }{}
  659. %%
  660. % Turns newlines into spaces. Based on code from the `titlesec' package.
  661. \DeclareRobustCommand{\@tufte@newlinetospace}{%
  662. \@ifstar{\@tufte@newlinetospace@i}{\@tufte@newlinetospace@i}%
  663. }
  664. \def\@tufte@newlinetospace@i{%
  665. \ifdim\lastskip>\z@\else\space\fi
  666. \ignorespaces%
  667. }
  668. \DeclareRobustCommand{\newlinetospace}[1]{%
  669. \let\@tufte@orig@cr\\% save the original meaning of \\
  670. \def\\{\@tufte@newlinetospace}% turn \\ and \\* into \space
  671. \let\newline\\% turn \newline into \space
  672. #1%
  673. \let\\\@tufte@orig@cr% revert to original meaning of \\
  674. }
  675. %%
  676. % Sets up the running heads and folios.
  677. \RequirePackage{fancyhdr}
  678. % Set the default page style to 'fancy'
  679. \pagestyle{fancy}
  680. % Set the header/footer width to be the body text block plus the margin
  681. % note area.
  682. \ifthenelse{\boolean{@tufte@symmetric}}
  683. {\fancyhfoffset[LE,RO]{\@tufte@overhang}}
  684. {\fancyhfoffset[RE,RO]{\@tufte@overhang}}
  685. % The running heads/feet don't have rules
  686. \renewcommand{\headrulewidth}{0pt}
  687. \renewcommand{\footrulewidth}{0pt}
  688. % The 'fancy' page style is the default style for all pages.
  689. \fancyhf{} % clear header and footer fields
  690. \ifthenelse{\boolean{@tufte@twoside}}
  691. {\fancyhead[LE]{\thepage\quad\smallcaps{\newlinetospace{\theauthor}}}%
  692. \fancyhead[RO]{\smallcaps{\newlinetospace{\thetitle}}\quad\thepage}}
  693. {\fancyhead[RE,RO]{\smallcaps{\newlinetospace{\thetitle}}\quad\thepage}}
  694. % The `plain' page style is used on chapter opening pages.
  695. % In Tufte's /Beautiful Evidence/ he never puts page numbers at the
  696. % bottom of pages -- the folios are unexpressed.
  697. \fancypagestyle{plain}{
  698. \fancyhf{} % clear header and footer fields
  699. % Uncomment the following five lines of code if you want the opening page
  700. % of the chapter to express the folio in the lower outside corner.
  701. %\ifthenelse{\boolean{@tufte@twoside}}
  702. % {\fancyfoot[LE,RO]{\thepage}}
  703. % {\fancyfoot[RE,RO]{\thepage}}
  704. }
  705. % The `empty' page style suppresses all headers and footers.
  706. % It's used on title pages and `intentionally blank' pages.
  707. \fancypagestyle{empty}{
  708. \fancyhf{} % clear header and footer fields
  709. }
  710. %%
  711. % Set raggedright and paragraph indentation for document
  712. \AtBeginDocument{\@tufte@justification}
  713. %%
  714. % Prints the list of class options and their states.
  715. \newcommand{\typeoutbool}[2]{%
  716. \ifthenelse{\boolean{#2}}
  717. {\typeout{\space\space#1: true}}
  718. {\typeout{\space\space#1: false}}
  719. }
  720. \newcommand{\typeoutstr}[2]{%
  721. \typeout{\space\space#1: #2}
  722. }
  723. \newcommand{\PrintTufteSettings}{%
  724. \typeout{-------------------- Tufte-LaTeX settings ----------}
  725. \typeout{Class: \@tufte@pkgname}
  726. \typeout{}
  727. \typeout{Class options:}
  728. \typeoutbool{a4paper}{@tufte@afourpaper}
  729. \typeoutbool{load fonts}{@tufte@loadfonts}
  730. \typeoutbool{fully-justified}{@tufte@justified}
  731. \typeoutbool{letterspacing}{@tufte@letterspace}
  732. \typeoutbool{sans-serif sidenotes}{@tufte@sfsidenotes}
  733. \typeoutbool{symmetric margins}{@tufte@symmetric}
  734. \typeoutbool{titlepage}{@tufte@titlepage}
  735. \typeoutbool{twoside}{@tufte@twoside}
  736. \typeoutbool{debug}{@tufte@debug}
  737. \typeout{}
  738. \typeout{Internal variables:}
  739. \typeoutbool{[twoside]}{@twoside}
  740. \typeoutbool{pdflatex}{@tufte@pdf}
  741. \typeoutbool{xelatex}{@tufte@xetex}
  742. \typeout{----------------------------------------------------}
  743. }
  744. %%
  745. % Color
  746. \RequirePackage{xcolor}
  747. %%
  748. % Produces a full title page
  749. \newcommand{\maketitlepage}[0]{%
  750. \cleardoublepage%
  751. {%
  752. \sffamily%
  753. \begin{fullwidth}%
  754. \fontsize{18}{20}\selectfont\par\noindent\textcolor{darkgray}{\allcaps{\thanklessauthor}}%
  755. \vspace{11.5pc}%
  756. \fontsize{36}{40}\selectfont\par\noindent\textcolor{darkgray}{\allcaps{\thanklesstitle}}%
  757. \vfill%
  758. \fontsize{14}{16}\selectfont\par\noindent\allcaps{\thanklesspublisher}%
  759. \end{fullwidth}%
  760. }
  761. \thispagestyle{empty}%
  762. \clearpage%
  763. }
  764. %%
  765. % Title block
  766. \renewcommand{\maketitle}{%
  767. \newpage
  768. \global\@topnum\z@% prevent floats from being placed at the top of the page
  769. \begingroup
  770. \setlength{\parindent}{0pt}
  771. \setlength{\parskip}{4pt}
  772. \ifthenelse{\boolean{@tufte@sfsidenotes}}
  773. {\begingroup
  774. % FIXME fails with \thanks
  775. \sffamily
  776. \par{\Large\allcaps{\@title}}
  777. \ifthenelse{\equal{\@author}{}}{}{\par{\large\allcaps{\@author}}}
  778. \ifthenelse{\equal{\@date}{}}{}{\par{\large\allcaps{\@date}}}
  779. \endgroup}
  780. {\begingroup
  781. \par{\Large\textit{\@title}}
  782. \ifthenelse{\equal{\@author}{}}{}{\par{\large\textit{\@author}}}
  783. \ifthenelse{\equal{\@date}{}}{}{\par{\large\textit{\@date}}}
  784. \endgroup}
  785. \par
  786. \endgroup
  787. \setlength{\parindent}{1pc}
  788. \setlength{\parskip}{0pt}
  789. \thispagestyle{plain}% suppress the running head
  790. }
  791. %%
  792. % Title page (if the `titlepage' option was passed to the tufte-handout
  793. % class.)
  794. \ifthenelse{\boolean{@tufte@titlepage}}
  795. {\renewcommand{\maketitle}{\maketitlepage}}
  796. {}
  797. %%
  798. % When \cleardoublepage is called, produce a blank (empty) page -- i.e.,
  799. % without headers and footers
  800. \def\cleardoublepage{\clearpage\if@twoside\ifodd\c@page\else
  801. \hbox{}
  802. %\vspace*{\fill}
  803. %\begin{center}
  804. % This page intentionally contains only this sentence.
  805. %\end{center}
  806. %\vspace{\fill}
  807. \thispagestyle{empty}
  808. \newpage
  809. \if@twocolumn\hbox{}\newpage\fi\fi\fi}
  810. %%
  811. % Make Tuftian-style section headings and TOC formatting
  812. \RequirePackage{titlesec,titletoc}
  813. % TODO: I'd prefer to use the 'titlesec' package for this formatting, but
  814. % I'll do it old-style for now. --Kevin
  815. \renewcommand\section{\@startsection {section}{1}{\z@}%
  816. {-3.5ex \@plus -1ex \@minus -.2ex}%
  817. {2.3ex \@plus.2ex}%
  818. {\normalfont\large\it}}
  819. \renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
  820. {-3.25ex\@plus -1ex \@minus -.2ex}%
  821. {1.5ex \@plus .2ex}%
  822. {\normalfont\normalsize\it}}
  823. % Subsubsection and following section headings shouldn't be used.
  824. % See Bringhurst's _The Elements of Typography_, section 4.2.2.
  825. \renewcommand\subsubsection{%
  826. \PackageError{\@tufte@pkgname}{\noexpand\subsubsection is undefined by this class.%
  827. \MessageBreak See Robert Bringhurst's _The Elements of
  828. \MessageBreak Typographic Style_, section 4.2.2.
  829. \MessageBreak \noexpand\subsubsection was used}
  830. {From Bringhurst's _The Elements of Typographic Style_, section 4.2.2: Use as
  831. \MessageBreak many levels of headings as you need, no more and no fewer. Also see the many
  832. \MessageBreak related threads on Ask E.T. at http://www.edwardtufte.com/.}
  833. }
  834. \renewcommand\paragraph{%
  835. \PackageError{\@tufte@pkgname}{\noexpand\paragraph is undefined by this class.%
  836. \MessageBreak See Robert Bringhurst's _The Elements of
  837. \MessageBreak Typographic Style_, section 4.2.2.
  838. \MessageBreak \noexpand\paragraph was used}
  839. {From Bringhurst's _The Elements of Typographic Style_, section 4.2.2: Use as
  840. \MessageBreak many levels of headings as you need, no more and no fewer. Also see the many
  841. \MessageBreak related threads on Ask E.T. at http://www.edwardtufte.com/.}
  842. }
  843. \renewcommand\subparagraph{%
  844. \PackageError{\@tufte@pkgname}{\noexpand\subparagraph is undefined by this class.%
  845. \MessageBreak See Robert Bringhurst's _The Elements of
  846. \MessageBreak Typographic Style_, section 4.2.2.
  847. \MessageBreak \noexpand\subparagraph was used}
  848. {From Bringhurst's _The Elements of Typographic Style_, section 4.2.2: Use as
  849. \MessageBreak many levels of headings as you need, no more and no fewer. Also see the many
  850. \MessageBreak related threads on Ask E.T. at http://www.edwardtufte.com/.}
  851. }
  852. % Formatting for main TOC (printed in front matter)
  853. % {section} [left] {above} {before w/label} {before w/o label} {filler + page} [after]
  854. \ifthenelse{\boolean{@tufte@toc}}
  855. {\titlecontents{chapter}%
  856. [0em] % distance from left margin
  857. {\begin{fullwidth}\fontsize{13pt}{18pt}\selectfont} % above (global formatting of entry)
  858. {\contentslabel{2em}\rm\itshape} % before w/label (label = ``Chapter 1'')
  859. {\rm\itshape} % before w/o label
  860. {\rm\qquad\thecontentspage} % filler + page (leaders and page num)
  861. [\vspace{1.5\baselineskip}\end{fullwidth}] % after
  862. }
  863. {}
  864. %\titlecontents{chapter}%
  865. % [0em]% distance from left margin
  866. % {\fontsize{12pt}{18pt}\selectfont}% above (global formatting of entry)
  867. % {\textit}% before w/ label (label = ``Chapter 1'')
  868. % {\textit}% before w/o label
  869. % {\qquad\thecontentspage}% filler and page (leaders and page num)
  870. % [\vspace{1.5\baselineskip}]% after
  871. \titleformat{\chapter}%
  872. [display]% shape
  873. {\relax\ifthenelse{\NOT\boolean{@tufte@symmetric}}{\begin{fullwidth}}{}}% format applied to label+text
  874. {\itshape\fontsize{22}{24}\selectfont\thechapter}% label
  875. {0pt}% horizontal separation between label and title body
  876. {\fontsize{22}{24}\rm\itshape}% before the title body
  877. [\ifthenelse{\NOT\boolean{@tufte@symmetric}}{\end{fullwidth}}{}]% after the title body
  878. %%
  879. % A handy command to disable hyphenation for short bits of text.
  880. % Borrowed from Peter Wilson's `hyphenat' package.
  881. \newlanguage\langwohyphens% define a language without hyphenation rules
  882. \newcommand{\nohyphens}[1]{{\language\langwohyphens #1}}% used for short bits of text
  883. \newcommand{\nohyphenation}{\language\langwohyphens}% can be used inside environments for longer text
  884. %%
  885. % If debugging is enabled, print the Tufte-LaTeX options and the list of
  886. % files.
  887. \ifthenelse{\boolean{@tufte@debug}}
  888. {\PrintTufteSettings\listfiles}
  889. {}
  890. %%
  891. % If there is a `tufte-common-local.tex' file, load it up.
  892. \IfFileExists{tufte-common-local.tex}
  893. {\input{tufte-common-local}}
  894. {}
  895. %%
  896. % End of file
  897. \endinput