-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathSciComputing.tex
More file actions
365 lines (235 loc) · 7.44 KB
/
SciComputing.tex
File metadata and controls
365 lines (235 loc) · 7.44 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
\documentclass[11pt]{book}
% include figures
\usepackage{epsfig,wrapfig}
% prefer PDF to PNG
\DeclareGraphicsExtensions{%
.pdf, .png}
%\graphicspath{}
\usepackage[T1]{fontenc}
% AMS symbols
\usepackage{amsmath,amssymb}
% cancel
\usepackage{cancel}
% Palatino font (and math symbols) -- looks nicer than the standard
% LaTeX font
\usepackage{mathpazo}
%\usepackage{helvet}
%\usepackage{lmodern} % better computer modern sans needed with fontenc
\usepackage{gillius}
% URLs (special font for monospace)
\usepackage{inconsolata}
%
% margins and paper size -- this needs to come before fncychap
% see http://stackoverflow.com/questions/3729099/latex-paper-size
\usepackage[top=0.75in,
bottom=0.75in,
inner=0.9in,
outer=0.65in]{geometry}
\geometry{papersize={7in,10in}}
% this needs to be done before the fncychap style, since that will
% redo the chapter stuff
\usepackage{sectsty}
\allsectionsfont{\sffamily}
\subsectionfont{\sffamily\em}
\usepackage[PetersLenny]{fncychap}
\ChNameVar{\fontsize{16}{18}\usefont{OT1}{phv}{m}{n}\selectfont}
\ChNumVar{\fontsize{60}{62}\usefont{OT1}{ptm}{m}{n}\selectfont}
\ChTitleVar{\Huge\bfseries\sffamily}
\ChRuleWidth{1pt}
% part page style
% see http://tex.stackexchange.com/questions/6609/problems-with-part-labels-using-titlesec
\usepackage{titlesec}
\titleformat{\part}[display]
{\bfseries\sffamily\Huge\filcenter}
{{\partname{}} \thepart}
{0em}
{\hrule}
% hyperlinks -- load after fncychap
\usepackage{hyperref}
\usepackage[hyperpageref]{backref}
\renewcommand*{\backref}[1]{}% for backref < 1.33 necessary
\renewcommand*{\backrefalt}[4]{%
\ifcase #1 %
No citations.%
\or
(Cited on page #2)%
\else
(Cited on pages #2)%
\fi
}
% back references
% color package
\usepackage{xcolor}
\definecolor{mygray}{gray}{0.5}
% custom hrule for title page
\newcommand{\HRule}{\rule{\linewidth}{0.125mm}}
\newcommand{\pyro}{{\sf pyro}}
\newcommand{\git}{{\tt git}}
\newcommand{\ddx}[1]{{\frac{{\partial#1}}{\partial x}}}
% don't make the chapter/section headings uppercase. See the fancyhdr
% documentation (section 9)
\usepackage{fancyhdr}
\renewcommand{\chaptermark}[1]{%
\markboth{\chaptername
\ \thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection---#1}}
% don't put a header on blank pages, see
% http://www.latex-community.org/forum/viewtopic.php?f=4&p=51559
% change ``plain'' to ``empty'' to eliminate the page number
\makeatletter
\renewcommand*\cleardoublepage{\clearpage\if@twoside
\ifodd\c@page\else
\hbox{}
\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
% skip a bit of space between paragraphs, to enhance readability
\usepackage{parskip}
% captions
\usepackage{caption}
\renewcommand{\captionfont}{\footnotesize}
\renewcommand{\captionlabelfont}{\footnotesize}
\setlength{\captionmargin}{3em}
%-----------------------------------------------------------------------------
% license
\usepackage{ccicons}
% computer keyboard symbol
\usepackage{marvosym}
% for dotted lines in the matrics/arrays
\usepackage{arydshln}
% fonts for TOC, list of figures, etc
\renewcommand*\listfigurename{\bf\textsf{List of Figures}}
\renewcommand*\contentsname{\bf\textsf{Table of Contents}}
% short table of contents
\usepackage{shorttoc}
% pack more figures on a page
\usepackage{float}
\renewcommand\floatpagefraction{.9}
\renewcommand\topfraction{.9}
\renewcommand\bottomfraction{.9}
\renewcommand\textfraction{.1}
% MarginPars
\setlength{\marginparwidth}{0.75in}
\newcommand{\MarginPar}[1]{\marginpar{\vskip-\baselineskip\raggedright\tiny\sffamily\hrule\smallskip{\color{red}#1}\par\smallskip\hrule}}
\usepackage[many]{tcolorbox}
\newtcolorbox{mybox}[1][]{
width=\textwidth,
arc=0mm,
% auto outer arc,
boxsep=0cm,
toprule=1pt,
leftrule=0pt,
bottomrule=1pt,
rightrule=0pt,
colframe=black,
colback=white,
fontupper=\centering\fontsize{40pt}{40pt}\sffamily,
breakable,
nobeforeafter,
enhanced jigsaw,
opacityframe=1.0,
opacityback=0.7
}
\pdfpageattr{/Group <</S /Transparency /I true /CS /DeviceRGB>>}
% special colors and definitions for framing source code listings
\usepackage{listings}
\definecolor{AntiqueWhite3}{rgb}{0.98,0.96,0.94}
\definecolor{DarkerAntiqueWhite3}{rgb}{0.659,0.635,0.612}
\definecolor{orange}{rgb}{1.0,0.65,0.0}
\newcommand{\cmd}[1]{\lstinline{#1}}
\lstset{%
keywordstyle=\color{blue}\ttfamily,%
commentstyle=\itshape\color[gray]{0.5},%
mathescape=true,%
basicstyle=\small\ttfamily,%
%frameround=fttt,%
frameround=ffff,%
%frame=shadowbox,%
frame=single,%
rulesepcolor=\color{DarkerAntiqueWhite3},%
backgroundcolor=\color{AntiqueWhite3},%
emph={load,add_slice,save}, emphstyle=\color{blue},%
emph={[2]In}, emphstyle=[2]\color{yellow},%
emph={[3]Out}, emphstyle=[3]\color{orange},%
xleftmargin=1em,
xrightmargin=1em,
mathescape=false}
\input symbols
\begin{document}
\frontmatter
\begin{titlepage}
\ \\[2.5in]
\begin{center}
\begin{mybox}[]
\vskip 3mm
{\Huge Scientific Computing Cookbook} \\[-0.5em]
{\Large part of the Open Astrophysics Bookshelf}
\end{mybox}
\end{center}
\vfill
\begin{flushright}
\today
\end{flushright}
\end{titlepage}
\pagestyle{plain}
\null \vfill
\noindent \ccCopy\ 2015, the Open Astrophysics Bookshelf project \\
\noindent document git version: \input git_info.tex $\ldots$
\noindent the source for these notes are available online (via \git):
\url{https://github.com/Open-Astrophysics-Bookshelf/scientific_computing_cookbook}
\noindent \ccbyncsa \\
\noindent This work is licensed under the Creative Commons
Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA
4.0) license.
\clearpage
\shorttoc{Chapter Listing}{0}
\clearpage
\setcounter{tocdepth}{2}
\tableofcontents
\clearpage
\chapter*{Preface}
\chaptermark{Preface}
\addcontentsline{toc}{chapter}{Preface}
\input preface/preface.tex
\clearpage
\pagestyle{headings}
\renewcommand{\chaptermark}[1]{%
\markboth{\chaptername
\ \thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection---#1}}
% put the git hash on the first page of each chapter -- see section
% 7 of the fancyhdr docs to see how to override the plain
% style
\fancypagestyle{plain}{%
\fancyhf{} % clear all header and footer fields
\fancyfoot[C]{\thepage} % except the center
\fancyfoot[L]{\scriptsize git version: \input git_info.tex $\ldots$}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}}
\mainmatter
%-----------------------------------------------------------------------------
\part{The UNIX Shell}
\chapter{Basic operations}
\input UNIX/unix.tex
\chapter{Advanced Scripting}
\chapter{Working Remotely}
\input remote/remote.tex
%-----------------------------------------------------------------------------
\part{Programming}
\chapter{Python}
\chapter{Fortran}
\chapter{Parallel Programming}
%-----------------------------------------------------------------------------
\part{Plotting and Data Analysis}
%-----------------------------------------------------------------------------
\part{Software Engineering Practices}
\chapter{Version Control}
\chapter{Testing}
\chapter{Reproducibility}
\input reproducibility/reproducibility.tex
\backmatter
%\addcontentsline{toc}{chapter}{References}
%\bibliographystyle{plain}
%\bibliography{refs}
\end{document}