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.

I have a big matrix which exceeds the width of page, how can I fix this problem? enter image description here

share|improve this question

4 Answers 4

up vote 4 down vote accepted

You can use the nccmathpackage, an extension to amsmath that defines medium-sized mathematics, intermediate between textstyle and displaystyle (ca 80 % of the displaystyle size). With a suitable text width, it's OK but, of course, everything depends on what you actually have. Here is an illustration with textwidth=16cm and both styles:

    \documentclass{article}

    \usepackage[showframe, nomarginpar, textwidth = 16cm]{geometry}
    \usepackage{amsmath}
    \usepackage{nccmath}
    \newenvironment{mpmatrix}{\begin{medsize}\begin{pmatrix}}%
    {\end{pmatrix}\end{medsize}}%

    \begin{document}

    \[
    \begin{mpmatrix}
    a+b+c+d+e+f+g+h+i+j+k+l+m+n+o & a+b+c+d+e+f+g+h+i+j+k+l+m+n+o \\
    a+b+c+d+e+f+g+h+i+j+k+l+m+n+o &a+b+c+d+e+f+g+h+i+j+k+l+m+n+o
    \end{mpmatrix},
    \]
    \[
    \begin{pmatrix}
    a+b+c+d+e+f+g+h+i+j+k+l+m+n+o & a+b+c+d+e+f+g+h+i+j+k+l+m+n+o \\
    a+b+c+d+e+f+g+h+i+j+k+l+m+n+o &a+b+c+d+e+f+g+h+i+j+k+l+m+n+o
    \end{pmatrix},
    \]

    \end{document} 

enter image description here

share|improve this answer
    
@rose: Before you start using nccmath too much in your code I thought I'd refer you to: Is there a replacement for nccmath?. I was using nccmath for a while but then abandoned it due to the problems listed in that question. –  Peter Grill Mar 19 at 4:43

Using smallmatrix:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\noindent X \hrulefill X
\[
\begin{smallmatrix}
a+b+c+d+e+f+g+h+i+j+k+l+m+n+o & a+b+c+d+e+f+g+h+i+j+k+l+m+n+o \\
a+b+c+d+e+f+g+h+i+j+k+l+m+n+o &a+b+c+d+e+f+g+h+i+j+k+l+m+n+o
\end{smallmatrix}
\]
\noindent X\hrulefill X


\end{document}

enter image description here

share|improve this answer

In those cases, I'd suggest you to use some names for the entries and then explain those names in the text, as the following example illustrates:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[
\begin{pmatrix}
\alpha & \beta \\
\gamma & \delta
\end{pmatrix},
\]
where $\alpha=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o$, $\beta=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o$, $\gamma=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o$
 and $\delta=a+b+c+d+e+f+g+h+i+j+k+l+m+n+o$.

\end{document} 

enter image description here

share|improve this answer

Or use of array in an math environment

enter image description here

Code

\documentclass[12pt]{article}
\usepackage{amsmath}
\thispagestyle{empty}
\begin{document}
\[
\left (
\begin{array}{ccc}
\begin{array}{l}
a+b+c+d+e+f+g+h\\
+i+j+k+l+m+n+o 
\end{array}
& \cdots & 
\begin{array}{l}
a+b+c+d+e+f+g+h\\
+i+j+k+l+m+n+o 
\end{array} \\
\vdots & \ddots & \vdots\\
\begin{array}{l}
a+b+c+d+e+f+g+h\\
+i+j+k+l+m+n+o 
\end{array} &
\cdots & 
\begin{array}{l}
a+b+c+d+e+f+g+h\\
+i+j+k+l+m+n+o \\
\end{array} 
\end{array}
\right )
\]

\end{document}
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.