Incompatibility between the emaxima LaTeX mode and the knitr R package.



Dear Xie, dear list,

In order to add some trace of symbolic computations related to a
statistical problem in the relevant document, created via R and knitr, I
tried to use the emaxima LaTeX style (which I already had used
successfully in another Sweave-processed .Rnw file).

It turns out that this is not currently possible :

- the knitting process adds \usepackage{graphicx, color} right after the
\documentclass declaration opening the .Rnw file.

- The emaxima package also uses color, in an incompatible way. From the
pdflatex log :

==============================================================
(/usr/share/texmf/tex/latex/emaxima.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty)

! LaTeX Error: Option clash for package color.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.85 \usepackage
                {pdfcolmk}
? 
! Emergency stop.
 ...                                              
                                                  
l.85 \usepackage
                {pdfcolmk}
!  ==> Fatal error occurred, no output PDF file produced!
==============================================================

Can someone suggest a workaround ?

Sincerely,

					Emmanuel Charpentier