1

This is my code:

\documentclass{article}
\usepackage{tikz}
\usepackage[margin=15mm]{geometry}
\usepackage{calc}
\usetikzlibrary{matrix,arrows}
\usetikzlibrary{positioning,arrows}
\usetikzlibrary{shapes,arrows,fit,calc,positioning,automata}

\newcommand{\mytab}[2]% alignment, content
{   \begin{tabular}{#1}
        #2
    \end{tabular}
}

\begin{document}

\tikzset{
    mynode/.style={line width=0.25pt, draw, minimum width=3.0cm, minimum height=1.0cm, inner sep=0, anchor=south west},
    mymatrix/.style={line width=0.5pt, draw, inner sep=0},
    myline/.style={shorten <=0.2pt, shorten >=0.2pt},
}

\begin{figure}[H]
\begin{tikzpicture}
    \matrix[matrix of nodes, nodes=mynode, mymatrix] (s1) at (0,-2)
    {   $p_0$  \\
        $f(q_0, x) = q_0$  \\
        $g(q_0, x, y) = y$ \\
    };

     \matrix[matrix of nodes, nodes=mynode, mymatrix] (s2) at (7,-2)
     {  $p_0$  \\
        $f(q_0, x) = q_0$  \\
        $g(q_0, x, y) = z1.y$ \\
     };

     \node [ below = 1 mm of s1,align=center] (a1) {$r_0$};
     \node [ below = 1 mm of s2,align=center] (a2) {$r_1$};

     \draw[-latex] (s1.120) to [out=135,in=45] node [auto] {$a \rightarrow [y = a.y]$\newline$b \rightarrow [y = b.y]$}  (s1.80);
     \draw[-latex] (s1.east) to node [auto]                {$a \rightarrow [y = a.y]$\newline$b \rightarrow [y = b.y]$} (s2.west);

\end{tikzpicture}
\end{figure}

\end{document}

This is the output: enter image description here

How to get line break on labels? And why are some lines of the node are appearing darker than others?

tikzlearner
  • 4,527

0 Answers0