\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: