\lstset{basicstyle=\sf\footnotesize,columns=fullflexible}

\lstnewenvironment{code}[1][mathescape=false]{\lstset{language=XML, #1}}{}

\newcommand{\delima}{\mid\negmedspace \mid}
\newcommand{\delimb}{\delima\negmedspace \delima}
\newcommand{\GS}{\ensuremath{\textcolor{RedViolet}{\delimb\negmedspace\delimb}}}
\newcommand{\RS}{\ensuremath{\textcolor{Green}{\delimb}}}
\newcommand{\US}{\ensuremath{\textcolor{Turquoise}{\delima}}}

\lstdefinestyle{mmt}{	
	keywordstyle=\color{Emerald},
	columns=flexible
}
\lstdefinelanguage{mmt}{
	morekeywords={theory,view,include,namespace,rule,role,implicit,import},
	morecomment=[l][\color{Gray}]{//},
	% morecomment={[s]{//}{❚},[s]{//}{❙},[s]{//}{❘}}
}
\lstnewenvironment{mmtcode}[1][language=mmt]{\lstset{language=mmt,style=mmt,inputencoding=utf8,escapechar=\&,#1}}{}
\lstnewenvironment{nmmtcode}[1][language=mmt]{\lstset{xleftmargin=1.2em,language=mmt,style=mmt,inputencoding=utf8,escapechar=\&,#1}}{}
\lstdefinestyle{scala}{	
	keywordstyle=\color{BurntOrange}
}
\lstdefinelanguage{scala}{
	emphstyle=\underbar,
	classoffset=0,keywordstyle=\bfseries\color{BurntOrange},
	morekeywords={case,class,object,trait,extends,match,if,else,def,implicit,import,val,var,this,override,with,return,abstract},
	classoffset=1,keywordstyle=\color{blue},
	morekeywords={OMA,OMS,OMBIND,OMV,OMID,Context,VarDecl,Term,LocalName,GlobalName,MPath,Solver,Stack,Rule,
	History,Inhabitable,Subtyping,Equality,Typing,Common,Judgment,FormationRule,CheckingRule,IntroductionRule,
	EliminationRule,InferenceRule,TypingRule,ComputationRule,TypeBasedEqualityRule,TermBasedEqualityRule,
	TermHeadBasedEqualityRule,Continue,CheckingCallback,Simplifiability,Simplify,RecurseOnly,SubtypingRule,
	VarianceRule,TypeBasedSolutionRule,DerivedDeclaration,StructuralFeature,Elaboration,FormatBasedExtension,
	Marker,ExtendedCheckingEnvironment,DeclaredModule,Universe,InhabitableRule,UniverseRule,ElementContainer,Declaration,
	OMMOD,ContentPath,RealizedType,SemanticType,StandardNat},
	classoffset=2,keywordstyle=\color{PineGreen},
	morekeywords={Option,Some,None,Boolean,String,List,Int,true,false,Nil,BigInt,Double},
	classoffset=0,
	morecomment=[l][\color{Gray}]{//},
	morecomment=[s][\color{Gray}]{/*}{*/},
	morecomment=[s][\color{OliveGreen}]{/**}{**/},
	morestring=[b][\color{Purple}]",
}
\lstnewenvironment{scalacode}[1][language=scala]{\lstset{language=scala,style=scala,inputencoding=utf8,escapechar=\&,#1}}{}
\lstnewenvironment{nscalacode}[1][language=scala]{\lstset{xleftmargin=1.2em,numbers=left,language=scala,style=scala,inputencoding=utf8,escapechar=\&,#1}}{}

%\newunicodechar{→}{\ensuremath{\rightarrow}}
\lstset{
	literate={→}{\ensuremath{\rightarrow\ }}1
			{⟶}{\ensuremath{\rightarrow\ }}1
			{Π}{\ensuremath{\Pi}}1
			{⟹}{\ensuremath{\Longrightarrow\ }}1
			{λ}{\ensuremath{\lambda}}1
			{⟨}{\ensuremath{\langle}}1
			{⟩}{\ensuremath{\rangle}}1
			{❚}{\GS}1
			{❙}{\RS}1
			{❘}{\US}1
			{Σ}{\ensuremath{\sum}}1
			{…}{\ldots}1
			{×}{\ensuremath{\times}}1
			{π}{\ensuremath{\pi}}1
			{⨁}{\ensuremath{\bigoplus}}1
			{↪}{\ensuremath{\hookrightarrow}}1
			{↩}{\ensuremath{\hookleftarrow}}1
			{⊕}{\ensuremath{\oplus}}1
			{∅}{\ensuremath{\emptyset}}1
			{★}{\ensuremath{\star}}1
			{ℕ}{\ensuremath{\mathbb N}}1
			{∘}{\ensuremath{\circ}}1
			{∀}{\ensuremath{\forall}}1
			{≐}{\ensuremath{\doteq}}1
			{⊦}{\ensuremath{\vdash}}1
			{𝒰}{\ensuremath{\mathcal U}}1
			{≤}{\ensuremath{\leq }}1
			{≥}{\ensuremath{\geq }}1
			{&}{\ampersand}1
}

%%% Local Variables:
%%% mode: latex
%%% mode: visual-line
%%% fill-column: 5000
%%% TeX-master: "paper"
%%% End:
