Skip to content

Instantly share code, notes, and snippets.

@wataru420
Created February 28, 2012 12:35
Show Gist options
  • Save wataru420/1932286 to your computer and use it in GitHub Desktop.
Save wataru420/1932286 to your computer and use it in GitHub Desktop.
TeX
\documentclass{jarticle}
\usepackage{scala}
\begin{document}
こんにちわ
\end{document}
\usepackage{listings}
% "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]"""
}
\usepackage{color}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
% Default settings for code listings
\lstset{frame=tb,
language=scala,
aboveskip=3mm,
belowskip=3mm,
showstringspaces=false,
columns=flexible,
basicstyle=\renewcommand{\baselinestretch}{0.95}\ttfamily,
numbers=none,
numberstyle=\tiny\color{gray},
keywordstyle=\color{blue},
commentstyle=\color{dkgreen},
stringstyle=\color{mauve},
frame=single,
breaklines=true,
breakatwhitespace=true
tabsize=3
}
\documentclass{jarticle}
\usepackage{scala}
\begin{document}
こんにちわ
\begin{lstlisting}
val t = "hello" // a string
val x = 42 // an int
\end{lstlisting}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment