4

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} 

ams

mathabx

Mensch
  • 65,388

1 Answers1

2

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:

enter image description here

Marijn
  • 37,699
  • Thanks a lot my dear Marijn. But this method doesn't work for below situation. Thanks again – SH.Madadpour Dec 17 '17 at 07:51
  • \usepackage{amsmath}
    \let\amssum=\sum
    \usepackage{mathptmx}
    \let\ptmxsum=\sum
    \let\sum\amssum
    – SH.Madadpour Dec 17 '17 at 09:28
  • @SH.Madadpour it does work (at least on my computer). You may also want to add an = sign for consistency \let\sum=\amssum. –  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
  • My answer is here: https://tex.stackexchange.com/questions/407129/how-can-i-use-amsmath-package-and-mathptmx-package-together#comment1015293_407129 – SH.Madadpour Dec 21 '17 at 15:23