LaTeX for smalltalk

Michael Haupt mhaupt at gmail.com
Sat Feb 4 13:37:29 UTC 2006


Hi,

On 2/3/06, Nicolas Roard <nicolas.roard at gmail.com> wrote:
> the listings package
> (http://www.tug.org/tex-archive/macros/latex/contrib/listings/) with
> possibly a list of custom keywords ?

as far as I know, the listings package doesn't have Smalltalk support
by default, but I've assembled something for my dissertation. Try this
configuration:

-----
\lstdefinelanguage{Smalltalk}{
  morekeywords={true,false,self,super,nil},
  sensitive=true,
  morecomment=[s]{"}{"},
  morestring=[d]',
  style=SmalltalkStyle
}
\lstdefinestyle{SmalltalkStyle}{
  literate={:=}{{$\gets$}}1{^}{{$\uparrow$}}1
}
-----

It does some pretty-printing (using an arrow pointing to the left for
assignment, and an arrow pointing upwards for returning), and keywords
are printed in boldface per default.

Using the above, you can do something like

-----
\begin{lstlisting}[language=Smalltalk]
HelloWorld>>sayHelloTo: aString
    "print a hello world message"
    Transcript show: 'Hello, ', aString, '!'
\end{lstlisting}
-----

And all the other stuff that the listings package allows for. :-)

Please let me know if it works for you!

Best,

Michael Haupt



More information about the Squeak-dev mailing list