imaxima in emacs



Hello,

My problem (and solution) is related to imaxima, but I guess the userbase for 
this program is a subset of the maxima users. I recently installed maxima, 
imaxima , breqn (all included in maxima 5.16.3) and did all the stuff to get 
maxima working 'latex style' in emacs. On my laptop this was no problem. 
However, on my pc I had some problems. Maxima works fine in emacs, but when I 
switch to imaxima and type something,

(%i1) 2;

I get the error message:

Latex error in 2

It turns out that the generated latex code is not complete. The generated 
latex code is:

\documentclass[11pt,leqno]{article}
% mylatex
\setlength{\textwidth}{178mm}
\begin{document}
\pagecolor[rgb]{0.996109,0.996109,0.996109}\pagestyle{empty}
\begin{normalsize}
\color[rgb]{1.000000,0.000000,0.000000}\tt\begin{dmath}[number={\%o2}]
\color[rgb]{0.000000,0.000000,0.000000}3\end{dmath}
\end{normalsize}
\end{document}

but it does not recognize pagecolor or dmath. What is missing (at least)
is 
\usepackage{breqn}
\usepackage{color}

After inserting this in the imaxima.el  (I don't know anything about lisp, 
btw) file above the %mylatex comment:
...
     "\\usepackage{color} \n"
     "\\usepackage{breqn} \n"
     "\n% mylatex \n"

the latex rendering  in emacs worked fine. 

Did other people experience this problem? 

Regards,
nijso