Connecting nodes by edges
In the previous chapter, we used lines with arrows to create the small diagram in Figure 3.3. In more complex diagrams, text labels on such lines and arrows are often desired. Such “smart” lines connecting nodes are called edges.
We will start with the first small example. We aim to illustrate the compiling process from a LaTeX .tex
file to a PDF file. We will also add some colors to get more familiar with styling nodes.
- Start with this small LaTeX document, which loads TikZ and the
positioning
library and contains an emptytikzpicture
environment for now:\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}
\end{tikzpicture}
\end{document}
- In the
tikzpicture
environment, create a node, which we calltex
, filled with orange color and white text:\node (tex) [fill=orange, text=white] {TEX};
- Put a second node on the right of the
tex
node, call itpdf
, and fill it...