流程图 Latex 代码

流程图 Latex 代码

有人可以帮忙提供一个在 Latex 中绘制此流程图的代码吗?图像如下图所示。隔室图

答案1

虽然应该发布一个代码来展示已经尝试过的方法来解决这些问题,但我想对这个automata库进行一些尝试。这是一个解决方案

\documentclass{standalone}

\usepackage{tikz}
    \usetikzlibrary{arrows.meta}
    \usetikzlibrary{positioning}
    \usetikzlibrary{automata}

\begin{document}

\begin{tikzpicture}[node distance = 1cm and 2cm, > = Stealth, accepting/.style = accepting by arrow]

    \node[%
        state, rectangle, fill = red,%
        accepting, accepting text = {$(\mu + \omega_1)\mathrm{A}$}] (A) {A};
    \node[%
        state, rectangle, fill = blue!40!white, above right = of A,%
        initial above, initial text = {$(1 - p)\mu v$},%
        accepting, accepting text = {$\mu\mathrm{E}$}] (E) {E};
    \node[%
        state, rectangle, fill = green, below right = of A,%
        accepting, accepting text = {$\mu\mathrm{Q}$}] (Q) {Q};
    \node[%
        state, rectangle, fill = yellow, below left = of A,
        accepting left, accepting text = {$(\mu + \omega_2)\mathrm{R}$}] (R) {R};
    \node[%
        state, rectangle, fill = green!30!white, above left = of A,%
        initial above, initial text = {$p\mu v$},%
        accepting left, accepting text = {$\mu\mathrm{S}$}] (S) {S};

    \path[->] (A) edge[bend right]  node[above left]            {$\pi\mathrm{A}$}              (R)
              (E) edge              node[above left]            {$\varepsilon\eta\mathrm{EA}$} (A)
              (E) edge              node[right]                 {$\lambda\mathrm{E}$}          (Q)
              (R) edge[bend right]  node[near end, below right] {$\rho\mathrm{R}$}             (A)
              (R) edge              node[below]                 {$\theta\mathrm{R}$}           (Q)
              (S) edge              node[above right]           {$\varepsilon\mathrm{SA}$}     (A)
              (S) edge              node[above]                 {$\gamma\mathrm{S}$}           (E);

\end{tikzpicture}

\end{document}

导致在此处输入图片描述

相关内容