For the moment I came up with a very workaround-ish solution which I bet isn't by far the most elegant/correct approach. It worked for me, that is a code which should be included in the LaTeX preamble. I have something like this:
\usepackage{listings}
\lstset{
keepspaces=true,
columns=flexible,
basicstyle=\footnotesize\ttfamily %nevermind, this is optional
}
% Estilo para ChucK
\lstdefinelanguage{ChucK}
{
sensitive=true,
morecomment=[l]{//},
morecomment=[s]{/*}{*/},
morestring=[b]",
morestring=[d]',
morekeywords={int,float,time,dur,void,same,string,
if,else,while,until,for,repeat,break,continue,return,switch,
class,extends,public,static,pure,this,super,interface,implements,
protected,private,function,fun,spork,const,new,now,true,false,
maybe,null,NULL,me,pi,samp,ms,second,minute,hour,day,week,
dac,adc,blackhole,then,before,after,at},
morekeywords={complex,polar,Object,array,Event,UGen,Machine,Math,Std,
Shred,MidiIn,MidiMsg,OscRecv,OscEvent,OscSend},
morekeywords={SinOsc,PulseOsc,SqrOsc,TriOsc,SawOsc,Phasor,Noise,Impulse,
Step,Gain,SndBuf,HalfRect,FullRect,ZeroX,Mix2,Pan2,GenX,CurveTable,
WarpTable,LiSa,OneZero,TwoZero,OnePole,TwoPole,PoleZero,BiQuad,Filter,
LPF,HPF,BPF,BRF,ResonZ,Dyno,Envelope,ADSR,Delay,DelayA,DelayL,Echo,
JCRev,NRev,PRCRev,Chorus,Modulate,PitShift,SubNoise,Blit,BlitSaw,
BlitSquare,WvIn,WaveLoop,WvOut,StkInstrument,BandedWG,BlowBotl,BlowHole,
Bowed,Brass,Clarinet,Flute,Mandolin,ModalBar,Moog,Saxofony,Shakers,
Sitar,StifKarp,VoicForm,FM,BeeThree,FMVoices,HevyMetl,PercFlut,Rhodey,
TubeBell,Wurley},
morekeywords={UAna,UAnaBlob,Windowing,FFT,IFFT,DCT,IDCT,Centroid,Flux,
RMS,RollOff},
otherkeywords={=>,=^,\%,+,-,*,/,+=>,-=>,*=>,/=>,@,@=>,
!=,>,>=,<,<=,<<,>>,\&,\&\&,|,||,=,==,^,++,--,~,\%=>,::,
<<<,>>>}
}
Then, you should call your listing environment using the lang=ChucK parameter.
You are warned that this probably contains errors and barely fits most basic ChucK code.
Nonetheless, it can serve as boilerplate for more proficient TeX users to create something
more correct and compatible.
Best regards!
P.S.: I did not try using the minted package, as it wasn't compatible with the template required
by my uni.
Hi Jean,
I don't know of anything like that but it would come in handy for my own thesis as well! Let us know if you get anywhere with it.
It might be useful to centralize links to the various ChucK support resources that have been developed over the years (vimrc's, syntax highlighting definitions, Sublime bundles, etc.)
spencer
_______________________________________________
chuck-users mailing list
chuck-users@lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users