# latex equation not displaying correct format

my equation not displaying in expected format. can any one help me to correct this equation to display exactly the same as source.. i used this code

\alpha=a_{1}+\frac{1}{a_{2}+\cdots+\frac{1}{a_{n}+\frac{1}{\alpha_{n+1}}}}.


• Use \cfrac (continued fraction) instead of the normal \frac – Sean Allred Jul 31 '13 at 3:52
• @SeanAllred an answer? :) – cmhughes Jul 31 '13 at 5:39

Use \cfrac (which stands for continued fraction) instead of the normal \frac. Unlike \frac, \cfrac does not scale its arguments (at least not nearly as much) and instead focuses on enlarging the fraction box as a whole.

\documentclass{article}
\usepackage[margin=1cm,b6paper]{geometry}

\usepackage{amsmath} % Contains the definition of \cfrac

\begin{document}
\section*{Using \texttt{frac}}
$\alpha=a_{1}+\frac{1}{a_{2}+\cdots+\frac{1}{a_{n}+\frac{1}{\alpha_{n+1}}}}$

In \verb|equation|:
\begin{equation*}
\alpha=a_{1}+\frac{1}{a_{2}+\dots+\cfrac{1}{a_{n}+\frac{1}{\alpha_{n+1}}}}
\end{equation*}

\section*{With \texttt{cfrac}}
$\alpha=a_{1}+\cfrac{1}{a_{2}+\cdots+\cfrac{1}{a_{n}+\cfrac{1}{\alpha_{n+1}}}}$

In \verb|equation|:
\begin{equation*}
\alpha=a_{1}+\cfrac{1}{a_{2}+\cdots+\cfrac{1}{a_{n}+\cfrac{1}{\alpha_{n+1}}}}
\end{equation*}
\end{document}