2

I would like to write a text equation like this:

Text equation example

The terms of the equation are text and every one should be written in several lines.

Until now I am able to write the equation with text terms of one line, so the whole length is too large:

\text{Variation of neutron number in time}=\text{Rate of production of neutrons}-
\text{Rate of absorption of neutrons}-\text{Rate of leakage of neutrons}    

I tried to use a line break (cntr+enter) but it does create a new whole equation line. I cannot use it inside each text term.

Do you know how to achieve this?

Thanks a lot in advance!

2

You can do that very simply with stackengine: its \Centerstack command is in text mode.

\documentclass{article}
\usepackage[usestackEOL]{stackengine}

\begin{document}

{\sffamily\[ \Centerstack[l]{ Variation of \\neutron number\\ in time}{}={}\Centerstack[l]{Rate of \\production\\ of neutrons}{}-{}\Centerstack[l]{Rate of\\ absorption \\ of neutrons} {}-{}\Centerstack[l]{Rate of \\leakage\\ of neutrons}\]}%

\end{document} 

enter image description here

| improve this answer | |
  • Great! It works perfectly. Thank you! – Maria May 29 at 9:09
2

You could enclose each text segment in a \pbox. Note, this requires the pbox package. This way you can treat each block of text as a math object.

enter image description here

\documentclass{article}

\usepackage{pbox}

\begin{document}

$\pbox{3cm}{Variation of\\ neutron number\\ in time} = \pbox{3cm}{Rate of\\ production\\ of neutrons} - \pbox{3cm}{Rate of\\ absorption\\ of neutrons}-\pbox{3cm}{Rate of\\ leakage\\ of neutrons}$

\end{document}

The \pbox will shrink its width to your text, so you only need a width that is wider than your actual width. I chose 3cm in the example.

| improve this answer | |

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.