<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">% sample latex/latex2e file with lots of math, tables, figures, etc
% useful for writing papers, assignments, etc
% genuine finger-typed files by Christina C. Christara

\documentclass[12pt]{article}

\linespread{1.1} % for more than single spacing

% take more advantage of the size of paper
\addtolength{\topmargin}{-2cm}
\addtolength{\textheight}{4cm}
\addtolength{\evensidemargin}{-2cm}
\addtolength{\oddsidemargin}{-2cm}
\addtolength{\textwidth}{4cm}

% some standard packages
\usepackage{times}
\usepackage{graphics, graphicx}
\usepackage{subfigure, epsfig}
\usepackage{rotate}
\usepackage{tikz, amsmath, amssymb}
\usepackage{enumitem}
\usepackage{hyperref}
\usepackage{float} % for forcing position of figures with H
\usepackage{listings} % for code and output embedding
\lstdefinestyle{mystyle}{
    basicstyle=\ttfamily\footnotesize
}
\lstset{style=mystyle}

% convenient abbreviations
\newcommand{\Cee}{\mathbf{C}}
\newcommand{\Iee}{\mathbf{I}}
\newcommand{\Lee}{\mathbf{L}}
\newcommand{\Ccal}{\mathcal{C}}
\newcommand{\Ical}{\mathcal{I}}
\newcommand{\Lcal}{\mathcal{L}}
\newcommand{\mc}{\multicolumn}
\newcommand{\hs}{\hspace}
\newcommand{\EQ}{\begin{equation}}
\newcommand{\EN}{\end{equation}}
\newcommand{\EQA}{\begin{eqnarray}}
\newcommand{\ENA}{\end{eqnarray}}
\newcommand{\EQAS}{\begin{eqnarray*}}
\newcommand{\ENAS}{\end{eqnarray*}}

\pagestyle{myheadings}
\markboth{ccc}{SHORT TITLE}
%\markboth{}{}

\title{CSC 466-2305 Winter 2024 - Assignment 1}
\author{Christina Christara, Student Id yyyzzz}
\date{January 6, 2024}

\begin{document}
\maketitle

\section{Introduction} \label{sc:1}
Latex is a text formatting software.
It takes a source file ending in \texttt{.tex},
and produces formatted output in pdf or postscript.

\subsection{1(a)} \label{sc:1a}
This is a sample latex source file, ending in \texttt{.tex}.
You can change fonts to \emph{italics} or to \textbf{bold},
or go back to roman.
If you want to make comments visible in the source file,
but not in the formatted output, precede them
with the percent (\%) symbol.
% This is a comment

\subsection{1(b)} \label{sc:1b}
It is very useful to give labels to just about anything in Latex,
so that it can be referred to later in the file.

In this sample file, we define sections and subsections.
You can also define subsubsections.
Latex numbers these automatically and in a nested way.

Every time you leave a blank line in this source file,
latex changes paragraph in the output.
But changing line in the source file without leaving a blank line
does not change line or paragraph in the output.
Keeping your source file lines short helps readability
of your source file,
therefore, use return/enter reasonably frequently.

\section{Lots of mathematics} \label{sc:2}

We first given an example of \texttt{equation} with a number (label).

The error formula for a polynomial interpolant $p_n$
of a function $f \in \Ccal^{n+1}$,
on $n+1$ distinct points $x_0, x_1, \ldots, x_n$, is
\EQ
\label{eq:polyerror}
f(x) - p_n(x) = \frac{f^{(n+1)}(\xi)}{(n+1)!} \prod_{i=0}^n (x - x_i).
\EN

\subsection{Relation alignment and labelling}

\noindent
If you want to align math stuff, you can do it with \texttt{eqnarray}.
\subsubsection{Aligning and labelling}

In the following, we align $p_1(0)$ with $p_1(1)$, etc, and give a label
to each equation:
\EQA
\label{eq:align1}
p_1(0) &amp;=&amp; 0 \\
\label{eq:align2}
p_1(1) &amp;=&amp; 10.
\ENA
\subsubsection{Aligning and selective labelling}
If you do not want an equation or a line in eqnarray to be numbered,
then use \texttt{nonumber}. For example, only the first line
of eqnarray will be numbered, by using
\EQA
\label{eq:align3}
p_1(0) &amp;=&amp; 0 \\
\nonumber
p_1(1) &amp;=&amp; 10.
\ENA
\subsubsection{Aligning without labelling}
If, on the other side, you do not want any line in eqnarray to be numbered,
then use \texttt{eqnarray*}, as in the following example:
\EQAS
p_1(0) &amp;=&amp; 0 \\
p_1(1) &amp;=&amp; 10.
\ENAS
\subsubsection{Equations without numbers}
Finally, if you want a simple equation without number,
then just use square brackets, as in the following:
\[
A \equiv \frac{1}{8}
(  \frac{a}{h_x^2} T_{-2}^{E,M} \otimes T_6^{D,N}
 + \frac{c}{h_y^2} T_6^{E,M}    \otimes T_{-2}^{D,N}
 + \frac{f}{8}     T_6^{E,M}    \otimes T_6^{D,N}
).
\]
You can refer to a relation to which you have given a label.
For example, relation (\ref{eq:polyerror}) gives
the polynomial interpolation error formula.

You can refer to a section by its label too.
For example, the introduction is in Section \ref{sc:1}.

\subsection{Other mathematics} \label{sc:other}
Here are examples of more math, with dots notation, fractions, subscripts,
superscripts, etc.

Let $\Delta_x \equiv \{x_i = i/M, i = 0, \cdots, M\}$
and $\Delta_y \equiv \{y_j = j/N, j = 0, \cdots, N\}$
be uniform partitions of (0, 1) with step-sizes
$h_x = \frac{1}{M}$ and $h_y = \frac{1}{N}$, respectively.
We denote by $S_{\Delta_x}$ and $S_{\Delta_y}$ the quadratic spline spaces
with respect to partitions $\Delta_x$ and $\Delta_y$, respectively.
The basis functions $\{\phi_i^x(x)\}_{i=1}^M$ and $\{\phi_j^y(y)\}_{j=1}^N$
for $S_{\Delta_x}$ and $S_{\Delta_y}$, respectively, are
generated through appropriate transformations
of the model quadratic spline $\phi(x)$ defined by \{
$\phi(x) \equiv x^2           $ for $0 \leq x \leq 1$;
$\phi(x) \equiv -3 + 6x - 2x^2$ for $1 \leq x \leq 2$;
$\phi(x) \equiv  9 - 6x +  x^2$ for $2 \leq x \leq 3$;
$\phi(x) \equiv 0$ elsewhere\}.

Mathematical functions such as $\sin(x)$, $\cos(x)$, $\log(x)$,
$\exp(x)$, etc, should be printed in roman fonts.
This is why they are preceded by a backslash.
Similarly, precede with backslash the symbols $\max$, $\min$, etc.

Integrals and Sums?
The $L_2$ norm of a function $f(x)$ in the interval $[a, b]$
is defined by $||f||_{L_2[a,b]} \equiv (\int_a^b f^2(x) dx )^{1/2}$.

\section{Matrices} \label{sc:mat}

