4

After spending quite some time making sure this wasn't already answered, I decided to post this anyway, as I haven't found what I'm looking for.

I have this equation with nested fractions, and I want the Left Hand Side to be centered with respect to the Right Hand Side. It now appears at the hard left corner, I want it to be in the middle. See the picture below for an example.

\documentclass[]{Article}
\usepackage{amssymb,amsmath} 
\begin{document}

\begin{math}

\ C(m) =  \cfrac{D_1(K_1+mK_2)}{1- \cfrac{1}{ \left(  \cfrac{D_1+D_2}{D_2} \right) ^{m+1}- \cfrac{D_1}{D_2}}}
\end{math}

\end{document}

example

1 Answer 1

2

I would advise against this, since the display seems confusion. The fractional content is aligned, vertically, to the outer \frac's math axis, which is located at the horizontal rule. However, you can fake a fraction using an array, that has a vertically centered math axis regardless of the location of the horizontal rule:

enter image description here

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}

\[
  C(m) = \cfrac{D_1(K_1 + mK_2)}
    {1 - \cfrac{1}
      { \left( \cfrac{D_1 + D_2}{D_2} \right)^{m+1} - \cfrac{D_1}{D_2}}}
\]

\[
  C(m) = \begin{array}{@{}c@{}}
    D_1(K_1 + mK_2) \\ \hline
    1- \dfrac{\strut 1}
      { \biggl( \dfrac{D_1 + D_2}{D_2} \biggr)^{m+1} - \dfrac{D_1}{D_2}}
    \end{array}
\]
\end{document}

There didn't seem to be a need for using the continued fractions.

2
  • Thank you for the quick response! Your code looks really neat. I suppose the position of the LHS is a matter of taste. I might reconsider repositioning it. And, I have yet to delve into the subtleties of dfrac/cfrac. Commented Jan 10, 2014 at 3:28
  • @MisterMister: All the subtleties are described in the amsmath user guide (section 4.11 Fractions and related constructions, p 14).
    – Werner
    Commented Jan 10, 2014 at 3:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .