summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/macroswap/macroswap.sty
blob: 6d719cde5a02527ec18daa51cd16e76da3ee7a7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
%%
%% This is file `macroswap.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% macroswap.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2013 by Robert J Lee
%% 
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.2 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.2 or later is part of all distributions of
%% LaTeX version 1999/12/01 or later.
%% 
\makeatletter
\newcommand{\gmacroswap}[2]{%
  \edef\macro@swap@left{\csexpandonce{#1}}%
  \edef\macro@swap@right{\csexpandonce{#2}}%
  \expandafter\xdef\csname#2\endcsname{\expandonce{\macro@swap@left}}%
  \expandafter\xdef\csname#1\endcsname{\expandonce{\macro@swap@right}}%
  \let\macroswap@left\relax%
  \let\macroswap@right\relax%
}
\newcommand{\macroswap}[2]{%
  \edef\macro@swap@left{\csexpandonce{#1}}%
  \edef\macro@swap@right{\csexpandonce{#2}}%
  \expandafter\edef\csname#2\endcsname{\expandonce{\macro@swap@left}}%
  \expandafter\edef\csname#1\endcsname{\expandonce{\macro@swap@right}}%
  \let\macroswap@left\relax%
  \let\macroswap@right\relax%
}
\makeatother
\endinput
%%
%% End of file `macroswap.sty'.