2

My question is related to the out put of following code. I want the \ddots to start from the center of the plus sign and continue diagonally. The way it is right now is bit odd. Any help is much appreciated.

enter image description here

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\newcommand*{\cofrac}[2]{%
  {%
    \rlap{$\dfrac{1}{\phantom{#1}}$}%
    \genfrac{}{}{0pt}{0}{}{#1+#2}%
  }%
}
\[
\sqrt{x} =~ \cfrac{1}{a_1+\cfrac{1}{a_2+\cfrac{1}{a_3+\cfrac{1}{a_4+{\ddots}}}}}
\]
\end{document}

1 Answer 1

2

Something like this?

I just placed the \ddots inside a \raisebox of -.33\height.

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\newcommand*{\cofrac}[2]{%
  {%
    \mathrlap{\dfrac{1}{\phantom{#1}}}%
    \genfrac{}{}{0pt}{0}{}{#1+#2}%
  }%
}
\[
\sqrt{x} =~ \cfrac{1}{a_1+\cfrac{1}{a_2+\cfrac{1}{a_3+\cfrac{1}{a_4+\raisebox{-.33\height}{\(\ddots\)}}}}}
\]
\end{document}
1
  • This looks better. Thank you.
    – Quantas
    Apr 16, 2020 at 14:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .