You should use

```
\begin{equation}
S_\textup{ном.} = S_{123}
\end{equation}
```

because that's text.

You can consider using `unicode-math`

instead of `mathtext`

```
\usepackage{amsmath}
\usepackage{unicode-math}
\setmainfont{Times New Roman}
\setmathfont{XITS Math}
% \newfontfamily\cyrillicfont{Times New Roman}
\usepackage{polyglossia}
\setdefaultlanguage{russian}
```

but notice that `amsmath`

must be loaded before it. This wouldn't change the way you input that subscript.

XeTeX introduced new primitives such as `\Umathcode`

(up to version 0.9998 called `\XeTeXmathcode`

, renamed for compatibility with LuaTeX) that's the Unicode analog of `\mathcode`

.

What does `\mathcode`

in traditional TeX? A declaration such as

```
\mathcode`+="202B
```

tells TeX that a `+`

in math mode should be treated as a binary operation symbol (leftmost byte `"2`

), taken from font family `"0`

and slot `"2B`

in the corresponding font. In the same vein, one can say something like

```
\Umathcode`∑="1 "1 "2211
```

or even

```
\Umathcode`∑="1 "1 `∑
```

The primitive `\Umathcode`

has the syntax

```
\Umathcode<Unicode point> = <math type> <family> <slot>
```

After the (optional) `=`

, three numbers should be given, because packing the information into a single number as done by TeX is not possible. Actually the information is still packed into a single number (in this case it's decimal 18883089, hexadecimal `"1202211`

), but the translation from packed number to explicit type-family-slot is not straightforward.

This will be probably accompanied by a similar declaration

```
\Umathchardef\sum="1 "1 "2211
```

so that typing `$∑$`

or `$\sum$`

will give the same result.

The `unicode-math`

package loads a huge list of symbols and performs assignments similar to the one for `∑`

. The number corresponding to `∑`

will be different, because it depends on many aspects which can't be covered in a short answer.

Actually `unicode-math`

does much more than this, because it sets things up so that commands such as `\mathbf`

or `\mathrm`

give the desired result.

There are other primitives corresponding to the traditional ones, namely `\Umathchar`

, for using a directly specified character, or `\Udelimiter`

for setting delimiters with normal and large variant, `\Umathaccent`

and finally `\Uradical`

for defining root symbols. See `texdoc xetex`

that will open “The XeTeX reference guide” by Will Robertson and Khaled Hosny.

## Best Answer

I don't know anything of Devanagari and Sanskrit; but here's an example that I obtained first by compiling without the second line, then copying from the PDF and pasting.

As far as I can see, the two lines are identical.

The lines

have the same effect as your

but use XeTeX more efficiently.