/[escript]/branches/stage3.1/doc/user/guide_defs.tex
ViewVC logotype

Annotation of /branches/stage3.1/doc/user/guide_defs.tex

Parent Directory Parent Directory | Revision Log Revision Log


Revision 97 - (hide annotations)
Tue Dec 14 05:39:33 2004 UTC (14 years, 10 months ago) by jgs
Original Path: trunk/esys2/doc/user/guide_defs.tex
File MIME type: application/x-tex
File size: 9096 byte(s)
*** empty log message ***

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26