4

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

  • 2
    In equation there mustn't be $ inside ;-) – user31729 May 22 '15 at 17:21
  • please can you see the last line of the question since I have a problem with another equation – user1930901 May 22 '15 at 17:23
  • in your first equation, you should be using \mathbf rather than \textbf. – barbara beeton May 22 '15 at 17:24
  • 1
    @user1930901 please stop adding questions to this question. if your first question(s) have been answered, mark an answer as accepted and post a new question for your matrix. you should also be aware that this community discourages "please do this for me" questions. you haven't shown any attempts to typeset the followup questions for yourself. – aeroNotAuto May 22 '15 at 17:45
  • 1
    @user1930901 Rather than using \mathbf{q} I would think of what is that q. If it's a vector, the logic would be to input \vec{q} and then redefine \vec to give bold letters (by default it places an small arrow above the letter). In any case, you should change your name to something more telling than user1930901 :) – Manuel May 22 '15 at 18:21
8

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

|improve this answer|||||
  • May be \renewcommand*\vec{\mathbf} and use \vec{q}. – Manuel May 22 '15 at 18:22
  • 1
    @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. – Heiko Oberdiek May 22 '15 at 18:39
3

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}


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


\end{document}

which gives

equations

|improve this answer|||||
  • 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. – aeroNotAuto 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! – user1930901 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. – barbara beeton 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? – aeroNotAuto 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". – barbara beeton May 22 '15 at 19:20

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.