I have text inside an equation that is too long for one line:
\documentclass{amsart}
\newcommand{\sset}[1]{\{ #1 \}}
\begin{document}
We have $(x, y, z) \in \sset{(a, b, c) \in \mathbb{N}^3 \mid \text{they satisfy a very complicated condition that can only be described in text}}$.
\end{document}
This renders like in the picture.
As you can see, the text goes outside the boundaries of my document, which is bad. Instead, I want it to look something like this: I have produced this with
\documentclass{amsart}
\begin{document}
We have $(x, y, z) \in \{(a, b, c) \in \mathbb{N}^3 \mid \text{they satisfy a very complicated condition that}$
$\text{ can only be described in text}\}$.
\end{document}
This looks like really bad style.
(For instance, what happens when I add a sentence in front?
Then I have to rearrange the split.
Also I can not use my custom command \sset
here, but that's OK I guess.)
I have tried to use \linebreak
or \allowbreak
inside the \text
, but they seem to do nothing.
What I would like to have is a command that I can use inside \text
that allows the text to break at that point.
Then I can put this command at multiple positions and LaTeX will decide where to put the break.
An alternative would be a command \breaktext
for breakable text which I can use instead of \text
.
\usepackage[utf8]{inputenc}
inputenc
-line in the question.We have $(x, y, z) \in \{(a, b, c) \in \mathbb{N}^3 \mid $ they satisfy a very complicated condition that can only be described in text $\}$
", is that correct? I don't know, it feels wrong. The text belongs (semantically) to the inline math expression. So it should stay inside it, I think. In particular, this approach would force me to split the braces $\{ ... \}$ up into two inline math environments.}
inside the inline math.