sebastiano.tronto.net

Source files and build scripts for my personal website
git clone https://git.tronto.net/sebastiano.tronto.net
Download | Log | Files | Refs | README

jobs-diagram.tex (1221B)


      1 \documentclass[crop, tikz]{standalone}
      2 \usepackage{tikz}
      3 
      4 \begin{document}
      5 \begin{tikzpicture}
      6 \usetikzlibrary{arrows.meta}
      7 
      8 % Just a workaround to leave some space around the diagram
      9 \filldraw[color=white,fill=white] (-8,-9) rectangle (8,1);
     10 
     11 % Boxes
     12 \newcommand{\tbox}[3]{
     13 	\node[draw, rounded corners, text centered, text width=3cm]
     14 		(#1) at (#2) {\bf #3}
     15 	;
     16 }
     17 \tbox  {top}    {0,0}     {Job not running}
     18 \tbox  {left}   {-6,-4}   {Job running in the background}
     19 \tbox  {right}  {6,-4}    {Job running in the foreground}
     20 \tbox  {bottom} {0,-8}    {Job suspended}
     21 
     22 % Arrows
     23 \newcommand{\arr}[4]{
     24 	\draw[-{Latex[length=3mm]}, ultra thick]
     25 		(#1) edge[#4] node[fill=white] {\texttt{#3}} (#2)
     26 	;
     27 }
     28 \arr  {top}    {left}   {command \&}       {bend right}
     29 \arr  {left}   {top}    {kill \%job}       {bend right}
     30 \arr  {left}   {bottom} {kill -STOP \%job} {bend right}
     31 \arr  {bottom} {left}   {bg \%job}         {bend right}
     32 \arr  {bottom} {right}  {fg \%job}         {bend left}
     33 \arr  {right}  {bottom} {Ctrl+Z}           {bend left}
     34 \arr  {right}  {top}    {Ctrl+C}           {bend left}
     35 \arr  {top}    {right}  {command}          {bend left}
     36 \arr  {left}   {right}  {fg \%job}         {}
     37 \end{tikzpicture}
     38 \end{document}