I have a matrix that is a bit too wide to fit inside my page width.
After reading a lot of different answers on the Internet, none really related to LyX, I came up with these three different solutions, all of them involve inserting an ERT (raw LaTeX code, in this case all the lines before \begin{equation}
and after \end{equation}
). Here is the image:
I don't know if other possibilities also work and which are the advantages or disadvantages, from each method.
The LaTeX source for all this is:
\noindent\makebox[\textwidth]{%
\tiny%
\begin{minipage}[t]{1\columnwidth}%
\begin{equation}
Q=\begin{pmatrix}
0.00301472 & -0.0961879 & -0.00897697 & 0.0389941 & -0.860642 & 0.0131329 & -4.73786 & -0.00552858\\
-0.028584 & 0.615003 & 0.111671 & -0.371008 & 4.94379 & -0.138279 & 20.3258 & 0.0512362\\
0.0132728 & -0.345125 & -0.0701132 & 0.115389 & -3.11777 & 0.102871 & -16.9949 & -0.0408223\\
2.91757 & 1.03545 & -5.16595 & 1.69976 & -22.1649 & 4.33453 & 120.513 & -1.35074\\
0.867566 & 2.92363 & -1.14174 & 3.4356 & -2.96193 & 1.91413 & -113.348 & -0.684269
\end{pmatrix}
\end{equation}
%
\end{minipage}}
\resizebox{\textwidth}{!}{%
\tiny%
\begin{minipage}[t]{1\columnwidth}%
\begin{equation}
Q_{ij}=\left(\begin{array}{cccccccc}
0.00301472 & -0.0961879 & -0.00897697 & 0.0389941 & -0.860642 & 0.0131329 & -4.73786 & -0.00552858\\
-0.028584 & 0.615003 & 0.111671 & -0.371008 & 4.94379 & -0.138279 & 20.3258 & 0.0512362\\
0.0132728 & -0.345125 & -0.0701132 & 0.115389 & -3.11777 & 0.102871 & -16.9949 & -0.0408223\\
2.91757 & 1.03545 & -5.16595 & 1.69976 & -22.1649 & 4.33453 & 120.513 & -1.35074\\
0.867566 & 2.92363 & -1.14174 & 3.4356 & -2.96193 & 1.91413 & -113.348 & -0.684269
\end{array}\right)
\end{equation}
%
\end{minipage}}
\noindent%
\begin{minipage}[t]{1\textwidth}%
\tiny
\begin{equation}
Q=\begin{pmatrix}
0.00301472 & -0.0961879 & -0.00897697 & 0.0389941 & -0.860642 & 0.0131329 & -4.73786 & -0.00552858\\
-0.028584 & 0.615003 & 0.111671 & -0.371008 & 4.94379 & -0.138279 & 20.3258 & 0.0512362\\
0.0132728 & -0.345125 & -0.0701132 & 0.115389 & -3.11777 & 0.102871 & -16.9949 & -0.0408223\\
2.91757 & 1.03545 & -5.16595 & 1.69976 & -22.1649 & 4.33453 & 120.513 & -1.35074\\
0.867566 & 2.92363 & -1.14174 & 3.4356 & -2.96193 & 1.91413 & -113.348 & -0.684269
\end{pmatrix}
\end{equation}
%
\end{minipage}
Is there a simpler way of doing this in LyX, for example without using the \tiny
command and inserting boxes inside boxes? Can't LaTeX simply determine when a matrix is too big and rescale it to fit the page?
This is how it looks like in the output: 2
!
in front of it to turn it into a link. A moderator or another user with edit privileges can then reinsert the!
to turn it into an image again.equation
, say) to absorb the content, decide whether it'll fit, and then rescale/-size it. Why is using ERTs not cool?