# How to use latex package emaxima in emacs

I am trying to use maxima with emaxima package in latex. I am using xubuntu 20.04, emacs 26.3, maxima 5.43.2. Here is my simple latex file.

\documentclass[11pt,a4paper]{article}
\usepackage[lines]{emaxima}
\begin{document}
\begin{maxima}
diff(sin(x^2),x);
\end{maxima}
\end{document}


It compiles giving me a nicely formated maxima cell but does not run maxima on the cell.

I could not find the emaxima command to update cell, which according to an old maxima book is:

C-c C-u c (emaxima-update-cell)

I also tried inside the cell to change the mode to maxima-mode and evaluated the code block, but the maxima interpreter starts in another window, and the solution is displayed there.

I would like it to be included right after the maxima cell. This used to work many years ago, and I have used it. But now does not seem to work. I have the following lines in my init.el, but I am not sure if they are relevant.

(add-to-list 'load-path "/usr/share/emacs/site-lisp/maxima/")
(autoload 'maxima-mode "maxima" "Maxima mode" t)
(autoload 'imaxima "imaxima" "Frontend for maxima with Image support" t)
(autoload 'maxima "maxima" "Maxima interaction" t)
(autoload 'imath-mode "imath" "Imath mode for math formula input" t)
(setq imaxima-use-maxima-mode-flag t)

Have you tried changing the mode to emaxima-mode? You may need to M-: (require 'emaxima) RET first. Note that this doesn't work for me as it complains about missing tex-site package but you might have that installed (or may be willing to install).