1

For this equation:

P_{\lambda \sigma} = 2 \sum\limits_{i}^{\hbox{occupied  molecular  orbitals} } c_{\lambda i} c_{\sigma i}

I want the words "occupied molecular orbitals" stacked 3 high. I tried \vbox, but that did not work.

  • what do you mean with "stacked 3 high"? – naphaneal Sep 27 '16 at 18:08
1

\substack

A solution with amsmath' macro \substack:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
  P_{\lambda \sigma} =
  2 \sum\limits_{i}^{
    \substack{\text{occupied}\\\text{molecular\vphantom{p}}\\\text{orbitals}}
  }
  c_{\lambda i} c_{\sigma i}
\]
\end{document}

Result \substack

The purpose of \vphantom is the better line spacing.

tabular

Also a `tabular` works:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
  P_{\lambda \sigma} =
  2 \sum\limits_{i}^{
    \text{\scriptsize
      \begin{tabular}{@{}c@{}}occupied\\molecular\\orbitals\end{tabular}%
    }
  }
  c_{\lambda i} c_{\sigma i}
\]
\end{document}

Result tabular

\mathclap

Macro \mathclap lies to TeX, that its contents does not have width. Therefore, it can be used to place the superscript without affecting the horizontal spacing below:

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[
  P_{\lambda \sigma} =
  2 \sum\limits_{i}^{
    \mathclap{%
      \substack{\text{occupied}\\\text{molecular\vphantom{p}}\\\text{orbitals}}
    }%
  }
  c_{\lambda i} c_{\sigma i}
\]
\end{document}

Result \mathclap

plain TeX

$$
  P_{\lambda \sigma} =
  2 \sum\limits_{i}^{
    \hbox to 0pt{%
      \hss
      \vbox{%
        \sevenrm
        \baselineskip=8pt
        \halign{\hss#\hss\cr occupied\cr molecular\cr orbitals\cr}%
      }\hss
    }
  }
  c_{\lambda i} c_{\sigma i}
$$

\bye

Result plain TeX

| improve this answer | |
  • There's also \smashoperator from mathtools. – Manuel Sep 27 '16 at 18:28
1

Instead of placing the string "occupied molecular orbitals" above the \sum symbol, I'd place it below the symbol and group it with the i summation index.

enter image description here

\documentclass{article}
\usepackage{mathtools} % for "\smashoperator" macro
\begin{document}
\[
  P_{\lambda\sigma}
  = 2 \smashoperator{\sum_{\substack{
                              i\in\text{\,occupied}\\
                              \text{molecular}\mathstrut\\
                              \text{orbitals}\mathstrut}}}
  c_{\lambda i} c_{\sigma i}
\]
\end{document}
| improve this answer | |
0

Perhaps a \Longstack in \scriptsize.

\documentclass{article}
\usepackage{stackengine}
\begin{document}
\[
P_{\lambda \sigma} = 2 \sum\limits_{i}^{\scriptsize\Longstack{occupied  molecular  orbitals} 
  } c_{\lambda i} c_{\sigma i}
\]
\end{document}

enter image description here

If you didn't want the spacing of the text to affect the surrounding math, add a \mathclap

\documentclass{article}
\usepackage{stackengine,mathtools}
\begin{document}
\[
P_{\lambda \sigma} = 2 \sum\limits_{i}^{\mathclap{\scriptsize\Longstack{occupied  molecular  orbitals} 
  }} c_{\lambda i} c_{\sigma i}
\]
\end{document}

enter image description here

| improve this answer | |
0

the \substack from amsmath is another way of approaching this.

because there are no descenders on the second and third lines, a \mathstrut is added to keep the lines a constant distance apart.

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
\thispagestyle{empty}
\[
 P_{\lambda \sigma}
  = 2 \sum_{i}^{\substack{\text{occupied}\\
              \mathstrut\text{molecular}\\
              \mathstrut\text{orbitals}}}
  c_{\lambda i} c_{\sigma i}
\]
\end{document}

enter image description here

| improve this answer | |

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