\noindent
Here are some examples of matrices:
\[
E \equiv \left[ \begin{array}{c}
    \Iee^M\\
    0
\end{array} \right]
~ \mbox{and} ~~
R \equiv \left[ \begin{array}{cccccccccc}
    1 &amp; 0 &amp; 0 &amp; \cdot &amp; \cdot &amp; \cdot &amp; \cdot &amp; \cdot &amp; \cdot &amp; 0 \\
    0 &amp; 0 &amp; 1 &amp; 0     &amp; 0 &amp; \cdot &amp; \cdot &amp; \cdot &amp; \cdot &amp; 0 \\
    0 &amp; 0 &amp; 0 &amp; 0     &amp; 1 &amp; 0     &amp; 0     &amp; \cdot &amp; \cdot &amp; 0 \\
      &amp;   &amp;   &amp;       &amp; \cdot &amp; \cdot &amp; \cdot &amp; \cdot &amp; \\
    0 &amp; \cdot &amp; \cdot &amp; \cdot &amp; \cdot &amp; 0     &amp; 1     &amp; 0 &amp; 0 &amp; 0 \\
    0 &amp; \cdot &amp; \cdot &amp; \cdot &amp; \cdot &amp; \cdot &amp; \cdot &amp; 0 &amp; 1 &amp; 0
\end{array} \right],
\]
and
\[
\left[ \begin{array}{rr}
    \Lee_{11} &amp; \Lee_{12} \\
    \Lee_{21} &amp; \Lee_{22}
\end{array} \right]
\left[ \begin{array}{r}
    u \\
    v
\end{array} \right]
=
\left[ \begin{array}{r}
    g_1 \\
    g_2
\end{array} \right]
\mbox{ in } \Omega.
\]

