May you provide some guidance on how to add some descriptions on the arrow of the following two figures? For example,

In the first figure,

  • can we add: Arrow $\vec{21}$ on the top of arrow (better to be (1) parallel or (2) horizontal if possible, but not necessary if it is too difficult for you) from the item 2 to the item 1?

  • Similarly, can we add: Arrow $\vec{i j}$ on the top of each arrow from the item i to the item j? Here i=2, and j=1,3,4,5,6.

In the second figure,

  • can we try to add some greek alphabet, $\alpha$, $\beta$, $\gamma$, etc on each of the arrow?

Can we make the above alignment to have the choices of being (1) parallel to the arrow or (2) horizontal to the document? If so, could you advise the command lines for each case?

enter image description here

Here is my Minimal Working note MWE:



\usepackage{amsmath, amsthm, amssymb,slashed,mathtools,tabu}



\begin{tikzpicture}\kern-5mm[>=stealth,->,shorten >=2pt,looseness=.5,auto]
      \matrix (M)[matrix of math nodes,row sep=1cm,column sep=8mm]{
1 & 2 & 3\\
   4    &  5 & 6 \\
       \foreach \a/\b in {1-2/2-1,1-2/1-1,1-2/2-2,1-2/2-3, 1-2/1-3}


\begin{tikzpicture}[node distance=2cm, auto]

  (1, 0), (2, 0), (3, 0), (4, 0), (5, 0),
  (5, 1), (4, 1), (3, 1), (2, 1), (1, 1)%
  \foreach \x [count=\xi] in \mypoints {
    \x node[circle, fill, inner sep=sqrt(2)*0.025cm] (node\xi) {}
  \foreach \x [count=\xi, remember=\xi-1 as \xiprev] in \mypoints {
    \ifnum\xi>1 %
      (node\xiprev) edge[-latex', black!50!white] (node\xi)


The second figure is from and many thanks to https://tex.stackexchange.com/a/385800/41144

  • As I understand it, you want each arrow to have an equation written next to it and that equation to be parallel to the arrow. Is that correct? If not, can you add a freehand drawing of the desired result?
    – AndréC
    Jul 30 '20 at 16:34
  • Dear AndreC, the attempt output of the user is good (but I am not sure the file is compilable...)
    – wonderich
    Jul 30 '20 at 17:08
  • (maybe you can try to compile of user213378 file and you will see the issue...) thank you!
    – wonderich
    Jul 30 '20 at 17:10
  • It can be compiled with asymptote as it gave the code, otherwise, with LaTeX, you have to add \usepackage[inline]{asymptote} and compile successively this way pdflatex->asymptote->pdflatex.
    – AndréC
    Jul 30 '20 at 17:11
  • 1
    look here and use \begin{asy} Using Asymptote with pdfLaTeX
    – AndréC
    Jul 30 '20 at 17:27

TikZ can probably do it !

While waiting for an TikZ answer, I have an Asymptote answer as following:

Only for compare purpose!

picture pic1,pic2;

pair[] A={(0,0),(-1,0),(1,0),sqrt(2)*dir(-135),(0,-1),sqrt(2)*dir(-45)};
int[] B={2,1,3,4,5,6};
margin m=Margin(2.5,2.5);
for (int i=0; i< A.length; ++i){  label(pic1,"$"+ (string) B[i] + "$",A[i],(0,0)); }

pair[] A={(0,0),(1,0),(2,0),(3,0),(4,0),(4,1),(3,1),(2,1),(1,1),(0,1)};
string[] alphabet={"$\alpha$", "$\beta$", "$\gamma$"};
for (int i=0; i< A.length-1; ++i){
picture pic;

enter image description here

  • +1 I think he means alpha, beta, gamma, delta, epsilon, which is the Greek alphabet.
    – AndréC
    Jul 30 '20 at 17:04
  • That is not a problem, +1 - I think this is already a great nearly perfect answer!
    – wonderich
    Jul 30 '20 at 17:04
  • excuse me, however, how do we use usepackage("esvect"); and why not \usepackage("esvect"); ???
    – wonderich
    Jul 30 '20 at 17:06
  • @wonderich You can see here overleaf.com/6581438472kbmkvdwtwbvk
    – user213378
    Jul 30 '20 at 17:32
  • @wonderich To answer for why do we use usepackage("esvect");, see page 53 of the official documetation.
    – user213378
    Jul 30 '20 at 17:41

With TikZ:

\documentclass[tikz, margin=3mm]{standalone}

       every edge/.style = {draw, thick, -Straight Barb},
every edge quotes/.style = {auto, inner sep=2pt, sloped}
\matrix (m) [matrix of math nodes,
             nodes={circle, minimum size=1.1em, inner sep=1pt, anchor=center},
             column sep=2cm,
             row sep=2cm]
1 & 2 & 3     \\
4 & 5 & 6     \\
\foreach \i/\j/\k in {1/1/1, 4/2/1, 5/2/2, 6/2/3, 3/1/3}
\draw   (m-1-2) edge ["$\vv{21}$"] (m-\j-\k);

           node distance = 2cm and 2 cm,
             start chain = going right,
              dot/.style = {circle, fill, inner sep=2pt},
       every edge/.style = {draw=gray, thick, -Straight Barb},
every edge quotes/.style = {auto, inner sep=2pt, sloped}

  \foreach \i in {1,...,5}
    \node (n1\i) [dot, on chain] {};
    \node (n2\i) [dot, above=of n1\i] {};
  \foreach \x [count=\xi,count=\xj from 2] in {\alpha, \beta, \gamma, \alpha}
\ifnum\xj<6     \draw (n1\xi) edge["$\x$"] (n1\xj);   \fi
  \foreach \x [count=\xi,count=\xj from 2] in {\gamma, \beta, \alpha,  \gamma}
\ifnum\xj<6     \draw (n2\xj) edge["$\x$"] (n2\xi);   \fi
\draw (n15) edge["$\beta$"] (n25);

enter image description here enter image description here

  • thanks! this looks nearly perfect!!! I am learning it. ++1
    – wonderich
    Aug 1 '20 at 19:14

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.