Math & ScienceHandling a too big matrix equation

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
arastpour
Posts: 4
Joined: Thu Aug 09, 2012 8:48 pm

Handling a too big matrix equation

Post by arastpour »

I was wondering if I could rotate the equation below to fit it on a page without compromising the font size.

I tried landscape and rotating packages to rotate the equation. In both cases I received error messages!

Code: Select all

\begin{align*}
         &\left[ {\begin{array}{ccccccccccc}
         1                              & -P(N_k^a|L_k^c) & 0 & 0 & 0 &0&\dots&0&0&0&0\\
         -P(N_{k+1}^d|L_{k+1}) & 1              & 0& -P(N_{k+1}^a|L_{k+1})& 0 &0&\dots&0&0&0&0\\
         -P(N_{k+1}^d|L_{k+1}^c) & 0 & 1              & -P(N_{k+1}^a|L_{k+1}^c)& 0 &0&\dots&0&0&0&0\\
         0 & 0              &  -P(N_{k+2}^d|L_{k+2})& 1&0&-P(N_{k+2}^a|L_{k+2})&\dots&0&0&0&0\\
         0 & 0              &  -P(N_{k+2}^d|L_{k+2}^c)& 0&1&-P(N_{k+2}^a|L_{k+2}^c)&\dots&0&0&0&0\\
         \vdots & \vdots & \vdots & \vdots & \vdots & \vdots&\ddots&\vdots&\vdots&\vdots&\vdots\\
         0 & 0 & 0&0&0&0&\dots& -P(N_{c-1}^d|L_{c-1})& 1              &0& -P(N_{c-1}^a|L_{c-1})\\
         0 & 0 & 0&0&0&0&\dots& -P(N_{c-1}^d|L_{c-1}^c)&0 & 1              & -P(N_{c-1}^a|L_{c-1}^c)\\
         0 & 0 & 0&0&0 &0&\dots&0 &0 & -P(N_c^d|L_c) & 1
         \end{array} } \right]
         .\left[ {\begin{array}{c}
         E(\widetilde{A}_{kk}^{cn}|L_k^c)\\
         E(\widetilde{A}_{k k+1}^{cn}|L_{k+1})\\
         E(\widetilde{A}_{k k+1}^{cn}|L_{k+1}^c)\\
         E(\widetilde{A}_{k k+2}^{cn}|L_{k+2})\\
         E(\widetilde{A}_{k k+2}^{cn}|L_{k+2}^c)\\
         \vdots \\
         E(\widetilde{A}_{k c-1}^{cn}|L_{c-1})\\
         E(\widetilde{A}_{k c-1}^{cn}|L_{c-1}^c)\\
         E(\widetilde{A}_{kc}^{cn}|L_{c})\\
         \end{array} } \right]\\=
         &\left[ {\begin{array}{c}
         E(R_k|L_k^c) + P(N_k^s|L_k^c)   E\left(\widetilde{B}_{kk}^{c+n}|L_k^c\right) \\
         E(R_{k+1}|L_{k+1}) + P(N_{k+1}^s|L_{k+1})  E\left(\widetilde{B}_{kk+1}^{c+n}|L_{k+1}^c      \right)\\
         E(R_{k+1}|L_{k+1}^c) +P(N_{k+1}^s|L_{k+1}^c)   E\left(\widetilde{B}_{kk+1}^{c+n}|L_{k+1}^c      \right)\\
         E(R_{k+2}|L_{k+2}) + P(N_{k+2}^s|L_{k+2})  E\left(\widetilde{B}_{kk+2}^{c+n}|L_{k+2}^c      \right)\\
         E(R_{k+2}|L_{k+2}^c) +P(N_{k+2}^s|L_{k+2}^c)   E\left(\widetilde{B}_{kk+2}^{c+n}|L_{k+2}^c      \right)\\
         \vdots \\
         E(R_{k+2}|L_{c-1}) + P(N_{c-1}^s|L_{c-1})  E\left(\widetilde{B}_{kc-1}^{c+n}|L_{c-1}^c      \right)\\
         E(R_{k+2}|L_{c-1}^c) +P(N_{c-1}^s|L_{c-1}^c)   E\left(\widetilde{B}_{kc-1}^{c+n}|L_{c-1}^c      \right)\\
         E(\widetilde{A}_{kc}^{cn}|L_{c})\\
         \end{array} } \right]
\end{align*}
Last edited by cgnieder on Mon Jul 15, 2013 11:06 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Handling a too big matrix equation

Post by Johannes_B »

What error messages do you get? That is some important information.
Have a look at the following, even with font size tiny it doesn't fit the page.

Code: Select all

