| 1 |
|
| 2 |
Conflict Resolver <noconflict.sty> |
| 3 |
Resolves Macro Name Conflict among Packages |
| 4 |
Copyright 2013 M. Zahid Hossain |
| 5 |
|
| 6 |
This package resolves macro name conflict among packages with concise |
| 7 |
approaches and user-friendly syntaxes. |
| 8 |
|
| 9 |
This program may be distributed and/or modified under the conditions |
| 10 |
of the LaTeX Project Public License, either version 1.2 of this |
| 11 |
license or (at your option) any later version. |
| 12 |
|
| 13 |
A macro name can be defined by many packages. In LaTeX, macro name need |
| 14 |
to be unique for a document and thus using the packages with same macro |
| 15 |
name causes conflict among them. In order to avoid macro name conflict |
| 16 |
this package defines several commands to save, restore and rename macros |
| 17 |
defined by other packages. |
| 18 |
|
| 19 |
PACKAGE COMMANDS |
| 20 |
================ |
| 21 |
|
| 22 |
\prefix{<prefix added to the macro name>} |
| 23 |
\save{<prefix added to the macro name>} |
| 24 |
{<comma separated list of macro name>} |
| 25 |
\save*{<comma separated list of macro name>} |
| 26 |
\restore{<prefix added to the macro name>} |
| 27 |
\restore* |
| 28 |
\reinstate{<prefix added to the macro name>} |
| 29 |
{<comma separated partial list of macro name>} |
| 30 |
\rename{<old name>}{<new name>} |
| 31 |
|
| 32 |
|
| 33 |
USAGE EXAMPLE |
| 34 |
============= |
| 35 |
|
| 36 |
If package A, B and C define three macro names X, Y and Z. To avoid macro |
| 37 |
name conflict: |
| 38 |
|
| 39 |
\usepackage{noconflict} |
| 40 |
\usepackage{A} |
| 41 |
\prefix{First} is optional |
| 42 |
\save{X,Y,Z} |
| 43 |
|
| 44 |
\usepackage{B} |
| 45 |
\save{Second}{X,Y,Z} |
| 46 |
The above line can also be written as: \prefix{Second} and \save*{X,Y,Z} |
| 47 |
|
| 48 |
\usepackage{C} |
| 49 |
\save{Third}{X,Y,Z} |
| 50 |
|
| 51 |
Now macro X, Y and Z of |
| 52 |
Package A: \FirstX, \FirstY, \FirstZ |
| 53 |
Package B: \SecondX, \SecondY, \SecondZ |
| 54 |
Package C: \ThirdX, \ThirdY, \ThirdZ |
| 55 |
|
| 56 |
\restore{First} |
| 57 |
Macros \FirstX, \FirstY and \FirstZ become \X, \Y and \Z |
| 58 |
\restore{Second} |
| 59 |
The above line can also be written as: \prefix{Second} and \restore* |
| 60 |
The above line can also be written as: \reinstate{Second}{X,Y,Z} |
| 61 |
Macros \SecondX, \SecondY and \SecondZ become \X, \Y and \Z |
| 62 |
\restore{Third} |
| 63 |
Macros \ThirdX, \ThirdY and \ThirdZ become \X, \Y and \Z |
| 64 |
\rename{X}{CofX} |
| 65 |
Macro \X becomes \CofX |