2

I'm trying to write the following images in TeX using MathJax rendering:

enter image description here

So I have the following equation:

\[
\frac{36}{60} = \frac{18}{30} = \frac{9}{15} = \frac{3}{5}
\]

And I want to display arrows above the numerators, and above the denominators. And above this arrow I need to display some text (see the image for the details).

I have the feeling that this is quite impossible with the latex that MathJax support, so I'm now thinking about using svg, but maybe I'm overseeing something.

  • It would be easier to understand what you wanted if you added minimal working example to show what you are doing: without code that exhibits your problem we have to guess what you are doing. From what you have written it sounds more like a MathJax rather than a latex question, in which it's probably off-topic for TeX.SX. Please clarify. – Andrew Dec 8 '17 at 11:17
  • @Andrew I have added the code that I have. It is not about MathJax, but I use the Mathjax for rendering the TeX I write. So there are some limitation. For example, I can't use every latex package out there, so I thought this context is important. – Kasper Dec 8 '17 at 11:28
  • 2
    I don't think this is doable in mathjax. It only handles limited letters and similar, not random arrows, that might even be undoable in traditional html. Again, mathjax is not relevant here. That said, this should not be a problem for tikz and pdflatex. – daleif Dec 8 '17 at 12:28
1

Here is my not so close but working solution ^^

\documentclass[varwidth,border=7pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc, bending}
\usepackage{amsmath}

\def\da#1{\tikz[baseline=(A.base)]
  \draw[red, -stealth, line width=.035em]
    (0,0) node[circle, inner sep=0cm](A){$#1$}
    let \p1=(A.north east),\p2=(A.south west), \n1={\x1-\x2} in
      (180:\n1) arc(180:0:\n1);}

\def\ua#1{\tikz[baseline=(A.base)]
  \draw[red, -stealth, line width=.035em]
    (0,0) node[circle, inner sep=0cm](A){$#1$}
    let \p1=(A.north east),\p2=(A.south west), \n1={\x1-\x2} in
      (-180:\n1) arc(-180:0:\n1);}

\newcommand{\red}[1]{\color{red}{#1}}
\newcommand{\du}[2]{\underset{\underset{\red{:#1}}{\ua{\phantom{+}}}}{\overset{\overset{\red{:#2}}{\da{\phantom{+}}}}{=}}}


\begin{document}

\[
\frac{36}{60} \du{2}{2} \frac{18}{30} \du{2}{2} \frac{9}{15} \du{2}{3} \frac{3}{5}
\]  

\end{document}

enter image description here

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.