I am trying to write a continued fraction in the style in the image provided. This involves lowering the + symbol to be on the same part of the page as the denominators of the fraction, but I am not sure how to do this. Any help would be appreciated. Thanks.
2 Answers
Use {\atop +}
to lower the +
\documentclass{article}
\begin{document}
$a_1+\frac{1}{a_2} {\atop +} \frac{1}{a_3} {\atop +\ \cdots\ +}$
\end{document}
EDIT: As @David Carlisle suggested you could also use \genfrac{}{}{0pt}{}{}{+}
from amsmath
and get the same result without using a TeX primitive.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
$a_1+\frac{1}{a_2} \genfrac{}{}{0pt}{}{}{+} \frac{1}{a_3} \genfrac{}{}{0pt}{}{}{+\ \cdots\ +}$
\end{document}
-
4yes although
amsmath
will scream at you for the tex-primitive syntaxPackage amsmath Warning: Foreign command \atop;
so better to use\genfrac
I think. Commented Nov 18, 2021 at 17:37 -
@DavidCarlisle Thanks! I hadn't known about
\genfrac
. I edited in the\genfrac
equivalent to the answer.– DanCommented Nov 18, 2021 at 17:47 -
Using amsmath
to include \text{...}
to \raisebox{...}{$+$}
by -1.5ex
or a suitable depth
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath}
\newcommand{\lp}{\text{\raisebox{-1.5ex}{$\,+\,$}}}
\newcommand{\ls}[1]{\text{\raisebox{-1.5ex}{#1}}}
\begin{document}
\[
a_1 +
\frac{1}{a_2} \lp
\frac{1}{a_3} \lp
\frac{1}{a_3} \lp
\ls{$\,\cdots\,$} \lp
\frac{1}{a_n}
\]
\end{document}
to get something like this...