# \emph in math mode

I am new to LaTeX and have a problem with the line

The difference is that the signing key \emph{x} is split into two pieces, \begin{math}
\emph{x_{L}}\end{math} and \begin{math}\emph{x_{R}}\end{math} and are both elements of the
\begin{math}\textbf{Z}_{q}\end{math}.


I get the error

! Missing $inserted. <inserted text>  I am a little confused why I am getting this error since I have put the _ in a math section. Any help would be great. Thanks! - Welcome to TeX.sx! \emph is a text-mode command, so even though it's within a math-mode environment, a _ will be recognized as text. in fact, unless you've done something unusual, the math will be set automatically in italic, so there should be no need for the \emph. also, a shorter way to input in-line math is $$x_L$$ and you don't need to bury single-letter subscripts in braces. these things will come with time. – barbara beeton Sep 26 '12 at 16:41 ## 3 Answers For inline math you should use $ your equation $ or $$your equation$$. But $$...$$ is fragile. loading fixltx2e makes it robust. For display equation without number, use $equation$ or \begin{equation*} . . . \end{equation*}  For numbered equations, use $$. . .$$  A MWE: \documentclass{article} \usepackage{amsmath} \begin{document} The difference is that the signing key$x$is split into two pieces,$x_{L}$and $$x_{R}$$ and are both elements of the$x_{L}$$\mathbf{Z}_{q}.$ $$\mathbf{Z}_{q}$$ \begin{equation*}$$\mathbf{Z}_{q}$$\end{equation*} \end{document}  - $$ ...$$ is robust if you load fixltx2e. – Joseph Wright Sep 26 '12 at 17:24 @egreg Thank you. – Harish Kumar Sep 26 '12 at 22:57 @JosephWright Thanks. – Harish Kumar Sep 26 '12 at 22:57 Why you use \emph{} for math? $x_L$ and $\mathbf{Z}_q$ will do the same in simplest form without error. - \emph{} starts in text mode, so its parameter must be text, not math. So you need to go into math mode again within the \emph{}, as in \emph{$x_{L}$}. ## Notes: • I usually just use $...$ for inline math constructs (See References below). • Also I am not sure why you want to use \emph{} within math mode, unless you have a special definition of \emph{}. • I have also replaced \textbf{} with \mathbf{}. ## References: ## Code: \documentclass{article} \begin{document} The difference is that the signing key$x$is split into two pieces,$x_{L}$and$x_{R}$and are both elements of the$\mathbf{Z}_{q}\$.
\end{document}

-