boffi at questa.la.so writes: > def prmat(mat): > return (r'\begin{bmatrix}' + > r'\\'.join('&'.join('%f'%x for x in row) for row in mat) + > r'\end{bmatrix}' add a closing parenthesis here ^