-----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----- |
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 |
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 |
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 |
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? > > 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 |
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? 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 |
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) ! |
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. |
Free forum by Nabble | Edit this page |