# [IPython-User] question about rendering latex in ipython

Comer Duncan comer.duncan@gmail....
Fri Jan 20 12:48:01 CST 2012

Hi,

I am writing a notebook which uses sympy.  It seems to work fine.  However,
when I create markdown cells and try to format a 3x3 matrix, it does not
render properly.  Here is a simple example:

Say I want to display a 3 by 3 matrix in a markdown cell. As a test, I have
a matrix Elec in a code cell which has format returned by latex{Elec}:

\left( \begin{smallmatrix}0 & E_{z}  & - E_{y}\\ - E_{z} & 0 & E_{x}\\ -
E_{x} & 0\end{smallmatrix}\right(

Just mentioning Elec in the code cell of course prints it in the expected
output.  But when I copy the above into a markdown cell and surround it
with s, it renders as

( 0  E_z  -E_y  -E_{z}  0  E_{x}  E_{y}  -E_{x}  0 )

So in a markdown cell it does not render. I have tried other ways but all
at most result in a 'vector' and not a matrix.

I am wondering whether in markdown cells some additional packages would
need to be included?  And is there some sympy stuff going on in the
background affecting the rendering?

Thanks for any help.

Comer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20120120/e7cdc402/attachment.html