From bec520863474a2c3743eeefb46847f4c09de096f Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sun, 19 Feb 2012 23:32:17 +0000
Subject: new latex package footnoterange (19feb12)

git-svn-id: svn://tug.org/texlive/trunk@25430 c570f23f-e606-0410-a88d-b1316a301751
---
 .../tex/latex/footnoterange/footnoterange.sty      | 174 +++++++++++++++++++++
 1 file changed, 174 insertions(+)
 create mode 100644 Master/texmf-dist/tex/latex/footnoterange/footnoterange.sty

(limited to 'Master/texmf-dist/tex/latex/footnoterange/footnoterange.sty')

diff --git a/Master/texmf-dist/tex/latex/footnoterange/footnoterange.sty b/Master/texmf-dist/tex/latex/footnoterange/footnoterange.sty
new file mode 100644
index 00000000000..c7b369f60d0
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/footnoterange/footnoterange.sty
@@ -0,0 +1,174 @@
+%%
+%% This is file `footnoterange.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% footnoterange.dtx  (with options: `package')
+%% 
+%% This is a generated file.
+%% 
+%% Project: footnoterange
+%% Version: 2012/02/17 v1.0a
+%% 
+%% Copyright (C) 2012 by
+%%     H.-Martin M"unch <Martin dot Muench at Uni-Bonn dot de>
+%% 
+%% The usual disclaimer applies:
+%% If it doesn't work right that's your problem.
+%% (Nevertheless, send an e-mail to the maintainer
+%%  when you find an error in this package.)
+%% 
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3c of this license or (at your option) any later
+%% version. This version of this license is in
+%%    http://www.latex-project.org/lppl/lppl-1-3c.txt
+%% and the latest version of this license is in
+%%    http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+%% 
+%% This work has the LPPL maintenance status "maintained".
+%% 
+%% The Current Maintainer of this work is H.-Martin Muench.
+%% 
+%% This work consists of the main source file footnoterange.dtx,
+%% the README, and the derived files
+%%    footnoterange.sty, footnoterange.pdf,
+%%    footnoterange.ins, footnoterange.drv,
+%%    footnoterange-example.tex, footnoterange-example.pdf.
+%% 
+\NeedsTeXFormat{LaTeX2e}[2011/06/27]
+\ProvidesPackage{footnoterange}[2012/02/17 v1.0a
+            References to ranges of footnotes (HMM)]
+%% Provides the footnoterange and footnoterange* environment to
+%% refer to ranges of footnotes.
+\RequirePackage{ltxcmds}[2011/04/18]% v1.20; for "\ltx@ifpackageloaded"
+\RequirePackage{xspace}[2009/10/20]%  v1.13; for "\@\xspace"
+
+\newcommand{\fnr@rangefootnote}[2][\empty]{%
+  \nolinebreak%
+  % no \footnotemark here
+  \addtocounter{footnote}{+1}%
+  \ltx@ifpackageloaded{hyperref}{% hyperref loaded
+    \ifHy@hyperfootnotes% option hyperfootnotes=true
+      \addtocounter{Hfootnote}{+1}%
+      % Code from the hyperref package
+        \global\let\Hy@saved@currentHref\@currentHref%
+        \hyper@makecurrent{Hfootnote}%
+        \global\let\Hy@footnote@currentHref\@currentHref%
+        \global\let\@currentHref\Hy@saved@currentHref%
+      % End of code form the hyperref package
+    \fi%
+   }{% hyperref not loaded, nothing to be done here
+   }%
+  \xdef\fnr@opt{#1}% contains the optional argument
+  \xdef\fnr@arabic{\arabic{footnote}}%
+  \edef\fnr@formated{\thefootnote}%
+  \ifx\fnr@opt\empty%
+    \footnotetext{\label{fnr:\fnr@arabic}#2}%
+  \else%
+    \PackageWarning{footnoterange}{%
+      Custom footnote-numbers used in a footnoterange\MessageBreak%
+      environment: Footnote with natural number\MessageBreak%
+      \ifx\fnr@formated\fnr@arabic%
+        \fnr@arabic \space %
+      \else%
+        \space \fnr@arabic \space (\fnr@formated )\MessageBreak%
+      \fi%
+      was renumbered to \fnr@opt %
+     }%
+    \ltx@ifpackageloaded{hyperref}{% hyperref loaded
+      \footnotetext[#1]{\phantomsection\label{fnr:\fnr@arabic}#2}%
+     }{% hyperref not loaded
+      \footnotetext[#1]{\label{fnr:\fnr@arabic}#2}%
+     }%
+  \fi%
+}%
+
+
+\newenvironment{footnoterange}{%
+  % at begin of the footnoterange environment
+  \addtocounter{footnote}{+1}%
+  \xdef\fnr@first{\arabic{footnote}}%
+  \addtocounter{footnote}{-1}%
+  \let\fnr@origfn\footnote%
+  \let\footnote\fnr@rangefootnote%
+}{% at end of the footnoterange environment
+  \let\footnote\fnr@origfn%
+  \ifx\fnr@opt\empty%
+  \else%
+    \hspace{-0.85ex}%
+  \fi%
+  \ifx\fnr@first\fnr@arabic%
+    \PackageInfo{footnoterange}{%
+      Environment footnoterange used,\MessageBreak%
+      but only one footnote (number \fnr@first ) is contained%
+      \MessageBreak%
+     }%
+    \ltx@ifpackageloaded{hyperref}{% hyperref package loaded
+      \ifHy@hyperfootnotes% option hyperfootnotes=true
+        \hbox{\hyperref[fnr:\fnr@first]{%
+                \@textsuperscript {\normalfont \ref*{fnr:\fnr@first}}}}%
+      \else% option hyperfootnotes=false
+        \hbox {\@textsuperscript {\normalfont \ref*{fnr:\fnr@first}}}%
+      \fi%
+    }{% hyperref package not loaded
+      \hbox {\@textsuperscript {\normalfont \ref{fnr:\fnr@first}}}%
+     }%
+  \else%
+    \ltx@ifpackageloaded{hyperref}{% hyperref package loaded
+      \ifHy@hyperfootnotes% option hyperfootnotes=true
+        \hbox{\hyperref[fnr:\fnr@first]{%
+                \@textsuperscript {\normalfont \ref*{fnr:\fnr@first}}}%
+              \@textsuperscript {\normalfont --}%
+              \hyperref[fnr:\arabic{footnote}]{%
+                \@textsuperscript {\normalfont \ref*{%
+                                              fnr:\arabic{footnote}}}}}%
+      \else% option hyperfootnotes=false
+        \hbox {\@textsuperscript {\normalfont \ref*{fnr:\fnr@first}%
+                                       --\ref*{fnr:\arabic{footnote}}}}%
+      \fi%
+    }{% hyperref package not loaded
+      \hbox {\@textsuperscript {\normalfont \ref{fnr:\fnr@first}%
+                                        --\ref{fnr:\arabic{footnote}}}}%
+     }%
+  \fi%
+\@\xspace%
+}
+
+
+\newenvironment{footnoterange*}{%
+  % at begin of the footnoterange* environment
+  \addtocounter{footnote}{+1}%
+  \xdef\fnr@first{\arabic{footnote}}%
+  \addtocounter{footnote}{-1}%
+  \let\fnr@origfn\footnote%
+  \let\footnote\fnr@rangefootnote%
+}{% at end of the footnoterange* environment
+  \let\footnote\fnr@origfn%
+  \ifx\fnr@first\fnr@arabic%
+    \PackageInfo{footnoterange}{%
+      Environment footnoterange used,\MessageBreak%
+      but only one footnote (number \fnr@first ) is contained%
+     }%
+    \ltx@ifpackageloaded{hyperref}{% hyperref package loaded
+      \hbox {\@textsuperscript {\normalfont \ref*{fnr:\fnr@first}}}%
+    }{% hyperref package not loaded
+      \hbox {\@textsuperscript {\normalfont \ref{fnr:\fnr@first}}}%
+     }%
+  \else%
+    \ltx@ifpackageloaded{hyperref}{% hyperref package loaded
+      \hbox {\@textsuperscript {\normalfont \ref*{fnr:\fnr@first}%
+                                       --\ref*{fnr:\arabic{footnote}}}}%
+    }{% hyperref package not loaded
+      \hbox {\@textsuperscript {\normalfont \ref{fnr:\fnr@first}%
+                                        --\ref{fnr:\arabic{footnote}}}}%
+     }%
+  \fi%
+\@\xspace%
+}
+\endinput
+%%
+%% End of file `footnoterange.sty'.
-- 
cgit v1.2.3

