Ask Your Question
0

Undefined control sequence when showing multiplication table

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

anonymous user

Anonymous

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
2

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)
{\setlength{\arraycolsep}{2\ex}
\begin{array}{r|*{5}{r}}
\multicolumn{1}{c|}{\ast}&a&b&c&d&e\\\hline
{}a&a&a&a&a&a\\
{}b&a&b&c&d&e\\
{}c&a&c&e&b&d\\
{}d&a&d&b&e&c\\
{}e&a&e&d&c&b\\
\end{array}}

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

Comments

This is now ticket <http://trac.sagemath.org/ticket/15452>. Needs review.

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

I think this has been fixed in Sage 5.13 (which has not been released yet). See http://trac.sagemath.org/ticket/15210.

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

Stats

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

Seen: 486 times

Last updated: Nov 25 '13