From e470e032d162d488eb329c579dcf4d042883b898 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 11 Jun 2008 13:43:22 +0000 Subject: oberdiek update (10jun08) git-svn-id: svn://tug.org/texlive/trunk@8673 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/latex/oberdiek/letltxmacro.sty | 139 +++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/oberdiek/letltxmacro.sty (limited to 'Master/texmf-dist/tex/latex/oberdiek') diff --git a/Master/texmf-dist/tex/latex/oberdiek/letltxmacro.sty b/Master/texmf-dist/tex/latex/oberdiek/letltxmacro.sty new file mode 100644 index 00000000000..380586612a8 --- /dev/null +++ b/Master/texmf-dist/tex/latex/oberdiek/letltxmacro.sty @@ -0,0 +1,139 @@ +%% +%% This is file `letltxmacro.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% letltxmacro.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright (C) 2008 by Heiko Oberdiek +%% +%% 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 +%% and version 1.3 or later is part of all distributions of +%% LaTeX version 2005/12/01 or later. +%% +%% This work has the LPPL maintenance status "maintained". +%% +%% This Current Maintainer of this work is Heiko Oberdiek. +%% +%% 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. +%% +\begingroup + \catcode123 1 % { + \catcode125 2 % } + \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 + }% + }% +\x +\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 #2\relax +} +\TMP@EnsureCode{40}{12}% ( +\TMP@EnsureCode{41}{12}% ) +\TMP@EnsureCode{42}{12}% * +\TMP@EnsureCode{45}{12}% - +\TMP@EnsureCode{46}{12}% . +\TMP@EnsureCode{47}{12}% / +\TMP@EnsureCode{58}{12}% : +\TMP@EnsureCode{61}{12}% = +\TMP@EnsureCode{62}{12}% > +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{letltxmacro}% + [2008/06/09 v1.0 Let assignment for LaTeX macros (HO)] +\newcommand*{\LetLtxMacro}[2]{% + \edef\reserved@a{% + \noexpand\protect + \expandafter\noexpand + \csname\expandafter\@gobble\string#2 \endcsname + }% + \ifx\reserved@a#2\relax + \edef#1{% + \noexpand\protect + \expandafter\noexpand + \csname\expandafter\@gobble\string#1 \endcsname + }% + \expandafter\let + \csname\expandafter\@gobble\string#1 \expandafter\endcsname + \csname\expandafter\@gobble\string#2 \endcsname + \expandafter\llm@LetLtxMacro + \csname\expandafter\@gobble\string#1 \expandafter\endcsname + \csname\expandafter\@gobble\string#2 \endcsname + \else + \llm@LetLtxMacro{#1}{#2}% + \fi +} +\def\llm@LetLtxMacro#1#2{% + \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 + }% + \expandafter\endgroup\ifx\x\y + \begingroup + \def\@protected@testopt##1##2##3{% + \toks@={##3}% + \xdef\llm@GlobalTemp{% + \noexpand\@protected@testopt + \noexpand#1% + \expandafter\noexpand\csname\string#1\endcsname + {\the\toks@}% + }% + }% + #2% + \endgroup + \let#1=\llm@GlobalTemp + \expandafter\let\csname\string#1\expandafter\endcsname + \csname\string#2\endcsname + \else + \let#1=#2\relax + \fi + }{% + \let#1=#2\relax + }% +} +\def\llm@CheckParams#1#2#3#4#5#6#7#8#9\@nil{% + \begingroup + \def\x{#1#2#3#4#5#6#7#8}% + \@onelevel@sanitize\x + \expandafter\endgroup\ifx\x\llm@macro + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} +\def\llm@macro{macro:->} +\@onelevel@sanitize\llm@macro +\def\llm@CarThree#1#2#3#4\llm@nil{#1#2#3}% +\llm@AtEnd +\endinput +%% +%% End of file `letltxmacro.sty'. -- cgit v1.2.3