% from sarah-marie belcastro's website
\documentclass[12pt]{article} % 10 and 11 point also available
\usepackage{amsmath, amssymb} % these packages should be included in your TeX installation
\begin{document} % end of the preamble
% This document was edited from one Tom Hull gave me, which he yanked from somewhere else a couple of decades ago.
% It incorporates some 2020 suggestions from Murray Eisenberg.
\title{My Awesome Paper} % defines the title info
\author{Minnie Maximallian}
\maketitle % this actually does the title. Omit this if you don't want a title.
Introduction blah blah. Just type in text normally! \LaTeX\ will format normal text very professionally, just like a real publication.
\section{Our very first section}
To start things off I'll blah blah blah % LaTeX ignores
more text blah blah blah blahblah. % extra spaces
But then I'll blah blah blah blah blab. Notice that by leaving a blank line, we started a new paragraph!
Yippity-dee!
\section{Our Second Section!}
\subsection{Math formulae in text}
Use dollar signs before and after a mathematical
expression. One formula is $x-3y=7$. Another
is $A=\pi r^2$.
\subsection{Important-looking math formulae}
Use double dollar signs to put a formula/equation
on a line by itself!
$${d\over dx}\arcsin x=
(1-x^2)^{-\frac12} =
\int_0^x\theta(1-\theta^2)^{-\frac32}d\theta $$
There are easily-remembered keywords for all
the mathematical symbols you want to use. (In fact, often guessing at the name for a command will end up being correct\dots)
Begin each with a backslash.
$$\alpha+\beta < \gamma \leq \Gamma
\approx \lim_{n \rightarrow \infty} x_n =
\prod_{i=1}^{\infty} \sqrt{y_i} $$
\subsection{Magical parentheses and things!}
\LaTeX\ keeps track of how big things are very nicely!
$$\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{x}}}}}}}}$$
$$\left\{ {n\choose 0}+{n\choose 1}+{n\choose 2}+\cdots
+{n\choose n}\right\} = 2^n$$ % Every \left must have a \right following it.
$$\left(\left(\left(\left(x^2\right)^2\right)^2\right)^2\right)^2=x^{32}$$
Notice how these work: Every time we have a \verb+\left+ command we need a \verb+\right+ command to go with it. Using these commands with parentheses () and brackets \{\} will make them as big as they need to be.
\subsection{Neat formulae}
To print a list of equations with the equal signs aligned:
\begin{align*} % the * suppresses numbering for the lines
x_{i+1} &= N^{i+1}(x_0) \\ % \\ means newline in
&= N(x_i) \\ % this environment
&= x_i- \frac{f(x_i)}{f'(x_i)} % But no \\ on the
\end{align*}
Here are fancy things:
\begin{equation*}
D(x)=\begin{cases}
1 &\text{if $x$ is rational,}
\\
(x+1)^2 &\text{otherwise}
\end{cases}
\quad\text{ or }\quad
M= \begin{pmatrix}
1 & 0 & 1 \\
2 & -1 & 0 \\
3 & 3 & 17
\end{pmatrix}
\end{equation*}
Notice how I use the \verb+\text+ command to do normal text inside of ``math mode." (Also notice how I just got the quotation marks to work properly there!)
\subsection{Lists}
A bulleted list
\begin{itemize}
\item of words
\item in the rest
\item of this sentence.
\end{itemize}
\noindent A numbered list
\begin{enumerate}
\item of words
\item in the rest
\item of this sentence.
\end{enumerate}
\subsection{Other stuff}
\LaTeX\ has lots of of commands to make {\normalsize text} {\large large}, {\Large larger},
{\Huge huge}, {\small small}, {\footnotesize footnote size}, {\scriptsize script size}, and {\tiny tiny}!
\newcommand{\qed}{\raise1truemm\hbox{$\infty\hskip-.165in\lower6truept\hbox{$\smile$}$}}
We can also define new commands. For example, the above (see the source code!)
produces a command \verb+\qed+ which can be used as an alternative to qed,
namely \qed.
Or suppose we needed a falling power command, which \LaTeX\ doesn't provide. To
do this, we need to define a command with an argument.
\newcommand{\fall}[1]{\underline{#1}}
This gives us $n^{\fall k}=n(n-1)(n-2)\cdots (n-k+1)$.
\section{Typesetting things like Homework!}
On the next page I'll do an example of how you might want to format homework and things like that. There are fun commands like \verb+\hline+ and \verb+\hfill+ that can be used to do make fun-looking headers and such. I'll also include an example of how to make a TABLE of things in \LaTeX. But first I'll use the \verb+\clearpage+ command to make a new page and then I'll do the sample homework! Let's go!
\clearpage
\noindent Thomas Hull \hfill 3/29/04
\centerline{\bf A goofy homework assignment!} % some people prefer \textbf{blah blah}
\smallskip
\hrule
\vspace{.05in} % the \vspace command makes some vertical space. Very useful!
\noindent {\bf (1)} Find the airspeed velocity of an unladen swallow.
\vspace{.1in}
{\bf Solution:} This problem is unclear because it does not specify whether it is an African or European swallow. Therefore it is impossible to give an accurate answer. Phooey!
\vspace{.2in}
\noindent{\bf (2)} Make a table. Any table. Just for fun.
\vspace{.1in}
{\bf Solution:} Here is a table, just for fun:
\begin{tabular}{||l||c|c|c|c|c|c||} % | (pipe) gives a vertical divider. c indicates a centered column. l (ell) gives a left-justified column. To make a text column that wraps, use p{.5cm}
\hline\hline
Module angle & $30^\circ$ & $45^\circ$ & $54.7^\circ$ & $60^\circ$ & $67.5^\circ$ &
$75.5^\circ$\\
\hline\hline
3-gon (triangle) & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ &
$\checkmark$ & $\checkmark$\\
\hline
4-gon (square) & & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$ &
$\checkmark$\\
\hline
5-gon & & & $\checkmark$ & $\checkmark$ & $\checkmark$ & $\checkmark$\\
\hline
6-gon & & & & $\checkmark$ & $\checkmark$ & $\checkmark$\\
\hline
8-gon & & & & & $\checkmark$ & $\checkmark$\\
\hline
10-gon & & & & & & $\checkmark$\\
\hline
12-gon & & & & & & $\checkmark$\\
\hline\hline
\end{tabular}
\end{document}