Using arrays, we can present the definition of the
model quadratic spline $\phi(x)$ given in Section \ref{sc:other}
in a different way:
\[
\psi(x) \equiv \left\{ \begin{array}{rl}
    x^2             &amp; \mbox{if $0\leq x\leq 1,$}\\
    -3+6x-2x^2      &amp; \mbox{if $1\leq x\leq 2,$}\\
    9-6x+x^2        &amp; \mbox{if $2\leq x\leq 3,$}\\
    0               &amp; \mbox{elsewhere.}
    \end{array} \right.
\]
This takes more space, but it is easier to read than
the one given in Section \ref{sc:other}.

\section{Tables} \label{sc:tab}

\noindent
We first show a simple table, like Table \ref{tb:1},
then some more complicated tables.
\begin{table}
\caption{ \label{tb:1}
Observed errors and respective orders of convergence
by the two-step QSC for Problem 1, for several gridsizes $N \times N$.
}
\begin{center}
\begin{tabular}{r||c|c}
$N$ &amp; error &amp; order\\
\hline
32 &amp; 1.8e-07&amp;     \\
64 &amp; 1.1e-08&amp; 3.97\\
128&amp; 7.8e-10&amp; 3.87\\
\end{tabular}
\end{center}
\end{table}

\begin{table}
\caption{ \label{tb:2}
Errors on the gridpoints, respective orders of convergence,
number of iterations for convergence of the $DL$-preconditioned GMRES method
and time in seconds,
corresponding to Problem 3 discretized by the QSC method,
for several gridsizes $N \times N$.
The solution of the preconditioner is obtained by 1D-FFTQSC and 2D-FFTQSC.
}
\begin{center}
\begin{tabular}{c||c|c||cc||cr|cr||cc||r}
&amp;\mc{8}{c||}{$\zeta = -15$}&amp;\mc{2}{c||}{$\zeta = -50$}\\
&amp;\mc{2}{c||}{on gridpoints}&amp;\mc{2}{c||}{no. of iter.}&amp;\mc{4}{c||}{time}
&amp;\mc{2}{c||}{no. of iter.}&amp;time\\
$N$&amp;error&amp;order&amp;step 1&amp;step 2&amp;per it.&amp;total&amp;per it.&amp;total&amp;step 1&amp;step 2&amp;total\\
&amp;&amp;&amp;&amp;&amp;\mc{2}{c}{1D-FFTQSC}&amp;\mc{2}{c||}{2D-FFTQSC}&amp;&amp;&amp;GE\\
\hline
32 &amp; 3.1e-08&amp;     &amp; 18&amp; 13&amp; 0.003&amp; 0.18&amp; 0.003&amp; 0.18&amp; 24&amp; 20&amp;  0.11\\
64 &amp; 1.9e-09&amp; 4.00&amp; 18&amp; 13&amp; 0.013&amp; 0.73&amp; 0.013&amp; 0.73&amp; 26&amp; 20&amp;  0.95\\
128&amp; 1.2e-10&amp; 4.01&amp; 18&amp; 13&amp; 0.060&amp; 3.16&amp; 0.063&amp; 3.24&amp; 26&amp; 20&amp; 10.51\\
256&amp; 7.4e-12&amp; 4.01&amp; 18&amp; 13&amp; 0.281&amp;13.90&amp; 0.297&amp;14.31&amp; 26&amp; 20&amp;162.28\\
512&amp; 4.6e-13&amp; 4.01&amp; 18&amp; 13&amp; 1.315&amp;61.58&amp; 1.456&amp;65.79&amp; 26&amp; 20&amp;\\
\end{tabular}
\end{center}
\end{table}

\begin{table}
\caption{
Number of iterations for convergence of the $- \hat \triangle_h$-preconditioned
GMRES method with $(\xi_1, \xi_2)$ as shown,
corresponding to Problems 5 and 6 discretized by the QSC method,
for several gridsizes $N \times N$.
} \label{tb:3}
\begin{center}
\begin{tabular}{lr||cc|cc|cc|cc|cc||cc|cc|cc|cc}
&amp;&amp;\mc{10}{c||}{Problem 5}&amp;\mc{8}{c}{Problem 6}\\
&amp;($\xi_1, \xi_2$)&amp;
\mc{2}{c|}{(1,0)} &amp; \mc{2}{c|}{(2,1)} &amp; \mc{2}{c|}{(3,1)} &amp; \mc{2}{c|}{(5,1)} &amp;
\mc{2}{c||}{(25,1)} &amp;
\mc{2}{c|}{(1,0)} &amp; \mc{2}{c|}{(2,1)} &amp; \mc{2}{c|}{(3,1)} &amp; \mc{2}{c}{(5,1)} \\
$N$&amp;step &amp; 1 &amp; 2 &amp; 1 &amp; 2 &amp; 1 &amp; 2 &amp; 1 &amp; 2 &amp; 1 &amp; 2 &amp; 1 &amp; 2 &amp; 1 &amp; 2 &amp; 1 &amp; 2\\
\hline
32 &amp;&amp;12 &amp;9 &amp; 15 &amp;11 &amp; 12 &amp;9 &amp; 11 &amp;8 &amp; 11 &amp;8 &amp; 21 &amp;16 &amp; 16 &amp;12 &amp; 17 &amp;13 &amp; 19&amp;14\\
64 &amp;&amp;12 &amp;9 &amp; 15 &amp;11 &amp; 12 &amp;9 &amp; 11 &amp;8 &amp; 11 &amp;8 &amp; 21 &amp;16 &amp; 16 &amp;12 &amp; 17 &amp;13 &amp; 19&amp;14\\
128&amp;&amp;12 &amp;9 &amp; 15 &amp;11 &amp; 12 &amp;9 &amp; 11 &amp;8 &amp; 11 &amp;9 &amp; 22 &amp;16 &amp; 16 &amp;12 &amp; 18 &amp;13 &amp; 19&amp;14\\
256&amp;&amp;12 &amp;9 &amp; 15 &amp;11 &amp; 12 &amp;9 &amp; 11 &amp;8 &amp; 11 &amp;9 &amp; 22 &amp;16 &amp; 16 &amp;12 &amp; 18 &amp;13 &amp; 19&amp;14\\
\end{tabular}
\end{center}
\end{table}
There are several tricks to save space in tables, by shortening the
horizontal space between columns.
One is shown below. Notice that Tables \ref{tb:3} and \ref{tb:4}
present identical data, but the latter saves space.

\begin{table}
\caption{
Number of iterations for convergence of the $- \hat \triangle_h$-preconditioned
GMRES method with $(\xi_1, \xi_2)$ as shown,
corresponding to Problems 5 and 6 discretized by the QSC method,
for several gridsizes $N \times N$.
} \label{tb:4}
\begin{center}
\begin{tabular}{l@{\hs{1pt}}||c@{\hs{1pt}}c@{\hs{1pt}}|c@{\hs{1pt}}c@{\hs{1pt}}|
c@{\hs{1pt}}c@{\hs{1pt}}|c@{\hs{1pt}}c@{\hs{1pt}}|c@{\hs{1pt}}c@{\hs{1pt}}||
c@{\hs{1pt}}c@{\hs{1pt}}|c@{\hs{1pt}}c@{\hs{1pt}}|c@{\hs{1pt}}c@{\hs{1pt}}|
c@{\hs{4pt}}c}
&amp;\mc{10}{c||}{Problem 5}&amp;\mc{8}{c}{Problem 6}\\
~ ($\xi_1, \xi_2$)&amp;
\mc{2}{c|}{(1,0)} &amp; \mc{2}{c|}{(2,1)} &amp; \mc{2}{c|}{(3,1)} &amp; \mc{2}{c|}{(5,1)} &amp;
\mc{2}{c||}{(25,1)} &amp;
\mc{2}{c|}{(1,0)} &amp; \mc{2}{c|}{(2,1)} &amp; \mc{2}{c|}{(3,1)} &amp; \mc{2}{c}{(5,1)} \\
$N$~step&amp; 1 &amp; 2 &amp; 1 &amp; 2 &amp; 1 &amp; 2 &amp; 1 &amp; 2 &amp; 1 &amp; 2 &amp; 1 &amp; 2 &amp; 1 &amp; 2 &amp; 1 &amp; 2 &amp; 1 &amp; 2
\\
\hline
32 &amp;12 &amp;9 &amp; 15 &amp;11 &amp; 12 &amp;9 &amp; 11 &amp;8 &amp; 11 &amp;8 &amp; 21 &amp;16 &amp; 16 &amp;12 &amp; 17 &amp;13 &amp; 19&amp;14\\
64 &amp;12 &amp;9 &amp; 15 &amp;11 &amp; 12 &amp;9 &amp; 11 &amp;8 &amp; 11 &amp;8 &amp; 21 &amp;16 &amp; 16 &amp;12 &amp; 17 &amp;13 &amp; 19&amp;14\\
128&amp;12 &amp;9 &amp; 15 &amp;11 &amp; 12 &amp;9 &amp; 11 &amp;8 &amp; 11 &amp;9 &amp; 22 &amp;16 &amp; 16 &amp;12 &amp; 18 &amp;13 &amp; 19&amp;14\\
256&amp;12 &amp;9 &amp; 15 &amp;11 &amp; 12 &amp;9 &amp; 11 &amp;8 &amp; 11 &amp;9 &amp; 22 &amp;16 &amp; 16 &amp;12 &amp; 18 &amp;13 &amp; 19&amp;14\\
\end{tabular}
\end{center}
\end{table}

Remember that you can refer to tables by their labels.
For example, Table \ref{tb:1} is the first (simple) table and
Table \ref{tb:4} the last table.

%\clearpage
\section{Figures} \label{sc:fig}

\subsection{Postscript and other image formats}
We can easily include figures that are in encapsulated postscript.
Files in encapsulated postscript can be easily obtained
through MATLAB by the \texttt{&gt; print -depsc file.eps} command.
Similarly, you can use portable network graphics (png) files.
In the following, we show one single centered figure,
and two figures side-by-side, together with their captions.

\begin{figure}[h]
\begin{center}
\epsfig{figure=spyalt.eps, width=.31\textwidth}
\end{center}
\centering
\caption{\label{fg:02}
The structure of the QSC matrix arising from the discretization of a
system of two PDEs subject to general boundary conditions
with the alternating ordering, for $N = M = 4$.
The number of non-zero entries is denoted by nz.}
\end{figure}
\begin{figure}[h]
\centering
\mbox{
\subfigure[Alternating Ordering]{\epsfig{figure=spyalt.eps,width=.31\textwidth}}\quad
\subfigure[Block Ordering]{\epsfig{figure=spyblock.eps,width=.31\textwidth}}
}
%\epsffile{spyhelm.eps}
\caption{\label{fg:03}
The structure of the QSC matrix arising from the discretization of a
system of two PDEs subject to general boundary conditions
with the alternating and block orderings, for $N = M = 4$.
The number of non-zero entries is denoted by nz.}
\end{figure}

\subsection{Drawing}

Latex provides us with \texttt{picture}, an environment that allows us to draw
sharply and mathematically defined drawings, such as Figure \ref{fg:01}.

\begin{figure}
\begin{center}
\scalebox{.9}{
\begin{picture}(480,50)(8,-10)
\put(  0, 0){\line(1,0){480}}
\put( -4,-3){\small $\times$}
\put( 76,-3){\small $\times$}
\put(156,-3){\small $\times$}
\put(236,-3){\small $\times$}
\put(316,-3){\small $\times$}
\put(396,-3){\small $\times$}
\put(476,-3){\small $\times$}
\put( -4,10){\small $x_0$}
\put( 76,10){\small $x_1$}
\put(156,10){\small $x_{i-1}$}
\put(236,10){\small $x_i$}
\put(316,10){\small $x_{i+1}$}
\put(396,10){\small $x_{N-1}$}
\put(476,10){\small $x_N$}
\put( 40, 0){\circle*{4}}
\put(120, 0){\circle*{4}}
\put(198, 0){\circle*{4}}
\put(278, 0){\circle*{4}}
\put(360, 0){\circle*{4}}
\put(440, 0){\circle*{4}}
\put(  0,-10){\small $\tau_0$}
\put( 38,-10){\small $\tau_1$}
\put(118,-10){\small $\tau_2$}
\put(198,-10){\small $\tau_i$}
\put(278,-10){\small $\tau_{i+1}$}
\put(358,-10){\small $\tau_{N-1}$}
\put(438,-10){\small $\tau_N$}
\put(478,-10){\small $\tau_{N+1}$}
\put( 30, 20){\vector(-1,0){30}}
\put( 50, 20){\vector( 1,0){30}}
\put( 35, 17){\small $h$}
\put( 70, 35){\vector(-1,0){30}}
\put( 90, 35){\vector( 1,0){30}}
\put( 75, 32){\small $h$}
\end{picture}}
\end{center}
\begin{center}
\scalebox{.9}{
\begin{picture}(480,80)(8,-25)
\put(  0, 0){\line(1,0){480}}
\put( -4,-3){\small $\times$}
\put( 76,-3){\small $\times$}
\put(156,-3){\small $\times$}
\put(236,-3){\small $\times$}
\put(316,-3){\small $\times$}
\put(396,-3){\small $\times$}
\put(476,-3){\small $\times$}
\put( -4,10){\small $s_0$}
\put( 76,10){\small $s_1$}
\put(156,10){\small $s_{i-1}$}
\put(236,10){\small $s_i$}
\put(316,10){\small $s_{i+1}$}
\put(396,10){\small $s_{N-1}$}
\put(476,10){\small $s_N$}
\put( 40, 0){\circle*{4}}
\put(120, 0){\circle*{4}}
\put(198, 0){\circle*{4}}
\put(278, 0){\circle*{4}}
\put(360, 0){\circle*{4}}
\put(440, 0){\circle*{4}}
\put( -4,-10){\small $w_0$}
\put( 38,-10){\small $w_1$}
\put(118,-10){\small $w_2$}
\put(198,-10){\small $w_i$}
\put(278,-10){\small $w_{i+1}$}
\put(358,-10){\small $w_{N-1}$}
\put(438,-10){\small $w_N$}
\put(478,-10){\small $w_{N+1}$}
\put( 30, 20){\vector(-1,0){30}}
\put( 50, 20){\vector( 1,0){30}}
\put( 35, 17){\small $H_0$}
\put(270, 20){\vector(-1,0){30}}
\put(290, 20){\vector( 1,0){30}}
\put(275, 17){\small $H_i$}
\put(430, 20){\vector(-1,0){30}}
\put(450, 20){\vector( 1,0){30}}
\put(435, 17){\small $H_{N-1}$}
\put( 70, 35){\vector(-1,0){30}}
\put( 90, 35){\vector( 1,0){30}}
\put( 75, 32){\small $h_1$}
\put(230, 35){\vector(-1,0){30}}
\put(250, 35){\vector( 1,0){30}}
\put(235, 32){\small $h_i$}
\put(390, 35){\vector(-1,0){30}}
\put(410, 35){\vector( 1,0){30}}
\put(395, 32){\small $h_{N-1}$}
\put( 15,-20){\vector(-1,0){15}}
\put( 25,-20){\vector( 1,0){15}}
\put( 16,-22){\small $h_0^b$}
\put( 55,-20){\vector(-1,0){15}}
\put( 65,-20){\vector( 1,0){15}}
\put( 56,-22){\small $h_1^a$}
\put(215,-20){\vector(-1,0){15}}
\put(225,-20){\vector( 1,0){15}}
\put(216,-22){\small $h_i^a$}
\put(255,-20){\vector(-1,0){15}}
\put(265,-20){\vector( 1,0){15}}
\put(256,-22){\small $h_i^b$}
\put(415,-20){\vector(-1,0){15}}
\put(425,-20){\vector( 1,0){15}}
\put(416,-22){\small $h_{N-1}^b$}
\put(455,-20){\vector(-1,0){15}}
\put(465,-20){\vector( 1,0){15}}
\put(456,-22){\small $h_N^a$}
\end{picture}}
\end{center}
\caption{\label{fg:01}
The uniform grid and its non-uniform image
(drawn as uniform for convenience).
}
\end{figure}

\section{Lists}

Sometimes, we need to enumerate items,
or present them in bullet-form.

\noindent
Here is an example of a numbered list, including a nested one:
\begin{enumerate}
\item[1.] This is the first item.
\item[2.] This is the second item.
\begin{enumerate}
\item[(a)] This is the first subitem of the second item.
\item[(b)] This is the second subitem of the second item.
\end{enumerate}
\item[3.] This is the third item, and it can a long line,
long line, long line, long line, long line, long line, long line,
long line, long line, long line, long line, long line, long line,
long line, long line, long line, long line, long line, long line.
\item[4.] This is the fourth item.
\end{enumerate}

\noindent
Here is an example of an unnumbered list (bullet-form):
\begin{itemize}
\item This is the first item.
\item This is the second item.
\end{itemize}

If you find the vertical space between items too much or too little,
you can control it with some parameters.
Here, we make it a little less.
\begin{itemize}[itemsep=1pt, topsep=2pt, partopsep=0pt, parsep=0pt]
\item This is the first item.
\item This is the second item.
\item This is the third item.
\end{itemize}

\section{Embedding code and output}

We sometimes need to embed code and output into Latex.
This should be done using \emph{fixed width fonts},
in order to maintain the original alignment, indentation, etc.
There are many ways to include some text with fixed width fonts.
One is by using \verb|\tt|, for example,
{\tt this is fixed width font}.
Another is by using the verbatim environment
with \verb|\begin{verbatim}| and \verb|\end{verbatim}|,
such as
\begin{verbatim}
this is fixed width font
\end{verbatim}
With the verbatim environment, everything within the begin and end
is taken verbatim (without account for subscripts, other notation, etc).

I find that a convenient way to include code
and output already saved in some file
is by using the package ``listings'', already invoked
in the beginning of this sample latex file.
Then to include, say file {\tt trochoid1.m},
you can use \verb|\lstinputlisting{trochoid1.m}| as shown and get
\linespread{0.9}
\lstinputlisting{trochoid1.m}
\linespread{1.1}
Note that the linespread (vertical space) for the code is less (0.9)
than the linespread for the rest of the paper (1.1).
This is done by explicitly changing the linespread.
While this change in linespread is not necessary, it is useful,
as often code takes considerable number of lines,
and smaller linespread makes the presentation more concise.
Note also that the font size is a little smaller for
the included code than the default.
This is done by the listings environment automatically.
This is also desirable in the case of long code.

\section{Producing the pdf or postscript file}

To get a pdf file from a latex source file,
on any Unix/Linux system (i.e. on wolf)
you type
\begin{verbatim}
% pdflatex 2305a1.tex
\end{verbatim}
This creates a \texttt{2305a1.pdf} file.
Sometimes, you may have to re-run the above a second time,
to get rid of some error/warning messages.

To get a postscript file from a latex source file,
on any Unix/Linux system (i.e. on wolf)
you type
\begin{verbatim}
% latex 2305a1.tex
% latex 2305a1.tex
% dvips 2305a1
\end{verbatim}
This creates a \texttt{2305a1.ps} file,
which can be printed by
\begin{verbatim}
% lpr 2305a1.ps
\end{verbatim}
or previewed by
\begin{verbatim}
% gv 2305a1.ps
\end{verbatim}

\section{Preparing the bibliography}

You may not need this, but it does not hurt to include
an example of using a bibliography.
If, in your paper or assignment, you make citations to various papers,
books, theses, technical reports, etc,
the best way to do this is is to create a file,
say \texttt{assign.bib}, in the format shown in the file provided.
Then you can refer to any work by the label corresponding to it
as given in the file, for example, the publications
\cite{christara2011adaptive}, \cite{christara2018analysis},
\cite{chen2021penalty}.
Because of the above citations, an extra (final) section
of References appears in the formatted output.

Note that, in the \texttt{assign.bib} file,
there are certain fields that need to be filled,
e.g. author names, title of work, etc,
and the author names for a work are separated by \emph{and}.
Notice also that only the papers you cite in the Latex file
will appear in the references list, independently of
how many other works are included in the \texttt{assign.bib} file.

However, there is a procedure that helps Latex create pointers
to various works you cite, and it must be followed carefully.
First, you must create the appropriate \texttt{2305a1.bbl} file.
This is done with the \texttt{bibtex} command \emph{after} the
first run of the latex or pdflatex command.
Then, the latex or pdflatex command may have to be run \emph{twice}
every time you update the source file.

To summarize,
on any Unix/Linux system (i.e. on wolf)
you type
\begin{verbatim}
% latex 2305a1.tex
% bibtex 2305a1
% latex 2305a1.tex
% latex 2305a1.tex
\end{verbatim}

You need to re-run the bibtex command every time you update
the file \texttt{assign.bib}, or you change (add or remove) some citations
in the file \texttt{2305a1.tex}.
You need to run the latex/pdflatex command \emph{twice}
every time you update the file \texttt{2305a1.tex}.

The latex command creates a \texttt{2305a1.dvi} file.
To get a postscript file which you can preview by \texttt{gv}
or print by \texttt{lpr} you type \emph{after} the latex command:
\begin{verbatim}
% dvips 2305a1.dvi
% gv 2305a1.ps
% lpr 2305a1.ps
\end{verbatim}

In general, Latex displays many warnings and other messages.
Most of them can be safely ignored.
However, if you get warnings about ``undefined labels'',
``multiply defined labels'',
or ``undefined references'', you may want to run
latex/pdflatex (and/or bibtex) once more or twice.
This should normally fix the problem.

Also remember, that you should run the \texttt{lpr} command
only if you really want to see a hard copy of the document.
Often, previewing with \texttt{gv} suffices, and a hard-copy
is a waste.

\section{Links}

\noindent
Official LaTeX webpage: \url{http://latex-project.org/}

\noindent
Introduction to LaTeX (not too short):\\
\url{http://ctan.mirror.rafal.ca/info/lshort/english/lshort.pdf}

% If there are not citations and bibliography,
% you can comment the two lines below preceding them with %.
\bibliographystyle{siam}
\bibliography{assign}

\end{document}
</pre></body></html>