Advertisement
Guest User

Fig1

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