diff --git a/sample-book.pdf b/sample-book.pdf index 92d74d8..034c26d 100644 Binary files a/sample-book.pdf and b/sample-book.pdf differ diff --git a/sample-book.tex b/sample-book.tex index 525099d..691dab3 100644 --- a/sample-book.tex +++ b/sample-book.tex @@ -1,5 +1,8 @@ \documentclass{tufte-book} +%\usepackage{trace} +%\traceon + %% % Book metadata \title{A Tufte-Style Book\thanks{Thanks to Edward R.~Tufte for his inspiration.}} diff --git a/sample-handout.pdf b/sample-handout.pdf index 6c3c483..3f73778 100644 Binary files a/sample-handout.pdf and b/sample-handout.pdf differ diff --git a/tufte-book.cls b/tufte-book.cls index adc7646..f3fa49e 100644 --- a/tufte-book.cls +++ b/tufte-book.cls @@ -25,16 +25,14 @@ % contain only the (arabic) page number in the outside corner. %\newif\if@mainmatter \@mainmattertrue \renewcommand\frontmatter{% - \cleardoublepage - \@mainmatterfalse - \pagenumbering{arabic} - %\pagestyle{plain} - \fancyhf{} - \if@tufte@twoside - \fancyhead[LE,RO]{\thepage} - \else - \fancyhead[RE,RO]{\thepage} - \fi + \cleardoublepage% + \@mainmatterfalse% + \pagenumbering{arabic}% + %\pagestyle{plain}% + \fancyhf{}% + \ifthenelse{\boolean{@tufte@twoside}}% + {\fancyhead[LE,RO]{\thepage}}% + {\fancyhead[RE,RO]{\thepage}}% } @@ -42,19 +40,18 @@ % The main matter in Tufte's /Beautiful Evidence/ doesn't restart the page % numbering---it continues where it left off in the front matter. \renewcommand\mainmatter{% - \cleardoublepage - \@mainmattertrue - - % TODO The book should have the book title on the left and the chapter - % title on the right. - \fancyhf{} - \if@tufte@twoside - \renewcommand{\chaptermark}[1]{\markboth{##1}{}} - \fancyhead[LE]{\thepage\quad\smallcaps{\thetitle}}% book title - \fancyhead[RO]{\smallcaps{\leftmark}\quad\thepage}% chapter title - \else - \fancyhead[RE,RO]{\smallcaps{\thetitle}\quad\thepage}% book title - \fi + \cleardoublepage% + \@mainmattertrue% + \fancyhf{}% + \ifthenelse{\boolean{@tufte@twoside}}% + {% two-side + \renewcommand{\chaptermark}[1]{\markboth{##1}{}}% + \fancyhead[LE]{\thepage\quad\smallcaps{\plaintitle}}% book title + \fancyhead[RO]{\smallcaps{\leftmark}\quad\thepage}% chapter title + }% + {% one-side + \fancyhead[RE,RO]{\smallcaps{\plaintitle}\quad\thepage}% book title + }% } @@ -62,12 +59,12 @@ % The back matter contains appendices, indices, glossaries, endnotes, % biliographies, list of contributors, illustration credits, etc. \renewcommand\backmatter{% - \if@openright - \cleardoublepage - \else - \clearpage - \fi - \@mainmatterfalse + \if@openright% + \cleardoublepage% + \else% + \clearpage% + \fi% + \@mainmatterfalse% } %% diff --git a/tufte-common.sty b/tufte-common.sty index 78c8abc..282f00e 100644 --- a/tufte-common.sty +++ b/tufte-common.sty @@ -311,11 +311,11 @@ %% % Modified \title, \author, and \date commands. These store the -% (footnote-less) values in \thetitle, \theauthor, and \thedate, respectively. +% (footnote-less) values in \plaintitle, \plainauthor, and \thedate, respectively. -\newcommand{\thetitle}{}% plain-text-only title -\newcommand{\theauthor}{}% plain-text-only author -\newcommand{\thepublisher}{}% plain-text-only publisher +\newcommand{\plaintitle}{}% plain-text-only title +\newcommand{\plainauthor}{}% plain-text-only author +\newcommand{\plainpublisher}{}% plain-text-only publisher \newcommand{\thanklesstitle}{}% full title text minus \thanks{} \newcommand{\thanklessauthor}{}% full author text minus \thanks{} @@ -336,9 +336,9 @@ \protected@xdef\thanklesstitle{#2}% \endgroup% \ifthenelse{\isempty{#1}}% - {\renewcommand{\thetitle}{\thanklesstitle}}% use thankless title - {\renewcommand{\thetitle}{#1}}% use provided plain-text title - \hypersetup{pdftitle={\thetitle}}% set the PDF metadata title + {\renewcommand{\plaintitle}{\thanklesstitle}}% use thankless title + {\renewcommand{\plaintitle}{#1}}% use provided plain-text title + \hypersetup{pdftitle={\plaintitle}}% set the PDF metadata title } \def\@author{}% default author is empty (suppresses LaTeX's ``no author'' warning) @@ -350,9 +350,9 @@ \protected@xdef\thanklessauthor{#2}% \endgroup% \ifthenelse{\isempty{#1}} - {\renewcommand{\theauthor}{\thanklessauthor}}% use thankless author - {\renewcommand{\theauthor}{#1}}% use provided plain-text author - \hypersetup{pdfauthor={\theauthor}}% set the PDF metadata author + {\renewcommand{\plainauthor}{\thanklessauthor}}% use thankless author + {\renewcommand{\plainauthor}{#1}}% use provided plain-text author + \hypersetup{pdfauthor={\plainauthor}}% set the PDF metadata author } \renewcommand*{\date}[1]{% @@ -374,8 +374,8 @@ \protected@xdef\thanklesspublisher{#2}% \endgroup% \ifthenelse{\isempty{#1}} - {\renewcommand{\thepublisher}{\thanklesspublisher}}% use thankless publisher - {\renewcommand{\thepublisher}{#1}}% use provided plain-text publisher + {\renewcommand{\plainpublisher}{\thanklesspublisher}}% use thankless publisher + {\renewcommand{\plainpublisher}{#1}}% use provided plain-text publisher } % TODO: Test \hypersetup{pdfauthor,pdftitle} with DVI and XeTeX @@ -1055,9 +1055,9 @@ % The 'fancy' page style is the default style for all pages. \fancyhf{} % clear header and footer fields \ifthenelse{\boolean{@tufte@twoside}} - {\fancyhead[LE]{\thepage\quad\smallcaps{\newlinetospace{\theauthor}}}% - \fancyhead[RO]{\smallcaps{\newlinetospace{\thetitle}}\quad\thepage}} - {\fancyhead[RE,RO]{\smallcaps{\newlinetospace{\thetitle}}\quad\thepage}} + {\fancyhead[LE]{\thepage\quad\smallcaps{\newlinetospace{\plainauthor}}}% + \fancyhead[RO]{\smallcaps{\newlinetospace{\plaintitle}}\quad\thepage}} + {\fancyhead[RE,RO]{\smallcaps{\newlinetospace{\plaintitle}}\quad\thepage}} % The `plain' page style is used on chapter opening pages. @@ -1079,8 +1079,6 @@ } - - %% % Set raggedright and paragraph indentation for document