1

Right now, my document looks like this: enter image description here

Or, like this:

enter image description here

It bothers me a lot that the equations are scattered all over the place and are not evenly aligned. I want, for example, each line be aligned on the left side with Problem 1 or Problem 2. Any suggestions?

\documentclass[paper=a4, fontsize=11pt]{scrartcl} % A4 paper an
\usepackage{amsmath,amsthm,amssymb}
\usepackage{enumitem}
\begin{document}

\begin{enumerate}[label=\bfseries Problem \arabic*:]

\item %PROBLEM 1

Find $\textbf{A}+\textbf{B}$, $\textbf{AB}$, $\textbf{BA}$.\\\\


a) $\textbf{A} = \begin{bmatrix}  1 & 2  \\   3  & -1  \end{bmatrix}\,\,\,\,\,$ and $\,\,\,\,\,\textbf{B} = \begin{bmatrix} 2 & 1  \\1  & 1 \end{bmatrix}$. \,\,\,\,\,\textbf{A} is $2\times2$ and \textbf{B} is $2\times2$.

 \[\textbf{A}+\textbf{B}=\begin{bmatrix}  1 & 2  \\ 3  & -1\end{bmatrix} + \begin{bmatrix} 2 & 1  \\1  & 1 \end{bmatrix}=\begin{bmatrix} 1+2 & 2+1  \\3+1  & -1+1 \end{bmatrix}=\begin{bmatrix} 3 & 3  \\4  & 0 \end{bmatrix}\]

 \[\textbf{AB}=\begin{bmatrix}  1 & 2  \\ 3  & -1\end{bmatrix} \cdot \begin{bmatrix} 2 & 1  \\1  & 1 \end{bmatrix}=\begin{bmatrix} 1\cdot2+2\cdot1 & 1\cdot 1+2\cdot1  \\3\cdot2+(-1)\cdot1  & 3\cdot1+(-1)\cdot1 \end{bmatrix}=\begin{bmatrix} 4 & 3  \\5  & 2 \end{bmatrix}\]

 \[\textbf{BA}= \begin{bmatrix} 2 & 1  \\1  & 1 \end{bmatrix}\cdot \begin{bmatrix}  1 & 2  \\ 3  & -1\end{bmatrix}=\begin{bmatrix} 2\cdot1+1\cdot3 & 2\cdot 2+1\cdot(-1)  \\1\cdot1+1\cdot3  & 1\cdot2+1\cdot(-1) \end{bmatrix}=\begin{bmatrix} 5 & 3  \\4  & 1 \end{bmatrix}\]\\




b) $\textbf{A} = \begin{bmatrix} 2 & 3 & 1\\ 0  & -1 & 2 \end{bmatrix}\,\,\,\,\,$and 
$\,\,\,\,\,\textbf{B} = \begin{bmatrix} 2 & -2  \\ 4  & 3 \\1 & 5 \end{bmatrix}$. \,\,\,\,\,\,\textbf{A} is $2\times3$ and \textbf{B} is $3\times2$.     


    $\textbf{A}+\textbf{B}$ is undefined because the two matrices are incompatible for addition. 

 \[ \textbf{AB}=\begin{bmatrix} 2 & 3 & 1\\ 0  & -1 & 2 \end{bmatrix}\cdot\begin{bmatrix} 2 & -2  \\ 4  & 3 \\1 & 5 \end{bmatrix}=\begin{bmatrix} 2\cdot2+3\cdot4+1\cdot1 & 2\cdot (-2)+3\cdot3+1\cdot 5  \\0\cdot2+(-1)\cdot4 +2\cdot 1 & 0\cdot(-2)+(-1)\cdot3 +2\cdot5 \end{bmatrix}=\begin{bmatrix} 17 & 10  \\-2  & 7 \end{bmatrix} \]


 \[ \textbf{BA}=\begin{bmatrix} 2 & -2  \\ 4  & 3 \\1 & 5 \end{bmatrix}\cdot \begin{bmatrix} 2 & 3 & 1\\ 0  & -1 & 2 \end{bmatrix}=\begin{bmatrix} 2\cdot2+(-2)\cdot0 & 2\cdot 3+(-2)\cdot(1) &2\cdot1+(-2)\cdot 2  \\4\cdot2+3\cdot0&4\cdot3 +3\cdot (-1) & 4\cdot1+3\cdot2\\ 1\cdot2+5\cdot0&1\cdot3+5\cdot(-1)&1\cdot1+5\cdot2 \end{bmatrix}=\begin{bmatrix} 4 & 8&-2  \\8  & 9&10\\2&-2&11 \end{bmatrix} \]


