I am trying to achieve something similar to this:
My first idea was to use nodes inside tikzpicture, so I came up with this:
First Example
\documentclass[11pt]{article}
\usepackage{tikz}
\usetikzlibrary{positioning, intersections}
\usepackage{mathtools}
\usepackage{pifont}
\usepackage{xcolor}
\begin{document}
\begin{tikzpicture}
[frac/.style={node distance=-2mm and 8mm}, expression/.style={node distance=2mm and 10mm}]
\node [frac](A) {$3$};
\node [frac](B) [below=of A] {$-$};
\node [frac](C) [below=of B] {$5$};
\node [frac](D) [right=of A] {$5$};
\node [frac](E) [below=of D] {$-$};
\node [frac](F) [below=of E] {$9$};
\node [expression] (exp1) [below=of C] {$3\cdot9=27$};
\node [expression] (exp2) [below=of F] {$5\cdot5=25$};
\draw [<->] (A) -- (F);
\draw [<->] (C) -- (D);
\end{tikzpicture}
\end{document}
Although I like this way of setting up things, the multiplication at the bottom are overlapping and even if (I think) I put 10mm spacing between the nodes, the situation has not improved.
Here the result:
So I've done some research and found this post that, with some modification has served my purpose. This is how I modified it and the end result:
Second Example
\documentclass[border=10pt]{standalone}
\usepackage{tikz,amsmath}
\newcommand\tikzmark[2][]{
\tikz[remember picture,inner sep=0,outer sep=0,baseline=(#1.base)]{\node(#1){$#2$};}
}
\begin{document}
\begin{tabular}{cc}
$ \dfrac{\tikzmark[topleft]{3}}{\tikzmark[bottomleft]{5}}$ &
$\dfrac{\tikzmark[topright]{5}}{\tikzmark[bottomright]{9}} $\\
$3\cdot9=27$ & $5\cdot5=25$\\
\end{tabular}
\begin{tikzpicture} [remember picture,overlay]
\draw [<->] (topleft) -- (bottomright);
\draw [<->] (bottomleft) -- (topright);
\end{tikzpicture}
\end{document}
This result is perfect, but the problem is that when I put this code into Anki it does not work, no matter what I put into the preamble of the note type (but I could be doing something wrong).
Not to mention, that I really do not understand its preamble.
In summary, my main question would be: Using nodes as per the first example, how do I avoid the overlapping?
Out of curiosity, I have another question: how can I use tikzmark with Anki, so that I can use the second example?
Thanks!



