From ca42d058cdc448075f393474750d0a8a15fe9f4c Mon Sep 17 00:00:00 2001 From: Kenneth Odle Date: Mon, 31 Jul 2023 15:42:13 -0400 Subject: [PATCH] =?UTF-8?q?Added=20=C2=ABalign=C2=BB=20section?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lbol.tex | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/lbol.tex b/lbol.tex index 55f55e4..9a1c1d6 100644 --- a/lbol.tex +++ b/lbol.tex @@ -685,7 +685,7 @@ You can replace the bullets with any math symbol availabe in \LaTeX{} like this: \LaTeX{} has a couple of different environments that are useful for typesetting math (\texttt{align} and \texttt{array}, but they get a little beyond what I want to cover here. In addition, there are other packages (in particular \texttt{amsmath} and \texttt{mathtools}) that greatly extend the power of LaTeX to handle mathematical typesettings, but again, they are beyond the scope of this zine. -\section{Math Entry Modes} +\section{Math Entry Modes}\label{math-entry-modes} There are two types of \textit{entry modes} for math in LaTeX. The first is \textbf{in-line mode}, which begins and ends with a dollar sign, and renders the math in the same line of text as the rest of the paragraph. For example, @@ -804,8 +804,49 @@ You can also control the size of brackets and parentheses explicitly: \section{The \texttt{align} Environment} +You can use the \texttt{align} environment to typeset long equations and formulas and get them to line up nicely. + +Break your lines with \verb+\\+ and use \$ to show where the equations should align. + +\begin{Verbatim}[frame=lines, numbers=left, xleftmargin=5mm, framesep=3mm, breaklines=true, label=\texttt{align} Example] +\begin{align} +a_1& =b_1+c_1\\ +a_2& =b_2+c_2-d_2+e_2 +\end{align} + +\begin{align*} +a_1& =b_1+c_1\\ +a_2& =b_2+c_2-d_2+e_2\\ +a_2+d_2-e_2&=b_2+c_2 +\end{align*} +\end{Verbatim} + +\begin{align} +a_1& =b_1+c_1\\ +a_2& =b_2+c_2-d_2+e_2\\ +a_2+d_2-e_2&=b_2+c_2 +\end{align} + +\begin{align*} +a_1& =b_1+c_1\\ +a_2& =b_2+c_2-d_2+e_2\\ +a_2+d_2-e_2&=b_2+c_2 +\end{align*} + +\bigskip + +A couple of things to note: + +\begin{itemize}[noitemsep] + \item \texttt{align} is itself a math environment, so you don't need to use a separate math entry mode as described above. + \item \texttt{align} (no asterisk) produces numbered equations, whereas \texttt{align*} produces unnumbered equations. +\end{itemize} + + \section{The \texttt{array} Environment} + + \section{Special Math Environments} You can use the \texttt{nicefrac} package to get fractions with a diagonal slash. This is an ordinary fraction inline (using the \texttt{frac} command): $\frac{3}{4}$, and this is a ``nice'' fraction inline (using the \texttt{nicefrac} command): $\nicefrac{3}{4}$.