2

I'm having trouble finding a way to express this fraction with the amsmath package.

enter image description here

The result I'm getting isn't quite nice. Are there alternative ways to write this fraction?

enter image description here

 \documentclass[10pt,norsk, fleqn]{extarticle}
 \usepackage[a4paper, margin=1.2cm,includeheadfoot]{geometry}
 \usepackage{amsmath}

 \begin{document}

 $\displaystyle\frac{a}{\displaystyle\frac{b}{\displaystyle\frac{c}{\displaystyle\frac{d}{e}}}}\to\left(\displaystyle\frac{\left(\displaystyle\frac{\left(\displaystyle\frac{\left(\displaystyle\frac{a}{b}\right)}{c}\right)}{d}\right)}{e}\right)$

 \end{document}
3

1 Answer 1

5

Both solutions are horrible, but I don't think you can get any better.

\documentclass{article}
\usepackage{amsmath}
\usepackage{array,delarray}

\newcommand{\pfrac}[2]{\begin{array}({@{}>{\displaystyle}c@{}})\frac{#1}{#2}\end{array}}

\newcommand{\leftparen}[1]{%
  \raisebox{-\height}{$\left(\vcenter{\hbox{\vphantom{$#1$}}}\right.\kern-\nulldelimiterspace$}%
}
\newcommand{\rightparen}[1]{%
  \raisebox{-\height}{$\left.\kern-\nulldelimiterspace\vcenter{\hbox{\vphantom{$#1$}}}\right)$}%
}
\newcommand{\bigfrac}[1]{\raisebox{-\height}{$#1$}}

\begin{document}

\[
\pfrac{\pfrac{\pfrac{\pfrac{a}{b}}{c}}{d}}{e}
\]

\[
\leftparen{\dfrac{\dfrac{\dfrac{\dfrac{a}{b}}{c}}{d}}{e}}
\leftparen{\dfrac{\dfrac{\dfrac{a}{b}}{c}}{d}}
\leftparen{\dfrac{\dfrac{a}{b}}{c}}
\leftparen{\dfrac{a}{b}}
\bigfrac{\dfrac{\dfrac{\dfrac{\dfrac{a}{b}}{c}}{d}}{e}}
\rightparen{\dfrac{a}{b}}
\rightparen{\dfrac{\dfrac{a}{b}}{c}}
\rightparen{\dfrac{\dfrac{\dfrac{a}{b}}{c}}{d}}
\rightparen{\dfrac{\dfrac{\dfrac{\dfrac{a}{b}}{c}}{d}}{e}}
\]

\end{document}

enter image description here

3
  • 2
    The second one looks like a wireless sign emanating from the tower... :)
    – Sigur
    Nov 16, 2018 at 16:35
  • @Sigur Your comment is beautiful. I am not a person who often makes many compliments but the answers of egreg are wonderful.
    – Sebastiano
    Nov 16, 2018 at 16:56
  • 1
    @Sebastiano, I agree. So wonderful that leads me to see beyond the math... lol
    – Sigur
    Nov 16, 2018 at 17:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.