1

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.

  • Welcome to TeX.SX! Please help us to help you and add a full minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. Is easier for us in this way can help you copiyng and running code instead watch a screenshot. – Aradnix Oct 29 '14 at 4:30
  • no no. I have written this code: [a_0+\frac{b_1}{a_1}_+\frac{b_2}{a_2}]So I am not getting desirable space in plus sign between two fraction. – Sushree Oct 29 '14 at 4:42
7

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.

  • ...I prefer Option 2. – Werner Oct 29 '14 at 8:23

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.