From 359d88ccbe618bcf4e93007caac6564c8098d1ec Mon Sep 17 00:00:00 2001 From: "Kevin M. Godby" Date: Tue, 8 Sep 2009 06:18:16 +0000 Subject: [PATCH] * Added some debug output for the float code. git-svn-id: https://tufte-latex.googlecode.com/svn/trunk@128 516e2f36-ce3a-0410-bea4-1d4a03f5df72 --- sample-book.pdf | Bin 341173 -> 341173 bytes sample-handout.pdf | Bin 123585 -> 123585 bytes tufte-common.def | 57 ++++++++++++++++++++++++++++++++------------- 3 files changed, 41 insertions(+), 16 deletions(-) diff --git a/sample-book.pdf b/sample-book.pdf index 3477e1ca4fe43ad18b89ce3148d8c109d73b28fa..040a9a6c7bfe5936cb3662942b8d0a03c0f18585 100644 GIT binary patch delta 7145 zcmai2dtA-g7T4n>NzvKYpk6TYImy*ZQvSTKg2%nitlZ@4N7^ z9*1od9b3I2>h$T8)@DeiN6+uA>XU18CXBpAuE_ z+18hai_7<)`)ZhCu&v&%>C(eK%O(iKV7ut+xFXtxY9Ip<1G06U+ap2c(u?wzj*X%9MYmD}p z{_4h}V+XR2nI%uoPaj$_Z(i(okqH;Smq!)soM`uCg>iwID$KxX=alC!;?(1BhgURP znrZynHr2|FsacEM4VP6U^{*>Qelnry($-+VpR5gT&s?4KTaxMHN}q-q%SsOypBkMP z6B@L$*6ow6X$wy*>od20d4yfb4-pO7(<*wdzcD>=kLl7op;PTP+z2e1vg3>WjrJAu z?pp~@&x~-L6jzpIs(a$6!F#sM+HM`cNIix>HGG)kDWkyW)%ro@W=Fht#}&>1?p|7EFHBLq}5{Jw08!2(aO?M!m(<+_tq zp4+_^41eV?{%O<+KU@7p2F0Fh{nG8#vmDM@uNXJ(KWk%WW`tSqz5eu)Rot$isSevd zdNg*Wy2r2K!Qa-MF0`8VnNRnoi4B%`Hm(jz?tbTfbjp<$mn&Z1&S>>FdKs{%^t)dU zPk!);{cqDBzO0|-Y6n|_$!4yW9%3aWvO@Q z$(;pB9*);CPx<#G+FRla<2CFCVQa%-iJ97T)_sdvx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l&D<8yKi-a_Rf#r?@1Rq$+5*SQ!}@SQ@~T zZ0EYh7|xSmVrXpa3dGJXmgbJG<`yoNCdQ_gt_H>?=9VC(b_zBGmBcF8*>M$@Bo>ua W6s4wd85$XwSQvAus=E5SaRC5J%qT1X diff --git a/tufte-common.def b/tufte-common.def index afdc000..b0e160e 100644 --- a/tufte-common.def +++ b/tufte-common.def @@ -19,7 +19,7 @@ \newcommand{\TufteWarningNL}[1]{\ClassWarningNoLine{\@tufte@pkgname}{#1}} \newcommand{\TufteInfo}[1]{\ClassInfo{\@tufte@pkgname}{#1}} \newcommand{\TufteInfoNL}[1]{\ClassInfo{\@tufte@pkgname}{#1\@gobble}} -\newcommand{\tufteDebugInfo}[1]{\ifthenelse{\boolean{@tufte@debug}}{\TufteInfo{#1}}{}} +\newcommand{\TufteDebugInfo}[1]{\ifthenelse{\boolean{@tufte@debug}}{\TufteInfo{#1}}{}} \newcommand{\TufteDebugInfoNL}[1]{\ifthenelse{\boolean{@tufte@debug}}{\TufteInfoNL{#1}}{}} \newcommand{\TufteError}[2]{\ClassError{\@tufte@pkgname}{#1}{#2}} @@ -1047,11 +1047,18 @@ % \forcerectofloat forces the float to be treated as if it were appearing on a recto page. % \forceversofloat does the same, but for verso pages. +\newcommand{\@tufte@float@debug@info}{}% contains debug info generated as the float is processed +\newcommand{\@tufte@float@debug}[1]{% adds debug info to the queue for output +\ifthenelse{\equal{\@tufte@float@debug@info}{}}% + {\def\@tufte@float@debug@info{#1}}% + {\g@addto@macro\@tufte@float@debug@info{\MessageBreak#1}} +} + \newcommand{\floatalignment}{x}% holds the current float alignment (t, b, h, p) -\newcommand{\setfloatalignment}[1]{\global\def\floatalignment{#1}}% manually sets the float alignment +\newcommand{\setfloatalignment}[1]{\global\def\floatalignment{#1}\@tufte@float@debug{Forcing position: [#1]}}% manually sets the float alignment \newboolean{@tufte@float@recto} -\newcommand{\forcerectofloat}{\gsetboolean{@tufte@float@recto}{true}} -\newcommand{\forceversofloat}{\gsetboolean{@tufte@float@recto}{false}} +\newcommand{\forcerectofloat}{\gsetboolean{@tufte@float@recto}{true}\@tufte@float@debug{Forcing page: [recto]}} +\newcommand{\forceversofloat}{\gsetboolean{@tufte@float@recto}{false}\@tufte@float@debug{Forcing page: [verso]}} % Boxes to temporarily store our float and caption \newsavebox{\@tufte@figure@box} @@ -1100,19 +1107,19 @@ {% begin @tufte@float % Should this float be full-width or just text-width? \ifthenelse{\equal{#3}{star}}% - {\setboolean{@tufte@float@star}{true}}% - {\setboolean{@tufte@float@star}{false}}% + {\gsetboolean{@tufte@float@star}{true}}% + {\gsetboolean{@tufte@float@star}{false}}% % Check page side (recto/verso) and store detected value -- can be overriden in environment contents \@tufte@checkoddpage% \ifthenelse{\boolean{@tufte@odd@page}}% - {\gsetboolean{@tufte@float@recto}{true}}% - {\gsetboolean{@tufte@float@recto}{false}}% - + {\gsetboolean{@tufte@float@recto}{true}\@tufte@float@debug{Detected page: [recto/odd]}}% + {\gsetboolean{@tufte@float@recto}{false}\@tufte@float@debug{Detected page: [verso/even]}}% % If the float placement specifier is 'b' and only 'b', then bottom-align the mini-pages, otherwise top-align them. \renewcommand{\@tufte@fps}{#1}% + \@tufte@float@debug{Allowed positions: [#1]} \ifthenelse{\equal{#1}{b}\OR\equal{#1}{B}}% - {\renewcommand{\floatalignment}{b}}% - {\renewcommand{\floatalignment}{t}}% + {\renewcommand{\floatalignment}{b}\@tufte@float@debug{Presumed position: [bottom]}}% + {\renewcommand{\floatalignment}{t}\@tufte@float@debug{Presumed position: [top]}}% % Capture the contents of the \caption and \label commands to use later \renewcommand{\caption}{\optparams{\@tufte@caption}{[][0pt]}}% \renewcommand{\label}[1]{\@tufte@label{##1}}% @@ -1142,14 +1149,30 @@ {\@tufte@float@textwidth[\@tufte@caption@vertical@offset]{\@tufte@figure@box}{\@tufte@caption@box}}% \end{minipage}% \end{fullwidth}% - \@tufte@orig@endfloat% + \@tufte@orig@endfloat% end original LaTeX float environment + % output debug info + \ifthenelse{\boolean{@tufte@debug}}{% + \typeout{^^J^^J----------- Tufte-LaTeX float information ----------}% + \ifthenelse{\equal{\@tufte@stored@label}{}}% + {\typeout{Warning: Float unlabeled!}}% + {\typeout{Float label: [\@tufte@stored@label]}}% + \typeout{Page number: [\thepage]}% + \def\MessageBreak{^^J}% + \typeout{\@tufte@float@debug@info}% + \ifthenelse{\boolean{@tufte@symmetric}}% + {\typeout{Symmetric: [true]}}% + {\typeout{Symmetric: [false]}}% + \typeout{----------------------------------------------------^^J^^J}% + }{}% % reset commands and temp boxes and captions + \gdef\@tufte@float@debug@info{}% \let\caption\@tufte@orig@caption% \let\label\@tufte@orig@label% \begin{lrbox}{\@tufte@figure@box}\hbox{}\end{lrbox}% \begin{lrbox}{\@tufte@caption@box}\hbox{}\end{lrbox}% \gdef\@tufte@stored@shortcaption{}% \gdef\@tufte@stored@caption{}% + \gdef\@tufte@stored@label{}% \gsetlength{\@tufte@caption@vertical@offset}{0pt}% reset caption offset } @@ -1161,12 +1184,14 @@ \hspace{\marginparsep}% \smash{\raisebox{#1}{\usebox{#3}}}% }% + \@tufte@float@debug{Caption position: [right]}% }{% symmetric pages and page is even, so caption is on the left \hbox{% \smash{\raisebox{#1}{\usebox{#3}}}% \hspace{\marginparsep}% \usebox{#2}% }% + \@tufte@float@debug{Caption position: [left]}% }% } @@ -1174,12 +1199,12 @@ \ifthenelse{\equal{\floatalignment}{b}}% {% place caption above figure \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@float@recto}}% - {\hfill\smash{\raisebox{#1}{\usebox{#3}}}\par\usebox{#2}}% caption on the right - {\smash{\raisebox{#1}{\usebox{#3}}}\hfill\par\usebox{#2}}% caption on the left + {\hfill\smash{\raisebox{#1}{\usebox{#3}}}\par\usebox{#2}\@tufte@float@debug{Caption position: [above right]}}% caption on the right + {\smash{\raisebox{#1}{\usebox{#3}}}\hfill\par\usebox{#2}\@tufte@float@debug{Caption position: [above left]}}% caption on the left }{% place caption below figure \ifthenelse{\NOT\boolean{@tufte@symmetric}\OR\boolean{@tufte@float@recto}}% - {\usebox{#2}\par\hfill\smash{\raisebox{#1}{\usebox{#3}}}}% caption on the right - {\usebox{#2}\par\smash{\raisebox{#1}{\usebox{#3}}}\hfill}% caption on the left + {\usebox{#2}\par\hfill\smash{\raisebox{#1}{\usebox{#3}}}\@tufte@float@debug{Caption position: [below right]}}% caption on the right + {\usebox{#2}\par\smash{\raisebox{#1}{\usebox{#3}}}\hfill\@tufte@float@debug{Caption position: [below left]}}% caption on the left }% }