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!

1 Answer 1

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

2
  • 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

You must log in to answer this question.

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