[Tex/LaTex] Scala support in listings package

listings

As far as I know, the Scala programming language is not supported
by the listings package.
Is an implementation under way? Will it be included in the standard
listings distribution?

Best Answer

Shamelessly pinched from this site, the following provides a Scala language definition for listings. Simply place it in your preamble, and use listings in the normal way.

% "define" Scala
\lstdefinelanguage{scala}{
  morekeywords={abstract,case,catch,class,def,%
    do,else,extends,false,final,finally,%
    for,if,implicit,import,match,mixin,%
    new,null,object,override,package,%
    private,protected,requires,return,sealed,%
    super,this,throw,trait,true,try,%
    type,val,var,while,with,yield},
  otherkeywords={=>,<-,<\%,<:,>:,\#,@},
  sensitive=true,
  morecomment=[l]{//},
  morecomment=[n]{/*}{*/},
  morestring=[b]",
  morestring=[b]',
  morestring=[b]"""
}
Related Question