summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/oberdiek/letltxmacro.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/oberdiek/letltxmacro.sty')
-rw-r--r--Master/texmf-dist/tex/latex/oberdiek/letltxmacro.sty98
1 files changed, 61 insertions, 37 deletions
diff --git a/Master/texmf-dist/tex/latex/oberdiek/letltxmacro.sty b/Master/texmf-dist/tex/latex/oberdiek/letltxmacro.sty
index 744be21d84e..3a5ddaddbce 100644
--- a/Master/texmf-dist/tex/latex/oberdiek/letltxmacro.sty
+++ b/Master/texmf-dist/tex/latex/oberdiek/letltxmacro.sty
@@ -8,7 +8,7 @@
%%
%% This is a generated file.
%%
-%% Copyright (C) 2008 by
+%% Copyright (C) 2008, 2010 by
%% Heiko Oberdiek <heiko.oberdiek at googlemail.com>
%%
%% This work may be distributed and/or modified under the
@@ -31,28 +31,37 @@
%% letltxmacro-showcases.tex, letltxmacro-test1.tex,
%% letltxmacro-test2.tex.
%%
-\begingroup
- \catcode123 1 % {
- \catcode125 2 % }
+\begingroup\catcode61\catcode48\catcode32=10\relax%
+ \catcode13=5 % ^^M
+ \endlinechar=13 %
+ \catcode123=1 % {
+ \catcode125=2 % }
+ \catcode64=11 % @
\def\x{\endgroup
\expandafter\edef\csname llm@AtEnd\endcsname{%
- \catcode35 \the\catcode35\relax
- \catcode64 \the\catcode64\relax
- \catcode123 \the\catcode123\relax
- \catcode125 \the\catcode125\relax
+ \endlinechar=\the\endlinechar\relax
+ \catcode13=\the\catcode13\relax
+ \catcode32=\the\catcode32\relax
+ \catcode35=\the\catcode35\relax
+ \catcode61=\the\catcode61\relax
+ \catcode64=\the\catcode64\relax
+ \catcode123=\the\catcode123\relax
+ \catcode125=\the\catcode125\relax
}%
}%
-\x
-\catcode35 6 % #
-\catcode64 11 % @
-\catcode123 1 % {
-\catcode125 2 % }
+\x\catcode61\catcode48\catcode32=10\relax%
+\catcode13=5 % ^^M
+\endlinechar=13 %
+\catcode35=6 % #
+\catcode64=11 % @
+\catcode123=1 % {
+\catcode125=2 % }
\def\TMP@EnsureCode#1#2{%
\edef\llm@AtEnd{%
\llm@AtEnd
- \catcode#1 \the\catcode#1\relax
+ \catcode#1=\the\catcode#1\relax
}%
- \catcode#1 #2\relax
+ \catcode#1=#2\relax
}
\TMP@EnsureCode{40}{12}% (
\TMP@EnsureCode{41}{12}% )
@@ -61,39 +70,51 @@
\TMP@EnsureCode{46}{12}% .
\TMP@EnsureCode{47}{12}% /
\TMP@EnsureCode{58}{12}% :
-\TMP@EnsureCode{61}{12}% =
\TMP@EnsureCode{62}{12}% >
+\TMP@EnsureCode{91}{12}% [
+\TMP@EnsureCode{93}{12}% ]
\edef\llm@AtEnd{%
\llm@AtEnd
\escapechar\the\escapechar\relax
+ \noexpand\endinput
}
\escapechar=92 % `\\
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{letltxmacro}%
- [2008/06/24 v1.3 Let assignment for LaTeX macros (HO)]
-\newcommand*{\LetLtxMacro}[2]{%
+ [2010/09/02 v1.4 Let assignment for LaTeX macros (HO)]
+\newcommand*{\LetLtxMacro}{%
+ \llm@ModeLetLtxMacro{}%
+}
+\newcommand*{\GlobalLetLtxMacro}{%
+ \llm@ModeLetLtxMacro\global
+}
+\newcommand*{\llm@ModeLetLtxMacro}[3]{%
+ \edef\llm@escapechar{\the\escapechar}%
+ \escapechar=-1 %
\edef\reserved@a{%
\noexpand\protect
\expandafter\noexpand
- \csname\expandafter\@gobble\string#2 \endcsname
+ \csname\string#3 \endcsname
}%
- \ifx\reserved@a#2\relax
- \edef#1{%
+ \ifx\reserved@a#3\relax
+ #1\edef#2{%
\noexpand\protect
\expandafter\noexpand
- \csname\expandafter\@gobble\string#1 \endcsname
+ \csname\string#2 \endcsname
}%
- \expandafter\let
- \csname\expandafter\@gobble\string#1 \expandafter\endcsname
- \csname\expandafter\@gobble\string#2 \endcsname
+ #1\expandafter\let
+ \csname\string#2 \expandafter\endcsname
+ \csname\string#3 \endcsname
\expandafter\llm@LetLtxMacro
- \csname\expandafter\@gobble\string#1 \expandafter\endcsname
- \csname\expandafter\@gobble\string#2 \endcsname
+ \csname\string#2 \expandafter\endcsname
+ \csname\string#3 \endcsname{#1}%
\else
- \llm@LetLtxMacro{#1}{#2}%
+ \llm@LetLtxMacro{#2}{#3}{#1}%
\fi
+ \escapechar=\llm@escapechar\relax
}
-\def\llm@LetLtxMacro#1#2{%
+\def\llm@LetLtxMacro#1#2#3{%
+ \escapechar=92 %
\expandafter\llm@CheckParams\meaning#2:->\@nil{%
\begingroup
\def\@protected@testopt{%
@@ -122,7 +143,8 @@
\else
\edef\x{%
\noexpand\@testopt
- \expandafter\noexpand\csname\string#2\endcsname
+ \expandafter\noexpand
+ \csname\string#2\endcsname
}%
\expandafter\expandafter\expandafter\def
\expandafter\expandafter\expandafter\y
@@ -140,19 +162,21 @@
\else
\llm@protected\xdef\llm@GlobalTemp{%
\llm@testopt
- \expandafter\noexpand\csname\string#1\endcsname
+ \expandafter\noexpand
+ \csname\string#1\endcsname
{\the\toks@}%
}%
\fi
\expandafter\endgroup\ifx\llm@testopt\@empty
- \let#1=#2\relax
+ #3\let#1=#2\relax
\else
- \let#1=\llm@GlobalTemp
- \expandafter\let\csname\string#1\expandafter\endcsname
- \csname\string#2\endcsname
+ #3\let#1=\llm@GlobalTemp
+ #3\expandafter\let
+ \csname\string#1\expandafter\endcsname
+ \csname\string#2\endcsname
\fi
}{%
- \let#1=#2\relax
+ #3\let#1=#2\relax
}%
}
\def\llm@CheckParams#1:->#2\@nil{%
@@ -179,7 +203,7 @@
\@onelevel@sanitize\llm@protectedmacro
\def\llm@CarThree#1#2#3#4\llm@nil{#1#2#3}%
\def\llm@CarTwo#1#2#3\llm@nil{#1#2}%
-\llm@AtEnd
+\llm@AtEnd%
\endinput
%%
%% End of file `letltxmacro.sty'.