From 62fcc1652cf5fe51fb61cbcc6fe1a7917e36b5fb Mon Sep 17 00:00:00 2001 From: "Kevin M. Godby" Date: Tue, 24 Nov 2009 11:24:05 +0000 Subject: [PATCH] * Added \TufteLoadHyperref that may be used if you want to load the hyperref package with the TL defaults after you've loaded another packages. (Use in conjunction with the `nohyper' document class option.) * Added compatibility with the `subfigure' package. Needs further testing. git-svn-id: https://tufte-latex.googlecode.com/svn/trunk@132 516e2f36-ce3a-0410-bea4-1d4a03f5df72 --- sample-book.pdf | Bin 350554 -> 350554 bytes sample-handout.pdf | Bin 124378 -> 124378 bytes tufte-common.def | 33 +++++++++++++++++++++++++++++---- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/sample-book.pdf b/sample-book.pdf index efa3859bff549c6de1d17e32eb840e0054ee13f4..ec67ee1066be13e7a858407b10d294bde917176b 100644 GIT binary patch delta 126 zcmcb$N%Ynx(S{br7N!>F7M3ln%M`dw3`~s-O$~Gn%%(3CVie`JG&D4VifzB3z^Y~8 v?C5G??qck0>}uv{WZ>##?&|1fX=!2R=H%+)=4NVXVW(h2NXc~DNLE<@m%<>2 delta 126 zcmcb$N%Ynx(S{br7N!>F7M3ln%M`ebjf_kTjZJk8%%(3CVie`JG&D4VifzB3z^Y~8 u>}qW2Vr=2&>}c+4>}q5PRBmQuXy9n#;%4k@Y-wp=r(i=!$#mODR#^aat{-^- diff --git a/sample-handout.pdf b/sample-handout.pdf index 153222e1ba7b39b780f92470cd7ee55b63dccd24..ad3439499529747849de7dcb6d0ae6fdee0f32c2 100644 GIT binary patch delta 111 zcmcb0n*G*k_J%EtzizOb7?>IvnwU;!yvZm7<7`*C$r#4tY-wp^WbSO~WZ-0CXk=hy fZs=reVd`jV-HVy9q3NXhiQPZ?zaCygE@ delta 111 zcmcb0n*G*k_J%EtzizM_8yT3I8kkLIyvZm7<7`*C$r#4t?CR>|?BwEPVQysR>|$W( f=we`E=45Q-=4xtTVc_g$W~X37NXhiQPZ?zaQ6wJ+ diff --git a/tufte-common.def b/tufte-common.def index 39874e7..6d6bdad 100644 --- a/tufte-common.def +++ b/tufte-common.def @@ -306,9 +306,9 @@ } %%% -%% Load the `hyperref' package. +%% Loads the hyperref package and sets some default options. -\ifthenelse{\boolean{@tufte@loadhyper}}{% +\newcommand{\TufteLoadHyperref}{% \ifthenelse{\boolean{@tufte@xetex}} {\RequirePackage[unicode,hyperfootnotes=false,xetex]{hyperref}} {\RequirePackage[unicode,hyperfootnotes=false]{hyperref}} @@ -320,6 +320,13 @@ pagecolor = DarkBlue, urlcolor = DarkGreen, }% +} + +%%% +%% Load the `hyperref' package. + +\ifthenelse{\boolean{@tufte@loadhyper}}{% + \TufteLoadHyperref% }{% hyperfootnotes override our modifications to the \footnote* and \@footnote* commands. \PassOptionsToPackage{hyperfootnotes=false}{hyperref} } @@ -542,7 +549,7 @@ \ifthenelse{\isempty{#1}}% {\renewcommand{\plaintitle}{\thanklesstitle}}% use thankless title {\renewcommand{\plaintitle}{#1}}% use provided plain-text title - \ifthenelse{\boolean{@tufte@loadhyper}}{\hypersetup{pdftitle={\plaintitle}}}{}% set the PDF metadata title + \@ifpackageloaded{hyperref}{\hypersetup{pdftitle={\plaintitle}}}{}% set the PDF metadata title } \def\@author{}% default author is empty (suppresses LaTeX's ``no author'' warning) @@ -556,7 +563,7 @@ \ifthenelse{\isempty{#1}} {\renewcommand{\plainauthor}{\thanklessauthor}}% use thankless author {\renewcommand{\plainauthor}{#1}}% use provided plain-text author - \ifthenelse{\boolean{@tufte@loadhyper}}{\hypersetup{pdfauthor={\plainauthor}}}{}% set the PDF metadata author + \@ifpackageloaded{hyperref}{\hypersetup{pdfauthor={\plainauthor}}}{}% set the PDF metadata author } \renewcommand*{\date}[1]{% @@ -1120,6 +1127,11 @@ \global\let\@tufte@orig@label\label% \renewcommand{\caption}{\optparams{\@tufte@caption}{[][0pt]}}% \renewcommand{\label}[1]{\@tufte@label{##1}}% + % Handle subfigure package compatibility + \ifthenelse{\boolean{@tufte@packages@subfigure}}{% + % don't move the label while inside a \subfigure or \subtable command + \global\let\label\@tufte@orig@label% + }{}% subfigure package is not loaded \@tufte@orig@float{#2}[#1]% \ifthenelse{\boolean{@tufte@float@star}}% {\setlength{\@tufte@float@contents@width}{\@tufte@fullwidth}}% @@ -1785,6 +1797,19 @@ }% } + +%% +% Detect if the subfigure package has been loaded + +\newboolean{@tufte@packages@subfigure} +\setboolean{@tufte@packages@subfigure}{false} +\AtBeginDocument{% + \@ifpackageloaded{subfigure} + {\gsetboolean{@tufte@packages@subfigure}{true}} + {\gsetboolean{@tufte@packages@subfigure}{false}}% +} + + %% % If debugging is enabled, print the Tufte-LaTeX options and the list of % files.