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}
  • 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
5

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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