# Equations whose terms are multiple lines of text

I would like to write a text equation like this:

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?

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}


• Great! It works perfectly. Thank you! – Maria May 29 at 9:09

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.

\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.