# '! Undefined control sequence' and '! Package inputenc error' while typesetting equations

I'm writing complicated equations in LaTeX and I'm getting error messages: for the first two equations I get:

! Undefined control sequence.

and the third one I get:

! Package inputenc Error: Unicode char − (U+2212) (inputenc) not set up for use with LaTeX. See the inputenc package documentation for explanation. Type H for immediate help.

Can any one help? These are my equations:

\begin{document}
$\sigma \textsupsub{2}{j}(x)\equiv \sum_{j\prime=1}{M}{W \textsupsub{2} {ij\prime (X)a_{j\prime}(X)}, j,=1,...,M$ %(8b)

$$T= min_j\in [1,M]\Bigg{ \frac {\epsilon a_0(X)}{\mu_j(X)|},\frac {\in a_0(X)}^2{(\xi\textsupsub{2}{j}(x)})$$

Pr ${X_n=j\mid X_{n-1}=i, X_{n−2}=k,...,X_0=m}=Pr{X_n=j \mid X_(n-1)=i}$
\end{document}


it's supposed to produce:

• Welcome to TeX.SE! It seems hat you have encoding problem. That we can help you, please help us and provide complete document, which we can copy to our computers and compile it. – Zarko Sep 14 '16 at 3:37
• Is there a reason you are \textsupsub instead of simply using _ and ^  ? – Elad Den Sep 14 '16 at 3:45
• it is complicated it uses much dependency the latex file contain main tex which ontains included chapters, used packages, appendices and Bibliography. I'm writing in one of these chapters – Sama_science Sep 14 '16 at 3:48
• yes because it didn't complie with the exsistance of supersript and subscript together. So, i tried \textsupsub – Sama_science Sep 14 '16 at 3:50
• You never should use $$...$$ for displayed equations. This is plain TeX syntax, and you may have bad spacing (and a few other problems). Use $...$ instead. – Bernard Sep 14 '16 at 9:22

Your input document appears to contain the Unicode character − (U+2212) instead of _ (ordinary underscore).

Your code also features several other issues, such the use of { instead of \{ to generate an (opening) curly brace and the use of \in instead of \epsilon. Excellent use of \mid, though!

Here's how I would write the three equations:

\documentclass{article}
\usepackage{amsmath}             % for "gather" environment
\usepackage{newtxtext,newtxmath} % Times Roman text and math font
\newcommand{\bfx}{(\mathbf{x})}  % handy shortcut macro
\begin{document}
\begin{gather}
\sigma_j^2\bfx \equiv
\sum_{j'=1}^M f_{\!jj'}^2\bfx a_{j'}\bfx,
\tau = \min_{j\in[1,M]}\left\{
\frac{\epsilon a_0\bfx}{|\mu_j\bfx|},
\frac{(\epsilon a_0\bfx)^2}{\sigma_j^2\bfx}
\right\}. \notag \\[2ex]
\Pr\{\,X_n=j \mid X_{n-1}=i, X_{n-2}=k, \dots, X_0=m\,\} =
\Pr\{\,X_n=j \mid X_{n-1}=1\,\} \notag
\end{gather}
\end{document}

• I'd not encode the parentheses in \bfx – egreg Sep 14 '16 at 9:22