Browse Source

* Fixed the running heads. The titlesec package overwrite the \thetitle macro

which was holding our document title.  I've renamed \thetitle, \theauthor,
  etc. to \plaintitle, \plainauthor, etc.


git-svn-id: https://tufte-latex.googlecode.com/svn/trunk@92 516e2f36-ce3a-0410-bea4-1d4a03f5df72
master
Kevin M. Godby 16 years ago
parent
commit
0a31dc7fbb
5 changed files with 44 additions and 46 deletions
  1. BIN
      sample-book.pdf
  2. +3
    -0
      sample-book.tex
  3. BIN
      sample-handout.pdf
  4. +26
    -29
      tufte-book.cls
  5. +15
    -17
      tufte-common.sty

BIN
sample-book.pdf View File


+ 3
- 0
sample-book.tex View File

@@ -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.}}


BIN
sample-handout.pdf View File


+ 26
- 29
tufte-book.cls View File

@@ -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%
}

%%


+ 15
- 17
tufte-common.sty View File

@@ -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



Loading…
Cancel
Save