diff --git a/README.txt b/README.txt index 06afff5..4750c86 100644 --- a/README.txt +++ b/README.txt @@ -1,7 +1,7 @@ Hi, Welcome to the beginnings of Tufte LaTeX package to help you -produce Tufte style handouts, reports, and notes. +produce Tufte-style handouts, reports, and notes. == Quick Start @@ -33,7 +33,6 @@ or search the news:comp.text.tex group via, The following packages are required: - * caption * chngpage or changepage * fancyhdr * fontenc @@ -46,6 +45,7 @@ The following packages are required: * ragged2e * setspace * textcase + * textcomp * titlesec * titletoc * xcolor diff --git a/sample-book.pdf b/sample-book.pdf index bb603af..c426f4e 100644 Binary files a/sample-book.pdf and b/sample-book.pdf differ diff --git a/sample-book.tex b/sample-book.tex index 691dab3..8eb1851 100644 --- a/sample-book.tex +++ b/sample-book.tex @@ -1,8 +1,5 @@ \documentclass{tufte-book} -%\usepackage{trace} -%\traceon - %% % Book metadata \title{A Tufte-Style Book\thanks{Thanks to Edward R.~Tufte for his inspiration.}} @@ -404,19 +401,19 @@ The following characteristics define the various environments: \chapter{On the Use of the \texttt{tufte-book} Document Class} \label{ch:tufte-book} + The \texttt{tufte-book} document class is modeled primarily on \BE, since it's the most recent of Tufte's books and the design is (presumably) more refined. -This choice of book design has a few important implications: -\begin{inparaenum} -\item there are no parts---the highest heading level is the chapter; -\item the use of a sans serif font for many design elements (especially the -title page and epigraphs); and -\item \emph{something else---yyy}. -\end{inparaenum} +%This choice of book design has a few important implications: +%\begin{inparaenum} +%\item there are no parts---the highest heading level is the chapter; +%\item the use of a sans serif font for many design elements (especially the +%title page and epigraphs); and +%\item \emph{something else---yyy}. +%\end{inparaenum} -%\lipsum[1-25] %% diff --git a/sample-handout.pdf b/sample-handout.pdf index 3549288..ea627d9 100644 Binary files a/sample-handout.pdf and b/sample-handout.pdf differ diff --git a/sample-handout.tex b/sample-handout.tex index a0d48fa..3d8309f 100644 --- a/sample-handout.tex +++ b/sample-handout.tex @@ -73,7 +73,7 @@ Typographic Style},\cite{Bringhurst2005} you should ``use as many levels of headings as you need: no more, and no fewer.'' The Tufte-\LaTeX\ classes will emit an error if you try to use -\Verb|\subsubsection| and smaller headings. +\linebreak\Verb|\subsubsection| and smaller headings. %\medskip %\begin{fullwidth} @@ -173,6 +173,7 @@ Full page--width figures and tables may be placed in \docenv{figure*} or \docenv{table*} environments. To place figures or tables in the margin, use the \docenv{marginfigure} or \docenv{margintable} environments as follows (see figure~\ref{fig:marginfig}): + \begin{marginfigure}% \includegraphics[width=\linewidth]{helix} \caption{This is a margin figure. The helix is defined by @@ -198,20 +199,20 @@ The \docenv{marginfigure} and \docenv{margintable} environments accept an option \doccmd{end\{margintable\}}\\ \end{docspec} - Figure~\ref{fig:fullfig} is an example of the \Verb|figure*| environment and figure~\ref{fig:textfig} is an example of the normal \Verb|figure| environment. -\begin{figure*} - \includegraphics[width=\linewidth]{sine.pdf} + +\begin{figure*}[h] + \includegraphics[width=\linewidth]{sine.pdf}% \caption{This graph shows $y = \sin x$ from about $x = [-10, 10]$. - \emph{Notice that this figure takes up the full page width.}} - \label{fig:fullfig} - %\zsavepos{pos:fullfig} + \emph{Notice that this figure takes up the full page width.}}% + \label{fig:fullfig}% \end{figure*} \begin{figure} \includegraphics{hilbertcurves.pdf} +% \checkparity This is an \pageparity\ page.% \caption{Hilbert curves of various degrees $n$. \emph{Notice that this figure only takes up the main textblock width.}} \label{fig:textfig} @@ -356,13 +357,13 @@ classes rely upon. Packages marked with an asterisk are optional. \item natbib \emph{and} bibentry \item optparams \item placeins - \item caption \item mathpazo* \item helvet* \item fontenc \item beramono* \item fancyhdr \item xcolor + \item textcomp \item titlesec \item titletoc \end{itemize} diff --git a/tufte-common.sty b/tufte-common.sty index ad9fa08..00e49b3 100644 --- a/tufte-common.sty +++ b/tufte-common.sty @@ -284,13 +284,34 @@ \newboolean{@tufte@changepage} \IfFileExists{changepage.sty}{% + \PackageInfo{\@tufte@pkgname}{Found changepage.sty} \RequirePackage[strict]{changepage} \setboolean{@tufte@changepage}{true} }{% + \PackageInfo{\@tufte@pkgname}{Found chngpage.sty} \RequirePackage[strict]{chngpage} \setboolean{@tufte@changepage}{false} } +% Write our own aliases for the \checkoddpage and \ifoddpage or \ifcpoddpage commands +\newboolean{@tufte@odd@page} +\setboolean{@tufte@odd@page}{true} +\newcommand*{\@tufte@checkoddpage}{% + \checkoddpage% + \ifthenelse{\boolean{@tufte@changepage}}{% + \ifoddpage% + \setboolean{@tufte@odd@page}{true}% + \else% + \setboolean{@tufte@odd@page}{false}% + \fi% + }{% + \ifcpoddpage% + \setboolean{@tufte@odd@page}{true}% + \else% + \setboolean{@tufte@odd@page}{false}% + \fi + }% +} % Compute lengths used for full-width displays @@ -868,20 +889,29 @@ \end{lrbox}% % now typeset the stored boxes \begin{fullwidth}% - \begin{minipage}[\floatalignment]{\paperwidth}% - \usebox{\@tufte@figure@box}% - \hspace{\marginparsep}% - \smash{\usebox{\@tufte@caption@box}}% + \begin{minipage}[\floatalignment]{\linewidth}% + \@tufte@checkoddpage% + \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@odd@page}}{% + % asymmetric or page is odd, so caption is on the right + \usebox{\@tufte@figure@box}% + \hspace{\marginparsep}% + \smash{\usebox{\@tufte@caption@box}}% + }{% + % symmetric pages and page is even, so caption is on the left + \strut\smash{\usebox{\@tufte@caption@box}}% + \hspace{\marginparsep}% + \usebox{\@tufte@figure@box}% + }% \end{minipage}% \end{fullwidth}% \@tufte@orig@endfloat% % reset commands and temp boxes and captions \let\caption\@tufte@orig@caption% \let\label\@tufte@orig@label% - \begin{lrbox}{\@tufte@figure@box}\hbox{}\end{lrbox} - \begin{lrbox}{\@tufte@caption@box}\hbox{}\end{lrbox} - \gdef\@tufte@stored@shortcaption{} - \gdef\@tufte@stored@caption{} + \begin{lrbox}{\@tufte@figure@box}\hbox{}\end{lrbox}% + \begin{lrbox}{\@tufte@caption@box}\hbox{}\end{lrbox}% + \gdef\@tufte@stored@shortcaption{}% + \gdef\@tufte@stored@caption{}% } %% @@ -914,7 +944,7 @@ \renewcommand{\label}[1]{\@tufte@label{##1}}% \@tufte@orig@float{#2}[#1]% \begin{lrbox}{\@tufte@figure@box}% - \begin{minipage}[\floatalignment]{\linewidth}\hbox{}% + \begin{minipage}[\floatalignment]{\textwidth}\hbox{}% \begin{fullwidth} }% {% end figure* @@ -932,17 +962,29 @@ \end{minipage}% \end{lrbox}% % now typeset the stored boxes + \@tufte@checkoddpage% \begin{fullwidth}% - \begin{minipage}[\floatalignment]{\paperwidth}% - \hbox{}% + \begin{minipage}[\floatalignment]{\linewidth}% \ifthenelse{\equal{\floatalignment}{b}} {% place caption above figure - \hspace{\@tufte@caption@fill}\smash{\usebox{\@tufte@caption@box}}\\ - \usebox{\@tufte@figure@box}% + \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@odd@page}} + {% caption on the right + \hfill\smash{\usebox{\@tufte@caption@box}}% + \par\usebox{\@tufte@figure@box}% + }{% caption on the left + \smash{\usebox{\@tufte@caption@box}}\hfill\null% + \par\hspace{\@tufte@overhang}\usebox{\@tufte@figure@box}% + }% } {% place caption below figure - \usebox{\@tufte@figure@box}\\ - \hspace{\@tufte@caption@fill}\smash{\usebox{\@tufte@caption@box}}% + \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@odd@page}} + {% caption on the right + \usebox{\@tufte@figure@box}\par% + \hspace{\@tufte@caption@fill}\smash{\usebox{\@tufte@caption@box}}% + }{% caption on the left + \null\hspace{\@tufte@overhang}\usebox{\@tufte@figure@box}\par% + \smash{\usebox{\@tufte@caption@box}}\hfill% + }% } \end{minipage}% \end{fullwidth}% @@ -981,7 +1023,10 @@ {\ifthenelse{\boolean{@tufte@changepage}}{\begin{adjustwidth*}{}{-\@tufte@overhang}}{\begin{adjustwidth}[]{}{-\@tufte@overhang}}} {\begin{adjustwidth}{}{-\@tufte@overhang}}% } - {\end{adjustwidth}} + {\ifthenelse{\boolean{@tufte@symmetric}} + {\ifthenelse{\boolean{@tufte@changepage}}{\end{adjustwidth*}}{\end{adjustwidth}}} + {\end{adjustwidth}} + } %% % Format the captions in a style similar to the sidenotes