I have the following latex to create a matrix:
\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{graphicx,ctable,booktabs}
\begin{document}
$\left(\begin{array}{rrr}
-\frac{200 \, x^{2} {\left(\sqrt{x^{2} + y^{2}} - 1\right)}}{{\left(x^{2} + y^{2}\right)}^{\frac{3}{2}}} + \frac{200 \, x^{2}}{x^{2} + y^{2}} + \frac{200 \, {\left(\sqrt{x^{2} + y^{2}} - 1\right)}}{\sqrt{x^{2} + y^{2}}} + \frac{2000 \, \pi {\left(5 \, \pi \arctan\left(\frac{y}{x}\right) - z\right)} y}{x^{3} {\left(\frac{y^{2}}{x^{2}} + 1\right)}} + \frac{5000 \, \pi^{2} y^{2}}{x^{4} {\left(\frac{y^{2}}{x^{2}} + 1\right)}^{2}} - \frac{2000 \, \pi {\left(5 \, \pi \arctan\left(\frac{y}{x}\right) - z\right)} y^{3}}{x^{5} {\left(\frac{y^{2}}{x^{2}} + 1\right)}^{2}} & -\frac{200 \, x y {\left(\sqrt{x^{2} + y^{2}} - 1\right)}}{{\left(x^{2} + y^{2}\right)}^{\frac{3}{2}}} + \frac{200 \, x y}{x^{2} + y^{2}} - \frac{1000 \, \pi {\left(5 \, \pi \arctan\left(\frac{y}{x}\right) - z\right)}}{x^{2} {\left(\frac{y^{2}}{x^{2}} + 1\right)}} - \frac{5000 \, \pi^{2} y}{x^{3} {\left(\frac{y^{2}}{x^{2}} + 1\right)}^{2}} + \frac{2000 \, \pi {\left(5 \, \pi \arctan\left(\frac{y}{x}\right) - z\right)} y^{2}}{x^{4} {\left(\frac{y^{2}}{x^{2}} + 1\right)}^{2}} & \frac{1000 \, \pi y}{x^{2} {\left(\frac{y^{2}}{x^{2}} + 1\right)}} \\
-\frac{200 \, x y {\left(\sqrt{x^{2} + y^{2}} - 1\right)}}{{\left(x^{2} + y^{2}\right)}^{\frac{3}{2}}} + \frac{200 \, x y}{x^{2} + y^{2}} - \frac{1000 \, \pi {\left(5 \, \pi \arctan\left(\frac{y}{x}\right) - z\right)}}{x^{2} {\left(\frac{y^{2}}{x^{2}} + 1\right)}} - \frac{5000 \, \pi^{2} y}{x^{3} {\left(\frac{y^{2}}{x^{2}} + 1\right)}^{2}} + \frac{2000 \, \pi {\left(5 \, \pi \arctan\left(\frac{y}{x}\right) - z\right)} y^{2}}{x^{4} {\left(\frac{y^{2}}{x^{2}} + 1\right)}^{2}} & -\frac{200 \, y^{2} {\left(\sqrt{x^{2} + y^{2}} - 1\right)}}{{\left(x^{2} + y^{2}\right)}^{\frac{3}{2}}} + \frac{200 \, y^{2}}{x^{2} + y^{2}} + \frac{200 \, {\left(\sqrt{x^{2} + y^{2}} - 1\right)}}{\sqrt{x^{2} + y^{2}}} + \frac{5000 \, \pi^{2}}{x^{2} {\left(\frac{y^{2}}{x^{2}} + 1\right)}^{2}} - \frac{2000 \, \pi {\left(5 \, \pi \arctan\left(\frac{y}{x}\right) - z\right)} y}{x^{3} {\left(\frac{y^{2}}{x^{2}} + 1\right)}^{2}} & -\frac{1000 \, \pi}{x {\left(\frac{y^{2}}{x^{2}} + 1\right)}} \\
\frac{1000 \, \pi y}{x^{2} {\left(\frac{y^{2}}{x^{2}} + 1\right)}} & -\frac{1000 \, \pi}{x {\left(\frac{y^{2}}{x^{2}} + 1\right)}} & 202
\end{array}\right)$
\end{document}
Here is the result:
How can I properly format the above matrix so that it does not get cut off? How can I make span multiple lines instead?
Best Answer
I am not sure that is good enough for you, but one way to display this matris is to:
Another solution is to define a symbol for the four complicated entries:
Notes:
[showframe]
option was applied to thegeometry
package just to show the page margins.\,
were eliminated -- They are not necessary as the spacing is correct without them.Code: