4
$\begingroup$

I've recently asked Why is the label set too high in an \xrightarrow?. Here's another \xrightarrow question.

As you probably know, but I didn't until I Googled it, \xrightarrow accepts an optional argument that specifies a subscript. For example, \log(R_i) \xrightarrow[i \to \infty]{} -\infty? $$\log(R_i) \xrightarrow[i \to \infty]{} -\infty?$$ However, as you can see (if you're using my set-up, anyway: Firefox 131.0.3 on macOS 15.0.1, with HTML-CSS renderer, MathJax v2), the subscript gets cut off:

Rendered image from post, with subscript cut off

The same does not happen in a local TeX installation:

Compiled image from TeX, with subscript visible

I "fixed" this in the actual post I was editing by inserting \vphantom{\rule{0em}{-2ex}}, which works in my particular view, but is very far from being adaptive, or reactive, or whatever the proper terminology is (although hopefully using ex rather than absolute units makes it not too bad): $$\log(R_i)\vphantom{\rule{0em}{-2ex}}\xrightarrow[i\to\infty]{}-\infty?$$ How can one use the subscript on an \xrightarrow without having to manually and kludge-ily fix spacing?

$\endgroup$

2 Answers 2

5
$\begingroup$

Try other math renderers ...
menu

For me, "Common HTML" renders this properly.

$\endgroup$
1
  • $\begingroup$ For me, too—thanks for finding this! But that only fixes the problem for me, and I don't think it's reasonable for me to use code that requires other people to change their renderers or deal with bad results. $\endgroup$
    – LSpice
    Commented Oct 27 at 17:27
4
$\begingroup$

We could try \underset like this: $$ \log(R_i)\underset{\;i\to\infty\;}{\longrightarrow} -\infty $$ \log(R_i)\underset{\;i\to\infty\;}{\longrightarrow} -\infty

$\endgroup$
3
  • $\begingroup$ Thank you! This happens to more-or-less work because i \to \infty isn't much longer than a \longrightarrow, but it doesn't extend automatically with the subscript as \xrightarrow does. (Of course there's code somewhere that implements the extensibility in an \xrightarrow, but I don't know whether all the primitives in that code are available in MathJax, or, if they are, if they achieve the same result.) $\endgroup$
    – LSpice
    Commented Oct 27 at 22:41
  • $\begingroup$ By the way, I think that \underset centres manually, so that the spacing \; isn't needed. (I'll shame-facedly delete this comment if I'm wrong.) \begin{align*} \log(R_i) \underset{\;i \to \infty\;}\longrightarrow -\infty & \quad\text{with \\;} \\ \log(R_i) \underset{i \to \infty}\longrightarrow -\infty & \quad\text{without.} \end{align*} Ah, I guess that you were including the \; to keep the adjacent terms from getting too close? $\endgroup$
    – LSpice
    Commented Oct 27 at 22:48
  • 1
    $\begingroup$ Actually, that \; was a failed attempt to make the arrow longer. Providing space was an unexpected bonus. $\endgroup$ Commented Oct 27 at 22:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .