summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/mdwtools/footnote.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-12 23:58:53 +0000
committerKarl Berry <karl@freefriends.org>2006-01-12 23:58:53 +0000
commit73737138494c38ab30b24873f1da7d19a34c820a (patch)
tree3810db1fc65217e393992e34a7afdc718d375dbb /Master/texmf-dist/tex/latex/mdwtools/footnote.sty
parent31d05ca84e9dba8a5f61b45b5c475fa154272b48 (diff)
mdwtools
git-svn-id: svn://tug.org/texlive/trunk@1080 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/mdwtools/footnote.sty')
-rw-r--r--Master/texmf-dist/tex/latex/mdwtools/footnote.sty200
1 files changed, 200 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/mdwtools/footnote.sty b/Master/texmf-dist/tex/latex/mdwtools/footnote.sty
new file mode 100644
index 00000000000..c35317dca07
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/mdwtools/footnote.sty
@@ -0,0 +1,200 @@
+%%
+%% This is file `footnote.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% footnote.dtx (with options: `package')
+%%
+%% IMPORTANT NOTICE
+%%
+%% footnote package -- Save footnotes around boxing environments
+%% Copyright (c) 1996 Mark Wooding
+%%
+%% This program is free software; you can redistribute it and/or modify
+%% it under the terms of the GNU General Public License as published by
+%% the Free Software Foundation; either version 2 of the License, or
+%% (at your option) any later version.
+%%
+%% This program is distributed in the hope that it will be useful,
+%% but WITHOUT ANY WARRANTY; without even the implied warranty of
+%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+%% GNU General Public License for more details.
+%%
+%% You should have received a copy of the GNU General Public License
+%% along with this program; if not, write to the Free Software
+%% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+%%
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{footnote}
+ [1997/01/28 1.13 Save footnotes around boxes]
+%% \CharacterTable
+%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%%
+\ifx\fn@notes\@@undefined%
+ \newbox\fn@notes%
+\fi
+\newdimen\fn@width
+\let\fn@colwidth\columnwidth
+\newif\if@savingnotes
+\def\fn@startnote{%
+ \hsize\fn@colwidth%
+ \interlinepenalty\interfootnotelinepenalty%
+ \reset@font\footnotesize%
+ \floatingpenalty\@MM% Is this right???
+ \@parboxrestore%
+ \protected@edef\@currentlabel{\csname p@\@mpfn\endcsname\@thefnmark}%
+ \color@begingroup%
+}
+\let\fn@endnote\color@endgroup
+\def\fn@fntext#1{%
+ \ifx\ifmeasuring@\@@undefined%
+ \expandafter\@secondoftwo\else\expandafter\@iden%
+ \fi%
+ {\ifmeasuring@\expandafter\@gobble\else\expandafter\@iden\fi}%
+ {%
+ \global\setbox\fn@notes\vbox{%
+ \unvbox\fn@notes%
+ \fn@startnote%
+ \@makefntext{%
+ \rule\z@\footnotesep%
+ \ignorespaces%
+ #1%
+ \@finalstrut\strutbox%
+ }%
+ \fn@endnote%
+ }%
+ }%
+}
+\def\savenotes{%
+ \begingroup%
+ \if@savingnotes\else%
+ \@savingnotestrue%
+ \let\@footnotetext\fn@fntext%
+ \let\@mpfootnotetext\fn@fntext%
+ \fn@width\columnwidth%
+ \let\fn@colwidth\fn@width%
+ \global\setbox\fn@notes\box\voidb@x%
+ \let\fn@thempfn\thempfn%
+ \let\fn@mpfn\@mpfn%
+ \ifx\@minipagerestore\relax\let\@minipagerestore\@empty\fi%
+ \expandafter\def\expandafter\@minipagerestore\expandafter{%
+ \@minipagerestore%
+ \let\thempfn\fn@thempfn%
+ \let\@mpfn\fn@mpfn%
+ }%
+ \fi%
+}
+\def\spewnotes{%
+ \endgroup%
+ \if@savingnotes\else\ifvoid\fn@notes\else\begingroup%
+ \let\@makefntext\@empty%
+ \let\@finalstrut\@gobble%
+ \let\rule\@gobbletwo%
+ \@footnotetext{\unvbox\fn@notes}%
+ \endgroup\fi\fi%
+}
+\let\endsavenotes\spewnotes
+\def\fn@getmark#1#2{%
+ \begingroup%
+ \@ifnextchar[%
+ {\fn@getmark@i{#1}}%
+ {#1\fn@getmark@ii{#2}}%
+}
+\def\fn@getmark@i#1[#2]{%
+ \csname c@\@mpfn\endcsname#2%
+ \fn@getmark@ii%
+}
+\def\fn@getmark@ii#1{%
+ \unrestored@protected@xdef\@thefnmark{\thempfn}%
+ \endgroup%
+ #1%
+}
+\def\fn@startfntext{%
+ \setbox\z@\vbox\bgroup%
+ \fn@startnote%
+ \fn@prefntext%
+ \rule\z@\footnotesep%
+ \ignorespaces%
+}
+\def\fn@endfntext{%
+ \@finalstrut\strutbox%
+ \fn@postfntext%
+ \egroup%
+ \begingroup%
+ \let\@makefntext\@empty%
+ \let\@finalstrut\@gobble%
+ \let\rule\@gobbletwo%
+ \@footnotetext{\unvbox\z@}%
+ \endgroup%
+}
+\let\fn@latex@@footnote\footnote
+\def\fn@footnote{footnote}
+\def\footnote{%
+ \ifx\@currenvir\fn@footnote%
+ \expandafter\@firstoftwo%
+ \else%
+ \expandafter\@secondoftwo%
+ \fi%
+ {\fn@getmark{\stepcounter\@mpfn}%
+ {\leavevmode\unskip\@footnotemark\fn@startfntext}}%
+ {\fn@latex@@footnote}%
+}
+\let\endfootnote\fn@endfntext
+\def\fn@footnotetext{footnotetext}
+\let\fn@latex@@footnotetext\footnotetext
+\def\footnotetext{%
+ \ifx\@currenvir\fn@footnotetext%
+ \expandafter\@firstoftwo%
+ \else%
+ \expandafter\@secondoftwo%
+ \fi%
+ {\fn@getmark{}\fn@startfntext}%
+ {\fn@latex@@footnotetext}%
+}
+\let\endfootnotetext\endfootnote
+\long\def\@tempa#1\@@#2\@@@{\def\fn@prefntext{#1}\def\fn@postfntext{#2}}
+\expandafter\@tempa\@makefntext\@@\@@@
+\def\makesavenoteenv{\@ifnextchar[\fn@msne@ii\fn@msne@i}
+\def\fn@msne@i#1{%
+ \expandafter\let\csname msne$#1\expandafter\endcsname%
+ \csname #1\endcsname%
+ \expandafter\let\csname endmsne$#1\expandafter\endcsname%
+ \csname end#1\endcsname%
+ \fn@msne@ii[#1]{msne$#1}%
+}
+\def\fn@msne@ii[#1]#2{%
+ \expandafter\edef\csname#1\endcsname{%
+ \noexpand\savenotes%
+ \expandafter\noexpand\csname#2\endcsname%
+ }%
+ \expandafter\edef\csname end#1\endcsname{%
+ \expandafter\noexpand\csname end#2\endcsname%
+ \noexpand\expandafter%
+ \noexpand\spewnotes%
+ \noexpand\if@endpe\noexpand\@endpetrue\noexpand\fi%
+ }%
+}
+\makesavenoteenv[minipage*]{minipage}
+\let\fn@parbox\parbox
+\def\parbox{\@ifnextchar[{\fn@parbox@i{}}{\fn@parbox@ii{}}}
+\def\fn@parbox@i#1[#2]{%
+ \@ifnextchar[{\fn@parbox@i{#1[#2]}}{\fn@parbox@ii{#1[#2]}}%
+}
+\long\def\fn@parbox@ii#1#2#3{\savenotes\fn@parbox#1{#2}{#3}\spewnotes}
+\endinput
+%%
+%% End of file `footnote.sty'.