# How to vertically center equation number in single long continued fraction?

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

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}

$$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{document}

• To me it makes more sense if the equation number is vertically aligned with the = symbol and the main fraction line. – Matthias Nov 3 '17 at 23:45

Embed the formula in gathered:
\documentclass{article}
$$\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}$$