LaTeX 流图:根据文本长度确定节点和圆圈大小?

LaTeX 流图:根据文本长度确定节点和圆圈大小?

在此处输入图片描述

\documentclass{article}

\usepackage{warwickthesis}

\usepackage{booktabs}

\usepackage{rotating}

\usepackage{mathtools}

\usepackage{amssymb}

\usepackage{tkz-graph}

\usepackage{array} % for defining a new column type

\usepackage{varwidth} %for the varwidth minipage environment

\begin{document}

\begin{tikzpicture}[shorten >=4pt,auto,node distance=8cm,minimum size=1cm,thick,main node/.style={circle,draw,font=\Large\bfseries}]

  \node[main node] (1) {Employment};

  \node[main node] (2) [below left of=1] {Unemployment};

  \node[main node] (3) [below right of=1] {Inactivity};


  \path

    (1) edge [bend right] node {400(t)} (2)
            edge [bend left] node {500} (3)

    (2) edge node [below]{100} (1)
            edge [bend left] node {300} (3)

    (3) edge node[right] {500} (1)
        edge node[below] {200} (2);     

\end{tikzpicture}

\end{document}

答案1

像这样吗?

在此处输入图片描述

\documentclass{article}
%\usepackage{warwickthesis}
%\usepackage{booktabs}
%\usepackage{rotating}
%\usepackage{mathtools}
%\usepackage{amssymb}
\usepackage{tkz-graph}
%\usepackage{array} % for defining a new column type
%\usepackage{varwidth} %for the varwidth minipage environment

\begin{document}
    \begin{tikzpicture}[
    shorten >=4pt,
    auto,
    node distance=8cm,
    thick,
main node/.style = {circle, draw, text width=2cm, align=center,
                    font=\bfseries}
                        ]

  \node[main node] (1) {Employ\-ment};
  \node[main node] (2) [below left of=1] {Unemploy\-ment};
  \node[main node] (3) [below right of=1] {Inactivity};

\path (1)   edge [bend right]   node {400(t)} (2)
            edge [bend left]    node {500} (3)
      (2)   edge                node [swap] {100} (1)
            edge [bend left]    node {300} (3)
      (3)   edge                node[swap] {500} (1)
            edge                node[swap] {200} (2);
    \end{tikzpicture}
\end{document}

相关内容