From e91812bfb3518d6ee9709f83f8efd2706447a125 Mon Sep 17 00:00:00 2001 From: Kenneth Odle Date: Sat, 28 Oct 2023 16:00:58 -0400 Subject: [PATCH] =?UTF-8?q?Updated=20=C2=ABarray=C2=BB=20section?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lbol.tex | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lbol.tex b/lbol.tex index 144a123..a829743 100644 --- a/lbol.tex +++ b/lbol.tex @@ -883,17 +883,17 @@ You can typeset matrices and other similar objects using an \texttt{array} envir \begin{itemize}[noitemsep] \item \texttt{array} can only be used in a math environment. - \item You must declare the number and alignment of the columns by using \verb+\begin{array}{crl}+. In this instance, we are declaring one centered column, one right-aligned column, and one left-aligned column. + \item You must declare the number and alignment of the columns by using something like this:\vspace{0.5em} \\ \vspace{0.5em} \verb+\begin{array}{crl}+ \\ In this instance, we are declaring one centered column, one right-aligned column, and one left-aligned column. \end{itemize} In the example below, I've chose animal names to make the column alignment more explicit. -\begin{Verbatim}[frame=lines, numbers=left, xleftmargin=5mm, framesep=3mm, breaklines=true, label=array Example] +\begin{Verbatim}[frame=lines, numbers=left, xleftmargin=5mm, framesep=3mm, breaklines=true, label=\fbox{array Example}] \[ Zoo~animals = \left\{ \begin{array}{crl} lion & hippopotamus & gnu \\ elephant & zebra & kangaroo \\ -bear & camel & wallaby +bear & camel & naked~mole~rats \end{array}\right\} \] \end{Verbatim} @@ -902,10 +902,12 @@ bear & camel & wallaby Zoo~animals = \left\{ \begin{array}{crl} lion & hippopotamus & gnu \\ elephant & zebra & kangaroo \\ -bear & camel & wallaby +bear & camel & naked~mole~rats \end{array}\right\} \] +\paragraph{Note:} Because the \texttt{array} environment is designed for math applications, rather than a text application like our example, I had to use a $\sim$ to add the spaces in ``naked mole rats''. + If the built-in \texttt{array} environment cannot do all that you want, use the \texttt{amsmath} package and its \texttt{matrix} environment, which provides more options. \section{Special Math Environments}