Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resize matrix in LaTeX beamer

Hi I was wondering how to resize matrices in a beamer environment. Currently I am writing the following code:

\begin{align*}
\left( \begin{array}{ccccccc}
 0 & 1 &    &   &        &    &   \\
-1 & 0 &    &   &        &    &   \\
   &   &  0 & 1 &        &    &   \\
   &   & -1 & 0 &        &    &   \\
   &   &    &   & \ddots &    &   \\
   &   &    &   &        & 0  & 1 \\
   &   &    &   &        & -1 & 0
\end{array} \right)
\end{align*}

and the matrix takes up almost a whole page. I would like it to be about half a page in height.

like image 762
John Jiang Avatar asked Apr 28 '10 05:04

John Jiang


People also ask

How do you shrink a matrix in latex?

You can reduce the font size of the matrix limited by a group and/or adjust the command \arraycolsep to lower the column spacing.


2 Answers

There is the \resizebox command in the graphicx package:

\resizebox{.5\textwidth}{!}{  (your array here)  }

I've never tried it, but it looks as it is made exactly for this kind or problem.

Of course, you can choose different widths (first argument) or different height (second argument) parameters.

like image 174
topskip Avatar answered Sep 28 '22 15:09

topskip


See this answer for how to change font dimensions in LaTeX's math mode.

Edit

Specifying font sizes in beamer is no different from specifying them in other LaTeX documents. To e.g. change the size of your array you would switch the size by adding the command inside your align environment.

Valid commands are \tiny, \scriptsize, \footnotesize, \small, \normalsize, \large, \Large, \huge, and \Huge (there could be more).

like image 44
Benjamin Bannier Avatar answered Sep 28 '22 17:09

Benjamin Bannier