20

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.

  • 1
    A text as long like this is normally placed outside of mathmode. Only fillwords, like and, where, or are placed inside mathmode to concatenate the various terms. Also, please always provide a fully featured minimal working example (MWE), your question are highly more likely to get answered then. – Henri Menke Jul 29 '13 at 17:13
  • Thanks for the comment, I will update it into a full MWE. I am aware that \text is meant rather for short annotations, but sometimes I feel it's better to put the text there than in an \intertext or in a footnote. – quazgar Jul 29 '13 at 17:28
27

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.