Advertisement
Guest User

Fig2

a guest
Jul 22nd, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 1.23 KB | None | 0 0
  1. % Figure 2 Source Code | China Papers | Algorithm | Data structures | Vu Van Dung 2019
  2. %
  3. % Command line compilation:
  4. % pdflatex -jobname=output main.tex
  5. % convert -density 130 -background white -flatten output.pdf pages.png
  6. \documentclass[tikz]{standalone}
  7. \usepackage[utf8]{inputenc}
  8. \usepackage[T1,T5]{fontenc}
  9. \usepackage{inconsolata}
  10. \usepackage{mathptmx}
  11. \begin{document}
  12. \fontencoding{T1}\selectfont
  13. \begin{tikzpicture}[>=stealth]
  14.    \node[draw,inner sep=0pt,minimum size=.5cm] (0) at (0,0) {\texttt{C}};
  15.    \foreach \i [count=\j] in {D,A,C,B,D,C,A,D,C,D,B,A,D,C,C,B,A,D} {
  16.        \pgfmathtruncatemacro{\before}{\j-1}
  17.        \node[draw,inner sep=0pt,minimum size=.5cm,right]
  18.            (\j) at (\before.east) {\texttt{\i}};
  19.    }
  20.    \draw[densely dotted] (0.north west) -- ++ (-.3,0) (0.south west) -- ++ (-.3,0);
  21.    \draw[densely dotted] (18.north east) -- ++ (.3,0) (18.south east) -- ++ (.3,0);
  22.    \draw (0.north west) -- (18.north east) (0.south west) -- (18.south east);
  23.    \foreach \i in {15,13,12,11}
  24.        \draw[->] (16.north) parabola[parabola height=.5cm] (\i.north);
  25.    \foreach \i in {14,13,12,11}
  26.        \draw[->] (15.south) parabola[parabola height=-.5cm] (\i.south);
  27. \end{tikzpicture}
  28. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement