I want to draw the following picture:

enter image description here

But I got stuck where to start? What should I use normal TikZ node (\node) or TikZmark Node (\tikzmarknode)? I am not expert in tikz-pgf package. Your help is expected.


I tried:





\begin{tikzpicture}[remember picture,overlay]
        every node/.style={outer sep=2pt},
        lab/.style={font=\tiny,inner sep=0pt}}
        \draw[red] (B) to[out=90,in=90] node[lab,midway,above]{} (v2) ;  

  • Answering your question depends on the method you will use to create your picture in the first place (without the arrows, I mean). What did you do? Please share a compilable MWE of what you already wrote, then we could help you decide what better method to use.
    – SebGlav
    Dec 5, 2021 at 18:05
  • @SebGlav I actually could not decided which things should I use. I need to draw it with less hustle and easy to draw. I have added my code.
    – mmr
    Dec 5, 2021 at 19:09
  • Your approach is probably easiest. A regular \tikzmark puts a coordinate at the baseline, from which you would have to estimate the distance and direction to start the arrow. Here you can use the bounding box in which the letter was inserted. Dec 5, 2021 at 20:03
  • One last question before trying anything: what exactly is this picture supposed to illustrate? Could you elaborate a bit? I'm not familiar with this kind of figures disposition. And is it a one shot drawing or is it supposed to be reproduced with different figures elsewhere?
    – SebGlav
    Dec 5, 2021 at 22:49
  • 1
    This question my be related: Help writing a simple long division problem with LaTex
    – Roland
    Dec 6, 2021 at 0:00

1 Answer 1


Using \tikzmarknode is a good idea. But first you need to draw the division problem without the arrows. An array works well for this. The syntax {*{12}{c@{\,}}} center-justifies each column but reduces the column spacing to 0, then adds a small thin space (\,) between each column. *{12} means repeat that 12 times. (You only have 7 columns at the moment, but maybe you'll add more.)

enter image description here

Placing the minus signs inside \mathllap prevents them from adding space to their columns.

Once the division problem is drawn, put the numbers that you want to be nodes inside \tikzmarknode. Then in a tikzpicture with options remember picture, overlay, draw the arrows from node to node using any tikz options you want such as looseness=, in=, out=, etc. You can place a node (I called it M) in the middle of one of those arrows.


\usepackage{mathtools} % needed for \mathllap


& & &1&\tikzmarknode{B}{4}& & &\\ \cline{3-8}
&&&\smash{\vdots}&\\ \cline{4-8}
&&&\mathllap{-}1&2\\ \cline{4-8}
&&&&&\mathllap{-}\tikzmarknode{E}{8}\\ \cline{4-8}

\begin{tikzpicture}[remember picture, overlay, >=latex, shorten >=2pt, shorten <=2pt]
\draw[<->, looseness=2.5](A.north)to[out=90, in=90]node[pos=.7](M){}(B);
\draw[->, looseness=1.5](M.center)to[out=60, in=0](E.east);


You must log in to answer this question.

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