tricky.tex 2.05 KB
Newer Older
Jaime Arias's avatar
Jaime Arias committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
\documentclass[preview]{standalone}
\input{../../base.tex}

\begin{document}

\begin{figure}
  \begin{minipage}[c]{0.5\textwidth}%
    % ADT
    \centering
    \scalebox{.75}{
      \begin{tikzpicture}[every node/.style={ultra thick,draw=red}]
        % depth 0
        \node[and gate US,point up,logic gate inputs=nn] (A) {\rotatebox{-90}{$A$}};

        % depth 1
        \node[and gate US,point up,logic gate inputs=nn,
          below = 9mm of A.west, yshift=20mm] (B) {\rotatebox{-90}{$B$}};
        \draw (B.east) -- ([yshift=0.15cm]B.east) -| (A.input 1);
        \node[and gate US,point up,logic gate inputs=nn,
          below = 9mm of A.west, yshift=-14mm] (C) {\rotatebox{-90}{$C$}};
        \draw (C.east) -- ([yshift=0.15cm]C.east) -| (A.input 2);

        % depth 2
        \node[state, below = 3.6mm of B.west, xshift=-9mm] (d) {$d$};
        \draw (d.north) -- ([yshift=0.15cm]d.north) -| (B.input 1);
        \node[state, below = 3.6mm of B.west, xshift=9mm] (e) {$e$};
        \draw (e.north) -- ([yshift=0.15cm]e.north) -| (B.input 2);

        \node[state, below = 3.6mm of C.west, xshift=-9mm] (f) {$f$};
        \draw (f.north) -- ([yshift=0.15cm]f.north) -| (C.input 1);
        \node[state, below = 3.6mm of C.west, xshift=9mm] (g) {$g$};
        \draw (g.north) -- ([yshift=0.15cm]g.north) -| (C.input 2);
      \end{tikzpicture}
    }
  \end{minipage}
  \begin{minipage}[c]{0.5\textwidth}%
    \centering
    % information
    \scalebox{.75}{\parbox{\linewidth}{%
        \begin{tabular}{l@{~}l@{~}r@{~}}
          \textbf{Name} & \textbf{Cost} & \textbf{Time} \\
          \hline
Jaime Arias's avatar
Jaime Arias committed
43
44
45
46
47
48
49
          \gate{a}      & \EUR{0}       & 1~m           \\
          \gate{b}      & \EUR{0}       & 1~m           \\
          \gate{c}      & \EUR{0}       & 1~m           \\
          \leaf{d}      & \EUR{0}       & 1~m           \\
          \leaf{e}      & \EUR{0}       & 3~m           \\
          \leaf{f}      & \EUR{0}       & 1~m           \\
          \leaf{g}      & \EUR{0}       & 1~m           \\
Jaime Arias's avatar
Jaime Arias committed
50
51
52
53
54
55
        \end{tabular}
      }}
  \end{minipage}
\end{figure}

\end{document}