I'm trying to make a rectangle containing text as a subscript, something like this
I tried this code
$x_{\square{i..j}}$
with MathJax and LaTeX
MathJax gives this
where the subscript i..j is not inside the square
while LaTeX gives this
where the square doesn't render at all.
How do I do it correctly?
PS: it doesn't have to be MathJax




mathjaxis not on topic here as it never uses LaTeX.\squareis just a symbol and so mathjax gives the proper output. That LaTeX does not render it is simply because you are ignoring compilation errors as\squareis not defined by default, you'll need something likeamssymb. – daleif Jan 09 '23 at 10:34