I'm trying to do a presentation doing a Beamer template.
I've loaded the following packages:
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{bm}
\usepackage{mathtools}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
Everything else is according to the template with minor changes like instead \date{\today} I put \date{June 20, 2016}, or instead of \frametitle{Overview} I put \frametitle{Sumário}.
I'm trying to compile this with texmaker, but I get the following error:
! LaTeX Error: Command `\mathbf' already defined.See the LaTeX manual or LaTeX Companion for explanation.Type H <return> for immediate help....
I've yet to use that command in the presentation, and the line texmaker indicates as the beginning of problematic section is right at the start, i.e. \begin{document}
I know that if I comment out the bm package the problem goes away, but I've used this combination of packages in documents before without any problem.
Why is this happening?
Any help would be appreciated.

beamer,bmandlmodern. For example\documentclass{beamer} \usepackage{bm} \usepackage{lmodern} \begin{document} s \end{document}will produce the error, swapping the order ofbmandlmodernand the error goes away. – Torbjørn T. Jun 12 '16 at 09:51\usepackage{lmodern}? – egreg Jun 12 '16 at 10:15lmodernto do with accented letters? – egreg Jun 12 '16 at 13:51beamer, remember. However, the advice is misleading. Anyway, loading the packages in different order solves the issue: loadbmlast. I suggest the orderinputenc,fontenc,babelif needed,lmodern,mathtoolsand finallybm. – egreg Jun 12 '16 at 13:57