LaTeX for smalltalk

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

LaTeX for smalltalk

Damien Cassou-3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

how do you write papers about smalltalk in LaTeX ? Especially, how do
you write smalltalk code in LaTeX ? Do you have recipes ?

Bye

- --
Damien Cassou
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFD44re3hhx1vOEX5sRAjHaAKCsnSxscaQUpEurNIKHHBaREjqy6gCeOQqP
uyhTSxPNYE6rqFtgko/QNFc=
=1I6d
-----END PGP SIGNATURE-----

Reply | Threaded
Open this post in threaded view
|

Re: LaTeX for smalltalk

Lukas Renggli
Damien and I just found out that the following is quite a good start:


\usepackage{moreverb}

\newenvironment{source}[0]
        {\scriptsize\obeylines\verbatimtab}
        {\endtrivlist\normalsize}

Better ideas?

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

Reply | Threaded
Open this post in threaded view
|

Re: LaTeX for smalltalk

Nicolas Roard
On 2/3/06, Lukas Renggli <[hidden email]> wrote:

> Damien and I just found out that the following is quite a good start:
>
>
> \usepackage{moreverb}
>
> \newenvironment{source}[0]
>         {\scriptsize\obeylines\verbatimtab}
>         {\endtrivlist\normalsize}
>
> Better ideas?

the listings package
(http://www.tug.org/tex-archive/macros/latex/contrib/listings/) with
possibly a list of custom keywords ?

--
Nicolas Roard
"Any sufficiently advanced technology is indistinguishable from magic."
  -Arthur C. Clarke

Reply | Threaded
Open this post in threaded view
|

Re: LaTeX for smalltalk

Michael Haupt-3
Hi,

On 2/3/06, Nicolas Roard <[hidden email]> 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

Reply | Threaded
Open this post in threaded view
|

Re: LaTeX for smalltalk

Alain Plantec
In reply to this post by Lukas Renggli
Lukas Renggli a écrit :

>Damien and I just found out that the following is quite a good start:
>
>
>\usepackage{moreverb}
>
>\newenvironment{source}[0]
> {\scriptsize\obeylines\verbatimtab}
> {\endtrivlist\normalsize}
>
>Better ideas?
>  
>
maybe listings package.
http://www.tug.org/tex-archive/macros/latex/contrib/listings/listings-1.3.pdf
Smalltalk is not pre defined but it is very easy to add it.
alain

>Lukas
>
>--
>Lukas Renggli
>http://www.lukas-renggli.ch
>
>
>
>  
>


Reply | Threaded
Open this post in threaded view
|

Re[2]: LaTeX for smalltalk

Andres Valloud
Hello Alain,

Tuesday, February 7, 2006, 11:03:47 AM, you wrote:

>>Damien and I just found out that the following is quite a good start:
>>
>>
>>\usepackage{moreverb}
>>
>>\newenvironment{source}[0]
>> {\scriptsize\obeylines\verbatimtab}
>> {\endtrivlist\normalsize}
>>
>>Better ideas?
At the time I had written a TeX file out piece for Squeak 2.x.  See
attached.  I do not know if it will work or not, but it does produce
quite readable output in vanilla TeX.

Unfortunately I wrote this a long time ago so it may have what I
would now consider style defects.  Hopefully it's not too bad.

For LaTeX I use \smalltalk defined as \verbatim{such}, and for
Smalltalk paragraphs I use

\vbox{
\begin{verbatim}
  someMethod: withArguments

    and code indented with spaces only
    because it looks better than with tab
\end{verbatim}
}

--
Best regards,
 Andres                            mailto:[hidden email]



TeXFileOut 20000201.1Febr526pm.cs (57K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: LaTeX for smalltalk

Damien Cassou-3
Thank you very much for all your answers.


--
Damien Cassou

CSS3 :  "On passe au  HSL, plus intuitif  et moins orienté CRT  que le
RGB. Il y a du HSLA". Et en plus, ça veut dire quelque chose (au moins
pour l'auteur) !

Reply | Threaded
Open this post in threaded view
|

Re: LaTeX for smalltalk

Bijan Parsia-2

On Sun, 12 Feb 2006, Damien Cassou wrote:

> Thank you very much for all your answers.

I don't know if anyone mentioned:
  http://ctan.unik.no/macros/latex209/contrib/misc/smalltalk.sty

I don't know if this is a variant of the one we used in the nuBlue book.
that one was pretty nice looking.

Cheers,
Bijan.