Thanks for stopping by to help with my question. I'm trying to mimic what my professor did in our notes, putting a box around a specific portion of a continued fraction, shown below:

Continued fraction box

Here's the LaTex code I was trying to use for the continued fraction itself (sorry, I don't know how to format it so it looks nice like other questions I've seen on here):


Any help you might be able to provide would be much appreciated!

1 Answer 1


Simply use \boxedn and don't use $$ … $$, which is plain TeX code and produces bad spacing. Use [ … \] instead for unnumbered display formulae. Also with :=, the colon is not centred on the maths axis. Prefer \coloneqq instead, which is defined in mathtools, an extension of amsmath:



\[ X\coloneqq\cfrac{1}{a+\boxed{\cfrac{1}{a+\cfrac{1}{a+\cfrac{1}{a+\cfrac{1}{a+ ⋯ }}}}}} \]


enter image description here

  • Thanks, @Bernard! I appreciate your help and assistance in formatting my question.
    – jbrow35
    Oct 20, 2016 at 0:48
  • You're welcome. Always glad to help!
    – Bernard
    Oct 20, 2016 at 0:53

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.