/[escript]/trunk/doc/elist.tex
ViewVC logotype

Contents of /trunk/doc/elist.tex

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3385 - (show annotations)
Thu Nov 25 04:41:33 2010 UTC (8 years, 10 months ago) by ahallam
File MIME type: application/x-tex
File size: 4114 byte(s)
Updates to cookbook, something is wrong with the sconstruct though
1
2
3 \usepackage{listing}
4 % defines the colour for the background of code examples
5 \definecolor{LightGrey}{gray}{0.9}
6
7 %Some colour definitions added to keep pdflatex happy
8 %I make no claim that these values are particularly good
9 \definecolor{Purple}{rgb}{0.7, 0, 0.6}
10 \definecolor{Tan}{rgb}{0.5,0.5,0.5}
11 \definecolor{BrickRed}{rgb}{0.7, 0.2, 0.2}
12 \definecolor{Black}{rgb}{0, 0, 0}
13
14 % All the \color{x} used to be \color[named]{x}
15 %end color defs
16
17 \lstdefinestyle{myC++}{%
18 language=C++,
19 showstringspaces=false,
20 basicstyle=\small\ttfamily,
21 commentstyle=\color{BrickRed}\ttfamily,
22 keywordstyle=\color{Purple}\ttfamily,
23 %identifierstyle=\color{Blue}\ttfamily,
24 %functionstyle=\color{Blue}\ttfamily,
25 %typestyle=\color{ForestGreen}\ttfamily,
26 stringstyle=\color{Tan}\ttfamily,%
27 morekeywords={,complex,}%
28 frame=none,%
29 backgroundcolor=\color{LightGrey}%
30 }
31
32 \lstdefinestyle{myMatlab}{%
33 language=Matlab,
34 showstringspaces=false,
35 basicstyle=\small\ttfamily,
36 commentstyle=\color{BrickRed}\ttfamily,
37 keywordstyle=\color{Purple}\ttfamily,
38 %identifierstyle=\color{Blue}\ttfamily,
39 %functionstyle=\color{Blue}\ttfamily,
40 %typestyle=\color{ForestGreen}\ttfamily,
41 stringstyle=\color{Tan}\ttfamily,%
42 frame=none,%
43 backgroundcolor=\color{LightGrey}%
44 }
45
46 \lstdefinestyle{myScilab}{%
47 language=Scilab,
48 showstringspaces=false,
49 basicstyle=\small\ttfamily,
50 commentstyle=\color{BrickRed}\ttfamily,
51 keywordstyle=\color{Purple}\ttfamily,
52 %identifierstyle=\color{Blue}\ttfamily,
53 %functionstyle=\color{Blue}\ttfamily,
54 %typestyle=\color{ForestGreen}\ttfamily,
55 stringstyle=\color{Tan}\ttfamily,%
56 frame=none,%
57 backgroundcolor=\color{LightGrey}%
58 }
59
60 \lstdefinestyle{myShell}{%
61 language=ksh,
62 showstringspaces=false,
63 basicstyle=\small\ttfamily,
64 commentstyle=\color{Black}\ttfamily,
65 keywordstyle=\color{Black}\ttfamily,
66 %identifierstyle=\color{Blue}\ttfamily,
67 %functionstyle=\color{Blue}\ttfamily,
68 %typestyle=\color{ForestGreen}\ttfamily,
69 stringstyle=\color{Black}\ttfamily,%
70 frame=none,%
71 backgroundcolor=\color{LightGrey}%
72 }
73
74 \lstdefinestyle{myPython}{%
75 language=python,
76 showstringspaces=false,
77 basicstyle=\small\ttfamily,
78 commentstyle=\color{BrickRed}\ttfamily,
79 keywordstyle=\color{Purple}\ttfamily,
80 %identifierstyle=\color{Blue}\ttfamily,
81 %functionstyle=\color{Blue}\ttfamily,
82 %typestyle=\color{ForestGreen}\ttfamily,
83 stringstyle=\color{Tan}\ttfamily,%
84 frame=none,%
85 %backgroundcolor=\color{LightGrey}%
86 }
87
88 \lstdefinestyle{myhtml}{%
89 language=xml,
90 showstringspaces=false,
91 basicstyle=\small\ttfamily,
92 commentstyle=\color{BrickRed}\ttfamily,
93 keywordstyle=\color{Purple}\ttfamily,
94 %identifierstyle=\color{Blue}\ttfamily,
95 %functionstyle=\color{Blue}\ttfamily,
96 %typestyle=\color{ForestGreen}\ttfamily,
97 stringstyle=\color{Tan}\ttfamily,
98 morekeywords={,simulation,prop_dim,error_check,stochastic,%
99 globals,field,dimensions,lattice,domains,samples,vector,%
100 components,fourier_space,sequence,integrate,algorithm,%
101 interval,k_operators,constant,operator_names,vectors,%
102 output,filename,group,sampling,moments,benchmark,use_double,%
103 use_wisdom,use_prefs,binary_output,cycles,filter,post_propagation,%
104 default_value,argv,arg,iterations,cross_propagation,%
105 use_mpi,paths,seed,noises,author,description,name,type,%
106 }
107 frame=none,%
108 %framerule=2pt,%
109 backgroundcolor=\color{LightGrey}%
110 }
111
112
113 % this implements producing nice code blocks
114 % it also saves time, typing and
115 % *should* reduce errors in the text by removing doubling up of code
116 \lstnewenvironment{xmdsCode}[1][]{\lstset{style=myhtml}\lstset{#1}}{}
117
118 % this implements nicely formatted shell code
119 \lstnewenvironment{shellCode}[1][]{\lstset{style=myShell}\lstset{#1}}{}
120
121 % this implements nicely formatted Perl code
122 \lstnewenvironment{perlCode}[1][]{\lstset{style=myPerl}\lstset{#1}}{}
123
124 % this implements nicely formatted Python code
125 \lstnewenvironment{python}[1][]{\lstset{style=myPython}\lstset{#1}}{}
126
127 % this implements nicely formatted C++ code
128 \lstnewenvironment{CCode}{\lstset{style=myC++}}{}
129
130 % this implements nicely formatted matlab code
131 \lstnewenvironment{matlabCode}{\lstset{style=myMatlab}}{}
132
133 % this implements nicely formatted scilab code
134 \lstnewenvironment{scilabCode}{\lstset{style=myScilab}}{}

  ViewVC Help
Powered by ViewVC 1.1.26