[Tex/LaTex] Plus-minus sign in the continued fraction

math-mode

Continued fraction

How to write the plus/minus signs aligned with the bottom of the fraction. I can write the rest of the part of equation (1.1) and (1.2). but can cot write the plus/minus sign at the bottom.

Best Answer

Here are two options:

enter image description here

\documentclass{article}
\usepackage{amsmath}
\newcommand{\subplus}{\mathbin{\genfrac{}{}{0pt}{}{}{+}}}
\newcommand{\subminus}{\mathbin{\genfrac{}{}{0pt}{}{}{-}}}
\newcommand{\subcdots}{\genfrac{}{}{0pt}{}{}{\cdots}}
\begin{document}

Option 1:
\[
  1 - \begin{array}{@{}*{8}{c@{}}}
    1 &       & 1 &       & 1 &       & 1 \\ \cline{1-1}\cline{3-3}\cline{5-5}\cline{7-7}
    1 & {}+{} & 1 & {}-{} & 1 & {}+{} & 1 & {}- \cdots
  \end{array} =
  \frac{\sqrt{5}-1}{2}
\]

Option 2:
\[
  1 - \frac{1}{1} \subplus \frac{1}{1} \subminus \frac{1}{1} \subplus \frac{1}{1} \subminus \subcdots =
  \frac{\sqrt{5}-1}{2}
\]

\end{document}

OptionĀ 1 sets the fraction as an array, using \cline to simulate the fraction lines. OptionĀ 2 uses amsmath to set a fraction with 0pt horizontal rule. Additional macros have been created to set these using \subplus, \subminus and \subcdots.

Related Question