This is an alternative which comes closer to Euler's format. It creates the staggered appearance that is commonly used. The width of the finished fraction is the width at the widest point. To use, at the highest level use \cofrac{a}{b}{c}
for a/(b+c) and then nest sub-levels using \cofracel{a}{b}{c}
, e.g.
\cofrac{a}{b+}{\cofracel{aa}{bb+}{\cofracel{aaa}{bbb+}{\cofracdots}}}
The \cofracdots
command adds diagonal dots.
It is probably not the most elegant LaTeX formulation.

% -----------------------------------------------------------------------------------
% Continued fractions for use in math environment
% Use \cofrac{a}{b}{c} for a/(b+c) at highest level
% Set c to a continued fractior to build recursive structure
% Use \cofracel{a}{b}{c} for recursive terms
% Matches line for fractions to correct size
% -----------------------------------------------------------------------------------
% Temporary variables
%
\newlength{\cfDeleted}
\newlength{\cfA}
\newlength{\cfB}
\newlength{\cfC}
\newlength{\cfX}
\newlength{\cfY}
% -----------------------------------------------------------------------------------
\newcommand{\cofrac}[3]
{
\setlength{\cfDeleted}{0pt}
\cofracel{#1}{#2}{#3}\; \hspace{\cfDeleted}
}
% ------------------------------------------------------------------------------------
\newcommand{\cofracel}[3]
{
\settowidth{\cfA}{$#1$}
\settowidth{\cfB}{$#2\;$}
\settowidth{\cfC}{$#3$}
% Calculate B + C and take max of B + C and A
\setlength{\cfY}{\cfB}
\addtolength{\cfY}{\cfC}
\setlength{\cfX}{\maxof{\cfY}{\cfA}}
% \cfX has "true" width of fraction - at least at this level
% Now get 1/2 (A + B + C) and take greater of that and A by itself
\addtolength{\cfY}{\cfA}
\setlength{\cfY}{0.5\cfY}
\setlength{\cfY}{\maxof{\cfY}{\cfA}}
% \cfY has shortened width of fraction
% calculate amount deleted
\setlength{\cfC}{\cfX}
\addtolength{\cfC}{-\cfY}
\addtolength{\cfDeleted}{\cfC}
% Promote to global here and save for later
\global\cfDeleted=\cfDeleted
\setlength{\cfX}{\cfDeleted}
% then draw .. this may include multiple additional recursions
{
\mathrlap{\cfrac{#1}{{#2\;}{#3}}}\hspace{\cfY}
}
% and restore the saved deleted
\global\cfDeleted=\cfX
}
% ------------------------------------------------------------------------------------
\newcommand{\cofracdots}{\genfrac{}{}{0 pt}{}{\phantom{1}}{\ddots}}
% End of continued fractions
% ---------------------------------------------------------------