Ask Your Question
0

Undefined control sequence when showing multiplication table [closed]

asked 11 years ago

anonymous user

Anonymous

updated 2 years ago

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?

Preview: (hide)

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 11 years ago

tmonteil gravatar image

updated 2 years ago

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.

Preview: (hide)
link

Comments

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

Luca gravatar imageLuca ( 11 years ago )
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 ( 11 years ago )

Thanks for reporting, you are faster than me !

tmonteil gravatar imagetmonteil ( 11 years ago )

Question Tools

Stats

Asked: 11 years ago

Seen: 1,230 times

Last updated: Jan 10 '23