From 67a7f54b3d999c5255ba22cc3f2b02bda19cb1b4 Mon Sep 17 00:00:00 2001 From: "Kevin M. Godby" Date: Fri, 16 May 2008 07:35:39 +0000 Subject: [PATCH] * Added marginfig and margintab environments to place figures and tables in the margin. Thanks, Kjell Magne Fauske! git-svn-id: https://tufte-latex.googlecode.com/svn/trunk@48 516e2f36-ce3a-0410-bea4-1d4a03f5df72 --- tufte-handout.cls | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/tufte-handout.cls b/tufte-handout.cls index 45ee74b..88f1a56 100644 --- a/tufte-handout.cls +++ b/tufte-handout.cls @@ -273,8 +273,25 @@ \vspace*{#1} \@tufteh@raggedright #2}} -% FIXME: if anyone can make this an environment instead -- patch welcome! - +%% +% Margin figure environment + +\newsavebox{\@tufteh@marginfigbox} +\newenvironment{marginfig}[1] + [-1.2ex] + {\FloatBarrier% process all floats before this point so the figure numbers stay in order. + \begin{lrbox}{\@tufteh@marginfigbox} + \begin{minipage}{\marginparwidth} + \@tufteh@marginfont + \def\@captype{figure} + \vspace*{#1} + \@tufteh@raggedright + } + {\end{minipage}% + \end{lrbox}% + \marginpar{\usebox{\@tufteh@marginfigbox}}} + + %% % Margin table @@ -286,7 +303,24 @@ \vspace*{#1} \@tufteh@raggedright #2}} -% FIXME: if anyone can make this an environment instead -- patch welcome! + +%% +% Margin table environment +\newsavebox{\@tufteh@margintablebox} +\newenvironment{margintab}[1] + [-1.2ex] + {\FloatBarrier% process all floats before this point so the figure numbers stay in order. + \begin{lrbox}{\@tufteh@margintablebox} + \begin{minipage}{\marginparwidth} + \@tufteh@marginfont + \def\@captype{table} + \vspace*{#1} + \@tufteh@raggedright + } + {\end{minipage}% + \end{lrbox}% + \marginpar{\usebox{\@tufteh@margintablebox}}} + %% % Full-width figure