# Labeling equations and math 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

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


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:

\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}


• May be \renewcommand*\vec{\mathbf} and use \vec{q}. May 22 '15 at 18:22
• @Manuel \vec and \vector are already defined, thus I have updated the answer using \vc. I have kept \mahbf for the second question, because it is not too clear, if these are vectors, matrices, or tensors. May 22 '15 at 18:39

you should really have posted these as two separate questions, instead of adding on to the first. but you could try

\documentclass{article}
\usepackage{amsmath}
\begin{document}

$$\mathbf{q}=(\mu_1, \mu_2, \ldots ,\mu_{n-2}, \mu_n )^{\text{T}} \label{2}$$
and
$$L = \log(l) = \sum\limits_{i=1}^{\infty}\left( \log(s(\exp\left\{\mathbf{Q}_{i}^{t}\right\})\mathbf{q}) \right)$$

\end{document}


which gives

• oh, if that's not supposed to be a superscript t, then drop it inline...the picture looks a little fuzzy to me so at first i thought you wanted a superscript there. but i would encourage use of parentheses and curly braces that scale. May 22 '15 at 17:43
• yes I did that :) would it be possible to help me with the matrix I just posted? I am a beginner and really appreciate as they were taking me a lot of time! May 22 '15 at 17:45
• using \left and \right on the braces around the Q expression results in braces that are larger than the next-surrounding parentheses, which looks bad. the extra size isn't really needed though, so the answer is not to add more \left and \right. May 22 '15 at 18:26
• @barbarabeeton in the case that i (accidentally) typeset, without \left and \right creates braces that do not fully encompass the superscript and subscript. so should the answer actually have been to use \left and \right with the next-surrounding parentheses as well? May 22 '15 at 18:29
• @aeroNotAuto -- if you use \left and \right on the next pair, then you'd have to continue, and the result would be that the outermost pair would be entirely too large. better to take a little more time, use \bigl/\bigr and friends, and keep them as size-restricted as possible. there are many questions on this site with sensible guidance regarding sizing of delimiters, including when to let sub/superscripts and limits "hang out". May 22 '15 at 19:20