/[escript]/trunk/doc/user/guide_defs.tex
ViewVC logotype

Annotation of /trunk/doc/user/guide_defs.tex

Parent Directory Parent Directory | Revision Log Revision Log


Revision 572 - (hide annotations)
Wed Mar 1 04:40:10 2006 UTC (13 years, 9 months ago) by gross
File MIME type: application/x-tex
File size: 9686 byte(s)
some fixes to get Latex compiled
1 jgs 82 % $Id$
2    
3     \usepackage{epsfig}
4     \usepackage{graphicx,color}
5     \usepackage{makeidx} % handle the index properly
6     \usepackage{xspace} % handle spaces after commands more nicely
7     % use the ams math stuff, as it makes the maths easier to code, and
8     % nicer output than the standard LaTeX stuff
9     \usepackage{amsmath,amsfonts,amssymb} % this is handy for mathematicians and physicists
10     % see http://www.ams.org/tex/amslatex.html
11     \usepackage{alltt} % handy verbatim stuff
12    
13    
14     % define some handy commands for escript stuff
15 gross 565 \newcommand{\LINUX}{{\it Linux}\xspace}
16 jgs 107 \newcommand{\escript}{\module{esys.escript}\xspace}
17     \newcommand{\finley}{\module{esys.finley}\xspace}
18 gross 565 \newcommand{\pyvisi}{\module{esys.pyvisi}\xspace}
19     \newcommand{\bruce}{\module{esys.bruce}\xspace}
20    
21     \newcommand{\linearPDEs}{\module{esys.escript.linearPDEs}\xspace}
22 jgs 102 \newcommand{\LinearPDE}{\class{LinearPDE}\xspace}
23 jgs 121 \newcommand{\timeseries}{\module{esys.timeseries}\xspace}
24     \newcommand{\modelframe}{\module{esys.modelframe}\xspace}
25     \newcommand{\pdetools}{\module{esys.pdetools}\xspace}
26 gross 565
27 jgs 102 \newcommand{\AdvectivePDE}{\class{AdvectivePDE}\xspace}
28     \newcommand{\Poisson}{\class{Poisson}\xspace}
29 gross 568 \newcommand{\Helmholtz}{\class{Helmholtz}\xspace}
30 jgs 82 \newcommand{\Data}{\class{Data}\xspace}
31 jgs 102 \newcommand{\EmptyData}{empty \class{Data} \index{empty Data}\xspace}
32     \newcommand{\Domain}{\class{Domain}\xspace}
33 gross 565 \newcommand{\VTK}{{\it vtk} \index{visualization!vtk}\index{vtk}}
34     \newcommand{\mayavi}{{\it mayavi} \index{visualization!mayavi}\index{mayavi}}
35 jgs 102 \newcommand{\OpenDX}{{\it OpenDX}\xspace}
36     \newcommand{\finleyelement}[1]{{\it #1}\index{finley!#1}}
37     \newcommand{\False}{\constant{False}\xspace}
38     \newcommand{\True}{\constant{True}\xspace}
39     \newcommand{\PCG}{\constant{PCG}\index{linear solver!PCG}\index{PCG}}
40     \newcommand{\BiCGStab}{\constant{BICGSTAB}\index{linear solver!BiCGStab}\index{BiCGStab}}
41     \newcommand{\Direct}{\constant{DIRECT}\index{linear solver!Direct}\index{Direct solver}}
42     \newcommand{\GMRES}{\constant{GMRES}\index{linear solver!GMRES}\index{GMRES}}
43     \newcommand{\PRESTWENTY}{\constant{PRES20}\index{linear solver!PRES20}\index{PRES20}}
44 jgs 82
45 jgs 102 \newcommand{\FunctionSpace}{\class{FunctionSpace}\xspace}
46     \newcommand{\Operator}{\class{Operator}\xspace}
47     \newcommand{\SolutionFS}{solution \class{FunctionSpace}\index{solution}\xspace}
48     \newcommand{\ReducedSolutionFS}{reduced solution \class{FunctionSpace}\index{solution!reduced}\xspace}
49     \newcommand{\FunctionOnBoundary}{boundary \class{FunctionSpace}\xspace}
50     \newcommand{\Function}{general \class{FunctionSpace}\xspace}
51     \newcommand{\FunctionOnContactZero}{contact \class{FunctionSpace} on side 0\xspace}
52     \newcommand{\FunctionOnContactOne}{contact \class{FunctionSpace} on side 1\xspace}
53     \newcommand{\ContinuousFunction}{continuous \class{FunctionSpace}\xspace}
54 gross 565 \newcommand{\RankOne}{{rank-1 \Data object}\xspace}
55 jgs 102 \newcommand{\RankTwo}{{rank-2 \Data object}\xspace}
56     \newcommand{\RankThree}{{rank-3 \Data object}\xspace}
57     \newcommand{\RankFour}{{rank-4 \Data object}\xspace}
58     \newcommand{\Scalar}{{scalar \Data object}\xspace}
59     \newcommand{\DataSample}{{data sample} \index{data sample}\xspace}
60     \newcommand{\DataSamplePoints}{{data sample points} \index{data sample!points}\xspace}
61     \newcommand{\numarray}{\module{numarray}\xspace}
62     \newcommand{\Shape}{shape\xspace\index{shape}}
63 gross 565 \newcommand{\Rank}{rank\xspace\index{shape}}
64 jgs 102 \newcommand{\ExampleDirectory}{example directory\xspace}
65    
66    
67    
68 jgs 82 % default width for figures
69     \newcommand{\figwidth}{100mm}
70     % commands useful in cross-referencing
71     \newcommand {\Ref}[1] {Reference~\cite{#1}}
72     \newcommand {\Sec}[1] {Section~\ref{#1}}
73     \newcommand {\App}[1] {Appendix~\ref{#1}}
74     \newcommand {\Chap}[1] {Chapter~\ref{#1}}
75     \newcommand {\etal} {\emph{~et~al.}}
76     \newcommand {\fig}[1] {Figure~\ref{#1}}
77     \newcommand {\eqn}[1] {Equation~(\ref{#1})}
78     \newcommand {\tab}[1] {Table~\ref{#1}}
79    
80 jgs 102 % this stops one figure taking up a whole page and lets more text onto
81     % the one page when a figure exists
82     \renewcommand{\floatpagefraction}{0.8} % Default = 0.5
83    
84 jgs 82 % improved version of caption handling
85     \usepackage{ccaption}
86     \captionnamefont{\scshape}
87     \captionstyle{}
88     \makeatletter
89     \renewcommand{\fnum@figure}[1]{\quad\small\textsc{\figurename~\thefigure}:}
90     \renewcommand{\@makecaption}[2]{%
91     \vskip\abovecaptionskip
92     \sbox\@tempboxa{#1: #2}%
93     \ifdim \wd\@tempboxa >\hsize
94     \def\baselinestretch{1}\@normalsize
95     #1: #2\par
96     \def\baselinestretch{1.5}\@normalsize
97     \else
98     \global \@minipagefalse
99     \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
100     \fi
101     \vskip\belowcaptionskip}
102     \makeatother
103    
104 gross 572 % \usepackage{fancyvrb} % fancy verbatim stuff. Needed so code below goes
105 jgs 82 %%% this code grabbed from the PyScript docs
106     %%% pyscript.sourceforge.net
107    
108     % --------------------------------------------------------------
109     % Code format within \Verb
110     % --------------------------------------------------------------
111    
112 gross 572 % \definecolor{pycolor}{rgb}{0,0.4,0}
113 jgs 82
114 jgs 102 %% \DefineVerbatimEnvironment{python}{Verbatim}
115     %% {frame=leftline,framerule=.5mm,rulecolor=\color{pycolor},
116     %% formatcom=\color{pycolor}\small,fontshape=rm}
117 jgs 82
118     %\DefineShortVerb[formatcom=\color{dgreen}\small,fontshape=sl]{\|}
119    
120 gross 572 % \RecustomVerbatimCommand{\Verb}{Verb}{formatcom=\color{pycolor}\small,fontshape=rm}
121 jgs 82
122     %%% end of grabbed code
123    
124     % this is for when one uses pdflatex and therefore needs to load pdf
125     % figures into \includegraphics
126     \ifpdf
127     \DeclareGraphicsExtensions{.pdf} % this command defined in graphicx
128     \pdfcompresslevel=9 % 0: no compression, 9: highest compression
129     % or, set compress_level 9 in file pdftex.cfg
130     \else
131     \DeclareGraphicsExtensions{.eps}
132     \fi
133 jgs 102
134     % defines the colour for the background of code examples
135     \definecolor{LightGrey}{gray}{0.9}
136    
137     % add the listings package to pretty print the code output
138     \usepackage{listings}
139    
140     \lstdefinestyle{myC++}{%
141     %\lstset{%
142     language=C++,
143     showstringspaces=false,
144     basicstyle=\small\ttfamily,
145     commentstyle=\color[named]{BrickRed}\ttfamily,
146     keywordstyle=\color[named]{Purple}\ttfamily,
147     %identifierstyle=\color[named]{Blue}\ttfamily,
148     %functionstyle=\color[named]{Blue}\ttfamily,
149     %typestyle=\color[named]{ForestGreen}\ttfamily,
150     stringstyle=\color[named]{Tan}\ttfamily,%
151     morekeywords={,complex,}%
152     frame=none,%
153     backgroundcolor=\color{LightGrey}%
154     }
155    
156     \lstdefinestyle{myMatlab}{%
157     %\lstset{%
158     language=Matlab,
159     showstringspaces=false,
160     basicstyle=\small\ttfamily,
161     commentstyle=\color[named]{BrickRed}\ttfamily,
162     keywordstyle=\color[named]{Purple}\ttfamily,
163     %identifierstyle=\color[named]{Blue}\ttfamily,
164     %functionstyle=\color[named]{Blue}\ttfamily,
165     %typestyle=\color[named]{ForestGreen}\ttfamily,
166     stringstyle=\color[named]{Tan}\ttfamily,%
167     frame=none,%
168     backgroundcolor=\color{LightGrey}%
169     }
170    
171     \lstdefinestyle{myScilab}{%
172     %\lstset{%
173     language=Scilab,
174     showstringspaces=false,
175     basicstyle=\small\ttfamily,
176     commentstyle=\color[named]{BrickRed}\ttfamily,
177     keywordstyle=\color[named]{Purple}\ttfamily,
178     %identifierstyle=\color[named]{Blue}\ttfamily,
179     %functionstyle=\color[named]{Blue}\ttfamily,
180     %typestyle=\color[named]{ForestGreen}\ttfamily,
181     stringstyle=\color[named]{Tan}\ttfamily,%
182     frame=none,%
183     backgroundcolor=\color{LightGrey}%
184     }
185    
186     \lstdefinestyle{myShell}{%
187     %\lstset{%
188     language=ksh,
189     showstringspaces=false,
190     basicstyle=\small\ttfamily,
191     commentstyle=\color[named]{Black}\ttfamily,
192     keywordstyle=\color[named]{Black}\ttfamily,
193     %identifierstyle=\color[named]{Blue}\ttfamily,
194     %functionstyle=\color[named]{Blue}\ttfamily,
195     %typestyle=\color[named]{ForestGreen}\ttfamily,
196     stringstyle=\color[named]{Black}\ttfamily,%
197     frame=none,%
198     backgroundcolor=\color{LightGrey}%
199     }
200    
201     \lstdefinestyle{myPython}{%
202     %\lstset{%
203     language=python,
204     showstringspaces=false,
205     basicstyle=\small\ttfamily,
206     commentstyle=\color[named]{BrickRed}\ttfamily,
207     keywordstyle=\color[named]{Purple}\ttfamily,
208     %identifierstyle=\color[named]{Blue}\ttfamily,
209     %functionstyle=\color[named]{Blue}\ttfamily,
210     %typestyle=\color[named]{ForestGreen}\ttfamily,
211     stringstyle=\color[named]{Tan}\ttfamily,%
212     frame=none,%
213     %backgroundcolor=\color{LightGrey}%
214     }
215    
216     \lstdefinestyle{myhtml}{%
217     %\lstset{%
218     language=xml,
219     showstringspaces=false,
220     basicstyle=\small\ttfamily,
221     commentstyle=\color[named]{BrickRed}\ttfamily,
222     keywordstyle=\color[named]{Purple}\ttfamily,
223     %identifierstyle=\color[named]{Blue}\ttfamily,
224     %functionstyle=\color[named]{Blue}\ttfamily,
225     %typestyle=\color[named]{ForestGreen}\ttfamily,
226     stringstyle=\color[named]{Tan}\ttfamily,
227     morekeywords={,simulation,prop_dim,error_check,stochastic,%
228     globals,field,dimensions,lattice,domains,samples,vector,%
229     components,fourier_space,sequence,integrate,algorithm,%
230     interval,k_operators,constant,operator_names,vectors,%
231     output,filename,group,sampling,moments,benchmark,use_double,%
232     use_wisdom,use_prefs,binary_output,cycles,filter,post_propagation,%
233     default_value,argv,arg,iterations,cross_propagation,%
234     use_mpi,paths,seed,noises,author,description,name,type,%
235     }
236     frame=none,%
237     %framerule=2pt,%
238     backgroundcolor=\color{LightGrey}%
239     }
240    
241     % this implements producing nice code blocks
242     % it also saves time, typing and
243     % *should* reduce errors in the text by removing doubling up of code
244     \lstnewenvironment{xmdsCode}[1][]{\lstset{style=myhtml}\lstset{#1}}{}
245    
246     % this implements nicely formatted shell code
247     \lstnewenvironment{shellCode}[1][]{\lstset{style=myShell}\lstset{#1}}{}
248    
249     % this implements nicely formatted Perl code
250     \lstnewenvironment{perlCode}[1][]{\lstset{style=myPerl}\lstset{#1}}{}
251    
252     % this implements nicely formatted Python code
253     \lstnewenvironment{python}[1][]{\lstset{style=myPython}\lstset{#1}}{}
254    
255     % this implements nicely formatted C++ code
256     \lstnewenvironment{CCode}{\lstset{style=myC++}}{}
257    
258     % this implements nicely formatted matlab code
259     \lstnewenvironment{matlabCode}{\lstset{style=myMatlab}}{}
260    
261     % this implements nicely formatted scilab code
262     \lstnewenvironment{scilabCode}{\lstset{style=myScilab}}{}
263    

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26