Math & ScienceError - Missing $

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
caiohm
Posts: 2
Joined: Mon Dec 26, 2011 5:03 pm

Error - Missing $

Post by caiohm »

I've read a thousand times the code and I can't find out what's wrong. It follows below:

Code: Select all

A4:\textbf{Limit Dominance}: There exist $\underbar \theta \in \mathbb{R}$ and $\bar \theta  \in \mathbb{R}$, such that  (i) $\pi(l,x)<0$ for all $l \in [0,1]$ and $x  \leq \underbar \theta$;(ii) $\pi(l,x)>0$ for all $l \in [0,1]$ and $x \geq  \bar\theta$. 
I'm using the following math's packages:

Code: Select all

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
Texmaker error message is that there is a missing } and a missing $ in the line where is written \end{document}. (The error message is: Missing $ (or }) inserted \end{document}).

Thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Error - Missing $

Post by Stefan Kottwitz »

Hi caiohm,

welcome to the board!

\underbar expects the argument to be in text mode, so you need to switch to math mode in its argument. This works:

Code: Select all

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{amsthm}
\begin{document}
    A4:\textbf{Limit Dominance}: There exist $\underbar{$\theta$} \in \mathbb{R}$ and $\bar \theta  \in \mathbb{R}$, such that  (i) $\pi(l,x)<0$ for all $l \in [0,1]$ and $x  \leq \underbar{$\theta$}$;(ii) $\pi(l,x)>0$ for all $l \in [0,1]$ and $x \geq  \bar\theta$.
\end{document}
Stefan
LaTeX.org admin
caiohm
Posts: 2
Joined: Mon Dec 26, 2011 5:03 pm

Re: Error - Missing $

Post by caiohm »

Thanks, Stefan. It's working now.
Post Reply