[Tex/LaTex] Multiline \text in an equation

equations

There are a number of possibilities to have multiline equations, but I am looking for multiline \text{...} elements. For example:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{equation}
  a^3 + b^3 \neq c^3 \text{ I have discovered a truly marvelous proof of this,\\which this margin is too narrow to contain.}
\end{equation}

\end{document}

Is there a way to break that long text into two lines? The \\ does not work here.

Best Answer

Remarks

To reserve a box for text of a given size, use the \parbox macro.

\parbox[position]{width}{text}
  • position (optional): LaTeX will position the box, such that its center lines up with the surrounding text. Possible values can be t or b

  • width (mandatory): Specifies the width. The width needs a unit like em, cm, ex, etc...

  • text (can be empty): Your text, of course.

Keep in mind, that multiline text inside a box needs to be fit into the paragraph and therefore heavily disrupts your spacing!

Implementation

\documentclass{article}
\pagestyle{empty}
\begin{document}
\begin{equation}
    a^3 + b^3 \neq c^3 \; \parbox{15em}{I have discovered a truly marvelous proof of this,\\which this margin is too narrow to contain.}
\end{equation}
\end{document}

Output

enter image description here