\item %PROBLEM 2
  Let $\textbf{a}' = \begin{bmatrix}
       3 & 6 &-3 & 5 &  9& 2  \\
     \end{bmatrix}$. Find \textbf{a}$'$\textbf{a} and \textbf{aa}$'$.


 \textbf{a}$'$ is the transpose of $\textbf{a} = \begin{bmatrix}
       3 \\ 6 \\-3 \\ 5 \\  9\\ 2  \\
     \end{bmatrix}$

 \[\textbf{a}'\textbf{a} = \begin{bmatrix}
       3 & 6 &-3 & 5 &  9& 2  \\
     \end{bmatrix} \cdot \begin{bmatrix}
       3 \\ 6 \\-3 \\ 5 \\  9\\ 2  \\
     \end{bmatrix} = \begin{bmatrix}
       3^2 + 6^2 + (-3)^2 + 5^2 +  9^2 + 2^2  \\
     \end{bmatrix} =[164] \]

   \[\textbf{aa}' = \begin{bmatrix}
       3 \\ 6 \\-3 \\ 5 \\  9\\ 2  \\
     \end{bmatrix}\cdot \begin{bmatrix}
       3 & 6 &-3 & 5 &  9& 2  \\
     \end{bmatrix}  = \begin{bmatrix}
       3^2& 3\cdot 6 & 3\cdot (-3) & 3\cdot 5 &  3\cdot 9 & 3\cdot 2  \\
  6\cdot 3& 6^2 & 6\cdot (-3) & 6\cdot 5 &  6\cdot 9 & 6\cdot 2  \\
    (-3)\cdot 3& (-3)\cdot 6 & (-3)^2 & (-3)\cdot 5 &  (-3)\cdot 9 & (-3)\cdot 2  \\
      5\cdot 3& 5\cdot 6 & 5\cdot (-3) & 5^2 &  5\cdot 9 & 5\cdot 2  \\
        9\cdot 3& 9\cdot 6 & 9\cdot (-3) & 9\cdot 5 &  9^2 & 9\cdot 2  \\
         2\cdot 3& 2\cdot 6 & 2\cdot (-3) & 2\cdot 5 &  2\cdot 9 & 2^2  \\
     \end{bmatrix} \\=\begin{bmatrix}
       9& 18 & 9 & 15 &  27 & 6  \\
  18& 36 & -18 & 30 &  54 & 12  \\
    -9& -18 & 9 & -15 &  27 & -6  \\
      15& 30 & 15 & 10 &  45 & 10 \\
        27& 54 & 27 & 45 &  81 & 18  \\
         6& 12 & 6 & 10 &  18 & 4  \\
     \end{bmatrix} \]   







   Let $\textbf{b}' = \begin{bmatrix}
       1 & 1 & 1 & 1 & 1 & 1  \\
     \end{bmatrix}\,\,\,\,\,$
     and
    $\,\,\,\,\,\textbf{c}' = \begin{bmatrix}
       1 & -1 & 1 & -1 & 1 & -1  \\
     \end{bmatrix}$. Find \textbf{b}$'$\textbf{c} and \textbf{bc}$'$.


  \end{enumerate}
\end{document}   
3
  • First change \textbf to \mathbf inside mathmode. Second, you can use \intertext from amsmath or \shortintertext from mathtools. \shortintertext gives lesser space than \intertext.
    – user11232
    Sep 18, 2014 at 14:41
  • A simple solution would be to use \par$\displaystyle ...$ for each equation. Sep 18, 2014 at 14:46
  • never leave a blank line above \[ but here you want to use align* it seems Sep 18, 2014 at 14:48

2 Answers 2

1

I basically enacted two changes from your MWE. First, I used align=left in the enumerate call. Then, I replaced instances of \[ ... \] with $ ...$. Note that in some cases, you may have to invoke \displaystyle inside the $ delimiters, but that was not the case here.

Also, for math expressions that wrapped, I added few phantoms to get the proper indents.

\documentclass[paper=a4, fontsize=11pt]{scrartcl} % A4 paper an
\usepackage{amsmath,amsthm,amssymb}
\usepackage{enumitem}
\begin{document}

\begin{enumerate}[label=\bfseries Problem \arabic*:, align=left]
\parskip 1em
\item %PROBLEM 1

Find $\textbf{A}+\textbf{B}$, $\textbf{AB}$, $\textbf{BA}$.\\

\item[a)] $\textbf{A} = \begin{bmatrix}  1 & 2  \\   3  & -1  \end{bmatrix}\,\,\,\,\,$ and $\,\,\,\,\,\textbf{B} = \begin{bmatrix} 2 & 1  \\1  & 1 \end{bmatrix}$. \,\,\,\,\,\textbf{A} is $2\times2$ and \textbf{B} is $2\times2$.

 $\textbf{A}+\textbf{B}=\begin{bmatrix}  1 & 2  \\ 3  & -1\end{bmatrix} + \begin{bmatrix} 2 & 1  \\1  & 1 \end{bmatrix}=\begin{bmatrix} 1+2 & 2+1  \\3+1  & -1+1 \end{bmatrix}=\begin{bmatrix} 3 & 3  \\4  & 0 \end{bmatrix}$

 $\textbf{AB}=\begin{bmatrix}  1 & 2  \\ 3  & -1\end{bmatrix} \cdot \begin{bmatrix} 2 & 1  \\1  & 1 \end{bmatrix}=\begin{bmatrix} 1\cdot2+2\cdot1 & 1\cdot 1+2\cdot1  \\3\cdot2+(-1)\cdot1  & 3\cdot1+(-1)\cdot1 \end{bmatrix}=\begin{bmatrix} 4 & 3  \\5  & 2 \end{bmatrix}$

 $\textbf{BA}= \begin{bmatrix} 2 & 1  \\1  & 1 \end{bmatrix}\cdot \begin{bmatrix}  1 & 2  \\ 3  & -1\end{bmatrix}=\begin{bmatrix} 2\cdot1+1\cdot3 & 2\cdot 2+1\cdot(-1)  \\1\cdot1+1\cdot3  & 1\cdot2+1\cdot(-1) \end{bmatrix}=\begin{bmatrix} 5 & 3  \\4  & 1 \end{bmatrix}$


\item[b)] $\textbf{A} = \begin{bmatrix} 2 & 3 & 1\\ 0  & -1 & 2 \end{bmatrix}\,\,\,\,\,$and 
$\,\,\,\,\,\textbf{B} = \begin{bmatrix} 2 & -2  \\ 4  & 3 \\1 & 5 \end{bmatrix}$. \,\,\,\,\,\,\textbf{A} is $2\times3$ and \textbf{B} is $3\times2$.     


    $\textbf{A}+\textbf{B}$ is undefined because the two matrices are incompatible for addition. 

$\textbf{AB}=\begin{bmatrix} 2 & 3 & 1\\ 0  & -1 & 2 \end{bmatrix}\cdot\begin{bmatrix} 2 & -2  \\ 4  & 3 \\1 & 5 \end{bmatrix}=\begin{bmatrix} 2\cdot2+3\cdot4+1\cdot1 & 2\cdot (-2)+3\cdot3+1\cdot 5  \\0\cdot2+(-1)\cdot4 +2\cdot 1 & 0\cdot(-2)+(-1)\cdot3 +2\cdot5 \end{bmatrix}=\phantom{\textbf{AB}=}\begin{bmatrix} 17 & 10  \\-2  & 7 \end{bmatrix}$


 $\textbf{BA}=\begin{bmatrix} 2 & -2  \\ 4  & 3 \\1 & 5 \end{bmatrix}\cdot \begin{bmatrix} 2 & 3 & 1\\ 0  & -1 & 2 \end{bmatrix}=\begin{bmatrix} 2\cdot2+(-2)\cdot0 & 2\cdot 3+(-2)\cdot(1) &2\cdot1+(-2)\cdot 2  \\4\cdot2+3\cdot0&4\cdot3 +3\cdot (-1) & 4\cdot1+3\cdot2\\ 1\cdot2+5\cdot0&1\cdot3+5\cdot(-1)&1\cdot1+5\cdot2 \end{bmatrix}=\phantom{\textbf{BA}=}\begin{bmatrix} 4 & 8&-2  \\8  & 9&10\\2&-2&11 \end{bmatrix} $


\item %PROBLEM 2
  Let $\textbf{a}' = \begin{bmatrix}
       3 & 6 &-3 & 5 &  9& 2  \\
     \end{bmatrix}$. Find \textbf{a}$'$\textbf{a} and \textbf{aa}$'$.


 \textbf{a}$'$ is the transpose of $\textbf{a} = \begin{bmatrix}
       3 \\ 6 \\-3 \\ 5 \\  9\\ 2  \\
     \end{bmatrix}$

 \[\textbf{a}'\textbf{a} = \begin{bmatrix}
       3 & 6 &-3 & 5 &  9& 2  \\
     \end{bmatrix} \cdot \begin{bmatrix}
       3 \\ 6 \\-3 \\ 5 \\  9\\ 2  \\
     \end{bmatrix} = \begin{bmatrix}
       3^2 + 6^2 + (-3)^2 + 5^2 +  9^2 + 2^2  \\
     \end{bmatrix} =[164] \]

   $\textbf{aa}' = \begin{bmatrix}
       3 \\ 6 \\-3 \\ 5 \\  9\\ 2  \\
     \end{bmatrix}\cdot \begin{bmatrix}
       3 & 6 &-3 & 5 &  9& 2  \\
     \end{bmatrix}  = \begin{bmatrix}
       3^2& 3\cdot 6 & 3\cdot (-3) & 3\cdot 5 &  3\cdot 9 & 3\cdot 2  \\
  6\cdot 3& 6^2 & 6\cdot (-3) & 6\cdot 5 &  6\cdot 9 & 6\cdot 2  \\
    (-3)\cdot 3& (-3)\cdot 6 & (-3)^2 & (-3)\cdot 5 &  (-3)\cdot 9 & (-3)\cdot 2  \\
      5\cdot 3& 5\cdot 6 & 5\cdot (-3) & 5^2 &  5\cdot 9 & 5\cdot 2  \\
        9\cdot 3& 9\cdot 6 & 9\cdot (-3) & 9\cdot 5 &  9^2 & 9\cdot 2  \\
         2\cdot 3& 2\cdot 6 & 2\cdot (-3) & 2\cdot 5 &  2\cdot 9 & 2^2  \\
     \end{bmatrix} \\\phantom{\textbf{aa}'}=\begin{bmatrix}
       9& 18 & 9 & 15 &  27 & 6  \\
  18& 36 & -18 & 30 &  54 & 12  \\
    -9& -18 & 9 & -15 &  27 & -6  \\
      15& 30 & 15 & 10 &  45 & 10 \\
        27& 54 & 27 & 45 &  81 & 18  \\
         6& 12 & 6 & 10 &  18 & 4  \\
     \end{bmatrix} $







   Let $\textbf{b}' = \begin{bmatrix}
       1 & 1 & 1 & 1 & 1 & 1  \\
     \end{bmatrix}\,\,\,\,\,$
     and
    $\,\,\,\,\,\textbf{c}' = \begin{bmatrix}
       1 & -1 & 1 & -1 & 1 & -1  \\
     \end{bmatrix}$. Find \textbf{b}$'$\textbf{c} and \textbf{bc}$'$.


  \end{enumerate}
\end{document}   

enter image description here

1
  • This looks exactly how I want it to look. Awesome.
    – Olga
    Sep 23, 2014 at 2:53
0

Here is a solution: since you load amsthm I define problem as a example-style new theorem. This cater fort automatic numbering and cross referencing of problems. Also, the questions are typeset in italic. If you prefer roman shape, change example style for definition style.

Also, as the vertical spacing between theorems seems too tight, I added some vrtical spacing, with the help of the etoolbox package, more precisely its \AtBeginEnvironment command.

As for the alignments, I use the align* environment. Some matrices look better (those with some negative coefficients), in my opinion, if their columns are right-aligned. For these, I used the bmatrix* environment, from mathtools, with option [r]. Don't load amsmath: mathtools does it for you.

\documentclass[paper=a4, fontsize=11pt]{scrartcl} % A4 paper

\usepackage{mathtools, amsthm, amssymb}
\usepackage{enumitem}
\usepackage{etoolbox}

\theoremstyle{example}
\newtheorem{problem}{Problem}
\AtBeginEnvironment{problem}{\vspace{1ex}}{}{}

\begin{document}

\begin{problem}\label{pb1}% PROBLEM 1
Find $\mathbf{A}+\mathbf{B}$, $\mathbf{AB}$, $\mathbf{BA}$.
\end{problem}

 \begin{enumerate}[label = \alph*), wide = 0em]
\item $\mathbf{A} = \begin{bmatrix} 1 & 2 \\ 3 & -1 \end{bmatrix}$\enspace and \enspace$\mathbf{B} = \begin{bmatrix} 2 & 1 \\1 & 1 \end{bmatrix}$. $ \mathbf{A} $ is $2\times2$ and $ \mathbf{B} $ is $2\times2$.

\begin{align*}
    \mathbf{A}+\mathbf{B} &= \begin{bmatrix*}[r] 1 & 2 \\ 3 & -1\end{bmatrix*} + \begin{bmatrix} 2 & 1 \\ 1 & 1 \end{bmatrix} = \begin{bmatrix*}[r] 1+2 & 2+1 \\ 3+1 & -1+1 \end{bmatrix*}= \begin{bmatrix} 3 & 3 \\ 4 & 0 \end{bmatrix}\\[1ex]
%
  \mathbf{AB} &= \begin{bmatrix*}[r] 1 & 2 \\ 3 & -1\end{bmatrix*} \cdot \begin{bmatrix} 2 & 1 \\1 & 1 \end{bmatrix}= \begin{bmatrix} 1\cdot2+2\cdot1 & 1\cdot 1+2\cdot1 \\3\cdot2+(-1)\cdot1 & 3\cdot1+(-1)\cdot1 \end{bmatrix} = \begin{bmatrix} 4 & 3 \\ 5 & 2 \end{bmatrix} \\[1ex]
%
  \mathbf{BA} &= \begin{bmatrix} 2 & 1 \\1 & 1 \end{bmatrix}\cdot \begin{bmatrix*}[r] 1 & 2 \\ 3 & -1\end{bmatrix*} = \begin{bmatrix} 2\cdot1+1\cdot3 & 2\cdot 2+1\cdot(-1) \\1\cdot1+1\cdot3 & 1\cdot2+1\cdot(-1) \end{bmatrix} = \begin{bmatrix} 5 & 3 \\ 4 & 1 \end{bmatrix} \\
\end{align*}

\item $\mathbf{A} = \begin{bmatrix} 2 & 3 & 1\\ 0 & -1 & 2 \end{bmatrix}$\enspace and\enspace$ \mathbf{B} = \begin{bmatrix} 2 & -2 \\ 4 & 3 \\1 & 5 \end{bmatrix}$. $ \mathbf{A} $ is $2\times3$ and $ \mathbf{B} $ is $3\times2$.

    $\mathbf{A}+\mathbf{B}$ is undefined because the two matrices are incompatible for addition.

\begin{align*}
   \mathbf{AB} = \begin{bmatrix*}[r] 2 & 3 & 1 \\ 0 & -1 & 2 \end{bmatrix*} \cdot
   \smash{\begin{bmatrix*}[r] 2 & -2 \\ 4 & 3 \\ 1 & 5 \end{bmatrix*}}
   & = \begin{bmatrix}
   2\cdot 2+3\cdot 4+1\cdot 1 & 2\cdot (-2)+3\cdot 3+1\cdot 5 \\
   0\cdot2+(-1)\cdot 4 +2\cdot 1 & 0\cdot (-2)+(-1)\cdot 3 +2\cdot 5
   \end{bmatrix}\\
    & = \begin{bmatrix*}[r] 17 & 10 \\-2 & 7 \end{bmatrix*}\\[1.5ex]
%
   \mathbf{BA} = \begin{bmatrix*}[r] 2 & -2 \\ 4 & 3 \\1 & 5 \end{bmatrix*}\cdot
   \begin{bmatrix*}[r] 2 & 3 & 1\\ 0 & -1 & 2 \end{bmatrix*}
   & = \begin{bmatrix}
   2\cdot 2+(-2)\cdot 0 & 2\cdot 3+(-2)\cdot (-1) & 2\cdot 1+(-2)\cdot 2 \\4\cdot 2+3\cdot 0&4\cdot3 +3\cdot (-1) & 4\cdot1+3\cdot2 \\
   1\cdot 2+5\cdot 0& 1\cdot3 + 5\cdot (-1)&1\cdot 1+5\cdot 2
   \end{bmatrix}\\
    & = \begin{bmatrix*}[r] 4 & 8 & -2 \\
    8 & 9 & 10\\ 2 & -2 & 11
    \end{bmatrix*}
\end{align*}

\end{enumerate}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{problem}\label{pb2} %PROBLEM 2
  Let $\mathbf{a}' = \begin{bmatrix}3 & 6 &-3 & 5 & 9& 2 \\ \end{bmatrix}$. Find $\mathbf{a}'\mathbf{a}$ and $\mathbf{aa}'$.
\end{problem}

$\mathbf{a}'$ is the transpose of $\mathbf{a} = \begin{bmatrix}3 \\ 6 \\-3 \\ 5 \\ 9\\ 2 \end{bmatrix}$.

\begin{align*}
  \mathbf{a}' \mathbf{a} & = \begin{bmatrix} 3 & 6 &-3 & 5 & 9& 2 \end{bmatrix} \cdot \begin{bmatrix}
       3 \\ 6 \\-3 \\ 5 \\ 9\\ 2 \end{bmatrix} = \begin{bmatrix} 3^2 + 6^2 + (-3)^2 + 5^2 + 9^2 + 2^2
     \end{bmatrix} = [164] \\
%
  \mathbf{aa}' & = \begin{bmatrix} 3 \\ 6 \\-3 \\ 5 \\ 9\\ 2 \end{bmatrix}\cdot \begin{bmatrix} 3 & 6 &-3 & 5 & 9& 2 \end{bmatrix}
   = \begin{bmatrix}
       3^2& 3\cdot 6 & 3\cdot (-3) & 3\cdot 5 & 3\cdot 9 & 3\cdot 2 \\
  6\cdot 3& 6^2 & 6\cdot (-3) & 6\cdot 5 & 6\cdot 9 & 6\cdot 2 \\
    (-3)\cdot 3& (-3)\cdot 6 & (-3)^2 & (-3)\cdot 5 &( -3)\cdot 9 & (-3)\cdot 2 \\
      5\cdot 3& 5\cdot 6 & 5\cdot (-3) & 5^2 & 5\cdot 9 & 5\cdot 2 \\
        9\cdot 3& 9\cdot 6 & 9\cdot (-3) & 9\cdot 5 & 9^2 & 9\cdot 2 \\
         2\cdot 3& 2\cdot 6 & 2\cdot (-3) & 2\cdot 5 & 2\cdot 9 & 2^2
     \end{bmatrix} \\
      & = \begin{bmatrix*}[r]
       9& 18 & 9 & 15 & 27 & 6 \\
  18& 36 & -18 & 30 & 54 & 12 \\
    -9& -18 & 9 & -15 & 27 & -6 \\
      15& 30 & 15 & 10 & 45 & 10 \\
        27& 54 & 27 & 45 & 81 & 18 \\
         6& 12 & 6 & 10 & 18 & 4
     \end{bmatrix*}
\end{align*}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{problem}\label{pb3}%% PROBLEM 3
       Let $\mathbf{b}' = \begin{bmatrix} 1 & 1 & 1 & 1 & 1 & 1 \end{bmatrix}$\enspace and\enspace$ \mathbf{c}' = \begin{bmatrix} 1 & -1 & 1 & -1 & 1 & -1 \end{bmatrix}$. Find $\mathbf{b}'\mathbf{c}$ and $\mathbf{bc}'$.
\end{problem}

\end{document} 

First page of the resulting .pdf:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .