# [Tex/LaTex] Labeling equations and math mode

equationslabelsmath-mode

I have to write the equation shown below in Latex and I am using

{\textbf{q}=($\mu$  $_1$ $\mu$  $_2$ ... $\mu$  $_{n-2}$
$\mu$ $_n$ )\textsuperscript{T}}


and it comes OK. However, I need to label the equation and I am using

\begin{equation}{\textbf{q}=($\mu$  $_1$ $\mu$  $_2$ ... $\mu$
$_{n-2}$     $\mu$ $_n$ )\textsuperscript{T}}  \label{2} \end{equation}


but I am getting errors stating that there is a missing } and that math mode should end with .

Also how can the equation below be written using Latex: Example, how this can be typeset:

\documentclass[a5paper]{article}
\usepackage{amsmath}

\newcommand*{\transpose}{\mathrm{T}}
\newcommand*{\vc}{\mathhbf{#1}}
% \vec and \vector are already defined

\begin{document}
\begin{equation}
\label{q-def}
\vc{q} = (\mu_1, \mu_2, \dots, \mu_{n-1}, \mu_{n})^\transpose
\end{equation}
Equation~\eqref{q-def} defines vector $\vc{q}$.
\end{document} Or as matrix without commas:

\documentclass[a5paper]{article}
\usepackage{amsmath}

\newcommand*{\transpose}{\mathrm{T}}
\newcommand*{\vc}{\mathbf{#1}}

\begin{document}
\begin{equation}
\label{q-def}
\vc{q} =
\begin{pmatrix}
\mu_1 & \mu_2 & \dots & \mu_{n-1} & \mu_{n}
\end{pmatrix}^\transpose
\end{equation}
Equation~\eqref{q-def} defines vector $\vc{q}$.
\end{document} ## Second question

The equation can be typeset as:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
$L = \log(l) = \sum_{i=1}^{N} \bigl( \log ( \mathbf{s}(\exp \{ \mathbf{Q} t_i\}) \mathbf{q} ) \bigr)$
\end{document} 