0

I am trying to create something like the picture below, here is the code I have so far but it will not render I am not sure where I am going wrong.

\documentclass{article}

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

\begin{document}

\begin{tikzpicture}[
  vertex/.style = {shape=circle,draw,minimum size=2em},
  edge/.style = {->,-Latex},
  ]
  % Vertices
  \node[vertex] (c) at (0,0) {6};
  \node[vertex] (a) at (-2,-2) {};
  \node[vertex] (b) at (2,-2) {};
  \node[vertex] (d) at (0,-3) {6};
  \node[vertex] (e) at (-1,-5) {?};
  \node[vertex] (f) at (1,-5 {?};
  \node[vertex] (g) at (-2,-7) {};
  \node[vertex] (h) at (0,-7) {5};
  \node[vertex] (i) at (2,-7) {};
  \node[vertex] (bx) at (0,-9) {5};
  % Edges
  \draw[edge, ultra thick] (a) -- (c) node[midway,left] {$\times$}  ;
  \draw[edge, ultra thick] (b) -- (c) node[midway,right] {$\times$} ;
  \draw[edge, ultra thick] (g) -- (bx) node[midway,left] {$\+$}  ;
  \draw[edge, ultra thick] (I) -- (bx) node[midway,right] {$\+$} ;
  \draw[edge, ultra thick] (a) -- (i) node[midway,left] {}  ;
  \draw[edge, ultra thick] (b) -- (g) node[midway,right] {} ;
 \end{tikzpicture}
\end{document}

CrissCross

2
  • The compiler will tell you the line number where you have problems. Uncomment the line and compile again. It is more work to post here and your question is not of value for others as not two people will have the exact same typo. Jun 29 at 11:37
  • 2
    In your case the problem will be the line before the line number the compiler tells you because of mismatch in parentheses. Jun 29 at 11:40

1 Answer 1

2

Just a few typos: we've all been there ...

enter image description here

\documentclass{article}

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

\begin{document}

\begin{tikzpicture}[
  vertex/.style = {shape=circle,draw,minimum size=2em},
  edge/.style = {->,-Latex},
  ]
  % Vertices
  \node[vertex] (c) at (0,0) {6};
  \node[vertex] (a) at (-2,-2) {};
  \node[vertex] (b) at (2,-2) {};
  \node[vertex] (d) at (0,-3) {6};
  \node[vertex] (e) at (-1,-5) {?};
  \node[vertex] (f) at (1,-5) {?};% missed )
  \node[vertex] (g) at (-2,-7) {};
  \node[vertex] (h) at (0,-7) {5};
  \node[vertex] (i) at (2,-7) {};
  \node[vertex] (bx) at (0,-9) {5};
  % Edges
  \draw[edge, ultra thick] (a) -- (c) node[midway,left] {$\times$}  ;
  \draw[edge, ultra thick] (b) -- (c) node[midway,right] {$\times$} ;
  \draw[edge, ultra thick] (g) -- (bx) node[midway,left] {$+$}  ;% blocking \
  \draw[edge, ultra thick] (i) -- (bx) node[midway,right] {$+$} ;% i, not I; blocking \
  \draw[edge, ultra thick] (a) -- (i) node[midway,left] {}  ;
  \draw[edge, ultra thick] (b) -- (g) node[midway,right] {} ;
 \end{tikzpicture}
\end{document}
2
  • Nice drawing, BTW. <chit-chat out>
    – MS-SPO
    Jun 29 at 11:46
  • 1
    Thanks so much for being nice to a novice, much appreciated.
    – Paul A
    Jun 29 at 11:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.