Latex output of pretty

How do I get a latex output of the version you see in pretty? I have a crazy pair of eigenvalues (see below) that I want to input into Latex but it goes of the page when in Latex format. Is this possible to do?
ee=[-(r_n^2*sigma_p^2 + (Kmax^2*bmax^4*c^2*r_n^2*sigma_k^4 - 2*Kmax^2*bmax^4*c^2*r_n*r_p*sigma_k^4 + Kmax^2*bmax^4*c^2*r_p^2*sigma_k^4 - 2*Kmax*bmax^2*c*r_n^3*sigma_k^2*sigma_p^2 - 2*Kmax*bmax^2*c*r_n^2*r_p*sigma_k^4 - 2*Kmax*bmax^2*c*r_n^2*r_p*sigma_k^2*sigma_p^2 + 2*Kmax*bmax^2*c*r_n*r_p^2*sigma_k^4 + r_n^4*sigma_p^4 - 2*r_n^3*r_p*sigma_k^2*sigma_p^2 + r_n^2*r_p^2*sigma_k^4)^(1/2) + r_n*r_p*sigma_k^2 - Kmax*bmax^2*c*r_n*sigma_k^2 + Kmax*bmax^2*c*r_p*sigma_k^2)/(sigma_k^2*sigma_p^2*(Kmax*c*bmax^2 + r_n)), -(r_n^2*sigma_p^2 - (Kmax^2*bmax^4*c^2*r_n^2*sigma_k^4 - 2*Kmax^2*bmax^4*c^2*r_n*r_p*sigma_k^4 + Kmax^2*bmax^4*c^2*r_p^2*sigma_k^4 - 2*Kmax*bmax^2*c*r_n^3*sigma_k^2*sigma_p^2 - 2*Kmax*bmax^2*c*r_n^2*r_p*sigma_k^4 - 2*Kmax*bmax^2*c*r_n^2*r_p*sigma_k^2*sigma_p^2 + 2*Kmax*bmax^2*c*r_n*r_p^2*sigma_k^4 + r_n^4*sigma_p^4 - 2*r_n^3*r_p*sigma_k^2*sigma_p^2 + r_n^2*r_p^2*sigma_k^4)^(1/2) + r_n*r_p*sigma_k^2 - Kmax*bmax^2*c*r_n*sigma_k^2 + Kmax*bmax^2*c*r_p*sigma_k^2)/(sigma_k^2*sigma_p^2*(Kmax*c*bmax^2 + r_n))];

Answers (1)

Star Strider
Star Strider on 18 Dec 2017

0 votes

Have you used the latex (link) function? It will likely do what you want.

2 Comments

Yes, I did try that. I tried latex(pretty(ee)) which doesn't work, and latex(ee) will just run-off the page.
In that event, you’ll probably need to edit the LaTeX code to break it into more than one line. (That’s not an area of my expertise.)
The ‘official’ LaTeX documentation is The Not So Short Introduction to LaTeX2e (link).

Sign in to comment.

Products

Asked:

on 18 Dec 2017

Commented:

on 18 Dec 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!