如何制作以下带有文字的有向图?

如何制作以下带有文字的有向图?

我在弄清楚如何绘制以下有向图时遇到了很多麻烦: 在此处输入图片描述

有人可以帮助我/提供关于将来如何自己做这些的见解吗?

答案1

该网站有很多示例。您可以使用tikz-cd普通的 TiZ、PSTricks 等。下面是使用的示例forest

\documentclass[tikz,border=10pt]{standalone}
\usepackage{forest}
\begin{document}
% starting point: https://tex.stackexchange.com/a/341454/121799
\begin{forest}
  for tree={
    font=\sffamily,
    line width=1pt,
    child anchor=north,
    parent anchor=south,
    grow=south,
    align=center,
    edge path={
      \noexpand\path[line width=1pt, \forestoption{edge},-latex]
      (!u)  -- () \forestoption{edge label};
    },
  },
  s sep+=20pt,
  [Rings
   [Commutative\\ Rings
     [Commutative Rings\\ with identity,name=cr
      [Integer domains,l*=2,name=id] 
     ]
   ]
   [Rings\\ with unity,name=ru
    [Division rings
     [Fields,l*=2,name=fld]
    ]
   ]
  ]
 \begin{scope}[line width=1pt]
   \draw[-latex] (ru) -- (cr);
   \draw[-latex] (id) -- (fld);
  \end{scope}
\end{forest}
\end{document}

在此处输入图片描述

答案2

以下是一段简短的代码pstricks

\documentclass[border=12pt]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{fourier}
\usepackage{pst-node}
%\usepackage{auto-pst-pdf} % to compile with pdflatex
\usepackage[usestackEOL]{stackengine}

\begin{document}

\begin{psmatrix}[arrows=->, arrowinset=0, colsep=0.8cm, nodesep=6pt]
&[name=R] Rings \\
[name=CR] \Shortunderstack{Commutative\\Rings} & & [name=RU]\Shortunderstack{Rings with \\Unity} \\
[name=CRI] \Shortunderstack{Commutative Rings\\ with Identity} & & [name=DR] Division Rings \\
[name=ID] Integral Domains & & [name=F] Fields
\foreach \s/\t in {R/CR, R/RU, CR/CRI, RU/DR, RU/CRI, CRI/ID, DR/F, ID/F}{\ncline{\s}{\t}}
\end{psmatrix}

\end{document} 

在此处输入图片描述

答案3

替代/竞争forest解决方案:

\documentclass[border=10pt]{standalone}
\usepackage{forest}
\usetikzlibrary{arrows.meta}

\begin{document}
    \begin{forest}
for tree={
    font=\sffamily\linespread{.84}\selectfont,
        text centered,
        align=center,
        anchor=north,
    l sep=5mm,
    s sep=8mm,
    edge = {thick, -Stealth}
}
[Rings
    [Commutative\\ Rings
        [Commutative Rings\\ with identity,name=A
            [Integer domains,tier=word,name=B]
        ]
    ]
   [Rings\\ with unity,name=C
        [Division rings
            [Fields,tier=word,name=D]
        ]
    ]
]
\draw[thick, -Stealth]  (C) edge (A) (B) to (D);
    \end{forest}
\end{document}

在此处输入图片描述

相关内容