How do I make this in LaTeX? I keep losing track of the brackets.

enter image description here

  • Do you know about the \cfrac macro provided by the amsmath package?
    – Mico
    Dec 30, 2016 at 18:25
  • I don't have any packages, I use latex2png.com, as my teacher told me to use it.
    – JC123
    Dec 30, 2016 at 18:26
  • 3
    \cfrac works at that site, I just tried Dec 30, 2016 at 18:31
  • 1
    Checked with y = 2+\cfrac{1}{1+\cfrac{1}{2+\cfrac{1}{1+\dots}}} on that site, it works
    – user31729
    Dec 30, 2016 at 18:32
  • 2
    See this answer of mine for being able to use the friendlier syntax e=\xcontfrac{2;1,2,1,4,1,1,6+\cfraccdots} (in math mode, of course).
    – egreg
    Dec 30, 2016 at 19:09

2 Answers 2


The following code is "full" LaTeX:

\usepackage{amsmath} % for "\cfrac" macro
e=2+\cfrac{1}{1+\cfrac{1}{2+\cfrac{1}{ 1+\cfrac{1}{1+\cfrac{1}{4+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{6+\cdots}}}}}}}}

enter image description here

If you want, you can copy and paste the math part -- the stuff between \[ and \] -- into latex2png.com.

  • 1
    I am SO grateful! Thank you very much Mico (and all others helping me out)
    – JC123
    Dec 30, 2016 at 18:35
  • 2
    I learned something new today as well: the existence of the site latex2png.com!
    – Mico
    Dec 30, 2016 at 18:36
  • 2
    Our teacher told us we had to use it in our assignments, glad we could learn each other something. I think it's really nice to get into such a respectful and friendly community
    – JC123
    Dec 30, 2016 at 18:38

Or, using no packages:



enter image description here

Although \cfrac works better, this seemed to be what you were originally trying to get.

The copyable code for the website would be:


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.