Ask Your Question

Undefined control sequence when showing multiplication table

asked 2013-11-25 07:13:19 -0500

anonymous user


updated 2013-11-25 08:53:09 -0500

tmonteil gravatar image

Using Sage Version 5.12,

sage: Z5=Integers(5)

sage: show(Z5.multiplication_table())

The output is:

An error occurred.
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian) (format=pdflatex 2013.11.25)
! Undefined control sequence.
<argument> 2\ex 

l.40 ...ace{40mm}\[{\setlength{\arraycolsep}{2\ex}

How to get a table to display correctly with show?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-11-25 08:45:44 -0500

tmonteil gravatar image

updated 2013-11-25 08:50:44 -0500

You found a bug!! When, you call show, Sage calls view and latex functions, and the latex function produced with Z5 is the following:

sage: T = Z5.multiplication_table()
sage: latex(T)

And it seems that pdflatex is not able to understand the first line.

A first worksroud is to avoid latex so that the show function shows the ascii representation of T as follows:

sage: show(str(T))

A second workaround if you still want a latex typeset is to modify the latex representation, and remove its first line:

sage: show(LatexExpr(latex(T).replace('\\setlength{\\arraycolsep}{2\ex}','')))
edit flag offensive delete link more


This is now ticket <>. Needs review.

Luca gravatar imageLuca ( 2013-11-25 08:55:22 -0500 )edit

I think this has been fixed in Sage 5.13 (which has not been released yet). See

John Palmieri gravatar imageJohn Palmieri ( 2013-11-25 09:20:33 -0500 )edit

Thanks for reporting, you are faster than me !

tmonteil gravatar imagetmonteil ( 2013-11-25 09:21:32 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-11-25 07:13:19 -0500

Seen: 727 times

Last updated: Nov 25 '13