How to make the following directed graph with text?

Andrew Tawfeek 06/13/2018. 3 answers, 193 views
tikz-pgf

I'm having a lot of trouble figuring out how to draw the following directed graph:enter image description here

Could someone help me/provide insight on how to make these myself in the future?

3 Answers


marmot 06/13/2018.

This site is full of examples. You could use tikz-cd, plain TikZ, PSTricks and so on. Here is an example using 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}

enter image description here


Bernard 06/13/2018.

Here's a short code with 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} 

enter image description here


Zarko 06/13/2018.

an alternative/competitive forest solution:

\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}

enter image description here

Related questions

Hot questions

Language

Popular Tags