[Tex/LaTex] error command \iint already defined

errors

I constantly receive this message, but I do not use the amsmath package.

/usr/local/texlive/2018/texmf-dist/tex/latex/amsmath/amsmath.sty, line 645

LaTeX Error: Command \iint already defined.

Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
...                                              
                                              
l.645 ...d{\iint}{\DOTSI\protect\MultiIntegral{2}}
                                              
Your command was ignored.
Type  I <command> <return>  to replace it with another command,
or  <return>  to continue without it.

This is my preamble:

\documentclass[a4paper, 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[top=3cm, bottom=2cm, left=3cm, right=2cm]{geometry}
\usepackage{times}
\usepackage[onehalfspacing]{setspace}
\usepackage[T1]{fontenc}
\usepackage[brazil]{babel}
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{colortbl}
\usepackage{comment}
\usepackage{enumerate}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{indentfirst}
\usepackage{tocbibind}
\usepackage{booktabs}
\usepackage{subfigure}
\usepackage{tikz}
\usepackage{pxfonts}
\usepackage{cancel}
\usepackage{gensymb}
\usepackage{dsfont}
\usepackage{mathtools}
\usepackage{textcomp}
\usepackage[labelfont=bf]{caption}
\usepackage{longtable}

Best Answer

Your preamble is long and a bit confused. Also contradictory: with \usepackage{times} it makes little sense to load pxfonts that provides Palatino for math (and overrides times).

Here's a reorganized version

\documentclass[a4paper, 12pt]{article}

% page format
\usepackage[top=3cm, bottom=2cm, left=3cm, right=2cm]{geometry}

% character set, language and fonts
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[brazil]{babel}

\usepackage{newpxtext,newpxmath} % better than pxfonts
\usepackage{textcomp}

% spacing and general setup
\usepackage[onehalfspacing]{setspace}
\usepackage{indentfirst}
\usepackage{tocbibind}

% math
\usepackage{mathtools} % also loads amsmath
%\usepackage{gensymb} % probably not necessary
\usepackage{dsfont}
\usepackage{cancel}

% general tools
\usepackage{graphicx}
\usepackage{xcolor}
\usepackage{comment}
\usepackage[labelfont=bf]{caption}
\usepackage{subcaption}
%\usepackage{subfigure}% obsolete!
\usepackage{enumerate} % perhaps better enumitem
\usepackage{multicol}

% graphics
\usepackage{tikz}

% tables
\usepackage{colortbl}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{longtable}

\begin{document}

test

\end{document}

If you decide to load pxfonts notwithstanding its shortcomings, then you need to move the “math” section in front of the “fonts” section.

Be aware that subfigure has been obsolete for a long time. Either load subfig (which has a slightly different syntax, but mainly \subfigure and \subtable are replaced by the generic \subfloat) or the recommended subcaption package.

In any case, try and see what packages you are really using and remove the calls to those that aren't needed.