TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a relatively large but sparse matrix (say 20x20). Maple has no problem displaying it on a screen because maple does not force the columns to be aligned when the matrix is large enough : element 6,3 might not be directly underneath element 5,3.

In LaTeX, on the other hand, the width of a matrix is at least the sum of the widths of the widest elements in each column. This does not fit on a paper at all.

So, is there a way to make "maple-style" matrices in LaTeX?


|1 0 0 0 (very wide element) |
|(very wide element) 0 0 0 0 |

instead of

|1                   0 0 0 (very wide element) |
|(very wide element) 0 0 0         0           |
share|improve this question

From the example given, it looks as though there's no common alignment between the rows. In which case, all you really want is a list of numbers with a decent separation between and the appropriate braces either side. So the following would do that (using amsmath for nice matrices):

\begin{bmatrix} % or pmatrix or what ever
3.1415926538 \; 0 \; 0 \; 1 \\
0 \; 0 \; 2.718281828459045 \; 0
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.