Prevent line breaks immediately after closing inline mathjax \)

I’m often using inline mathjax, and there are cases where it is immediately followed by text. Here is one example:

\(i\)th

Sometimes, Anki will put a line break between the mathjax and the following text. The example above could be rendered with the i on one line, and the th on the next line. How can I prevent line breaks to be inserted specifically right after \) if it is followed by a non-whitespace character?

One possibility that I found is to replace it with

\(i\text{th}\)

but I don’t use this solution because it’s ugly. It changes the font of the th compared to regular text. I am looking for alternative solutions that do not have this drawback.

One acceptable solution would be a way to change the text font used by mathjax to match the text font of regular text. Is this achievable? I looked a bit but didn’t find how to do it.

Another thing I tried is to insert a unicode word joiner character, &#8288, but Anki removes it.