Text Formattingwhen the equations is too long...beyond the page width

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Sam
Posts: 62
Joined: Fri Nov 30, 2007 1:43 pm

when the equations is too long...beyond the page width

Post by Sam »

Dear All,

I have the following equation which is too long...beyond the page width

how could i divide it into two parts...in a correct way...

thanks for your help

\begin{equation}
%\label{eq:basel-problem}
\theta \emph(t) = \arccos [\frac{A_{1}^2 - (A_0 + (X_{0}\cdot \sin (\omega \cdot t)))^2}{-2\cdot L\cdot (\sqrt{(A_0 + (X_{0}\cdot \sin (\omega \cdot t)))^2 + L^2})}] - \atan((A_0 + (X_{0}\cdot \sin (\omega \cdot t)))/L)
\end{equation}

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

Montag
Posts: 340
Joined: Wed Jul 15, 2009 9:25 am

Re: when the equations is too long...beyond the page width

Post by Montag »

You could use the split-environment provided by amsmath.
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
Sam
Posts: 62
Joined: Fri Nov 30, 2007 1:43 pm

when the equations is too long...beyond the page width

Post by Sam »

Montag wrote:You could use the split-environment provided by amsmath.
thanks for the answer...

could you please give more details... am novice to these terms...

is it part of maths library in latex?
Montag
Posts: 340
Joined: Wed Jul 15, 2009 9:25 am

when the equations is too long...beyond the page width

Post by Montag »

Come on, you could have at least searched for it (on google/bing/yahoo) ...?
Please take a look at sections 1 and 2 in
http://www.latex-community.org/forum/vi ... =37&t=5838

After that, visit http://ctan.org/pkg/amsmath.

I have a question myself: What is the maths library?
OS: Win 7 64-bit LaTeX: MikTeX 2.9 64-bit Editor: TXC 1 RC1
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

when the equations is too long...beyond the page width

Post by svend_tveskaeg »

Here is a document with an example of what Montag is talking about. I have also used the \hphantom command from the mathtools package in order to get the correct alignment.

Code: Select all

\documentclass[12pt]{article}

\usepackage{mathtools}

\begin{document}

Something:
\begin{gather}
\begin{split}
 \label{something}
  \theta(t)
    &= \arccos\left(\frac{A_1^2 - (A_0 + (X_0 \cdot \sin(\omega \cdot t)))^2}{-2 \cdot L \cdot \sqrt{(A_0 + (X_0 \cdot  \sin(\omega \cdot t)))^2 + L^2}}\right)\\
    &\hphantom{{}=} - \arctan((A_0 + (X_{0} \cdot \sin(\omega \cdot t)))/L)
\end{split}
\end{gather}
In \eqref{something} we have something.

\end{document}
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

when the equations is too long...beyond the page width

Post by localghost »

svend_tveskaeg wrote:[…] I have also used the \hphantom command from the mathtools package in order to get the correct alignment.
This command comes from the LaTeX kernel.
Sam wrote:[…] I have the following equation which is too long...beyond the page width

how could i divide it into two parts...in a correct way […]
Please check your example for completeness and functionality and always provide a full but minimal example. The \atan command doesn't exist as such.

Use the aligned environment from amsmath within equation. The TeX primitive \mathrel provides better alignment of the second line.

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}   % load »amsmath«

\begin{document}
  \begin{equation}\label{eq:basel-problem}
    \begin{aligned}
      \theta(t) &= \arccos\left[\frac{A_{1}^2-(A_0+(X_{0}\cdot\sin(\omega\cdot t)))^2}{-2\cdot L\cdot \sqrt{(A_0 + (X_{0}\cdot \sin (\omega \cdot t)))^2 + L^2}}\right] \\
      &\mathrel{\phantom{=}} -\arctan[A_0+(X_{0}\cdot\sin(\omega\cdot t)))/L]
    \end{aligned}
\end{equation}
\end{document}
See the »Math mode« document for further reading on mathematical typesetting.


Thorsten
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

when the equations is too long...beyond the page width

Post by svend_tveskaeg »

localghost wrote:This command comes from the LaTeX kernel.
Arrrh! Thanks!
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
Post Reply