From 7e8524273b5139a0dbd600de9aba7f9d4a43347f Mon Sep 17 00:00:00 2001 From: "Kevin M. Godby" Date: Fri, 19 Dec 2008 04:37:49 +0000 Subject: [PATCH] * Using the `symmetric' option now executes the `twoside' option automatically. This fixes issue #7. * Added some debug output and cleaned up its appearance. git-svn-id: https://tufte-latex.googlecode.com/svn/trunk@65 516e2f36-ce3a-0410-bea4-1d4a03f5df72 --- tufte-common.sty | 41 ++++++++++++++++++++++++++++++++--------- tufte-handout.cls | 8 ++++++++ 2 files changed, 40 insertions(+), 9 deletions(-) diff --git a/tufte-common.sty b/tufte-common.sty index 8c2b04f..d63e809 100644 --- a/tufte-common.sty +++ b/tufte-common.sty @@ -68,14 +68,24 @@ %% % `symmetric' option -- puts marginpar space to the outside edge of the page -% Note: this option forces the twoside option +% Note: this option forces the twoside option (see the .cls files) \newboolean{@tufte@symmetric} \DeclareOption{symmetric}{ \setboolean{@tufte@symmetric}{true} - \PassOptionsToClass{twoside}{\@tufte@class} + \PackageInfo{\@tufte@pkgname}{The `symmetric' option implies `twoside'.} + %\ExecuteOptions{twoside} } +%% +% `twoside' option -- alternates running heads + +\newboolean{@tufte@twoside} +\DeclareOption{twoside}{ + \setboolean{@tufte@twoside}{true} +} + + %% % `justified' option -- uses fully justified text (flush left and flush % right) instead of ragged right. @@ -89,16 +99,15 @@ \DeclareOption*{\PassOptionsToClass{\CurrentOption}{\@tufte@class}} \ProcessOptions -%\LoadClass{\@tufte@class} - %% % Detect whether we're in two-side mode or not. (Used to set up running % heads later.) -\newboolean{@tufte@twoside} \ifthenelse{\boolean{@twoside}} {\setboolean{@tufte@twoside}{true}} - {\setboolean{@tufte@twoside}{false}} + {} + + %% % Detect if we're using pdfLaTeX @@ -148,7 +157,7 @@ \ifthenelse{\boolean{@tufte@symmetric}} {} - {\geometry{asymmetric}} + {\geometry{asymmetric}}% forces internal LaTeX `twoside' %% @@ -605,12 +614,19 @@ \newcommand{\typeoutbool}[2]{% \ifthenelse{\boolean{#2}} - {\typeout{#1: true}} - {\typeout{#1: false}} + {\typeout{\space\space#1: true}} + {\typeout{\space\space#1: false}} +} + +\newcommand{\typeoutstr}[2]{% + \typeout{\space\space#1: #2} } \newcommand{\PrintTufteSettings}{% \typeout{-------------------- Tufte-LaTeX settings ----------} + \typeout{Class: \@tufte@pkgname} + \typeout{} + \typeout{Class options:} \typeoutbool{a4paper}{@tufte@afourpaper} \typeoutbool{load fonts}{@tufte@loadfonts} \typeoutbool{fully-justified}{@tufte@justified} @@ -618,6 +634,13 @@ \typeoutbool{sans-serif sidenotes}{@tufte@sfsidenotes} \typeoutbool{symmetric margins}{@tufte@symmetric} \typeoutbool{titlepage}{@tufte@titlepage} + \typeoutbool{twoside}{@tufte@twoside} + \typeoutbool{debug}{@tufte@debug} + \typeout{} + \typeout{Internal variables:} + \typeoutbool{[twoside]}{@twoside} + \typeoutbool{pdflatex}{@tufte@pdf} + \typeoutbool{xelatex}{@tufte@xetex} \typeout{----------------------------------------------------} } diff --git a/tufte-handout.cls b/tufte-handout.cls index 5178807..cd7f834 100644 --- a/tufte-handout.cls +++ b/tufte-handout.cls @@ -2,6 +2,14 @@ \ProvidesClass{tufte-handout}[2008/11/16 v3.0.0 Tufte-handout class] +%% +% The symmetric option forces twoside. +\DeclareOption{symmetric}{% + \ExecuteOptions{twoside} + \PassOptionsToPackage{twoside}{tufte-common} + \PassOptionsToClass{twoside}{article} + \PackageInfo{tufte-handout}{Passing twoside to `article' class} +} \PassOptionsToPackage{handout}{tufte-common} \DeclareOption*{% pass options to tufte-common package and the article class