-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpseudocode.sty
More file actions
40 lines (40 loc) · 1.8 KB
/
pseudocode.sty
File metadata and controls
40 lines (40 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
%------------------------------------------------------------------------------
% pseudocode.sty defines additional languages using listings package for writing
% algorithms in a natural way (in english or in french)
% Guillaume J. Laurent, 2015
%------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{pseudocode}[2018/11/01 pseudocode package]
\RequirePackage{listings}
%------------------------------------------------------------------------------
\lstdefinelanguage{pseudocode}
{
sensitive=false,
keywords={while,do,endwhile,if,then,else,endif,repeat,until,for,endfor,from,to,each,step,%
function,procedure,begin,end,return,input,output,data,result,%
type,record,object,class,array,%
integer,boolean,true,false,real,string},
comment=[l]{//},
morecomment=[s]{/*}{*/},
string=[b]{"},
mathescape=true,
literate={:=}{{$\gets$ }}1 {<-}{{$\gets$ }}1 {<=}{{$\leq$ }}1 {>=}{{$\geq$ }}1 %
{<>}{{$\neq$ }}1 {!=}{{$\neq$ }}1
}
%------------------------------------------------------------------------------
\lstdefinelanguage{pseudocodefr}
{
sensitive=false,
keywords={tant,que,fintantque,si,alors,sinon,finsi,fin,pour,finpour,de,faire,%
fonction,retourner,type,enregistrement,objet,classe,%
tableau,entier,entiers,vrai,faux,allant,chaque,par,pas,la},
otherkeywords={début,Début,procédure,Procédure,répéter,Répéter,réel,réels,
Réel,Réels,chaîne,chaînes,Chaîne,Chaînes,Booléen,booléen,Booléens,booléens,à,donnée,Donnée,données,Données,résultat,Résultat,résultats,Résultat},
comment=[l]{//},
morecomment=[s]{/*}{*/},
string=[b]{"},
mathescape=true,
literate={:=}{{$\gets$ }}1 {<-}{{$\gets$ }}1 {<=}{{$\leq$ }}1 {>=}{{$\geq$ }}1 %
{<>}{{$\neq$ }}1 {!=}{{$\neq$ }}1
}
%------------------------------------------------------------------------------