Ask Your Question

# Undefined control sequence when showing multiplication table

Anonymous

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

## 1 Answer

Sort by ยป oldest newest most voted

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}','')))

more

## Comments

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

( 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.

( 2013-11-25 16:20:33 +0200 )edit

Thanks for reporting, you are faster than me !

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

## Your Answer

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

Add Answer

## Stats

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

Seen: 751 times

Last updated: Nov 25 '13