]> mj.ucw.cz Git - ucwmac.git/commitdiff
Added \addprotected
authorMartin Mares <mj@ucw.cz>
Fri, 22 Jun 2018 10:09:12 +0000 (12:09 +0200)
committerMartin Mares <mj@ucw.cz>
Fri, 22 Jun 2018 10:09:12 +0000 (12:09 +0200)
ucwmac.tex

index ea292d730e5534abcf988e2fa8cd6171d571a56b..d73247d13f0d465dfd1a777b26078f9b3871b9ac 100644 (file)
 \def\sdef#1{\expandafter\def\csname#1\endcsname}
 \def\slet#1#2{\expandafter\let\csname#1\expandafter\endcsname\csname#2\endcsname}
 
+% Add \protected to an existing macro
+\def\addprotected#1{\protected\edef#1{\expandafter\unexpanded\expandafter{#1}}}
+
+% Protect ~
+\addprotected~
+
 \def\ucwwarn#1{\immediate\write16{*** Warning: #1 ***}}
 
 %%% Page size and margins %%%
 % \putimage{width specification}{file}
 \def\putimage#1#2{\hbox{\pdfximage #1{#2}\pdfrefximage\pdflastximage}}
 
-% Let ~ be protected
-\let\plaintilde=~
-\protected\def~{\plaintilde}
-
 %%% Colors %%%
 
 % Use of pdfTeX color stack: