diff options
author | Karl Berry <karl@freefriends.org> | 2008-06-13 18:32:35 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-06-13 18:32:35 +0000 |
commit | cae42cea81a373da3e7a43470fa394581d3c9db9 (patch) | |
tree | bf624205e4ac1065f5b854c9151261d09cbd6f5d /Master/texmf-dist/tex | |
parent | 95baa29ba9f6fec032f18e232d89175be47f869f (diff) |
oberdiek update (13jun08)
git-svn-id: svn://tug.org/texlive/trunk@8716 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/oberdiek/letltxmacro.sty | 75 |
1 files changed, 56 insertions, 19 deletions
diff --git a/Master/texmf-dist/tex/latex/oberdiek/letltxmacro.sty b/Master/texmf-dist/tex/latex/oberdiek/letltxmacro.sty index 380586612a8..f247981c1c2 100644 --- a/Master/texmf-dist/tex/latex/oberdiek/letltxmacro.sty +++ b/Master/texmf-dist/tex/latex/oberdiek/letltxmacro.sty @@ -25,7 +25,8 @@ %% This work consists of the main source file letltxmacro.dtx %% and the derived files %% letltxmacro.sty, letltxmacro.pdf, letltxmacro.ins, letltxmacro.drv, -%% letltxmacro-test1.tex, letltxmacro-test2.tex. +%% letltxmacro-showcases.tex, letltxmacro-test1.tex, +%% letltxmacro-test2.tex. %% \begingroup \catcode123 1 % { @@ -59,9 +60,14 @@ \TMP@EnsureCode{58}{12}% : \TMP@EnsureCode{61}{12}% = \TMP@EnsureCode{62}{12}% > +\edef\llm@AtEnd{% + \llm@AtEnd + \escapechar\the\escapechar\relax +} +\escapechar=92 % `\\ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{letltxmacro}% - [2008/06/09 v1.0 Let assignment for LaTeX macros (HO)] + [2008/06/12 v1.1 Let assignment for LaTeX macros (HO)] \newcommand*{\LetLtxMacro}[2]{% \edef\reserved@a{% \noexpand\protect @@ -85,18 +91,30 @@ \fi } \def\llm@LetLtxMacro#1#2{% - \expandafter\llm@CheckParams\meaning#2{}{}{}{}{}{}{}{}\@nil{% + \expandafter\llm@CheckParams\meaning#2:->\@nil{% \begingroup - \edef\x{% - \noexpand\@protected@testopt - \noexpand#2% - \expandafter\noexpand\csname\string#2\endcsname - }% - \expandafter\expandafter\expandafter\def - \expandafter\expandafter\expandafter\y - \expandafter\expandafter\expandafter{% - \expandafter\llm@CarThree#2{}{}{}\llm@nil - }% + \ifx\llm@protected\@empty + \edef\x{% + \noexpand\@protected@testopt + \noexpand#2% + \expandafter\noexpand\csname\string#2\endcsname + }% + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter\y + \expandafter\expandafter\expandafter{% + \expandafter\llm@CarThree#2{}{}{}\llm@nil + }% + \else + \edef\x{% + \noexpand\@testopt + \expandafter\noexpand\csname\string#2\endcsname + }% + \expandafter\expandafter\expandafter\def + \expandafter\expandafter\expandafter\y + \expandafter\expandafter\expandafter{% + \expandafter\llm@CarTwo#2{}{}\llm@nil + }% + \fi \expandafter\endgroup\ifx\x\y \begingroup \def\@protected@testopt##1##2##3{% @@ -108,6 +126,14 @@ {\the\toks@}% }% }% + \def\@testopt##1##2{% + \toks@={##2}% + \protected\xdef\llm@GlobalTemp{% + \noexpand\@testopt + \expandafter\noexpand\csname\string#1\endcsname + {\the\toks@}% + }% + }% #2% \endgroup \let#1=\llm@GlobalTemp @@ -120,19 +146,30 @@ \let#1=#2\relax }% } -\def\llm@CheckParams#1#2#3#4#5#6#7#8#9\@nil{% +\def\llm@CheckParams#1:->#2\@nil{% \begingroup - \def\x{#1#2#3#4#5#6#7#8}% - \@onelevel@sanitize\x - \expandafter\endgroup\ifx\x\llm@macro + \def\x{#1}% + \ifx\x\llm@macro + \endgroup + \def\llm@protected{}% \expandafter\@firstoftwo \else - \expandafter\@secondoftwo + \ifx\x\llm@protectedmacro + \endgroup + \def\llm@protected{\protected}% + \expandafter\expandafter\expandafter\@firstoftwo + \else + \endgroup + \expandafter\expandafter\expandafter\@secondoftwo + \fi \fi } -\def\llm@macro{macro:->} +\def\llm@macro{macro} \@onelevel@sanitize\llm@macro +\def\llm@protectedmacro{\protected macro} +\@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 \endinput %% |