2

I am trying to use normal text in math mode but it is not working. Below is the error I get. I have included asmath

$ \textnormal{F_{prior}(LSTM)} $

Missing $ inserted.
<inserted text> 
                $
l.297 $ \textnormal{F_{prior}(LSTM)}
                                     $
6

Instead of $ \textnormal{F_{prior}(LSTM)} $ you should use $ \mathrm{F_{prior}(LSTM)} $, because subscripts need math mode.

4

With amsmath

$\text{F}_\text{prior}(\text{LSTM})$

if you want the text font.

6
  • Please don't encourage users to do this, it is wrong on all levels, even the _\text is bad for users.
    – daleif
    Dec 26 '17 at 7:54
  • Because users may think this is a general feature, that they do not need braces, so it confuses them that sometimes they need braces other times they don't. Especially when it is coming from a high level user (many points), new users will take their examples as law.
    – daleif
    Dec 26 '17 at 10:24
  • Also, noone have ever guaranteed that that fact that you can use _\text does not mean that it will keep working for ever. So using braces is safer in general.
    – daleif
    Dec 26 '17 at 10:28
  • The use of text is wrong, it should never be used this way. This wrong use of text is on my top 3 of errors made by most users. Users should use one single construction, not one where they need to change things if the context it is used in turns out to be italic, for example. If you wrap your example in \enmph{...} all the text will be italic. Clearly not your intent. Users should use mathrm for stuff that are math (here at least the F) and for example textnormal for things that are clearly textual (not math), here prior is a candidate.
    – daleif
    Dec 26 '17 at 11:46
  • That is an example of the effect. Think used inside a theorem environment. Text is for textual comments in math, none of these are comments and thus specific markup should be used. Even if the op is asking for text font, using textnormal on each component instead of text is more stable in all situations.
    – daleif
    Dec 26 '17 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.