1

I wrote the following equation with text inside:

\begin{equation*}
\text{$\Gamma$ schedulabile con RM in presenza di preemption} \quad \Leftrightarrow \quad \sum_{i = 1}^{n} \frac{C_i}{T_i} \leq n \, \left( 2^{1/n} - 1 \right)
\end{equation*}

I'd like to know if there is a way to break only the text line without affecting the math formula. E.g. the line break should occur after RM, and should affect only what I wrote inside \text{}.

2
  • 1
    replace \text by \parbox{3cm} Commented Jan 24, 2021 at 10:42
  • Perfect @DavidCarlisle it's exactly what I'm looking for Commented Jan 24, 2021 at 10:43

3 Answers 3

4

You can replace \text by \parbox{3cm} or perhaps \parbox[t]{3cm} or whatever width you need to have a box that allows line breaking.

2

Here are two solutions: one with pbox package, and its eponymous command, which is like \parbox{some length}, except the length is the maximum length of the box, and another solution with stackengine:

\documentclass{article}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{pbox}
\usepackage[usestackEOL]{stackengine} 

\begin{document}

\begin{equation*}
\pbox{40mm}{$\Gamma$ schedulabile con RM\\ in presenza di preemption} \quad \Leftrightarrow \quad \sum_{i = 1}^{n} \frac{C_i}{T_i} \leq n \, \left( 2^{1/n} - 1 \right)
\end{equation*}

\begin{equation*}
\Centerstack[l]{$\Gamma$ schedulabile con RM\\ in presenza di preemption} \quad \Leftrightarrow \quad \sum_{i = 1}^{n} \frac{C_i}{T_i} \leq n \, \left( 2^{1/n} - 1 \right)
\end{equation*}

\end{document} 

enter image description here

1
  • Thank you very much for your answer @Bernard Commented Jan 24, 2021 at 11:03
2

You can simply use tabular. This allows to make no guess on the desired width.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation*}
\begin{tabular}{@{}l@{}}
  $\Gamma$ schedulabile con RM \\
  in presenza di preemption
\end{tabular}
\iff
\sum_{i = 1}^{n} \frac{C_i}{T_i} \leq n ( 2^{1/n} - 1 )
\end{equation*}

\end{document}

enter image description here

I removed \,, \left and \right. They serve no purpose and actually make the formula ambiguous

enter image description here

In the second case the parentheses are way too big and they seem to mark a side condition, rather than a factor.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .