Updated «array» section
This commit is contained in:
parent
ab83643d5d
commit
e91812bfb3
10
lbol.tex
10
lbol.tex
@ -883,17 +883,17 @@ You can typeset matrices and other similar objects using an \texttt{array} envir
|
|||||||
|
|
||||||
\begin{itemize}[noitemsep]
|
\begin{itemize}[noitemsep]
|
||||||
\item \texttt{array} can only be used in a math environment.
|
\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}
|
\end{itemize}
|
||||||
|
|
||||||
In the example below, I've chose animal names to make the column alignment more explicit.
|
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}
|
Zoo~animals = \left\{ \begin{array}{crl}
|
||||||
lion & hippopotamus & gnu \\
|
lion & hippopotamus & gnu \\
|
||||||
elephant & zebra & kangaroo \\
|
elephant & zebra & kangaroo \\
|
||||||
bear & camel & wallaby
|
bear & camel & naked~mole~rats
|
||||||
\end{array}\right\}
|
\end{array}\right\}
|
||||||
\]
|
\]
|
||||||
\end{Verbatim}
|
\end{Verbatim}
|
||||||
@ -902,10 +902,12 @@ bear & camel & wallaby
|
|||||||
Zoo~animals = \left\{ \begin{array}{crl}
|
Zoo~animals = \left\{ \begin{array}{crl}
|
||||||
lion & hippopotamus & gnu \\
|
lion & hippopotamus & gnu \\
|
||||||
elephant & zebra & kangaroo \\
|
elephant & zebra & kangaroo \\
|
||||||
bear & camel & wallaby
|
bear & camel & naked~mole~rats
|
||||||
\end{array}\right\}
|
\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.
|
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}
|
\section{Special Math Environments}
|
||||||
|
Loading…
Reference in New Issue
Block a user