summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/everyhook
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-02-05 00:22:30 +0000
committerKarl Berry <karl@freefriends.org>2011-02-05 00:22:30 +0000
commit86517b6e5dfb0db3f1287ad413391ff14491b126 (patch)
treef5025ebe2301b97f9c2e80fcc076000db29f2f1f /Master/texmf-dist/tex/latex/everyhook
parentac8a78c00365911d30dffbc9e9492d3961c32b7f (diff)
everyhook (4feb11)
git-svn-id: svn://tug.org/texlive/trunk@21298 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/everyhook')
-rw-r--r--Master/texmf-dist/tex/latex/everyhook/everyhook.sty84
1 files changed, 71 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/latex/everyhook/everyhook.sty b/Master/texmf-dist/tex/latex/everyhook/everyhook.sty
index 6f546801a64..64e8d20785b 100644
--- a/Master/texmf-dist/tex/latex/everyhook/everyhook.sty
+++ b/Master/texmf-dist/tex/latex/everyhook/everyhook.sty
@@ -4,15 +4,15 @@
%%
%% The original source files were:
%%
-%% everyhook.dtx (with options: `package')
-%% Copyright (C) 2010 by Stephen Checkoway
+%% everyhook.dtx
+%% Copyright (C) 2010, 2011 by Stephen Checkoway
%%
%% This file 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. The latest version of this license is in:
+%% version. The latest version of this license is in:
%%
-%% http://www.latex-project.org/lppl.txt
+%% 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.
@@ -23,12 +23,21 @@
%%
%% This work consists of everyhook.dtx and the derived file
%% everyhook.sty.
-%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\RequirePackage{svn-prov}
\ProvidesPackageSVN
-{$Id: everyhook.dtx 9 2010-09-27 07:39:15Z steve $}
-[v1.0 \revinfo\ Hooks for low level TeX everyX primitives.]
+{$Id: everyhook.dtx 10 2011-02-04 06:43:36Z steve $}
+[v1.1 \revinfo\ Hooks for low level TeX everyX primitives.]
+\DeclareOption{excludeor}{%
+\AtBeginDocument{%
+\output\expandafter{%
+\expandafter\eh@saveclearallhooks
+\the\output
+\eh@restoreallhooks
+}%
+}%
+}
+\ProcessOptions\relax
\RequirePackage{etoolbox}
\def\eh@definehook#1#2{%
\cslet{eh@every#1}#2%
@@ -99,29 +108,78 @@
{\eh@popposthook#1{#2\eh@hookseparator#3}\eh@hookseparator#4\eh@hookend}%
}
\def\eh@sentinel{\eh@sentinel}
+\def\eh@clearhook#1{%
+\global\csdef{eh@#1}{}%
+}
\newrobustcmd\ClearPreHook[1]{%
\eh@checkhook{#1}\ClearPreHook
-\global\csdef{eh@pre#1}{}%
+\eh@clearhook{pre#1}%
}
\newrobustcmd\ClearPostHook[1]{%
\eh@checkhook{#1}\ClearPostHook
-\global\csdef{eh@post#1}{}%
+\eh@clearhook{post#1}%
+}
+\def\eh@savehook#1#2{%
+\letcs#2{eh@#1}%
+}
+\def\eh@restorehook#1#2{%
+\global\cslet{eh@#1}#2%
}
\newrobustcmd\SavePreHook[2]{%
\eh@checkhook{#1}\SavePreHook
-\letcs#2{eh@pre#1}%
+\eh@savehook{pre#1}#2%
}
\newrobustcmd\SavePostHook[2]{%
\eh@checkhook{#1}\SavePostHook
-\letcs#2{eh@post#1}%
+\eh@savehook{post#1}#2%
}
\newrobustcmd\RestorePreHook[2]{%
\eh@checkhook{#1}\RestorePreHook
-\global\cslet{eh@pre#1}#2%
+\eh@restorehook{pre#1}#2%
}
\newrobustcmd\RestorePostHook[2]{%
\eh@checkhook{#1}\RestorePostHook
-\global\cslet{eh@post#1}#2%
+\eh@restorehook{post#1}#2%
+}
+\def\eh@saveclearallhooks{%
+\global\eh@savehook{prepar}\eh@or@prepar
+\global\eh@savehook{postpar}\eh@or@postpar
+\global\eh@savehook{premath}\eh@or@premath
+\global\eh@savehook{postmath}\eh@or@postmath
+\global\eh@savehook{predisplay}\eh@or@predisplay
+\global\eh@savehook{postdisplay}\eh@or@postdisplay
+\global\eh@savehook{prehbox}\eh@or@prehbox
+\global\eh@savehook{posthbox}\eh@or@posthbox
+\global\eh@savehook{prevbox}\eh@or@prevbox
+\global\eh@savehook{postvbox}\eh@or@postvbox
+\global\eh@savehook{precr}\eh@or@precr
+\global\eh@savehook{postcr}\eh@or@postcr
+\eh@clearhook{prepar}%
+\eh@clearhook{postpar}%
+\eh@clearhook{premath}%
+\eh@clearhook{postmath}%
+\eh@clearhook{predisplay}%
+\eh@clearhook{postdisplay}%
+\eh@clearhook{prehbox}%
+\eh@clearhook{posthbox}%
+\eh@clearhook{prevbox}%
+\eh@clearhook{postvbox}%
+\eh@clearhook{precr}%
+\eh@clearhook{postcr}%
+}
+\def\eh@restoreallhooks{%
+\eh@restorehook{prepar}\eh@or@prepar
+\eh@restorehook{postpar}\eh@or@postpar
+\eh@restorehook{premath}\eh@or@premath
+\eh@restorehook{postmath}\eh@or@postmath
+\eh@restorehook{predisplay}\eh@or@predisplay
+\eh@restorehook{postdisplay}\eh@or@postdisplay
+\eh@restorehook{prehbox}\eh@or@prehbox
+\eh@restorehook{posthbox}\eh@or@posthbox
+\eh@restorehook{prevbox}\eh@or@prevbox
+\eh@restorehook{postvbox}\eh@or@postvbox
+\eh@restorehook{precr}\eh@or@precr
+\eh@restorehook{postcr}\eh@or@postcr
}
\endinput
%%