[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.

enter image description here

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:

enter image description here

Best Answer

Example, how this can be typeset:

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

\newcommand*{\transpose}{\mathrm{T}}
\newcommand*{\vc}[1]{\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}

Result

Or as matrix without commas:

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

\newcommand*{\transpose}{\mathrm{T}}
\newcommand*{\vc}[1]{\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}

Result as matrix

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}

Result for second question

Related Question