Matrix wird in Latex nicht vollständig angezeigt

Matrix wird in Latex nicht vollständig angezeigt

Ich versuche, die Matrix mit dem folgenden Code im Latex-Dokument anzuzeigen. Aber die rechte Seite der Matrix wird nicht vollständig angezeigt. Bitte überprüfen Sie dies.

\[
 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]
\]  

Antwort1

Der folgende Code zeigt drei mögliche Optionen:

  1. Wird verwendet \resizebox, um die Matrix automatisch so zu skalieren, dass sie eine Breite von hat \textwidth(da die Matrix sehr groß ist, kann die resultierende Matrix schwer lesbar sein).

  2. Verwenden Sie \resizeboxdazu vorher die vergrößerten Ränder, zum Beispiel mithilfe der \adjustwidthUmgebung aus dem changepagePaket. Dadurch verbessert sich die Lesbarkeit, die Ränder wurden jedoch teilweise vergrößert, was möglicherweise nicht erwünscht ist.

  3. Verwenden Sie die \resizeboxund die sidewaysfigureUmgebung des rotierenden Pakets, um die Matrix im Querformat auf einer eigenen Seite anzuzeigen. Dies scheint die beste Lösung zu sein.

    \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}
    

Das Ergebnis zeigt die drei Vergleichsoptionen:

Bildbeschreibung hier eingeben

verwandte Informationen