1

I'm trying to make a rectangle containing text as a subscript, something like this

enter image description here

I tried this code

$x_{\square{i..j}}$

with MathJax and LaTeX

MathJax gives this

enter image description here

where the subscript i..j is not inside the square

while LaTeX gives this

enter image description here

where the square doesn't render at all.

How do I do it correctly?

PS: it doesn't have to be MathJax

JJJohn
  • 556
  • 4
    Remember that mathjax is not on topic here as it never uses LaTeX. \square is 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 \square is not defined by default, you'll need something like amssymb. – daleif Jan 09 '23 at 10:34

1 Answers1

2

It is possible in MathJaX to use \fbox command to draw a rectangle containing text as a subscript.

Using this code directly x_{\fbox{i...j}} you will have

enter image description here

PS: To compile in MathJaX you can use this link: https://mathjax.github.io/MathJax-a11y/Semantics-Lab/walker/

Sebastiano
  • 54,118