编码流程图中的箭头

coding the arrows in flowchart

我需要绘制与下图相同的流程图,但我的问题是我不知道如何绘制从 A-7(钻石 1)到 A-4 的箭头。我尝试使用 \drawlatex edge (A-4) 和其他一些解决方案,但没有任何效果。我也想知道我是否可以改进我的代码。

\documentclass{article}
\usepackage[left=0.5cm,right=1.27cm,top=1.3cm,bottom=1.3cm]{geometry}
\usepackage[french]{babel}
 \usepackage[T1]{fontenc}
% Required packages
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
    calc, chains,
    decorations.pathreplacing,%
    calligraphy,% had to be after decorations.pathreplacing
    positioning,
    shapes}
\definecolor{blue1}{RGB}{84,141,212}
\definecolor{blue2}{RGB}{142,180,227}
\definecolor{yellow1}{RGB}{255,229,153}
\definecolor{orange1}{RGB}{255,153,0}
\definecolor{gray1}{RGB}{127,127,127}

\definecolor{gray2}{RGB}{217,217,217}

\begin{document}
    \begin{center}
        \small
        \begin{tikzpicture}[
            node distance = 8mm and 12mm,
            start chain = A going below,
            arr/.style = {-{Triangle[length=3mm, width=6mm]}, line width= 2mm,
                draw=blue2, shorten > = 1mm, shorten <=1mm},
            BC/.style args = {#1/#2/#3}{
                decorate,
                decoration={calligraphic brace, amplitude=6pt,
                    pre =moveto, pre  length=1pt,
                    post=moveto, post length=1pt,
                    raise=#1,
                    #2},% for mirroring of brace
                very thick,
                pen colour={#3} },
            N/.style = {draw, semithick, rounded corners,
                fill=#1,draw=blue2,
                minimum height=10mm, text width=80mm,
                align=flush center},
            N1/.style = {draw, semithick, rounded corners,
                fill=#1,
                minimum height=10mm, text width=50mm,
                align=flush center},
            N2/.style={draw,text width=3cm ,text centered,
                minimum width=4cm,fill=yellow1,tape, tape bend top=none,tape bend height=1.1mm,   tape bend bottom=in and out,
                minimum height=1.1cm}  ,
            N3/.style = {diamond,   minimum width=7.5cm, minimum height=4mm, text centered, draw=blue2, fill=blue2},
            N4/.style = {rectangle, text width=4cm, minimum height=1cm, text centered ,fill=gray2}]
            % main branch
            \begin{scope}[nodes={on chain=A, join=by arr}]
                \node [N1=blue1,draw=blue1]     {ETAPES};                   % A-1
                \node [N=blue2]   {Besoin en RH};    % A-2
                \node [N=blue2]     {Identification des compétences nécessaires};
                \node [N=blue2]     {Rédaction de l’offre d’emploi};
                \node [N=blue2]     {  Pré-sélection des candidats};
                \node [N=blue2]     {Entretien « final »};
                \node  [N3=blue2] {Candidature validée?};
                \node [N=blue2]     { Préparation, signature et archivage des documents légaux};
                \node [N=blue2]     {Formation interne et enregistrement de la formation };
                \node  [N3=blue2] {Candidature validée?};
                \node [N=blue2]     {Prise de fonction};
            \end{scope}
            
            % nodes on the left side of the main branch
            
            \node [N1=gray1,draw=gray1, 
            left=19 mm of A-1]     (B-1)   {ACTEURS};
            \node [N4=gray2,draw=gray2, 
            left=of A-2]     (B-2)   {Collaborateur };
            \node [N4=gray2,draw=gray2, 
            left=of A-3]     (B-3)   {Directeur et RQ\&AR };
            \coordinate (aux1) at ($(A-4.south west)!0.5!(A-5.north west)$);
            \draw[BC=4mm/mirror/gray2]   (A-4.west) -- (A-5.west);
            \node [N4=gray2,left=of aux1,draw=gray2 ]     (B-4)   { Agence Interim /  Cabinet de recrutement };
            \node [N4=gray2,draw=gray2,  
            left=of A-6]     (B-4)   {Directeur et RQ\&AR };
            \node [N4=gray2,draw=gray2,  
            left=of A-8]     (B-4)   {Directeur et RQ\&AR };
            \node [N4=gray2,draw=gray2,  
            left=of A-9]     (B-4)   {Directeur et RQ\&AR };
            \node [N4=gray2,draw=gray2,  
            left=of A-11]     (B-4)   {Directeur et RQ\&AR };
            
            % nodes on the right side of thr main branch
            \begin{scope}[N/.append style={text width=44mm},
                N/.default=yellow1]
                \node[N1=yellow1,draw=yellow1,  right=18mm of A-1]     (C-1)   {DOCUMENTS};
                \node[N2,draw=yellow1, right=of A-9,text width=5.4cm ]     (C-2)   {FOR\_MATRICE\_COMPETENCES +
                    BDD\_DOCS\_RH };
                \node[N2,draw=yellow1, right=of A-11]     (C-3)   {FOR\_FORMATION + BDD\_FORMATIONS};
                
            \end{scope}
            %arrows 
            
        \end{tikzpicture}
        
    \end{center}
\end{document}

你可以使用

\draw[red,ultra thick,-latex] (A-7.east) -- ++(1.5,0)  |- (A-4)  node[near start,anchor=west] {Non};
        

这首先从 A-7 向左绘制一条水平短线,然后 |- 通过垂直和水平线将其连接到 A-4。更改 1.5 的值以确定箭头应该伸出多远。

\documentclass{article}
\usepackage[left=0.5cm,right=1.27cm,top=1.3cm,bottom=1.3cm]{geometry}
\usepackage[french]{babel}
 \usepackage[T1]{fontenc}
% Required packages
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
    calc, chains,
    decorations.pathreplacing,%
    calligraphy,% had to be after decorations.pathreplacing
    positioning,
    shapes}
\definecolor{blue1}{RGB}{84,141,212}
\definecolor{blue2}{RGB}{142,180,227}
\definecolor{yellow1}{RGB}{255,229,153}
\definecolor{orange1}{RGB}{255,153,0}
\definecolor{gray1}{RGB}{127,127,127}

\definecolor{gray2}{RGB}{217,217,217}

\begin{document}
    \begin{center}
        \small
        \begin{tikzpicture}[
            node distance = 8mm and 12mm,
            start chain = A going below,
            arr/.style = {-{Triangle[length=3mm, width=6mm]}, line width= 2mm,
                draw=blue2, shorten > = 1mm, shorten <=1mm},
            BC/.style args = {#1/#2/#3}{
                decorate,
                decoration={calligraphic brace, amplitude=6pt,
                    pre =moveto, pre  length=1pt,
                    post=moveto, post length=1pt,
                    raise=#1,
                    #2},% for mirroring of brace
                very thick,
                pen colour={#3} },
            N/.style = {draw, semithick, rounded corners,
                fill=#1,draw=blue2,
                minimum height=10mm, text width=80mm,
                align=flush center},
            N1/.style = {draw, semithick, rounded corners,
                fill=#1,
                minimum height=10mm, text width=50mm,
                align=flush center},
            N2/.style={draw,text width=3cm ,text centered,
                minimum width=4cm,fill=yellow1,tape, tape bend top=none,tape bend height=1.1mm,   tape bend bottom=in and out,
                minimum height=1.1cm}  ,
            N3/.style = {diamond,   minimum width=7.5cm, minimum height=4mm, text centered, draw=blue2, fill=blue2},
            N4/.style = {rectangle, text width=4cm, minimum height=1cm, text centered ,fill=gray2}]
            % main branch
            \begin{scope}[nodes={on chain=A, join=by arr}]
                \node [N1=blue1,draw=blue1]     {ETAPES};                   % A-1
                \node [N=blue2]   {Besoin en RH};    % A-2
                \node [N=blue2]     {Identification des compétences nécessaires};
                \node [N=blue2]     {Rédaction de l’offre d’emploi};
                \node [N=blue2]     {  Pré-sélection des candidats};
                \node [N=blue2]     {Entretien « final »};
                \node  [N3=blue2] {Candidature validée?};
                \node [N=blue2]     { Préparation, signature et archivage des documents légaux};
                \node [N=blue2]     {Formation interne et enregistrement de la formation };
                \node  [N3=blue2] {Candidature validée?};
                \node [N=blue2]     {Prise de fonction};
            \end{scope}
            
            % nodes on the left side of the main branch
            
            \node [N1=gray1,draw=gray1, 
            left=19 mm of A-1]     (B-1)   {ACTEURS};
            \node [N4=gray2,draw=gray2, 
            left=of A-2]     (B-2)   {Collaborateur };
            \node [N4=gray2,draw=gray2, 
            left=of A-3]     (B-3)   {Directeur et RQ\&AR };
            \coordinate (aux1) at ($(A-4.south west)!0.5!(A-5.north west)$);
            \draw[BC=4mm/mirror/gray2]   (A-4.west) -- (A-5.west);
            \node [N4=gray2,left=of aux1,draw=gray2 ]     (B-4)   { Agence Interim /  Cabinet de recrutement };
            \node [N4=gray2,draw=gray2,  
            left=of A-6]     (B-4)   {Directeur et RQ\&AR };
            \node [N4=gray2,draw=gray2,  
            left=of A-8]     (B-4)   {Directeur et RQ\&AR };
            \node [N4=gray2,draw=gray2,  
            left=of A-9]     (B-4)   {Directeur et RQ\&AR };
            \node [N4=gray2,draw=gray2,  
            left=of A-11]     (B-4)   {Directeur et RQ\&AR };
            
            % nodes on the right side of thr main branch
            \begin{scope}[N/.append style={text width=44mm},
                N/.default=yellow1]
                \node[N1=yellow1,draw=yellow1,  right=18mm of A-1]     (C-1)   {DOCUMENTS};
                \node[N2,draw=yellow1, right=of A-9,text width=5.4cm ]     (C-2)   {FOR\_MATRICE\_COMPETENCES +
                    BDD\_DOCS\_RH };
                \node[N2,draw=yellow1, right=of A-11]     (C-3)   {FOR\_FORMATION + BDD\_FORMATIONS};
                
            \end{scope}
            %arrows 
            
            \draw[red,ultra thick,-latex] (A-7.east) -- ++(1.5,0)  |- (A-4)  node[near start,anchor=west] {Non};
            
        \end{tikzpicture}
        
    \end{center}
\end{document}