[OS X TeX] pushdown automata?

Alain Schremmer schremmer.alain at gmail.com
Mon Jan 19 06:12:10 CET 2009


On Jan 18, 2009, at 11:41 PM, Alain Matthes wrote:

>
> 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}

I agree, it is a lot less impressive.

(Which is precisely why it is TikZ which is on my To Learn list.)

Interested regards.
--schremmer


More information about the macostex-archives mailing list