\documentclass[english]{article}

% % % % % % % % % %  PACKAGES % % % % % % % % % %
\usepackage{amsmath,amssymb, amsthm, multirow, enumerate, mathtools}
\usepackage[margin = .75 in]{geometry}
\usepackage{MnSymbol} % For obscure logic symbols
\usepackage[breaklinks=true, bookmarks, colorlinks=true]{hyperref} % For awesome hyperlinks


% % % % % % % % % %  DEFINED COMMANDS % % % % % % % % % %
% Logic Symbols
\renewcommand{\L}{\mathcal{L}} %Language L
\renewcommand{\phi}{\varphi} %Nicer phi
\newcommand{\cond}{\supset} %Horseshoe Conditional
\newcommand{\bicond}{\equiv} %Three line Biconditional
\newcommand{\ra}{\rightarrow} %Right arrow Conditional
\newcommand{\la}{\leftarrow} %Left arrow
\newcommand{\lra}{\leftrightarrow} %Double Arrow Biconditional
\newcommand{\Ra}{\Rightarrow} %Double Line Right Arrow
\newcommand{\La}{\Leftarrow} %Double Line Left
\newcommand{\bland}{\doublewedge} %Big Conjunction
\newcommand{\blor}{\doublevee} %Big Disjunction
\newcommand{\di}{\Diamond} %Modal Diamond Operator
\newcommand{\bx}{\square} %Modal Box Operator


% Computability
\newcommand{\ua}{\uparrow} %Up Arrow (Undefined)
\newcommand{\da}{\downarrow} %Down Arrow (Defined)
\newcommand{\<}{\langle} %Left Angle Bracket
\renewcommand{\>}{\rangle} %Right Angle Bracket

% Tuples
\renewcommand{\a}{\bar{a}}
\renewcommand{\c}{\bar{c}}
\renewcommand{\b}{\bar{b}}
\renewcommand{\d}{\bar{d}}
\renewcommand{\j}{\bar{j}}
\newcommand{\x}{\bar{x}}
\newcommand{\w}{\bar{w}}
\renewcommand{\t}{\bar{t}}
\newcommand{\y}{\bar{y}}
\renewcommand{\v}{\bar{v}}
\newcommand{\z}{\bar{z}}
\newcommand{\n}{\bar{n}}
\newcommand{\m}{\bar{m}}
\newcommand{\s}{\bar{s}}
\newcommand{\f}{\bar{f}}

% General Mathematics Commands
\newcommand{\Z}{\mathbb{Z}} %Integers
\newcommand{\R}{\mathbb{R}} %Reals
\newcommand{\Q}{\mathbb{Q}} %Rationals
\newcommand{\N}{\mathbb{N}} %Natural Numbers
\newcommand{\C}{\mathbb{C}} %Complex Numbers

% Piecewise Definition Shortcut
\newcommand{\pw}[2]{
 \begin{displaymath}
  #1 = \left\{
     \begin{array}{ll}
	#2
     \end{array}
   \right.
\end{displaymath}}


% % % % % % % % % % % % % % % % % % % % % % % % % 

\title{Introduction to \LaTeX~2}
\author{Russell Buehler}
\date{}

\begin{document}
\maketitle

\tableofcontents
\newpage

To expand on the commands and environments canvased in the previous document, each of the sections below covers a commonly used feature.
\section{More Commands!} 

At the beginning of the document, the number of defined commands has been expanded with commands for symbols and notation which is prevalent in logic; for example,
\[\N \R \a \d \x \y \Z \L \bx\]
Of course, the above looks quite ugly.  It would be nice to have a way of putting these symbols in a table.







\section{Tables}

To construct a table, we use the \texttt{tabular} environment as so:

\begin{tabular} {c l r}
Centered & Left-Aligned & Right-Aligned \\
\end{tabular} 
\\ % forces a new line
As the table hints, `c' stands for a centered column, `l' for a left-aligned column, and `r' for a right-aligned column.  In the \texttt{tabular} environment itself, \& separates columns while $\backslash\backslash$ marks the end of a row.  So far so good.  But, looking above, our table is more than a bit squished.  The spacing issues can be resolved using 
\texttt{center}:

\begin{center}
\begin{tabular} {c l r}
Centered & Left-Aligned & Right-Aligned \\
\end{tabular}
\end{center}
Next, adding horizontal lines can be done by adding `$|$' between the $c$'s, $l$'s, and $r$'s:

\begin{center}
\begin{tabular} {c | l | r}
Centered & Left-Aligned & Right-Aligned \\
\end{tabular}
\end{center}
Finally, adding horizontal lines is accomplished with \texttt{$\backslash$hline}:
\begin{center}
\begin{tabular} {c | l | r}
Centered & Left-Aligned & Right-Aligned \\
\hline
\end{tabular}
\end{center}
Rewriting and expanding our symbols from above gives the much more appealing:
\begin{center}
\begin{tabular} {| c | c | c |}
\hline
$\land$ & $\lor$ & $\neg$ \\
$\ra$ & $\lra$ & $\forall$ \\
$\exists$ & $\bland$ & $\blor$ \\
$\models$ & $\vdash$ & $\to$ \\
$\phi$ & $\psi$ & $\Gamma$ \\
$\N$ & $\Z$ &$\R$\\
$\subset$ &$\subseteq$ & $\cup$\\
$\a$ &  &$\x$ \\
\hline
\end{tabular}
\end{center}













\section{Theorems}

Theorems are a big deal, and so it's nice to set them apart from normal text.  Luckily, the \texttt{amsthm} package provides tools for doing so:

\newtheorem{command name}{text} % These should probably go with the defined commands!

\begin{command name}
A theorem-esque thing!
\end{command name}


\newtheorem{thm}{Theorem}
\newtheorem*{defin}{Definition}

More usefully,
\begin{thm}
Theorem 2 is true
\end{thm}

\begin{thm}
Theorem 1 is false
\end{thm}
By adding an asterisk after the initial command, I can also remove numbering, e.g.
\begin{defin}[Truth]
A well-formed formula is true if and only if it's not false.
\end{defin}

\subsection{Proofs}
Proofs are even easier; simply use the \texttt{proof} environment:
\begin{proof}
Some algebra, and then--by magic--the conclusion.  Also, a formula:
\[x^2+x^{45}-15+89y(x_{17})\]
Also, a piecewise function:
\pw{f(\x)}{
\ua & x_1+x_2 = 9\\
5 & x_1+x_2 = 5\\
0 & \mbox{otherwise}\\
}
\end{proof}









\section{Aligning Formulas}

If you're doing actual problems, it's nice to be able to line up formulas; if you want labels:

\begin{align}
F(x,y) &= g(x)+y\\
&=x^3+y\\
& = 9 \nonumber \\
& = mc^2 \label{SCIENCE}
\end{align}
You can even set labels and reference them later; for example, physics enters at \ref{SCIENCE}.  To automatically remove labels,
\begin{align*}
F(x,y) &= g(x)+y\\
&=x^3+y\\
& = 9 \\
& = mc^2
\end{align*}
Inserting text is also quite easy; you'll want to shorten the command though:

\newcommand{\sit}{\shortintertext} %Put with other commands

\begin{align*}
F(x,y) &= g(x)+y\\
&=x^3+y\\
\sit{By the preceding result, it follows that}
& = 9 \\
& = mc^2
\end{align*}

\end{document} % Ends text