Ask Your Question
0

Undefined control sequence when showing multiplication table [closed]

asked 2013-11-25 14:13:19 +0200

anonymous user

Anonymous

updated 2023-01-10 02:07:33 +0200

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 reopen merge delete

Closed for the following reason question is not relevant or outdated by Max Alekseyev
close date 2023-01-10 15:33:01.599422

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-11-25 15:45:44 +0200

tmonteil gravatar image

updated 2023-01-10 02:14:25 +0200

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: this is now fixed:

sage: sage: Z5=Integers(5)
....: sage: show(Z5.multiplication_table())
*  a b c d e
 +----------
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

Setting tags from confirmed_issue to fixed_issue.

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 15:55:22 +0200 )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 16:20:33 +0200 )edit

Thanks for reporting, you are faster than me !

tmonteil gravatar imagetmonteil ( 2013-11-25 16:21:32 +0200 )edit

Question Tools

Stats

Asked: 2013-11-25 14:13:19 +0200

Seen: 1,058 times

Last updated: Jan 10 '23