Matrix no se muestra completamente en Latex

Matrix no se muestra completamente en Latex

Estoy intentando mostrar la matriz en un documento de látex usando el siguiente código, pero el lado derecho de la matriz no se muestra por completo. Verifique esto.

\[
 M=
\left[ {\begin{array}{cccccccccccccccccccccccc}
 0.3 & 0 & 0.6 & 0 & 0.3 & 0 & 0.9 & 0 & 0.3 & 0 & 0.6 & 0 & 0.3 & 0 & 1.2 & 0 & 0.3 & 0 & 0.6 & 0 & 0.3 & 0 & 0.9 & 0\\
 0 & 0.47 & 0 & 0 & 0.47 & 0 & 0 & 0.95 & 0 & 0 & 0.47 & 0 & 0 & 0.47 & 0 & 0 & 0.95 & 0 & 0 & 0.47 & 0 & 0 & 0.47 & 0\\
 0 & 0 & 0 & 0.7 & 0 & 0 & 0 & 0 & 0.7 & 0 & 0 & 0 & 0 & 0.7 & 0 & 0 & 0 & 0.7 & 0 & 0 & 0 & 0 & 0 & 1.4\\
 0 & 0 & 0 & 0 & 0 & 0.9 & 0 & 0 & 0 & 0 & 0 & 0 & 0.9 & 0 & 0 & 0 & 0 & 0 & 0 & 0.9 & 0 & 0 & 0 & 0\\
 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.07 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.07 & 0 & 0 & 0\\
 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.38 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.38 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.38 & 0 & 0 & 0 & 0 & 0 & 0\\
 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.38 & 0 & 0\\
\end{array} } \right]
\]  

Respuesta1

El siguiente código muestra tres opciones posibles:

  1. Usar \resizeboxpara escalar automáticamente la matriz para que tenga un ancho igual a \textwidth(dado que la matriz es muy grande, la matriz resultante puede ser difícil de leer).

  2. Utilizando \resizeboxpero aumentando previamente los márgenes utilizando, por ejemplo, el \adjustwidthentorno del changepagepaquete; esto mejora la legibilidad, pero los márgenes se han aumentado parcialmente y es posible que esto no sea deseable.

  3. Usando el \resizeboxy el sidewaysfigureentorno del paquete giratorio para poner la matriz en orientación horizontal en una página propia. Ésta parece ser la mejor solución.

    \documentclass{article}
    \usepackage{amsmath}
    \usepackage{graphicx}
    \usepackage{changepage}
    \usepackage{rotating}
    
    \begin{document}
    
    % requires the graphicx package
    \[
    \resizebox{\textwidth}{!}{%
     $M=
    \left[ {\begin{array}{*{24}{c}}
     0.3 & 0 & 0.6 & 0 & 0.3 & 0 & 0.9 & 0 & 0.3 & 0 & 0.6 & 0 & 0.3 & 0 & 1.2 & 0 & 0.3 & 0 & 0.6 & 0 & 0.3 & 0 & 0.9 & 0\\
     0 & 0.47 & 0 & 0 & 0.47 & 0 & 0 & 0.95 & 0 & 0 & 0.47 & 0 & 0 & 0.47 & 0 & 0 & 0.95 & 0 & 0 & 0.47 & 0 & 0 & 0.47 & 0\\
     0 & 0 & 0 & 0.7 & 0 & 0 & 0 & 0 & 0.7 & 0 & 0 & 0 & 0 & 0.7 & 0 & 0 & 0 & 0.7 & 0 & 0 & 0 & 0 & 0 & 1.4\\
     0 & 0 & 0 & 0 & 0 & 0.9 & 0 & 0 & 0 & 0 & 0 & 0 & 0.9 & 0 & 0 & 0 & 0 & 0 & 0 & 0.9 & 0 & 0 & 0 & 0\\
     0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.07 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.07 & 0 & 0 & 0\\
     0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.38 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
     0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.38 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
     0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.38 & 0 & 0 & 0 & 0 & 0 & 0\\
     0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.38 & 0 & 0\\
    \end{array} } \right]$
     }
    \]
    
    % requires the changepage package
    \begin{adjustwidth}{-3cm}{-3cm}
    \[
    \resizebox{\dimexpr\textwidth+6cm\relax}{!}{%
     $M=
    \left[ {\begin{array}{*{24}{c}}
     0.3 & 0 & 0.6 & 0 & 0.3 & 0 & 0.9 & 0 & 0.3 & 0 & 0.6 & 0 & 0.3 & 0 & 1.2 & 0 & 0.3 & 0 & 0.6 & 0 & 0.3 & 0 & 0.9 & 0\\
     0 & 0.47 & 0 & 0 & 0.47 & 0 & 0 & 0.95 & 0 & 0 & 0.47 & 0 & 0 & 0.47 & 0 & 0 & 0.95 & 0 & 0 & 0.47 & 0 & 0 & 0.47 & 0\\
     0 & 0 & 0 & 0.7 & 0 & 0 & 0 & 0 & 0.7 & 0 & 0 & 0 & 0 & 0.7 & 0 & 0 & 0 & 0.7 & 0 & 0 & 0 & 0 & 0 & 1.4\\
     0 & 0 & 0 & 0 & 0 & 0.9 & 0 & 0 & 0 & 0 & 0 & 0 & 0.9 & 0 & 0 & 0 & 0 & 0 & 0 & 0.9 & 0 & 0 & 0 & 0\\
     0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.07 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.07 & 0 & 0 & 0\\
     0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.38 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
     0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.38 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
     0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.38 & 0 & 0 & 0 & 0 & 0 & 0\\
     0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.38 & 0 & 0\\
    \end{array} } \right]$
     }
    \]
    \end{adjustwidth}
    
    % requires the rotating package
    \begin{sidewaysfigure}
    \[
    \resizebox{\textheight}{!}{%
     $M=
    \left[ {\begin{array}{*{24}{c}}
     0.3 & 0 & 0.6 & 0 & 0.3 & 0 & 0.9 & 0 & 0.3 & 0 & 0.6 & 0 & 0.3 & 0 & 1.2 & 0 & 0.3 & 0 & 0.6 & 0 & 0.3 & 0 & 0.9 & 0\\
     0 & 0.47 & 0 & 0 & 0.47 & 0 & 0 & 0.95 & 0 & 0 & 0.47 & 0 & 0 & 0.47 & 0 & 0 & 0.95 & 0 & 0 & 0.47 & 0 & 0 & 0.47 & 0\\
     0 & 0 & 0 & 0.7 & 0 & 0 & 0 & 0 & 0.7 & 0 & 0 & 0 & 0 & 0.7 & 0 & 0 & 0 & 0.7 & 0 & 0 & 0 & 0 & 0 & 1.4\\
     0 & 0 & 0 & 0 & 0 & 0.9 & 0 & 0 & 0 & 0 & 0 & 0 & 0.9 & 0 & 0 & 0 & 0 & 0 & 0 & 0.9 & 0 & 0 & 0 & 0\\
     0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.07 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.07 & 0 & 0 & 0\\
     0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.38 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
     0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.38 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\
     0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.38 & 0 & 0 & 0 & 0 & 0 & 0\\
     0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1.38 & 0 & 0\\
    \end{array} } \right]$
     }
    \]
    
    \end{sidewaysfigure}
    
    \end{document}
    

El resultado muestra las tres opciones para comparar:

ingrese la descripción de la imagen aquí

información relacionada