\documentclass{scrartcl}
\usepackage{mathtools}
\usepackage{pdflscape}
\begin{document}
\begin{landscape}
\begin{align*}
  \tiny
  &\left[ {\begin{array}{ccccccccccc}
      1 & -P(N_k^a|L_k^c) & 0 & 0 & 0 &0&\dots&0&0&0&0\\
      -P(N_{k+1}^d|L_{k+1}) & 1 & 0& -P(N_{k+1}^a|L_{k+1})& 0
      &0&\dots&0&0&0&0\\
      -P(N_{k+1}^d|L_{k+1}^c) & 0 & 1 & -P(N_{k+1}^a|L_{k+1}^c)&
      0 &0&\dots&0&0&0&0\\
      0 & 0 & -P(N_{k+2}^d|L_{k+2})&
      1&0&-P(N_{k+2}^a|L_{k+2})&\dots&0&0&0&0\\
      0 & 0 & -P(N_{k+2}^d|L_{k+2}^c)&
      0&1&-P(N_{k+2}^a|L_{k+2}^c)&\dots&0&0&0&0\\
      \vdots & \vdots & \vdots & \vdots & \vdots &
      \vdots&\ddots&\vdots&\vdots&\vdots&\vdots\\
      0 & 0 & 0&0&0&0&\dots& -P(N_{c-1}^d|L_{c-1})& 1 &0&
      -P(N_{c-1}^a|L_{c-1})\\
      0 & 0 & 0&0&0&0&\dots& -P(N_{c-1}^d|L_{c-1}^c)&0 & 1 &
      -P(N_{c-1}^a|L_{c-1}^c)\\
      0 & 0 & 0&0&0 &0&\dots&0 &0 & -P(N_c^d|L_c) & 1
  \end{array} } \right]
  .\left[ {\begin{array}{c}
      E(\widetilde{A}_{kk}^{cn}|L_k^c)\\
      E(\widetilde{A}_{k k+1}^{cn}|L_{k+1})\\
      E(\widetilde{A}_{k k+1}^{cn}|L_{k+1}^c)\\
      E(\widetilde{A}_{k k+2}^{cn}|L_{k+2})\\
      E(\widetilde{A}_{k k+2}^{cn}|L_{k+2}^c)\\
      \vdots \\
      E(\widetilde{A}_{k c-1}^{cn}|L_{c-1})\\
      E(\widetilde{A}_{k c-1}^{cn}|L_{c-1}^c)\\
      E(\widetilde{A}_{kc}^{cn}|L_{c})\\
  \end{array} } \right]\\=
  &\left[ {\begin{array}{c}
      E(R_k|L_k^c) + P(N_k^s|L_k^c)
      E\left(\widetilde{B}_{kk}^{c+n}|L_k^c\right) \\
      E(R_{k+1}|L_{k+1}) + P(N_{k+1}^s|L_{k+1})
      E\left(\widetilde{B}_{kk+1}^{c+n}|L_{k+1}^c \right)\\
      E(R_{k+1}|L_{k+1}^c) +P(N_{k+1}^s|L_{k+1}^c)
      E\left(\widetilde{B}_{kk+1}^{c+n}|L_{k+1}^c \right)\\
      E(R_{k+2}|L_{k+2}) + P(N_{k+2}^s|L_{k+2})
      E\left(\widetilde{B}_{kk+2}^{c+n}|L_{k+2}^c \right)\\
      E(R_{k+2}|L_{k+2}^c) +P(N_{k+2}^s|L_{k+2}^c)
      E\left(\widetilde{B}_{kk+2}^{c+n}|L_{k+2}^c \right)\\
      \vdots \\
      E(R_{k+2}|L_{c-1}) + P(N_{c-1}^s|L_{c-1})
      E\left(\widetilde{B}_{kc-1}^{c+n}|L_{c-1}^c \right)\\
      E(R_{k+2}|L_{c-1}^c) +P(N_{c-1}^s|L_{c-1}^c)
      E\left(\widetilde{B}_{kc-1}^{c+n}|L_{c-1}^c \right)\\
      E(\widetilde{A}_{kc}^{cn}|L_{c})\\
  \end{array} } \right]
\end{align*}
\end{landscape}
\end{document}
A Minimal Working Example would be helpful for future questions. For example, I don't knnow which documentclass you are using.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
arastpour
Posts: 4
Joined: Thu Aug 09, 2012 8:48 pm

Handling a too big matrix equation

Post by arastpour »

Hi Johannes_B,

I do appreciate your time and feedback.

Would you please take a look at the file that I have attached (Untitledq.png). It is a screen shot of my out put when I copied and pasted your code. The same thing happens with other solutions that I have found for my problem--the matrix sticks out of the screen!
Best,
Amir
Untitledq.png
Untitledq.png (53.21 KiB) Viewed 5765 times
Last edited by cgnieder on Mon Jul 15, 2013 11:05 am, edited 1 time in total.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Handling a too big matrix equation

Post by Johannes_B »

on my machine it just is flushed down on the left side (bottom of portait), i attached the pdf.
You can also click on Open in writelatex to see the same output.

Regards Johannes
Attachments
arastpour.pdf
(58.4 KiB) Downloaded 256 times
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Handling a too big matrix equation

Post by localghost »

Do not look at the DVI version of the document. Always look at the PS or PDF output. Most DVI viewers can't display objects that are rotated this way.


Best regards and welcome to the board
Thorsten
Post Reply