From f2c008c2e12ec6d67d8ce88415336a1e7fe3a21a Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 29 Jun 2018 18:51:03 +0200 Subject: [PATCH] Added \sget --- ucwmac2.tex | 9 +++++++++ 1 file changed, 9 insertions(+) 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}}} -- 2.39.2