Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This question is a slight variation of Compiling a BIG matrix, but I need to write a matrix in a A4 or letter size paper; it is a block 48x48 matrix but I can put lot of $0_2$ and $0_4$'s in order to keep a small number of entries, which, however, exceed the usual dimensions. How could I make the font smaller or the spaces between the entries (most of them 0) narrower in order for this matrix to fit in the page? For instance, the first rows are

\documentclass[a4paper,10pt]{article}
\usepackage{amsmath}
\begin{document}
\[
\begin{pmatrix}
0 & 0 & B & 0 & 0 & 0& 0& 0 & A & 0& 0& 0 & 0 & 0& 0& 0 \\
0 & 0 & 0 & C & 0 & 0& 0& 0 & 0 & 0& 0& 0 & 0 & 0& 0& 0 \\
D & 0 & 0 & 0 & 0 & 0& 0& 0 & 0 & 0& 0& 0 & 0 & 0& 0& 0 \\
0 & E & 0 & 0 & 0 & 0& 0& 0 & 0 & 0& 0& 0 & 0 & 0& 0& 0  
\end{pmatrix}
\]
\end{document}
share|improve this question
    
thanks. I just did. –  c.p. Sep 5 '12 at 14:44
1  
ok, I've reedited. –  c.p. Sep 5 '12 at 14:57

2 Answers 2

up vote 9 down vote accepted

The following example uses three different methods:

  • The distance between the entries can be set by \arraycolsep.

  • The font size can be decreased by switching to text mode, setting the smaller font size and going back to math.

  • And finally the whole equation can be scaled to fit the line width using the package resizegather if amsmath is used.

The whole example:

\documentclass[12pt]{article}
\usepackage[a6paper]{geometry}
\usepackage{amsmath}
\setcounter{MaxMatrixCols}{48}
\usepackage{resizegather}
\begin{document}
\hrule
\begin{gather*}
  \setlength{\arraycolsep}{.75\arraycolsep}
  \text{\footnotesize$\displaystyle
    \begin{pmatrix}
      0 & 0 & B & 0 & 0 & 0& 0& 0 & A & 0& 0& 0 & 0 & 0& 0& 0 \\
      0 & 0 & 0 & C & 0 & 0& 0& 0 & 0 & 0& 0& 0 & 0 & 0& 0& 0 \\
      D & 0 & 0 & 0 & 0 & 0& 0& 0 & 0 & 0& 0& 0 & 0 & 0& 0& 0 \\
      0 & E & 0 & 0 & 0 & 0& 0& 0 & 0 & 0& 0& 0 & 0 & 0& 0& 0
    \end{pmatrix}
  $}
\end{gather*}
\hrule
\end{document}

Result

share|improve this answer
    
Thank you for this nice answer. I've installed resizegather: this code however gives me an error at the resizegather.sty file "Undefined control sequence AddToKeyvalOption{equation}" –  c.p. Sep 5 '12 at 15:58

One idea would be to use landscape enviroment. At that way you can print your big table along the biggest side of your paper.

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.