Math & ScienceFit a very long Equation into the Page

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
Sam
Posts: 62
Joined: Fri Nov 30, 2007 1:43 pm

Fit a very long Equation into the Page

Post by Sam »

Dear All,

I have already posted similar question, but never gone around solving this problem!!!

How can I fit a very long equation into an A4 page ?

Please see attached the output file.

and here is the code:

Code: Select all

\begin{equation}
U_{1} = \frac{\frac{L \sqrt{(A_{0} + x)^2 + L^2} \sin(\frac{A_{0} + x}{L} + \theta)}{I_{p}A_{2}}}{\frac{L \sqrt{(A_{0} + x)^2 + L^2} \sin(\frac{A_{0} + x}{L} + \theta)}{m I_{p}A_{2}} - \frac{m L \sqrt{(A_{0} + x)^2 + L^2} \sin(\frac{A_{0} + x}{L} - \theta)}{m I_{p}A_{1}}}(\dot{x}_{2}- tr_{1} x_{2} - I_{p}A_{2}\frac{(\dot{x}_{4} - tr_{4} x_{2})}{m L \sqrt{(A_{0} + x)^2 + L^2}\sin(\frac{A_{0} + x}{L} + \theta)} - g)
\label{eq:u1}
\end{equation}
I tried using the recommended syntax: but it still does not work...

Code: Select all

\begin{gather}
\begin{split}
\label{u1S}U_{1} = \frac{\frac{L \sqrt{(A_{0} + x)^2 + L^2} \sin(\frac{A_{0} + x}{L} + \theta)}{I_{p}A_{2}}}{\frac{L \sqrt{(A_{0} + x)^2 + L^2} \sin(\frac{A_{0} + x}{L} + \theta)}{m I_{p}A_{2}} - \frac{m L \sqrt{(A_{0} + x)^2 + L^2} \sin(\frac{A_{0} + x}{L} - \theta)}{m I_{p}A_{1}}}(\dot{x}_{2}- tr_{1} x_{2} - I_{p}A_{2}\frac{(\dot{x}_{4} - tr_{4} x_{2})}{m L \sqrt{(A_{0} + x)^2 + L^2}\sin(\frac{A_{0} + x}{L} + \theta)} - g)
\end{split}\end{gather}
Attachments
equation-long-better.jpg
equation-long-better.jpg (32.77 KiB) Viewed 10067 times
Last edited by localghost on Thu Aug 11, 2011 8:54 pm, edited 4 times 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.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Fit a very long Equation into the Page

Post by Stefan Kottwitz »

Hi Sam,

use \\ somewhere in the equation for breaking the line. Further you could use & for alignment, if needed.

Code: Select all

\documentclass{book}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{split}
\label{u1S}U_{1} = \frac{\frac{L \sqrt{(A_{0} + x)^2 + L^2} \sin(\frac{A_{0} + x}{L} + \theta)}{I_{p}A_{2}}}{\frac{L \sqrt{(A_{0} + x)^2 + L^2} \sin(\frac{A_{0} + x}{L} + \theta)}{m I_{p}A_{2}} - \frac{m L \sqrt{(A_{0} + x)^2 + L^2} \sin(\frac{A_{0} + x}{L} - \theta)}{m I_{p}A_{1}}}(\dot{x}_{2} \\
  - tr_{1} x_{2} -  I_{p}A_{2}\frac{(\dot{x}_{4} - tr_{4} x_{2})}{m L \sqrt{(A_{0} + x)^2 + L^2}\sin(\frac{A_{0} + x}{L} + \theta)} - g)
\end{split}
\end{equation}
\end{document}
And please use the Code environment in the forum when posting code, as I did, there's a button for Code when writing or editing.

Stefan
LaTeX.org admin
Post Reply