I have the following MWE:
\documentclass[class=article,border=0pt,svgnames]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows,arrows.meta,matrix,backgrounds}
\begin{document}
\tikzset{%
transition/.style={
-{Triangle Cap[cap angle=100]},
line width=1pt,
black,
line join=round,
line cap=round,
opacity=1,
double=Crimson!25,
double distance=10mm},
tableau proportionnalite/.style={
draw,
matrix of math nodes,
row sep=2cm,
column sep=2cm,
nodes={
font=\Huge,
minimum width=2cm,
minimum height=2cm,
}
}
}
\begin{tikzpicture}
\matrix (tableau) [tableau proportionnalite]{
3 & 4\\
5 & A\\
};
\begin{scope}[on background layer]
\draw[transition] (tableau-2-2.center)
-- (tableau-1-1.center)
-- (tableau-1-2.center)
-- (tableau-2-1.center);
\end{scope}
\end{tikzpicture}
\end{document}
that produces the following picture :
I would like the reader understands that to find the value of A, he has to use 3, 4 and 5 in that order. Hence the arrow along the line which do not fulfill its goal at all!
However I cannot figure out a simple solution that brings more clarity to the path order. I try to put some color gradient along the line (to kind of visually identify the start and end of the line) but I found out that it is not a simple thing to do with TikZ.
Than I thought about a solution which I cannot achieve : if this line has borders, it would make the line overlapping itself. Therefore, the line's start and end would be completly obvious. But as you can see, it doesn't work because the line does not overlap itself and the borders of the first part of the line does not seem at all to be underneath the last part of the line. In addition, the arrow's end of the line is not concerned by the border which is not acceptable.
Maybe some of you guys will have a nice idea, as always ?
Thanks in advance for your answers. Sylvain
EDIT
I've consider the proposition of using the knots library as suggested in the Schrödinger's Cat answer, which should lead to more reproductible way to do the job. It worked fine except for the crossing which is made with a circle instead of a quadrilateral... and look weird. I've try the clip width factor with no effect... And if I decrease the clip radius, the crossing is not visible anymore...
Any idea ?
\documentclass[class=article,border=0pt,svgnames]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows,arrows.meta,matrix,backgrounds,knots,positioning}
\begin{document}
\tikzset{%
transition/.style={
-{Triangle Cap[cap angle=100]},
line width=10mm,
Crimson!50,
line join=round,
line cap=round,
opacity=1,},
tableau proportionnalite/.style={
draw,
matrix of math nodes,
row sep=2cm,
column sep=2cm,
nodes={
font=\Huge,
minimum width=2cm,
minimum height=2cm,
}
},
couleur/.store in=\couleur,
couleur=NavyBlue}
\begin{tikzpicture}
\matrix[tableau proportionnalite] (tableau) {
3 & 4\\
5 & A\\
};
\begin{scope}[on background layer]
\begin{knot}[
line width=10mm,
clip radius=8mm,
background color=white,
consider self intersections,
ignore endpoint intersections=false,
only when rendering/.style={
transition
}
]
\strand (tableau-2-2.center)
-- (tableau-1-1.center)
-- (tableau-1-2.center)
-- (tableau-2-1.center);
\flipcrossings{1}
\end{knot}
\end{scope}
\end{tikzpicture}
\end{document}





knotslibrary as you suggested. Crossing looks weird... – Sylcha May 20 '20 at 08:19