3

I'm wondering if there's a more cleaner/nicer way to write this equation

\begin{document}
\begin{enumerate}[a.)]
\item If $u_i, v_i \in \R $ for $1 \leq i \leq 2 $, then 
        \begin{equation*}
            \vec{u} \oplus \vec{v} = 
            \begin{bmatrix}
                    u_1\\
                    u_2
            \end{bmatrix}
            +
            \begin{bmatrix}
                    v_1\\
                    v_2
            \end{bmatrix}
            =
            \begin{bmatrix}
                    u_1 + v_1\\
                    u_2 + v_2
            \end{bmatrix}
            \in \R^2.
        \end{equation*}
\end{enumerate}
\end{solution}
\end{document}

I have about 9 more entries to type up in this list and I don't want my code to be completely unreadable.

  • 3
    welcome to tex.se! please make your code compilable! as small complete document beginning with \documentclass{...} and ending with \end{document}. and shortly: your code seems to just fine (beside missing things). – Zarko Aug 30 '17 at 22:36
  • 1
    In particular, \R is undefined. I suspect you want either \renewcommand{\theenumi}{\alph{enumi})}% or [label=\alph*)] using the enumitem package. – John Kormylo Aug 31 '17 at 1:23
2

I find the following code quite readable. :-)

As you'll notice, I'm not convinced of the benefits of exaggerated nested indentation amounts; naturally, your views may differ. Observe, in addition, the setting up of a macro called \myvec, to simplify the use of instances of bmatrix environments.

\documentclass{article}
\usepackage{amsmath}  % for 'equation*' and 'bmatrix' environments
\usepackage{amssymb}  % for '\mathbb' macro
\usepackage{enumitem} % to modify enumeration labels
\newcommand\R{\mathbb{R}}
\newcommand\myvec[1]{\begin{bmatrix} #1 \end{bmatrix}}

\begin{document}
\begin{enumerate}[label=\alph*)]
\item If $u_i, v_i \in \R$, $1 \le i \le 2$, then
  \begin{equation*}
    \vec{u} \oplus \vec{v} 
    = \myvec{ u_1 \\ u_2 } + \myvec{ v_1 \\ v_2 }
    = \myvec{ u_1 + v_1 \\ u_2 + v_2 }
    \in \R^2\,.
  \end{equation*}
\end{enumerate}
\end{document}
  • Exactly what I was looking for. Looks much cleaner. Thanks! – lukas Sep 2 '17 at 0:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.