Browse Source

* 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
master
Kevin M. Godby 16 years ago
parent
commit
62fcc1652c
3 changed files with 29 additions and 4 deletions
  1. BIN
      sample-book.pdf
  2. BIN
      sample-handout.pdf
  3. +29
    -4
      tufte-common.def

BIN
sample-book.pdf View File


BIN
sample-handout.pdf View File


+ 29
- 4
tufte-common.def View File

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


Loading…
Cancel
Save