Welcome! Use \text: \documentclass{article} \usepackage{amsmath} \begin{document} $\text{slope} = 0.0021$ or \[\text{slope} = 0.0021\] \end{document}
– Nov 27 '19 at 05:39
2
Please clarify the nature of your query. E.g., are you familiar with TeX's (and LaTeX's) two types of math mode: inline math mode and display math mode? Do you know how to enter and exit inline math mode and display math mode? Alternatively, are you asking about how to typeset the word "slope" in upright lettering while in (inline or display) math mode? Please advise.
– MicoNov 27 '19 at 05:48
1
Welcome! To write decimal numbers you don't need nothing special: just use a dot (.) and put numbers between it.
– manoooohNov 27 '19 at 07:04
@Schrödinger'scat it is better to use \mathrm{slope} or \mathit{slope}. The style of \text changes depending on the outside font and this is normally not what you want for a variable.
– Ulrike FischerNov 27 '19 at 09:32
@UlrikeFischer I am not sure I agree. In many situations one does want to adjust the font to the ambient font, e.g. in a theorem.
– Nov 27 '19 at 16:07
@Schrödinger'scat intermediary text like "while" or "larger than" yes, but not variables. Longer "text variables" should like short variables x or y have a uniform look. See e.g. daleif's comment here https://tex.stackexchange.com/questions/482743/typesetting-multi-letter-variable-names-in-math-mode
– Ulrike FischerNov 27 '19 at 16:17
@UlrikeFischer I beg to disagree. It really depends on the case, but IMHO slope is not a variable but a term. Let’s say we were talking about, say, “rotation angle “ instead of “slope”. Would you then agree that \text is to be used?
– Nov 27 '19 at 16:31
@Schrödinger'scat not if it is used in a equation like in the example above. Then is doesn't matter if the text is "angle" or "duck rotation vector". It is then a math object and for math objects the look matters and they shouldn't change it (with the exception of math e.g. in heading which can get overall bolder).
– Ulrike FischerNov 27 '19 at 16:38
@UlrikeFischer Seems like we have a disagreement, then. Math operators do not change their font, terms do. Basically all math and physics books I know would adjust the font.
– Nov 27 '19 at 16:48
\text:\documentclass{article} \usepackage{amsmath} \begin{document} $\text{slope} = 0.0021$ or \[\text{slope} = 0.0021\] \end{document}– Nov 27 '19 at 05:39\mathrm{slope}or\mathit{slope}. The style of\textchanges depending on the outside font and this is normally not what you want for a variable. – Ulrike Fischer Nov 27 '19 at 09:32xoryhave a uniform look. See e.g. daleif's comment here https://tex.stackexchange.com/questions/482743/typesetting-multi-letter-variable-names-in-math-mode – Ulrike Fischer Nov 27 '19 at 16:17