首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在流程图中编码箭头

在流程图中编码箭头
EN

Stack Overflow用户
提问于 2022-04-26 12:10:55
回答 1查看 1.2K关注 0票数 2

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

代码语言:javascript
复制
\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}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-04-26 12:23:22

您可以使用

代码语言:javascript
复制
\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的值以确定箭头应该突出多远。

代码语言:javascript
复制
\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}

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72013717

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档