[OS X TeX] pushdown automata?

Alain Matthes alain.matthes at mac.com
Mon Jan 19 05:41:52 CET 2009


Le 19 janv. 09 à 05:28, Alain Schremmer a écrit :

>
> On Jan 18, 2009, at 10:31 PM, Ross Moore wrote:
>
>> Hi Art,
>>
>> On 19/01/2009, at 12:46 PM, Art Werschulz wrote:
>>
>>> Hi.
>>>
>>> Any suggestions for drawing pushdown automata using TiKZ (or some  
>>> other LaTeX-friendly package)?  Something like the following  
>>> (which will only look good in a monospaced font):
>>>
>>> +---------+
>>> | State   |-------+
>>> | control |       |
>>> +---------+       V
>>>    |	       +---------------+
>>>    |          | a | a | b | b |
>>>    |          +---------------+
>>>    V
>>>  +---+
>>>  | x |
>>>  +---+
>>>  | y |
>>>  +---+
>>>  | z |
>>>  +---+
>>
>> It can be done in just a few lines of Xy-pic coding:
>>
> Which reminds me of Hamada's response to a person who was wondering  
> how he could ask, say, $10,000 dollars for a pot he had turned in  
> "just a few minutes":
>
> "It took me "just a few minutes", yes … plus fifty years before that".


Hi,

It can be done in just a few lines of TikZ coding and it took me "just  
a few seconds" :)
The syntax is not exactly the same

Best Regards

Alain

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{%
   arrows,%
   chains,%
   positioning,%
   scopes}

\begin{document}


\begin{tikzpicture}[node distance=0mm, every node/.style={draw,minimum  
size=8mm}]
\node (deb) {State Control};
{ [start chain=1]
\node [on chain] at (3,-2){$a$};
\node [on chain] {$a$};
\node [on chain] {$b$};
\node [on chain] {$b$};
}

{ [start chain=2 going below]
\node [on chain] at (-2,-3){0};
\node [on chain] {$x$};
\node [on chain] {$y$};
\node [on chain] {$z$};
}
\begin{scope}[->,>=latex']
	\draw (deb.east) -| (1-1);
	\draw (deb.south) |- (2-1.east);
\end{scope}

\end{tikzpicture}
\end{document}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Image 4.png
Type: image/png
Size: 9923 bytes
Desc: not available
URL: <http://tug.org/pipermail/macostex-archives/attachments/20090119/9e20659a/attachment.png>
-------------- next part --------------



More information about the macostex-archives mailing list