Symbolic Matrix as a Latex Object

10 views
Skip to first unread message

louie

unread,
Sep 27, 2009, 8:55:36 AM9/27/09
to sage-support
Hello, my platform is:
- W. Vista 64
- Firefox 3.0.10
- Sage Version 4.1.1 (VMWare)

Last night I tried this Matlab exercise in the notebook (without
Typeset activated):

x,y,z,a,b,c=var('x,y,z,a,b,c')
A=matrix(SR,[[a,b,1],[0,1,c],[x,0,0]]);A
[a b 1]
[0 1 c]
[x 0 0]

type(A)
<type 'sage.matrix.matrix_symbolic_dense.Matrix_symbolic_dense'>

So far, so good, but with Typeset activated:

type(A)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/notebook/sage_notebook/worksheets/admin/3/code/12.py",
line 6, in <module>
type(A)
File "", line 1, in <module>

File "/usr/local/sage/local/lib/python2.6/site-packages/sage/misc/
latex.py", line 1768, in pretty_print
view(object)
File "/usr/local/sage/local/lib/python2.6/site-packages/sage/misc/
latex.py", line 1512, in view
s = _latex_file_(objects, title=title, sep=sep, tiny=tiny,
debug=debug, **latex_options)
File "/usr/local/sage/local/lib/python2.6/site-packages/sage/misc/
latex.py", line 1180, in _latex_file_
L = latex(x)
File "/usr/local/sage/local/lib/python2.6/site-packages/sage/misc/
latex.py", line 580, in __call__
return LatexExpr(x._latex_())
TypeError: descriptor '_latex_' of 'sage.matrix.matrix0.Matrix' object
needs an argument

Is this behaviour normal?

--Luis V.--

John H Palmieri

unread,
Sep 27, 2009, 6:57:51 PM9/27/09
to sage-support
No, it's a bug. Note that when you execute "type(A)", you're not
asking for the matrix to be typeset, but for its type to be typeset.
With the typeset box checked, executing "A" should produce a nice
version of the matrix.

For some reason, typesetting "types" is not working well.

John

John H Palmieri

unread,
Sep 28, 2009, 4:17:24 PM9/28/09
to sage-support
On Sep 27, 3:57 pm, John H Palmieri <jhpalmier...@gmail.com> wrote:
> On Sep 27, 5:55 am, louie <louferville...@hotmail.com> wrote:

[snip]

> > Is this behaviour normal?
>
> No, it's a bug.  Note that when you execute "type(A)", you're not
> asking for the matrix to be typeset, but for its type to be typeset.
> With the typeset box checked, executing "A" should produce a nice
> version of the matrix.
>
> For some reason, typesetting "types" is not working well.

There is a patch available at

<http://trac.sagemath.org/sage_trac/ticket/7051>

Cheers,
John
Reply all
Reply to author
Forward
0 new messages