[Tex/LaTex] \mathbbm in exponent of equation

equationssymbols

I am trying to put a blackboard 1 (indicator function; I'm using the bbm package) in the exponent of an equation, something like

\begin{align*}
  f(x) = \mathbbm{1}(x = 1) \\  % works
  p(x) = q^{\mathbbm{1}(x = 1)} % does not work
\end{align*}

I've also tried putting in a \protect before \mathbbm, to no avail. The error is

dfTeX error: /usr/local/texlive/bin/i386-linux/pdflatex (file bbm8): Font bbm8 at 600 not found

EDIT: As several kind commenters have pointed out, this code compiles in isolation. I have determined that the source of problem is likely something in my style file since changing the document class to book works just fine.
Any pointers of what to look for in the .cls file?

Best Answer

Load the bbm package.

\documentclass{article}
\usepackage{bbm}
\begin{document}
\[p(x) = q^{\mathbbm{1}(x = 1)}\]
\end{document}

output