source: doc/theses/andrew_beach_MMath/thesis.tex @ 2655031

arm-ehjacob/cs343-translationnew-astnew-ast-unique-expr
Last change on this file since 2655031 was 2655031, checked in by Peter A. Buhr <pabuhr@…>, 19 months ago

second pass over Andrew's Chapter 1

  • Property mode set to 100644
File size: 15.0 KB
Line 
1% Main tex file for thesis document.
2\documentclass[digital]{uw-ethesis}
3\usepackage{comment}
4\usepackage{fullpage}
5\setlength{\textheight}{8.75in}
6\renewcommand\labelitemi{\footnotesize$\bullet$} % shrink bullet for level 1 itemize
7\usepackage{lmodern}                            % bold typewriter font
8
9\usepackage{listings}                           % format program code
10% Default underscore is too low and wide. Cannot use lstlisting "literate" as replacing underscore
11% removes it as a variable-name character so keywords in variables are highlighted. MUST APPEAR
12% AFTER HYPERREF.
13%\DeclareTextCommandDefault{\textunderscore}{\leavevmode\makebox[1.2ex][c]{\rule{1ex}{0.1ex}}}
14\renewcommand{\textunderscore}{\leavevmode\makebox[1.2ex][c]{\rule{1ex}{0.075ex}}}
15% parindent is relative, i.e., toggled on/off in environments like itemize, so store the value for
16% use rather than use \parident directly.
17\newlength{\parindentlnth}
18\setlength{\parindentlnth}{\parindent}
19
20% CFA programming language, based on ANSI C (with some gcc additions)
21\lstdefinelanguage{CFA}[ANSI]{C}{
22        morekeywords={
23                _Alignas, _Alignof, __alignof, __alignof__, asm, __asm, __asm__, __attribute, __attribute__,
24                auto, _Bool, catch, catchResume, choose, _Complex, __complex, __complex__, __const, __const__,
25                coroutine, disable, dtype, enable, exception, __extension__, fallthrough, fallthru, finally,
26                __float80, float80, __float128, float128, forall, ftype, generator, _Generic, _Imaginary, __imag, __imag__,
27                inline, __inline, __inline__, __int128, int128, __label__, monitor, mutex, _Noreturn, one_t, or,
28                otype, restrict, resume, __restrict, __restrict__, __signed, __signed__, _Static_assert, suspend, thread,
29                _Thread_local, throw, throwResume, timeout, trait, try, ttype, typeof, __typeof, __typeof__,
30                virtual, __volatile, __volatile__, waitfor, when, with, zero_t},
31        moredirectives={defined,include_next},
32        % replace/adjust listing characters that look bad in sanserif
33        literate={-}{\makebox[1ex][c]{\raisebox{0.5ex}{\rule{0.8ex}{0.1ex}}}}1 {^}{\raisebox{0.6ex}{$\scriptstyle\land\,$}}1
34                {~}{\raisebox{0.3ex}{$\scriptstyle\sim\,$}}1 % {`}{\ttfamily\upshape\hspace*{-0.1ex}`}1
35                {<}{\textrm{\textless}}1 {>}{\textrm{\textgreater}}1
36                {<-}{$\leftarrow$}2 {=>}{$\Rightarrow$}2 {->}{\makebox[1ex][c]{\raisebox{0.5ex}{\rule{0.8ex}{0.075ex}}}\kern-0.2ex{\textrm{\textgreater}}}2,
37}
38
39\lstset{
40language=CFA,
41columns=fullflexible,
42basicstyle=\linespread{0.9}\tt,                 % reduce line spacing and use sanserif font
43stringstyle=\tt,                                % use typewriter font
44tabsize=5,                                      % N space tabbing
45xleftmargin=\parindentlnth,                     % indent code to paragraph indentation
46%mathescape=true,                               % LaTeX math escape in CFA code $...$
47escapechar=\$,                                  % LaTeX escape in CFA code
48keepspaces=true,
49showstringspaces=false,                         % do not show spaces with cup
50showlines=true,                                 % show blank lines at end of code
51aboveskip=4pt,                                  % spacing above/below code block
52belowskip=3pt,
53moredelim=**[is][\color{red}]{`}{`},
54}% lstset
55
56\lstnewenvironment{cfa}[1][]
57{\lstset{#1}}
58{}
59% inline code @...@
60
61% Commands used in documenting how to use the template. To remove.
62\newcommand{\package}[1]{\textbf{#1}}
63\newcommand{\cmmd}[1]{\textbackslash\texttt{#1}}
64\newcommand{\href}[1]{#1}
65
66% For a nomenclature (optional; available from ctan.org)
67%\usepackage{nomencl}
68% Lots of math symbols and environments
69\usepackage{amsmath,amssymb,amstext}
70% For including graphics, sets the pdftex graphics driver.
71\usepackage[pdftex]{graphicx}
72
73\usepackage{cfalab}
74
75\usehyperrefpackage[pdftex,pagebackref=false]{
76    pdftitle={Exception Handling in CFA},
77    pdfauthor={Andrew James Beach},
78    pdfsubject={Programming Languages},
79    pdfkeywords={exceptions,implementation},
80}
81
82% The \phantomsection is used to help the hyperref package create links.
83
84% Maybe only package that should be loaded after the hyperref package.
85% From http://ctan.org/pkg/glossaries-extra, extends glossaries which replaces
86% glossary and builds off of the makeindex system.
87\usepackage[toc,abbreviations]{glossaries-extra}
88
89% Main glossary entries -- definitions of relevant terminology
90\newglossaryentry{computer}
91{
92name=computer,
93description={A programmable machine that receives input data,
94               stores and manipulates the data, and provides
95               formatted output}
96}
97
98% Nomenclature glossary entries -- New definitions, or unusual terminology
99\newglossary*{nomenclature}{Nomenclature}
100\newglossaryentry{dingledorf}
101{
102type=nomenclature,
103name=dingledorf,
104description={A person of supposed average intelligence who makes incredibly
105               brainless misjudgments}
106}
107
108% List of Abbreviations (abbreviations are from the glossaries-extra package)
109\newabbreviation{aaaaz}{AAAAZ}{American Association of Amature Astronomers
110               and Zoologists}
111
112% List of Symbols
113\newglossary*{symbols}{List of Symbols}
114\newglossaryentry{rvec}
115{
116name={$\mathbf{v}$},
117sort={label},
118type=symbols,
119description={Random vector: a location in n-dimensional Cartesian space, where
120               each dimensional component is determined by a random process}
121}
122
123% Must be here of cause problems with glossaries-extra.
124\lstMakeShortInline$%
125
126% Generate the glossaries defined above.
127\makeglossaries
128
129\begin{document}
130
131%----------------------------------------------------------------------
132% FRONT MATERIAL
133%----------------------------------------------------------------------
134\input{thesis-frontpgs}
135
136%----------------------------------------------------------------------
137% MAIN BODY
138%----------------------------------------------------------------------
139\input{unwinding}
140
141%======================================================================
142\chapter{Introduction}
143%======================================================================
144In the beginning, there was $\pi$:
145
146\begin{equation}
147   e^{\pi i} + 1 = 0  \label{eqn_pi}
148\end{equation}
149A \gls{computer} could compute $\pi$ all day long. In fact, subsets of digits
150of $\pi$'s decimal approximation would make a good source for psuedo-random
151vectors, \gls{rvec} .
152
153%----------------------------------------------------------------------
154\section{State of the Art}
155%----------------------------------------------------------------------
156
157See equation \ref{eqn_pi} on page \pageref{eqn_pi}.\footnote{A famous equation.}
158
159\section{Some Meaningless Stuff}
160
161The credo of the \gls{aaaaz} was, for several years, several paragraphs of gibberish, until the \gls{dingledorf} responsible for the \gls{aaaaz} Web site realized his mistake:
162
163"Velit dolor illum facilisis zzril ipsum, augue odio, accumsan ea augue molestie lobortis zzril laoreet ex ad, adipiscing nulla. Veniam dolore, vel te in dolor te, feugait dolore ex vel erat duis nostrud diam commodo ad eu in consequat esse in ut wisi. Consectetuer dolore feugiat wisi eum dignissim tincidunt vel, nostrud, at vulputate eum euismod, diam minim eros consequat lorem aliquam et ad. Feugait illum sit suscipit ut, tation in dolore euismod et iusto nulla amet wisi odio quis nisl feugiat adipiscing luptatum minim nisl, quis, erat, dolore. Elit quis sit dolor veniam blandit ullamcorper ex, vero nonummy, duis exerci delenit ullamcorper at feugiat ullamcorper, ullamcorper elit vulputate iusto esse luptatum duis autem. Nulla nulla qui, te praesent et at nisl ut in consequat blandit vel augue ut.
164
165Illum suscipit delenit commodo augue exerci magna veniam hendrerit dignissim duis ut feugait amet dolor dolor suscipit iriure veniam. Vel quis enim vulputate nulla facilisis volutpat vel in, suscipit facilisis dolore ut veniam, duis facilisi wisi nulla aliquip vero praesent nibh molestie consectetuer nulla. Wisi nibh exerci hendrerit consequat, nostrud lobortis ut praesent dignissim tincidunt enim eum accumsan. Lorem, nonummy duis iriure autem feugait praesent, duis, accumsan tation enim facilisi qui te dolore magna velit, iusto esse eu, zzril. Feugiat enim zzril, te vel illum, lobortis ut tation, elit luptatum ipsum, aliquam dolor sed. Ex consectetuer aliquip in, tation delenit dignissim accumsan consequat, vero, et ad eu velit ut duis ea ea odio.
166
167Vero qui, te praesent et at nisl ut in consequat blandit vel augue ut dolor illum facilisis zzril ipsum. Exerci odio, accumsan ea augue molestie lobortis zzril laoreet ex ad, adipiscing nulla, et dolore, vel te in dolor te, feugait dolore ex vel erat duis. Ut diam commodo ad eu in consequat esse in ut wisi aliquip dolore feugiat wisi eum dignissim tincidunt vel, nostrud. Ut vulputate eum euismod, diam minim eros consequat lorem aliquam et ad luptatum illum sit suscipit ut, tation in dolore euismod et iusto nulla. Iusto wisi odio quis nisl feugiat adipiscing luptatum minim. Illum, quis, erat, dolore qui quis sit dolor veniam blandit ullamcorper ex, vero nonummy, duis exerci delenit ullamcorper at feugiat. Et, ullamcorper elit vulputate iusto esse luptatum duis autem esse nulla qui.
168
169Praesent dolore et, delenit, laoreet dolore sed eros hendrerit consequat lobortis. Dolor nulla suscipit delenit commodo augue exerci magna veniam hendrerit dignissim duis ut feugait amet. Ad dolor suscipit iriure veniam blandit quis enim vulputate nulla facilisis volutpat vel in. Erat facilisis dolore ut veniam, duis facilisi wisi nulla aliquip vero praesent nibh molestie consectetuer nulla, iriure nibh exerci hendrerit. Vel, nostrud lobortis ut praesent dignissim tincidunt enim eum accumsan ea, nonummy duis. Ad autem feugait praesent, duis, accumsan tation enim facilisi qui te dolore magna velit, iusto esse eu, zzril vel enim zzril, te. Nisl illum, lobortis ut tation, elit luptatum ipsum, aliquam dolor sed minim consectetuer aliquip.
170
171Tation exerci delenit ullamcorper at feugiat ullamcorper, ullamcorper elit vulputate iusto esse luptatum duis autem esse nulla qui. Volutpat praesent et at nisl ut in consequat blandit vel augue ut dolor illum facilisis zzril ipsum, augue odio, accumsan ea augue molestie lobortis zzril laoreet. Ex duis, te velit illum odio, nisl qui consequat aliquip qui blandit hendrerit. Ea dolor nonummy ullamcorper nulla lorem tation laoreet in ea, ullamcorper vel consequat zzril delenit quis dignissim, vulputate tincidunt ut."
172
173%======================================================================
174\chapter{Observations}
175%======================================================================
176
177This would be a good place for some figures and tables.
178
179Some notes on figures and photographs\ldots
180
181\begin{itemize}
182\item A well-prepared PDF should be
183  \begin{enumerate}
184    \item Of reasonable size, {\it i.e.} photos cropped and compressed.
185    \item Scalable, to allow enlargment of text and drawings.
186  \end{enumerate}
187\item Photos must be bit maps, and so are not scaleable by definition. TIFF and
188BMP are uncompressed formats, while JPEG is compressed. Most photos can be
189compressed without losing their illustrative value.
190\item Drawings that you make should be scalable vector graphics, \emph{not}
191bit maps. Some scalable vector file formats are: EPS, SVG, PNG, WMF. These can
192all be converted into PNG or PDF, that pdflatex recognizes. Your drawing
193package probably can export to one of these formats directly. Otherwise, a
194common procedure is to print-to-file through a Postscript printer driver to
195create a PS file, then convert that to EPS (encapsulated PS, which has a
196bounding box to describe its exact size rather than a whole page).
197Programs such as GSView (a Ghostscript GUI) can create both EPS and PDF from
198PS files. Appendix~\ref{AppendixA} shows how to generate properly sized Matlab
199plots and save them as PDF.
200\item It's important to crop your photos and draw your figures to the size that
201you want to appear in your thesis. Scaling photos with the
202includegraphics command will cause loss of resolution. And scaling down
203drawings may cause any text annotations to become too small.
204\end{itemize}
205 
206For more information on \LaTeX\, see the uWaterloo Skills for the
207Academic Workplace \href{https://uwaterloo.ca/information-systems-technology/services/electronic-thesis-preparation-and-submission-support/ethesis-guide/creating-pdf-version-your-thesis/creating-pdf-files-using-latex/latex-ethesis-and-large-documents}{course notes}.
208\footnote{
209Note that while it is possible to include hyperlinks to external documents,
210it is not wise to do so, since anything you can't control may change over time.
211It \emph{would} be appropriate and necessary to provide external links to
212additional resources for a multimedia ``enhanced'' thesis.
213But also note that if the \package{hyperref} package is not included,
214as for the print-optimized option in this thesis template, any \cmmd{href}
215commands in your logical document are no longer defined.
216A work-around employed by this thesis template is to define a dummy
217\cmmd{href} command (which does nothing) in the preamble of the document,
218before the \package{hyperref} package is included.
219The dummy definition is then redifined by the
220\package{hyperref} package when it is included.
221}
222
223The classic book by Leslie Lamport \cite{lamport.book}, author of \LaTeX , is
224worth a look too, and the many available add-on packages are described by
225Goossens \textit{et al} \cite{goossens.book}.
226
227%----------------------------------------------------------------------
228% END MATERIAL
229%----------------------------------------------------------------------
230
231%----------------------------------------------------------------------
232% BIBLIOGRAPHY
233%----------------------------------------------------------------------
234
235% Use \clearpage instead if the document class uses the "oneside" argument.
236\cleardoublepage
237\phantomsection
238
239% Bibliography setup and creation, renamed to References.
240\addcontentsline{toc}{chapter}{\textbf{\bibname}}
241\bibliographystyle{plain}
242\bibliography{thesis}
243
244% Include all uncited entries in the bibliography.
245\nocite{*}
246
247% Begin the appendix, add a title and table of contents entry.
248\appendix
249\chapter*{APPENDICES}
250\addcontentsline{toc}{chapter}{APPENDICES}
251%======================================================================
252\chapter[PDF Plots From Matlab]{Matlab Code for Making a PDF Plot}
253\label{AppendixA}
254% Tip 4: Example of how to get a short chapter title for the Table of Contents
255%======================================================================
256\section{Using the GUI}
257Properties of Matab plots can be adjusted from the plot window via a graphical
258interface. Under the Desktop menu in the Figure window, select the Property
259Editor. You may also want to check the Plot Browser and Figure Palette for
260more tools. To adjust properties of the axes, look under the Edit menu and
261select Axes Properties.
262
263To set the figure size and to save as PDF or other file formats, click the
264Export Setup button in the figure Property Editor.
265
266\section{From the Command Line}
267All figure properties can also be manipulated from the command line. Here's an
268example:
269\begin{verbatim}
270x=[0:0.1:pi];
271hold on % Plot multiple traces on one figure
272plot(x,sin(x))
273plot(x,cos(x),'--r')
274plot(x,tan(x),'.-g')
275title('Some Trig Functions Over 0 to \pi') % Note LaTeX markup!
276legend('{\it sin}(x)','{\it cos}(x)','{\it tan}(x)')
277hold off
278set(gca,'Ylim',[-3 3]) % Adjust Y limits of "current axes"
279set(gcf,'Units','inches') % Set figure size units of "current figure"
280set(gcf,'Position',[0,0,6,4]) % Set figure width (6 in.) and height (4 in.)
281cd n:\thesis\plots % Select where to save
282print -dpdf plot.pdf % Save as PDF
283\end{verbatim}
284
285\end{document}
Note: See TracBrowser for help on using the repository browser.