• 利用TikZ 宏包在 LaTeX 中绘制流程图


    发现用TikZ画流程图其实挺方便的,对于简单的图应该比visio简单。

    使用的宏包:

    usepackage{tikz,mathpazo}
    usetikzlibrary{shapes.geometric, arrows}
    usetikzlibrary{calc}

    结果示例:

    具体代码为:

    % 流程图定义基本形状
    	ikzstyle{startstop} = [rectangle, rounded corners, minimum width = 2cm, minimum height=1cm,text centered, draw = black, fill = red!40]
    	ikzstyle{io} = [trapezium, trapezium left angle=70, trapezium right angle=110, minimum width=2cm, minimum height=1cm, text centered, draw=black, fill = blue!40]
    	ikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill = yellow!50]
    	ikzstyle{decision} = [diamond, aspect = 3, text centered, draw=black, fill = green!30]
    % 箭头形式
    	ikzstyle{arrow} = [->,>=stealth]
    
    egin{figure}[htbp]
    centering
    egin{tikzpicture}[node distance=2cm]
    %定义流程图具体形状
    
    ode (start) [startstop] {start};
    
    ode (pro1) [process, below of=start, yshift=-0.2cm, left of=start, xshift=-1cm] {PROCESS 1};
    
    ode (pro2) [process, right of=pro1, xshift= 4cm] {PROCESS 2};
    
    ode (in1) [io, below of=pro1, yshift= -0.2cm, right of=pro1, xshift=1cm] {IO};
    
    ode (pro3) [process, below of=in1, yshift= -0.2cm] {PROCESS 3};
    
    ode (pro4) [process, below of=pro3, yshift= -0.2cm] {PROCESS 4};
    
    ode (in2) [io, below of=pro4, yshift= -0.2cm] {IO 2};
    
    ode (dec1) [decision, below of=in2, yshift= -0.2cm] {DECISION};
    
    ode (stop) [startstop, below of=dec1] {end};
    
    %连接具体形状
    draw [arrow](start) -- (pro1);
    draw [arrow](start) -- (pro2);
    draw [arrow](pro1) -- (in1);
    draw [arrow](pro2) -- (in1);
    draw [arrow](in1) -- (pro3);
    draw [arrow](pro3) -- (pro4);
    draw [arrow](pro4) -- (in2);
    draw [arrow](in2) -- (dec1);
    draw [arrow](dec1) -- ($(dec1.east) + (1.5,0)$) node[anchor=north] {NO} |- (pro3);
    draw [arrow](dec1) -- node[anchor=west] {YES} (stop);
    end{tikzpicture}
    caption{label{fig: } 示例图}
    end{figure}

    其中画双折线的方法来自这里,更详细的使用可以参考这里

  • 相关阅读:
    redis 持久化RDB、AOF
    进程、线程、协程
    nginx 常用配置
    Redis详解(一)
    Nginx(一)
    docker compose
    练习1——排序
    8万行的insert数据,Ctrl+c、Ctrl+v后心态崩了(如何在Linux下对MySQL数据库执行sql文件)
    Ubuntu使用+Thinkphp5学习——20(html文件中代码注释掉,但是runtime/temp中的php文件仍然存在)
    Ubuntu使用+Thinkphp5学习——19(新增用户报错strip_tags() expects parameter 1 to be string, array given)
  • 原文地址:https://www.cnblogs.com/fly2mato/p/7994200.html
Copyright © 2020-2023  润新知