\mbox issue

35 views
Skip to first unread message

Sujatha .R D

unread,
Jul 20, 2022, 4:49:40β€―AM7/20/22
to MathJax Users
Hi Team

LaTeX code \mbox is rendering any commands inside it as commands itself. Only text is rendered properly. It doesn't throw an error as well.Β  Can this be resolved.Β 

\begin{align*} d_{\operatorname{TV}}\Bigl( \operatorname*{\mbox{{\hbox{a}\text{\Large \ensuremath{\ast}}}}}_{n \in J_k} \eta_n \, , \, \mathcal{E}(\lambda_k \delta_{b_k})\Bigr) \leq \lambda_k^{-1} \sum_{n \in J_k} p_n^2 \leq \max_{n \in J_k} p_n \leq \max_{n \in J_k} 2 C d_n^{-2} \leq \frac{2C}{(|k|-1)^2} \; , \end{align*}

Capture.GIF

Please do the needful.

Regards
Sujatha

William F Hammond

unread,
Jul 20, 2022, 4:05:55β€―PM7/20/22
to mathja...@googlegroups.com
Try this:

\begin{align*}
d_{\operatorname{TV}}
\Bigl(
\underset{n \in J_k}{\mathrm{a}\ast} \eta_n \, ,

\, \mathcal{E}(\lambda_k \delta_{b_k})
\Bigr)
\leq
\lambda_k^{-1} \sum_{n \in J_k} p_n^2
\leq
\max_{n \in J_k} p_n
\leq
\max_{n \in J_k} 2 C d_n^{-2}
\leq
\frac{2C}{(|k|-1)^2} \; ,
\end{align*}



William F Hammond
Email: gel...@gmail.com
https://www.facebook.com/william.f.hammond
http://www.albany.edu/~hammond/

π‘Ίπ’–π’‘π’‘π’π’“π’•π’Šπ’π’ˆ π’‚π’‡π’‡π’Šπ’“π’Žπ’‚π’•π’Šπ’—π’† π’‚π’„π’•π’Šπ’π’ 𝒇𝒐𝒓 𝒕𝒉𝒆 π’‡π’Šπ’π’Šπ’•π’† 𝒑𝒍𝒂𝒄𝒆𝒔






Davide Cervone

unread,
Jul 21, 2022, 7:18:44β€―AM7/21/22
to mathja...@googlegroups.com
MathJax is focused on mathematical notation, so doesn't implement much in the way of text-mode material, and (by defualt) does not process macros in the limited text-mode support that it does have. Β See the documentation at


That is why you are seeing the code rather than having it processed. Β MathJax v3 does have a textmacros extension that allows you to process some macros in text mode:


but that doesn't do all macros, and would not handle your code even if you used it (e.g., \ensuremath is no implemented, and \hbox and \text are not supported when you are already in text mode, though I suppose those could be added).

Because MathJax doesn't do text mode, it is more lenient about what you can do in math mode, and doesn't require all the back-and-forth between math and text mode, and so you are allowed to use \Large in math mode (unlike LaTeX itself, where that is a text-mode macro). Β So your can just use

\operatorname*{\text{a}\Large\ast}

to get what would require all the boxing and text mode in actual LaTeX. Β Of course, this won't work if you put it back into LaTeX, so if you want something that works in both, you could use

\operatorname*{\mbox{a\Large$\ast$}}

which is less cumbersome than your original, but still gets the job done in MathJax and LaTeX. Β I would not go through \underset route that Bill suggested, as the \operatorname approach is more semantically meaningful, and also includes the larger asterisk (though you could add \Large to Bill's answer if you wanted).

Davide


On Jul 20, 2022, at 4:49 AM, Sujatha .R D <rdsu...@gmail.com> wrote:

Hi Team

LaTeX code \mbox is rendering any commands inside it as commands itself. Only text is rendered properly. It doesn't throw an error as well.Β  Can this be resolved.Β 

\begin{align*} d_{\operatorname{TV}}\Bigl( \operatorname*{\mbox{{\hbox{a}\text{\Large \ensuremath{\ast}}}}}_{n \in J_k} \eta_n \, , \, \mathcal{E}(\lambda_k \delta_{b_k})\Bigr) \leq \lambda_k^{-1} \sum_{n \in J_k} p_n^2 \leq \max_{n \in J_k} p_n \leq \max_{n \in J_k} 2 C d_n^{-2} \leq \frac{2C}{(|k|-1)^2} \; , \end{align*}

<Capture.GIF>

Please do the needful.

Regards
Sujatha

--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mathjax-users/c72de70c-d077-49b3-b1cf-ba414e439f7en%40googlegroups.com.
<Capture.GIF>

Reply all
Reply to author
Forward
0 new messages