summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/savesym
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/savesym
Initial commit
Diffstat (limited to 'macros/latex/contrib/savesym')
-rw-r--r--macros/latex/contrib/savesym/savesym.sty53
1 files changed, 53 insertions, 0 deletions
diff --git a/macros/latex/contrib/savesym/savesym.sty b/macros/latex/contrib/savesym/savesym.sty
new file mode 100644
index 0000000000..b5691b9877
--- /dev/null
+++ b/macros/latex/contrib/savesym/savesym.sty
@@ -0,0 +1,53 @@
+% The following package was originally pinched (with permission) from
+% similar makros in symbols.tex, written by Scott Pakin <pakin@uiuc.edu>.
+% The following explanation was also taken from symbols.tex.
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% There are a number of symbols (e.g., \Square) that are defined by %
+% multiple packages. In order to typeset all the variants in this %
+% document, we have to give glyph a unique name. To do that, we define %
+% \savesymbol{XXX}, which renames a symbol from \XXX to \origXXX, and %
+% \restoresymbols{yyy}{XXX}, which renames \origXXX back to \XXX and %
+% defines a new command, \yyyXXX, which corresponds to the most recently %
+% loaded version of \XXX. %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% The implementation of \savesymbol and \restoresymbol was changed by
+% Heiko Oberdiek <oberdiek@uni-freiburg.de>
+% and
+% Rolf Niepraschk <rolf.niepraschk@ptb.de>
+% in May 2003. Thank you!
+%
+% Copyright 2003-2013 Juergen Goebel, <savesym-latex@t-online.de>
+% distributable under the LPPL
+%
+% Change history
+%
+% v1.1 2013/06/01
+% first edition on CTAN
+%
+% v1.2 2013/09/02
+% changed \ProvidesPackage{savesymbol} to \ProvidesPackage{savesym}
+% according to package name
+% changed mail address of maintainer
+
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{savesym}[2013/09/02 v1.2 Saves and restores symbols (JG)]
+
+% Save a symbol that we know is going to get redefined.
+\newcommand*\savesymbol[1]{%
+ \expandafter\let\csname orig#1\expandafter\endcsname\csname#1\endcsname
+ \expandafter\let\csname #1\endcsname\relax
+}
+
+% Restore a previously saved symbol, and rename the current one.
+\newcommand*\restoresymbol[2]{%
+ \expandafter\global\expandafter\let\csname#1#2\expandafter\endcsname%
+ \csname#2\endcsname
+ \expandafter\global\expandafter\let\csname#2\expandafter\endcsname%
+ \csname orig#2\endcsname
+}
+
+\endinput
+
+% EOF EOF EOF EOF EOF EOF EOF EOF EOF EOF EOF EOF EOF EOF EOF EOF EOF