# Word stacking in math mode

I have this wordy equation and don't have much room in my two-column article style. I want to stack small expressions with a "partial line break", so as to save room. I figured it out, but it isn't natural at all:

\begin{alignat*}{6}
Total\; expected\; loss\; of\; diversity\; = \\
\sum_{\substack{all\\languages}}
(_{Distinctiveness}^{\;\;\;\;\; Language}) \cdot \Pr(_{\;\;\;\;\:dies}^{Language})
\end{alignat*}


I feel like a twelve-year-old designing a webpage with non-ending <br/> strings

Is there a designated feature for this kind of thing?

-

You could misuse the command \binom{}{} for this. In order to get a bigger summation sign then, I used the package relsize and scaled the sign for two times.

% arara: pdflatex

\documentclass[twocolumn]{article}
\usepackage{blindtext}
\usepackage{mathtools}
\usepackage{relsize}

\begin{document}
\blindtext
\begin{multline*}
\text{Total expected loss of diversity} =\\
\mathlarger{\mathlarger\sum}_{\substack{\text{all}\\\text{languages}}}
\binom{\text{Language}}{\text{Distinctiveness}} \cdot \Pr\binom{\text{Language}}{\text{dies}}
\end{multline*}
\blindtext
\end{document}


-

Text can be set with \text and you can continue using \substack:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat*}{6}
\text{Total expected loss of diversity} = \\
\sum_{\substack{\text{all}\\\text{languages}}}
\big(\substack{\text{Language}\\\text{Distinctiveness}}\big)
\cdot
\Pr\big(\substack{\text{Language}\\\text{dies}}\big)
\end{alignat*}
\end{document}


With using multline:

\documentclass[a4paper,twocolumn]{article}
\usepackage{amsmath}
\begin{document}
\begin{multline*}
\text{Total expected loss of diversity} = \\
\sum_{\substack{\text{all}\\\text{languages}}}
\big(\substack{\text{Language}\\\text{Distinctiveness}}\big)
\cdot
\Pr\big(\substack{\text{Language}\\\text{dies}}\big)
\end{multline*}
\end{document}


-

The amsmath package has plenty of features to cope with this without abusing commands. I'd avoid pseudo-formulas like

Total expected loss of diversity = <formula>

particularly when this would force a split display. But this is not the main concern, do it with multline* if you prefer.

\documentclass[twocolumn]{article}
\usepackage{lipsum}
\usepackage{amsmath}

\begin{document}
\lipsum*[2]
The \emph{total expected loss of diversity} is
$\sum_{\substack{\textup{all}\\\textup{languages}}} \left(\begin{smallmatrix} \textup{Language}\\ \text{Distinctiveness} \end{smallmatrix}\right) \cdot \Pr\left(\begin{smallmatrix} \textup{Language}\\ \textup{dies} \end{smallmatrix}\right)$
\lipsum[3]
\end{document}


Notice \textup so the words will be upright even in an italic context.

-
As a refinement, perhaps you could put \textup{\makebox[0pt]{languages}} to avoid the big gap after the Sigma? – Thruston Jun 5 '14 at 16:11

stackengine offers a compact syntax in a case like this.

\documentclass{article}
\usepackage{stackengine}
\begin{document}
\stackunder[8pt]
{Total expected Loss of diversity =}
{$\displaystyle\sum_{\Shortstack{\tiny all \tiny languages}} \left(\Centerstack{Language Distinctiveness}\right)\cdot \Pr\left(\Centerstack{Language dies}\right)$}
\end{document}


-