Created
September 17, 2013 01:38
-
-
Save chi-feng/6589066 to your computer and use it in GitHub Desktop.
Latex Listings language definition/style for Julia
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\usepackage{inconsolata} % very nice fixed-width font included with texlive-full | |
\usepackage[usenames,dvipsnames]{color} % more flexible names for syntax highlighting colors | |
\usepackage{listings} | |
\lstset{ | |
basicstyle=\ttfamily, | |
columns=fullflexible, % make sure to use fixed-width font, CM typewriter is NOT fixed width | |
numbers=left, | |
numberstyle=\small\ttfamily\color{Gray}, | |
stepnumber=1, | |
numbersep=10pt, | |
numberfirstline=true, | |
numberblanklines=true, | |
tabsize=4, | |
lineskip=-1.5pt, | |
extendedchars=true, | |
breaklines=true, | |
keywordstyle=\color{Blue}\bfseries, | |
identifierstyle=, % using emph or index keywords | |
commentstyle=\sffamily\color{OliveGreen}, | |
stringstyle=\color{Maroon}, | |
showstringspaces=false, | |
showtabs=false, | |
upquote=false, | |
texcl=true % interpet comments as LaTeX | |
} | |
\lstdefinelanguage{julia} | |
{ | |
keywordsprefix=\@, | |
morekeywords={ | |
exit,whos,edit,load,is,isa,isequal,typeof,tuple,ntuple,uid,hash,finalizer,convert,promote, | |
subtype,typemin,typemax,realmin,realmax,sizeof,eps,promote_type,method_exists,applicable, | |
invoke,dlopen,dlsym,system,error,throw,assert,new,Inf,Nan,pi,im,begin,while,for,in,return, | |
break,continue,macro,quote,let,if,elseif,else,try,catch,end,bitstype,ccall,do,using,module, | |
import,export,importall,baremodule,immutable,local,global,const,Bool,Int,Int8,Int16,Int32, | |
Int64,Uint,Uint8,Uint16,Uint32,Uint64,Float32,Float64,Complex64,Complex128,Any,Nothing,None, | |
function,type,typealias,abstract | |
}, | |
sensitive=true, | |
morecomment=[l]{\#}, | |
morestring=[b]', | |
morestring=[b]" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For those of you who are intrested in a language definition that looks similiar to the one that is used in the official julia documentation check out my project jlcode: https://github.com/wg030/jlcode