summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/interfaces/interfaces-etoolbox.sty
blob: 6da5d77020e838965d2377b464eef5c3f6fef367 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
%%
%% This is file `interfaces-etoolbox.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% interfaces.dtx  (with options: `etoolbox')
%% 
%% This is a generated file.
%% 
%% interfaces : 2010/11/26 v2.4 - interfaces : interfaces with keys for other packages (FC)
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3 of this license or (at your option) any later
%% version. The latest version of this license is in
%%    http://www.latex-project.org/lppl.txt
%% 
%% This work consists of the main source file interfaces.dtx
%% and the derived files
%%     interfaces.sty, interfaces.pdf, interfaces.ins,
%%     interfaces-base.sty,
%%     interfaces-LaTeX.sty,
%%     interfaces-tikz.sty,
%%     interfaces-titlesec.sty,
%%     interfaces-hyperref.sty,
%%     interfaces-bookmark.sty,
%%     interfaces-hypbmsec.sty,interfaces-hypbmsec.code.tex,
%%     interfaces-fancyhdr.sty,
%%     interfaces-marks.sty,
%%     interfaces-tocloft.sty,
%%     interfaces-makecell.sty,
%%     interfaces-enumitem.sty,
%%     interfaces-truncate.sty,
%%     interfaces-appendix.sty,
%%     interfaces-embedfile.sty,
%%     interfaces-environ.sty,
%%     interfaces-umrand.sty,
%%     interfaces-scrlfile.sty,
%%     interfaces-pgfkeys.sty,
%%     interfaces-etoolbox.sty
%% 
%% interfaces: interfaces with keys for other packages (FC)
%% Copyright (C) 2010 by Florent Chervet <florent.chervet@free.fr>
%% 
\ProvidesPackage{interfaces-etoolbox}
   [2010/10/27 v1.2 some more etoolbox-like commands (FC)]
\RequirePackage{interfaces-base}
\begingroup\catcode`\&=3
   \long\gdef\etb@doitem#1&{\do{#1}}
\endgroup
\providerobustcmd\preappto[3]{%
   \edef#1{\unexpanded{#2}\ifdefined#1\expandonce#1\fi\unexpanded{#3}}%
}% \preappto
\providerobustcmd\epreappto[3]{%
   \edef#1{#2\ifdefined#1\expandonce#1\fi#3}%
}% \epreappto
\providerobustcmd*\gpreappto{\global\preappto}
\providerobustcmd*\xpreappto{\global\epreappto}
\providerobustcmd*\cspreappto[1]{%
   \csname itf@\ifcsname#1\endcsname
      preappto\else defpreapp\fi\expandafter\endcsname
                           \csname#1\endcsname
}% \cspreappto
\long\def\itf@preappto#1#2#3{\edef#1{#2\expandonce#1#3}}
\long\def\itf@defpreapp#1#2#3{\edef#1{#2#3}}
\providerobustcmd*\csepreappto[1]{%
   \csname itf@\ifcsname#1\endcsname
      preappto\else defpreapp\fi\expandafter\endcsname
                           \csname#1\endcsname
}% \csepreappto
\providerobustcmd*\csgpreappto{\global\cspreappto}
\providerobustcmd*\csxpreappto{\global\csepreappto}
%%----------------------------------------------------------------------------
\providerobustcmd\removefrom[2]{\in@false
   \long\def\itf@tp##1\itf@tp{%
      \in@true
      \edef#1{\unexpanded{##1}}%
   }\expandafter\itf@removefrom\expandafter{#1}{#2}%
}% \removefrom
\providerobustcmd\eremovefrom[2]{\begingroup
   \edef\x{\endgroup\removefrom\noexpand#1{#2}%
   }\x
}% \eremovefrom
\providerobustcmd\gremovefrom[2]{%
   \removefrom{#1}{#2}%
   \global\let#1=#1%
}% \gremovefrom
\providerobustcmd\xremovefrom[2]{%
   \eremovefrom{#1}{#2}%
   \global\let#1=#1%
}% \xremovefrom
\long\def\itf@removefrom#1#2{% removes #2 (code) from #1 (hook)
   \def\in@@##1#2##2\in@@{\itf@tp##1##2\in@@@}%
   \def\in@@@##1\in@@@##2\in@@@{%
      \ifx\in@##2\else##1\fi
   }\expandafter\in@@@\in@@#1\itf@tp\in@@@#2\in@\in@@
}% \itf@removefrom
\newrobustcmd\removefromstart[2]{\in@false
   \long\def\itf@tp##1\itf@tp{%
      \in@true
      \edef#1{\unexpanded{##1}}%
   }\expandafter\itf@removefromstart\expandafter{#1}{#2}%
}% \removefromstart
\providerobustcmd\eremovefromstart[2]{\begingroup
   \edef\x{\endgroup\removefromstart\noexpand#1{#2}%
   }\x
}% \eremovefromstart
\providerobustcmd\gremovefromstart[2]{%
   \removefromstart{#1}{#2}%
   \global\let#1=#1%
}% \gremovefromstart
\providerobustcmd\xremovefromstart[2]{%
   \eremovefromstart{#1}{#2}%
   \global\let#1=#1%
}% \xremovefromstart
\long\def\itf@removefromstart#1#2{% removes #2 (code) from #1 (hook)
   \long\def\in@@##1#2##2\in@@{##1\in@\itf@tp##2\in@@@}%
   \long\def\in@@@##1\in@@@##2\in@@@{%
      \ifx\in@##1\fi
   }\expandafter\in@@@\in@@#1\itf@tp\in@@@#2\in@@
}% \itf@removefromstart
\endinput
%%
%% End of file `interfaces-etoolbox.sty'.