# equality sign and fraction bar alignments in complex fractions around braces

When some math expressions such as complex fractions are around the braces which should be on the same baseline, besides, equality sign should be aligned with vinculum, how can we handle? For example, in the following formula, is it possible to make the equality signs aligned with the fraction bars?

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
$$S_d=\left[\begin{array}{@{}c@{}} \cfrac{\displaystyle\sum_{j=1}^{n}{(d_j-\bar{d})^2}}{n-1} \end{array}\right]^{1/2} =\left[\begin{array}{@{}c@{}} \cfrac{\displaystyle\sum_{j=1}^{n}{d_j^2}-\cfrac{1}{n}\left(\sum_{j=1}^{n}{d_j}\right)^2}{n-1} \end{array}\right]^{1/2}$$
\end{document}


-
+1 for posting the complete equation; that's something one can work on. (Next time make it even better and post complete code with \documentclass and all, please.) –  Hendrik Vogt Jan 21 '11 at 14:31

Here's how I would typeset this:

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
$$S_d = \left[ \frac{1}{n-1} \sum_{j=1}^{n} (d_j-\bar{d})^2 \right]^{1/2} = \left[ \frac{1}{n-1} \right]^{1/2} \left[ \sum_{j=1}^{n} d_j^2 - \frac{1}{n} \left( \sum_{j=1}^{n} d_j \right)^2 \right]^{1/2}$$
\end{document}


Herbert is quite right, the parentheses should always be symmetrical to the math baseline, and you should not use your above construct. Just try and avoid such fractions altogether.

-

That is not easy in fact of your unbalanced fractions. From the rules of mathematical typesetting the parentheses are always symmetrical to the math baseline:

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}

$$S_d = \left[ \dfrac{\sum\limits_{j=1}^{n}{(d_j-\bar{d})^2} \vphantom{ \left(\displaystyle\sum\limits_{j=1}^{n}{d_j} \right)^2 } }{n-1} \right]^{1/2} = \left[ \dfrac{\sum\limits_{j=1}^{n}{d_j^2}-\cfrac{1}{n} \left(\sum\limits_{j=1}^{n}{d_j}\right)^2}{n-1} \right]^{1/2}$$

\end{document}


Making the parentheses smaller doesn't really look good. Examples can be found in Mathmode.pdf.

-

As Herbert mentioned, math typesetting isn’t really done this way anymore, but it’s what Karel Wick recommends in Rules for Type-setting Mathematics (1965). If you want this sort of thing in LaTeX, you can use the nath package which reproduces these rules. The drawback is that nath has a specific syntax for math, so you may have to rewrite all your formulas and if it’s for an article you’re going to publish, the journal may not want you to use nath. If none of these disadvantages bother you, here's what your equation would look like:

Personally, I find this looks a bit strange and would prefer what Hendrik suggested in his answer. Here’s the code:

\documentclass[12pt]{article}
\usepackage{nath}
\begin{document}
$$S_d=[\frac{\sum_{j=1}^{n}(d_j-\bar{d})^2}{n-1}]^{1/2} =[\frac{\sum_{j=1}^{n} d_j^2 - \frac{1}{n}(\sum_{j=1}^{n}{d_j})^2}{n-1}]^{1/2}$$
\end{document}


Notice that, with nath, there is no need for \left and \right, the correct sizes are automatically chosen for you.

-
... and journals often have house styles which would override your choice in any case. –  Willie Wong Apr 3 '11 at 0:18