Added «align» section

This commit is contained in:
Kenneth John Odle 2023-07-31 15:42:13 -04:00
parent 40b7ec60b6
commit ca42d058cd

View File

@ -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}$.