ValueError:
s_\text{ind}
^
Expected {accentprefixed | accent | symbol | c_over_c | function | group | frac | dfrac | stackrel | binom | genfrac | sqrt | overline | operatorname}, found 'e' (at char 4), (line:1, col:5)
As far as I remember, r means raw string, so \t mustn't interpreter as tab. I tried \\t and other ways to avoid this problem but I didn't find any workaround for this case yet... So it seems to me I found a bug.
I use Python 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)],
Matplotlib version is 3.3.1. I tried my code in JupyterLab ver. 2.2.7 on Windows 10.
Matplotlib backend is module://ipykernel.pylab.backend_inline.
\text is not supported, but I agree that it should be, especially because I think it can just be mapped to \mathdefault; in fact \mathdefault/\mathregular (which are synonyms, and which both only exist in Matplotlib and not in TeX or any(?) package that I know of) could be (soft-)deprecated in favor of \text (which is from the pretty standard amsmath).
Sorry, I didn't expect, that there are some TeX commands, that aren't supported in Matplotlib yet. Is there any list of (un)suppoted TeX commands in Matplotlib?
It will be nice if the \text command can be recognized in Matplotlib. As a first step, \text can be mapped to \mathdefault, but the amsmath \text command keeps spaces in the given text while \mathdefault does not.
Another issue here (which is maybe more a theoretical issue maybe) is that \text is supposed to use the text font, not the math font. However, I guess it is most commonly used to obtain upright text in math, rather than using the actual text font in equations. At least in the matplotlib context it seems like a fair approximation.
(One should really need \mathup or something similar to have a family independent, upright font in math mode.)
Activity
anntzer commented on Sep 18, 2020
\text is not supported, but I agree that it should be, especially because I think it can just be mapped to \mathdefault; in fact \mathdefault/\mathregular (which are synonyms, and which both only exist in Matplotlib and not in TeX or any(?) package that I know of) could be (soft-)deprecated in favor of \text (which is from the pretty standard amsmath).
sindzicat commented on Sep 18, 2020
Sorry, I didn't expect, that there are some TeX commands, that aren't supported in Matplotlib yet. Is there any list of (un)suppoted TeX commands in Matplotlib?
anntzer commented on Sep 18, 2020
See #14766.
sindzicat commented on Sep 20, 2020
@anntzer, many thanks!
tueda commented on Oct 23, 2021
It will be nice if the \text command can be recognized in Matplotlib. As a first step, \text can be mapped to \mathdefault, but the amsmath \text command keeps spaces in the given text while \mathdefault does not.
oscargus commented on Jan 9, 2022
Another issue here (which is maybe more a theoretical issue maybe) is that \text is supposed to use the text font, not the math font. However, I guess it is most commonly used to obtain upright text in math, rather than using the actual text font in equations. At least in the matplotlib context it seems like a fair approximation.
(One should really need \mathup or something similar to have a family independent, upright font in math mode.)