Graphics, Figures & TablesA too big matrix

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
helllo
Posts: 44
Joined: Sat Jun 05, 2010 5:20 pm

A too big matrix

Post by helllo »

Hi guys, I was wondering if it is possible to fit a slightly too big matrix using some command ?

Thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

A too big matrix

Post by Stefan Kottwitz »

Hi,

you can
  • Decrease the font size, for example by \small
  • Make the space between columns and rows smaller, for example by using \arraystretch
  • Use \resizebox or \scalebox of the graphicx package
Stefan
LaTeX.org admin
helllo
Posts: 44
Joined: Sat Jun 05, 2010 5:20 pm

Re: A too big matrix

Post by helllo »

Hey,

thanks for the reply.

The first one doesn't work (\small is still too big, with \tiny it almost works but then it's quite "tiny").

I'm now trying to figure out how to use \arraystretch
helllo
Posts: 44
Joined: Sat Jun 05, 2010 5:20 pm

A too big matrix

Post by helllo »

Stefan_K wrote: [*] Make the space between columns and rows smaller, for example by using \arraystretch
How does this work ?
I tried:

Code: Select all

\renewcommand{\tabcolsep}{85mm}
\renewcommand{\arraystretch}{10}
with different numbers but it doesn't change anything.
Any idea?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

A too big matrix

Post by Stefan Kottwitz »

\arraystretch can be redefined to be smaller than 1, such as 0.9.

\tabcolsep is a length, so adjust it this way:

Code: Select all

\setlength{\tabcolsep}{1pt}
Stefan
LaTeX.org admin
helllo
Posts: 44
Joined: Sat Jun 05, 2010 5:20 pm

A too big matrix

Post by helllo »

Stefan_K wrote:\arraystretch can be redefined to be smaller than 1, such as 0.9.

\tabcolsep is a length, so adjust it this way:

Code: Select all

\setlength{\tabcolsep}{1pt}
Stefan
Hey, thanks but it still doesn't work.
I think I may be doing something wrong, here is what i write:

Code: Select all

\begin{pmatrix}
\setlength{\tabcolsep}{1pt}
\renewcommand{\arraystretch}{0.9}
then write the elements of the matrix and then close with

Code: Select all

\end{pmatrix}
I'm saying it's not woking cause each time I change the numbers (for tabolsep and arraystrtch) nothing happens :shock:
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

A too big matrix

Post by Stefan Kottwitz »

Adjust the value before you start the matrix, such as:

Code: Select all

\[
  \setlength{\arraycolsep}{2pt}
  \renewcommand{\arraystretch}{0.8}
  \begin{pmatrix}
    ...
  \end{pmatrix}
\]
Stefan
LaTeX.org admin
helllo
Posts: 44
Joined: Sat Jun 05, 2010 5:20 pm

A too big matrix

Post by helllo »

Stefan_K wrote:Adjust the value before you start the matrix, such as:

Code: Select all

\[
  \setlength{\arraycolsep}{2pt}
  \renewcommand{\arraystretch}{0.8}
  \begin{pmatrix}
    ...
  \end{pmatrix}
\]
Stefan
this works but it's still not enough.
Is it possible to reduce the font just for the matrix ?
Thanks!
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

A too big matrix

Post by Stefan Kottwitz »

For example, temporarily leaving math mode for changing the font size:

Code: Select all

$M = \mbox{\footnotesize$
  \begin{pmatrix}
    ...
  \end{pmatrix}$}$
You can use also \tiny, \scriptsize or \small instead.

Stefan
LaTeX.org admin
Post Reply