[Tex/LaTex] Big matrix in latex

matrices

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

Best Answer

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

Related Question