1

Suppose I would like to get an equation number on the left into the middle of some long continued fraction like this

enter image description here

Is there any simple way to do it?

MWE:

\documentclass{article}
\usepackage[cp1250]{inputenc}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}

\begin{document}

\begin{equation}
z(s)= z_1 +
\cfrac{1}{y_2+
 \cfrac{1}{z_3+ 
  \cfrac{1}{y_4+  
   \cfrac{1}{\ddots \raisebox{-2ex}{$+\cfrac{1}{z_{2n-3} + \cfrac{1}{y_{2n-2} + \cfrac{1}{z_{2n - 1} + \cfrac{1}{y_{2n}}}}}$}}}}}
\end{equation}

\end{document}
1
  • To me it makes more sense if the equation number is vertically aligned with the = symbol and the main fraction line.
    – Matthias
    Nov 3, 2017 at 23:45

1 Answer 1

4

Embed the formula in gathered:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation}
\begin{gathered}
z(s)= z_1 +
\cfrac{1}{y_2+
 \cfrac{1}{z_3+
  \cfrac{1}{y_4+
   \cfrac{1}{\ddots
    \raisebox{-2ex}{$+\cfrac{1}{z_{2n-3} +
     \cfrac{1}{y_{2n-2} +
      \cfrac{1}{z_{2n - 1} +
       \cfrac{1}{y_{2n}}}}}$}}}}}
\end{gathered}
\end{equation}

\end{document}

enter image description here

You must log in to answer this question.

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