Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

The result I have with the code above, which I would like with better code

share|improve this question

4 Answers 4

up vote 1 down vote accepted

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}

enter image description here

share|improve this answer

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}

Result

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} 

Result multline

share|improve this answer

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.

enter image description here

share|improve this answer
    
As a refinement, perhaps you could put \textup{\makebox[0pt]{languages}} to avoid the big gap after the Sigma? –  Thruston Jun 5 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}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.