# How to properly break text with lots of inline formulas?

I have the following document:

\documentclass{article}
\begin{document}
\textbf{Theorem:}
$\forall x_0\cdots\forall x_{n+2}( \forall x_{n+3}(x_{n+3}\in x_{n+1}\leftrightarrow \bigvee_{i=0}^n(x_{n+3}=x_i))\land \forall x_{n+3}(x_{n+3}\in x_{n+2} \leftrightarrow\bigvee_{i=0}^n(x_{n+3}=x_i)) \rightarrow x_{n+1}=x_{n+2})$.
\end{document}


When compiling it, I get a: Overfull \hbox (29.87967pt too wide) warning message. I can get rid of it by adding \raggedright before the theorem statement, but this way lines are not filled completely. I'd like to have justified text, no matter where LaTeX decides to break the formula. How can I accomplish this?

Thanks.

-
Usually an inline formula that exceeds one line should not be an inline formula after all. As opposed to text, line breaks may have impact on legibility in formulas. – Carsten Thiel Apr 13 '11 at 13:14

I would suggest several modifications to your code: 1) Instead of writing the theorem heads manually, you can use the theorem-like environments provided by the amsthm package. 2) Instead of just writing the formula in in-line math mode, I would write it as a displayed expression using one of the environments provided by the amsmath package. 3) I would also suggest you to start your theorem with some text defining the terms involved in the expression. Here's a modified version of your theorem:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}

\newtheorem{theo}{Theorem}

\begin{document}

\begin{theo}
Let $x_0, x_1\ldots x_{n+3}$ be...
\begin{multline*}
\forall x_0 \cdots \forall x_{n+2} \biggl(
\forall x_{n+3} \bigl( x_{n+3} \in x_{n+1} \leftrightarrow
\bigvee_{i=0}^n (x_{n+3}=x_i) \bigr) \\
\land \forall x_{n+3}\bigl( x_{n+3} \in x_{n+2}
\leftrightarrow\bigvee_{i=0}^n(x_{n+3}=x_i) \bigr)
\rightarrow x_{n+1}=x_{n+2} \biggr).
\end{multline*}
\end{theo}

\end{document}

-