# How can I use two similar usepackages for many similar commands?

For example I want to use \iint from ams package and also mathabx package in one file together. Actually I want a command that neutralizes ams package effect and replace it with mathabx package effect from here on in my file. Thanks for your responsibility.

This is my example minimal file:

\documentclass[12pt,a4paper]{report}
\usepackage{amsmath}
\usepackage{mathabx}
\begin{document}
i want this one in ams style:
$\iiint\,\iiint\, \iiint\,\oint\,$
text text text text text text text text text text text text
and this one in mathabx style:
$\iiint\,\iiint\, \iiint\,\oint\,$
but both of them are the same and i don't like it .....
\end{document}


You can load the first package, save the \iiint command in another macro, load the second package (which will redefine the command), save the redefined command in a second macro, and then whenever you want to switch you can redefine \iiint to either of the two saved macros. This works if you use \let, which saves the command content at that moment (see What is the difference between \let and \def?).

MWE:

\documentclass[12pt,a4paper]{report}
\usepackage{amsmath}
\let\amsiiint=\iiint
\usepackage{mathabx}
\let\abxiiint=\iiint
\let\iiint\amsiiint
\begin{document}
i want this one in ams style:
$\iiint\,\iiint\, \iiint\,\oint\,$
text text text text text text text text text text text text
and this one in mathabx style:
\let\iiint\abxiiint
$\iiint\,\iiint\, \iiint\,\oint\,$
but both of them are the same and i don't like it .....
\end{document}


Result:

• Thanks a lot my dear Marijn. But this method doesn't work for below situation. Thanks again – SH.Madadpour Dec 17 '17 at 7:51
• \usepackage{amsmath} \let\amssum=\sum \usepackage{mathptmx} \let\ptmxsum=\sum \let\sum\amssum – SH.Madadpour Dec 17 '17 at 9:28
• @SH.Madadpour it does work (at least on my computer). You may also want to add an = sign for consistency \let\sum=\amssum. – user121799 Dec 17 '17 at 17:45
• @ marmot Thanks a lot. I put = . But it doesn't work unfortunately. For amsmath and mathabx package is correct But for amsmath and mathptmx is false. – SH.Madadpour Dec 17 '17 at 19:47