%%
%% The LaTeX Companion, 3ed
%%
%% Example 11-4-7 on page II-166 in "Continued fractions".
%%
%% Copyright (C) 2022 Frank Mittelbach
%%
%% It may be distributed and/or modified under the conditions
%% of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%%
%% See
https://www.latex-project.org/lppl.txt for details.
%%
\documentclass{tlc3examargin}
\pagestyle{empty}
\setcounter{page}{6}
\setlength\textwidth{207.0pt}
% Shorten the vertical size of the example ...
\AtBeginDocument{%
\setlength\abovedisplayskip{.6\abovedisplayskip}%
\setlength\belowdisplayskip{.6\belowdisplayskip}%
}
%StartShownPreambleCommands
\usepackage{amsmath}
%StopShownPreambleCommands
\begin{document}
\begin{equation*}
\cfrac {1}{\sqrt{2} +
\cfrac {1}{\sqrt{3} +
\cfrac {1}{\sqrt{4} +
\cfrac[r] {1}{\sqrt{5} +
\cfrac[l] {1}{\sqrt{6} + \dotsb }
}}}}
\end{equation*}
\end{document}