# \textit{x_{min}} have error? [duplicate]

I want to write:

and give error:

When I put

\textit${x_{min}}$


It also error

• Do you want to use it in the text or inside of a mathematical formula? $x_{min}$ should work for the latter Jan 13, 2020 at 20:07
• @leandriis, I want to use in text and also make it italic. so I added in \textit{x_{min}}
– aan
Jan 13, 2020 at 20:09
• You should rather use $x_{\min}$ instead of what you're currently doing. At best, you're need \textit{x\textsubscript{min}}.
– Werner
Jan 13, 2020 at 20:09
• @aan: _ for a subscript only works in math mode. Hence the error message when you use it in text mode. Jan 13, 2020 at 20:10
• Related (possible duplicate?): Superscript outside math mode Jan 13, 2020 at 20:12

\textit(x_{min}} is an error as the content of \textit is text mode so can not have _
\textit$x_{min}$ is \textit{$}x_{min}$ with a lone $ as argument to \textit the usual markup would be $x_{\min}$ or if you really do want min in italics $x_{\mathit{min}}\$
If it is not mathematics then \textit{x\textsubscript{min}} is another possibility.
• You probably mean \textit{x\textsubscript{min}} :-) Jan 13, 2020 at 20:27
• position of min :-) :-), however in principle there is no difference, so you are right :-) Jan 13, 2020 at 20:52
• @Dario I'm assuming the questioner wants x with a subscript "min" not just text with a literal underscore x_min ??? Jan 13, 2020 at 22:55