I got this from the Literate Haskell page on the Emacs Wiki[1]:

\usepackage{listings}
\lstloadlanguages{Haskell}
\lstnewenvironment{code}
  {\lstset{}%
    \csname [EMAIL PROTECTED]
  {\csname [EMAIL PROTECTED]
  \lstset{
    basicstyle=\small\ttfamily,
    flexiblecolumns=false,
    basewidth={0.5em,0.45em},
    literate={+}{{$+$}}1 {/}{{$/$}}1 {*}{{$*$}}1 {=}{{$=$}}1
             {>}{{$>$}}1 {<}{{$<$}}1 {\\}{{$\lambda$}}1
             {->}{{$\rightarrow$}}2 {>=}{{$\geq$}}2 {<-}{{$\leftarrow$}}2
             {<=}{{$\leq$}}2 {=>}{{$\Rightarrow$}}2
             {\ .}{{$\circ$}}2 {\ .\ }{{$\circ$}}2
             {>>}{{>>}}2 {>>=}{{>>=}}2
             {|}{{$\mid$}}1
  }

That replaces various strings (including ++) with their symbol
equivalents and generally makes things quite pretty.

Tom

[1]: http://haskell.org/hawiki/LiterateProgramming

On 6/8/07, Andrew Coppin <[EMAIL PROTECTED]> wrote:
Does anybody know what the magical LaTeX command is to turn (say) "++"
into two overprinted pluses? (As seems to be fashionable...)

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to