I try to write (x,y,\theta) but I get an error that says, "Missing $ inserted". If I remove \theta the error disappears. What is wrong?

  • \theta is a macro that need to be used within a math-mode. So you should use $(x,y,\theta)$ to create an in-line mathematical environment (or replace $s by \[ (opening) and \] (closing) for centered formula in a new line). Or if you don't want to use math-mode, you can have a look on how to use greek letters in text without changing to math mode – ebosi Jun 10 '16 at 13:34

\theta is defined in math mode which is why TeX makes the announcement $ inserted. If what you type is indeed a formula, surround it with $:

$(x, y, \theta)$

If it is normal text, the correct input depends a bit on whether you use (normal) (La)TeX or e.g. XeLaTeX (or other compiler that understands unicode input). XeLaTeX allows for direct Unicode input and does not need \theta.

See also How to typeset greek letters

| improve this answer | |
  • Does it also applies for x of t when I want to writ in in text, like this: $x_{t}$ ? I'm using sharelatex – naman Jun 10 '16 at 13:44
  • 1
    In general, all mathematical formulae should be typeset using $...$ (or \( ... \)) when within a stretch of text or, if they are longer, within an environment such as \begin{equation} ... \end{equation}. For some more info and help, en.wikibooks.org/wiki/LaTeX/Mathematics might be helpful – dariok Jun 10 '16 at 13:53
  • Thnaks. But it does not work for equation for me when I try this: \begin{equation} $ \overline{bel}(x_{t}) = p ( x_{t} \textbar z_{1:t-1} , u_{1:t} ) $ \end{equation} If I remove $..$ then I get worming: Command \textbar invalid in math mode on input line 12 – naman Jun 10 '16 at 13:59
  • 1
    @naman Your last comment seems to be asking a new question, so please do that: ask a new question. This time include a MWE (a very small complete document with just the one mistake). Format it as code so we can cut and paste it and fix it. – Ethan Bolker Jun 10 '16 at 14:17
  • @naman Within the equation environment you don't need $ since \begin{equation} switch on the math mode. The warning you get only means that the \textbar command is not for use in math mode. – DRi Jun 10 '16 at 14:40

You need math mode: $(x,y,\theta)$.

| improve this answer | |

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.