How do I make this in LaTeX? I keep losing track of the brackets.
Asked
Active
Viewed 1.8k times
18
JPi
- 13,595
user121994
- 251
2 Answers
25
The following code is "full LaTeX":
\documentclass{article}
\usepackage{amsmath} % for "\cfrac" macro
\begin{document}
\[
\mathrm{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\vphantom{\cfrac{1}{1}} }}}}}}}}
\]
\end{document}
If you want, you can copy and paste the math part -- the stuff between \[ and \] -- into latex2png.com.
Mico
- 506,678
-
2I am SO grateful! Thank you very much Mico (and all others helping me out) – user121994 Dec 30 '16 at 18:35
-
2I learned something new today as well: the existence of the site
latex2png.com! – Mico Dec 30 '16 at 18:36 -
2Our 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 – user121994 Dec 30 '16 at 18:38
6
Or, using no packages:
\documentclass{standalone}
\begin{document}
$e=
2+\frac{1}{1+\frac{1}{2+\frac{1}{1+\frac{1}{1+\frac{1}{4+\frac{1}{1+\frac{1}{1+\frac{1}{6+\cdots}}}}}}}
}
$
\end{document}
Yields:
Although \cfrac works better, this seemed to be what you were originally trying to get.
The copyable code for the website would be:
e=2+\frac{1}{1+\frac{1}{2+\frac{1}{1+\frac{1}{1+\frac{1}{4+\frac{1}{1+\frac{1}{1+\frac{1}{6+\cdots}}}}}}}}
Dan
- 3,699



\cfracmacro provided by theamsmathpackage? – Mico Dec 30 '16 at 18:25\cfracworks at that site, I just tried – David Carlisle Dec 30 '16 at 18:31y = 2+\cfrac{1}{1+\cfrac{1}{2+\cfrac{1}{1+\dots}}}on that site, it works – Dec 30 '16 at 18:32\section{Foo};-) – Dec 30 '16 at 18:33e=\xcontfrac{2;1,2,1,4,1,1,6+\cfraccdots}(in math mode, of course). – egreg Dec 30 '16 at 19:09