[Tex/LaTex] Formula out of margin

equationsline-breakingmath-mode

I got some issues while writing a formula in LaTeX. I have to print this in my document:

\textit{P3ACM}: $ \left \langle \left \langle ( 09.00, 18.00 ) , \{ Monday, Tuesday, Wednesday, Thursady, Friday \} \right \rangle , \left \langle NOW,  24/12/11:23.59 \right \rangle \right \rangle $

but once I compile it, the formula gets off the margins used in the whole document.
I just started using LaTeX so I'm not so good, would you please suggest me how to get over this problem?

Best Answer

As @carlpett mentioned, LaTeX does not break lines in mathmode automatically. You have to tell it where to perform the breaking. And yes, extensible delimiters specified by \left and \right pairs need to be paired on the same line. A consolation is the use of \left. and \right. to be the "missing" pair on the left/right of another delimiter. However, this does not bode well if the contents between \left and \right are of different sizes between line breaks. For this, \vphantom{<stuff>} prints a zero-width rectangle with height exactly that of <stuff>. This way you can break equations the way you want to, and stretch the height of the extensible delimiters to match each other, even across lines.

A good example mixing all these ideas is contained in section 8.1.1 Braces over several lines (page 25) in Herbert Voß' mathmode document.

Alternatively, foregoing the use of extensible delimiters, you could resize delimiters using any of the following: \big, \bigg, \Big, \Bigg, or \bigl, \bigr, \Bigl, \Bigr, \biggl, \biggr, \Biggl and \Biggr from the amsmath package. Here is an example from the package documentation that highlights this:

\documentclass[12pt]{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
\[
  \left[\sum_i a_i\left|\sum_j x_{ij}\right|^p\right]^{1/p}
  \quad \text{versus} \quad
  \biggl[\sum_i a_i\Bigl\lvert\sum_j x_{ij}\Bigr\rvert^p\biggr]^{1/p}
\]
\end{document}

Different extensible delimiters

Related Question