From: Martin Mares Date: Fri, 29 Jun 2018 16:51:03 +0000 (+0200) Subject: Added \sget X-Git-Tag: v1.99~1^2~1 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=f2c008c2e12ec6d67d8ce88415336a1e7fe3a21a;p=ucwmac.git Added \sget --- diff --git a/ucwmac2.tex b/ucwmac2.tex index bd4ffda..624a5ad 100644 --- a/ucwmac2.tex +++ b/ucwmac2.tex @@ -44,6 +44,15 @@ \def\sdef#1{\expandafter\def\csname#1\endcsname} \def\slet#1#2{\expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname} +% Assign a control sequence given as a string, complain if it is not defined. +\def\sget#1#2{\ifcsname#2\endcsname + \expandafter\let\expandafter#1\csname#2\endcsname + \else + \errmessage{Undefined control sequence #2}% + \let#1\relax + \fi +} + % Add \protected to an existing macro \def\addprotected#1{\protected\edef#1{\expandafter\unexpanded\expandafter{#1}}}