3

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):

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\begin{document}
$$X:=\cfrac{1}{a+\cfrac{1}{a+\cfrac{1}{a+\cfrac{1}{a+\cfrac{1}{a+\cdots}}}}}$$
\end{document}

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

6

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:

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\begin{document}

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

\end{document}

enter image description here

  • Thanks, @Bernard! I appreciate your help and assistance in formatting my question. – jbrow35 Oct 20 '16 at 0:48
  • You're welcome. Always glad to help! – Bernard Oct 20 '16 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.