diff --git a/sample-handout.pdf b/sample-handout.pdf index 98d6ee5..039453b 100644 Binary files a/sample-handout.pdf and b/sample-handout.pdf differ diff --git a/sample-handout.tex b/sample-handout.tex index aab208d..2405427 100644 --- a/sample-handout.tex +++ b/sample-handout.tex @@ -1,4 +1,4 @@ -\documentclass[twoside]{tufte-handout} +\documentclass{tufte-handout} \usepackage{amsmath} @@ -48,6 +48,8 @@ It also provides examples and comments on the style's use. \end{abstract} +%\printclassoptions + The \Verb|tufte-handout| document class defines a style similar to the style Edward Tufte uses in his books and handouts. Tufte's style is known for its extensive use of sidenotes, tight integration of graphics with @@ -247,18 +249,11 @@ the page. This is how books are traditionally printed, but is contrary to Tufte's book design which sets the sidenotes on the right side of the page. This option implicitly sets the \Verb|twoside| option. -\subsection{Text Justification}\label{sec:justification} +The \Verb|justified| option sets all the text fully justified (flush left +and right). The default is to set the text ragged right. The body text of Tufte's books are set ragged right. This prevents needless hyphenation and makes it easier to read the text in the slightly -narrower column. If you prefer your text fully justified, put these lines -in the preamble of your document (i.e., prior to your -\Verb|\begin{document}| line): - -\begin{Verbatim} - \makeatletter - \def\@tufteh@raggedright{\relax} - \makeatother -\end{Verbatim} +narrower column. \subsection{Defining new sections}\label{sec:defining-sections} As mentioned on page~\pageref{sec:headings}, the \Verb|tufte-handout| diff --git a/tufte-handout.cls b/tufte-handout.cls index 9b3c8e7..7cc3811 100644 --- a/tufte-handout.cls +++ b/tufte-handout.cls @@ -21,10 +21,17 @@ \newif\if@tufteh@symmetric\@tufteh@symmetricfalse \DeclareOption{symmetric}{ \@tufteh@symmetrictrue -% \PassOptionsToClass{twoside}{tufte-handout} \PassOptionsToClass{twoside}{article} } +%% +% justified option -- uses fully justified text (flush left and flush +% right) instead of ragged right. + +\newif\if@tufteh@justified\@tufteh@justifiedfalse +\DeclareOption{justified}{\@tufteh@justifiedtrue} + + % FIXME: should probably specify options not supported like Mittelbach's aipproc.cls \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} @@ -68,12 +75,21 @@ \fi %% -% Modify \raggedright from latex.ltx to allow hyphenation per Donald Arseneau +% \RaggedRight allows hyphenation + +\RequirePackage{ragged2e} +\setlength{\RaggedRightRightskip}{\z@ plus 0.08\hsize} + +%% +% Set the justification baesed on the `justified' class option -\def\@tufteh@raggedright{% - \let\\\@centercr\@rightskip\z@ plus 0.08\hsize - \rightskip\@rightskip - \leftskip\z@skip} +\newcommand{\@tufteh@justification}{% + \if@tufteh@justified + \justifying + \else + \RaggedRight + \fi +} %% % Turn off section numbering @@ -200,7 +216,7 @@ % Sidenote: ``Where God meant footnotes to go.'' ---Tufte \RequirePackage[side,multiple]{footmisc} -\newcommand{\footnotelayout}{\@tufteh@marginfont\@tufteh@raggedright} +\newcommand{\footnotelayout}{\@tufteh@marginfont\@tufteh@justification} % Override footmisc's definition to set the sidenote marks (numbers) inside the % sidenote's text block. @@ -215,7 +231,7 @@ % Sidenote without the footnote mark \providecommand\marginnote[1]% - {\marginpar{\@tufteh@marginfont\raggedright #1}} + {\marginpar{\@tufteh@marginfont\@tufteh@justification #1}} %% % Citations should go in the margin as well @@ -297,7 +313,7 @@ \@tufteh@marginfont \def\@captype{figure} \vspace*{#1} - \@tufteh@raggedright + \@tufteh@justification } {\end{minipage}% \end{lrbox}% @@ -315,7 +331,7 @@ \@tufteh@marginfont \def\@captype{table} \vspace*{#1} - \@tufteh@raggedright + \@tufteh@justification } {\end{minipage}% \end{lrbox}% @@ -369,11 +385,21 @@ %% % Format the captions in a style similar to the sidenotes -% if 'sfsidenotes' option is specified, set the captions in sf, too. +\RequirePackage[format=default,font={rm,scriptsize},justification=raggedright,singlelinecheck=false]{caption} + +% if the `sfsidenotes' option is specified, set the captions in sf, too. \if@tufteh@sfsidenotes - \RequirePackage[format=default,font={sf,scriptsize},justification=raggedright,singlelinecheck=false]{caption} + \captionsetup{font={sf,scriptsize}} +\else + \captionsetup{font={rm,scriptsize}} +\fi + +% if the `justified' option is specified, set the captions in flush left +% and flush right +\if@tufteh@justified + \captionsetup{justification=justified} \else - \RequirePackage[format=default,font={rm,scriptsize},justification=raggedright,singlelinecheck=false]{caption} + \captionsetup{justification=raggedright} \fi %% @@ -441,7 +467,7 @@ %% % Set raggedright and paragraph indentation for document -\AtBeginDocument{\@tufteh@raggedright\setlength\parindent{1em}} +\AtBeginDocument{\@tufteh@justification\setlength\parindent{1em}} %% @@ -450,7 +476,8 @@ \texttt{symmetric}---\if@tufteh@symmetric true\else false\fi\\ \texttt{a4paper}---\if@tufteh@afourpaper true\else false\fi\\ \texttt{twoside}---\if@tufteh@twoside true\else false\fi\\ - \texttt{sfsidenotes}---\if@tufteh@sfsidenotes true\else false\fi + \texttt{sfsidenotes}---\if@tufteh@sfsidenotes true\else false\fi\\ + \texttt{justified}---\if@tufteh@justified true\else false\fi } \endinput