Shmalex
Shmalex

Reputation: 181

Mathjax \text{} with greek letters inside

I am trying to use mathjax in Jupyter Notebook, and trying to render the following
enter image description here

in Latex typesettings I can render only the followin:
\varepsilon-\text{greedy}(Q)$\
enter image description here

As you can see the dash is very long and adds extra space around dash.

If i move the epsolon within the \text expression the result will be:
\text{\varepsilon-greedy}(Q)$\
enter image description here\

The dash has no problem bu the epsilon is not rendered.

How can I render the epsilon as intend.

Resolved: UPDATE Resolved: UPDATE2

That is not the answer for rendering the same outout is just move the dash into the \text \varepsilon\text{-greedy}(Q)$\
enter image description here

Upvotes: 0

Views: 421

Answers (1)

Davide Cervone
Davide Cervone

Reputation: 12260

Note that \text{\varepsilon-greedy}(Q) is not valid LaTeX. The \varepsilon macro is a math-mode macro, and is not allowed in text mode, as it appears here, so it would cause an error message in actual LaTeX.

MathJax is designed to process primarily math-mode material, so it does not process macros in text mode, so \varepsilon will be displayed verbatim. If you want to use it in text mode, you could use \text{$\varepsilon$-greedy}(Q) to temporarily enter math mode within text mode.

MathJax version 3 has a textmacros extension that allows processing of some macros in text mode, but that is not available in version 2, which is what is used on StackExchange. (They are using a four-year-old version of MathJax here.)

Upvotes: 1

Related Questions