1

I am looking for best practice in showing the following picture. I would like to show equivalent fractions and need to display the operation for numerators and denominators. I have to hardcode the coordinates like (1,0) for example but I am thinking there is a better way. Maybe with tikz matrix? This is my code:

    \documentclass[11pt,fleqn]{examdesign}
\usepackage{savesym}
\usepackage{amsmath}
\SectionFont{\large\sffamily}
%%\usepackage[shortlabels,inline]{enumitem}  %%shortlabels here for matchign
%%\usepackage{cancel}
\usepackage{tkz-euclide} %%%%%%%%%%%for marking angles
%%\usetkzobj{all}  %%%%%%%%%%%because Overleaf uses old Tex
\usepackage{tikz}
\usetikzlibrary{shapes.geometric,calc,matrix}

\class{needed for examdesign}
\begin{document}
\begin{tikzpicture}[]
    \node(A) at (0,0){$\cfrac{1}{2}$};
     \node(B) at (3,0){$\cfrac{5}{10}$};   
     \node(C) at (1.5,0){=};
 \path[every node/.style={font=\sffamily\small},->,>=latex]
  (A.south) edge[bend right] node [below,blue]{$\times5$}(B.south)
  (A.north) edge[bend left] node [above,blue]{$\times5$}(B.north);
\end{tikzpicture}

\begin{tikzpicture}[roundnode/.style={circle, draw=blue, fill=white, very thick, minimum size=10mm}]
    \node(A) at (0,0){$\cfrac{1}{2}$};
     \node(B) at (3,0){$\cfrac{5}{10}$};   
     \node(C) at (1.5,0){=};
 \path[every node/.style={font=\sffamily\small},->,>=latex]
  (A.south) edge[bend right] node [roundnode]{$\times5$}(B.south)
  (A.north) edge[bend left] node [roundnode]{$\times5$}(B.north);
\end{tikzpicture}

\end{document}

These are the pictures I get.

pic of fractions

I guess what I have works for now but is using matrix the better way?

1 Answer 1

1

Apart from what you mention there is tikz-cd (which is, of course, a matrix).

\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz-cd}

\begin{document}
\begin{tikzcd}
\dfrac{1}{2} \arrow[rr,-latex,bend left,shift left=1ex,"\times 5" blue]
\arrow[rr,-latex,bend right,shift right=1ex,"\times 5"' blue]
& = & \dfrac{5}{10}
\end{tikzcd}
\medskip

\begin{tikzcd}
\dfrac{1}{2} 
\arrow[rr,-latex,bend left,shift left=1ex,"\times 5" {marking,circle,draw=blue,fill=white}]
\arrow[rr,-latex,bend right,shift right=1ex,"\times 5"' {marking,circle,draw=blue,fill=white}]
& = & \dfrac{5}{10}
\end{tikzcd}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .