I know this is a common problem, but I searched for a solution and can't find one.
I tried to play with bmmax/hmmax but it does not help.
Below is the minimum part of the code to reproduce the problem.
I would be grateful for any advice/help.
\documentclass[12pt]{article}
\newcommand{\bmmax}{2}
\newcommand{\hmmax}{0}
\usepackage{array,float,epsf,latexsym,psfrag,amssymb,eurosym,theorem,amsmath,verbatim}
\usepackage{graphicx}
\usepackage{amsfonts}
\usepackage{bbm}
\usepackage{mathrsfs}
\usepackage[dvips]{color}
\usepackage[ansinew]{inputenc}
\usepackage{srcltx}
\DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it}
\def\bsf #1{ \mbox{\boldmath $\sf #1$}}
\def\bsfh #1{\widehat {\mbox{\boldmath $\sf #1$}}}
\begin{document}
\begin{equation}
\bsf x ~ \bsfh x
\end{equation}
\end{document}
P.S. I have a 70-pages document which compiles fine but as soon as I delete some first 40 pages with formulas I encounter that error. That's something I can't explain to myself.