[OS X TeX] pushdown automata?

Alain Schremmer schremmer.alain at gmail.com
Mon Jan 19 06:49:30 EST 2009


On Jan 19, 2009, at 1:13 AM, Michael Sharpe wrote:

>
> On Jan 18, 2009, at 5: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 |
>>  +---+
> And, for those of the pstricks persuasion, we have:
>
> %&latex
> %!TEX TS-program = latex
> \documentclass{article}
> \usepackage{pst-node}
> \begin{document}
> \psset{arrowscale=2}
> \begin{psmatrix}
> \psframebox{\parbox[b]{.7in}{\centering State\\Control}}\\
> \psframebox[framesep=0pt]{\vtop{\offinterlineskip\hbox{\psframebox 
> {\hbox to .7cm{\strut\hfil x\hfil}}}
> \hbox{\psframebox{\hbox to .7cm{\strut\hfil y\hfil}}}
> \hbox{\psframebox{\hbox to .7cm{\strut\hfil  z\hfil}}}}}
> &\psframebox[framesep=0pt]{\psframebox{\strut a}\psframebox{\strut  
> a}\psframebox{\strut b}\psframebox{\strut b}}
> \ncline[arrows=->]{1,1}{2,1}
> \ncangle[arrows=->,angleB=90]{1,1}{2,2}
> \end{psmatrix}
> \end{document}

And the winner is?

Regards
--schremmer



More information about the MacOSX-TeX mailing list