# Why isn't there \textsf commands, and what should we do about it?

Currently MathJax supports several fonts for text in mathematics:

$$normal,\mathbf{mathbf},\mathsf{mathsf},\mathrm{mathrm},\mathtt{mathtt}.$$ (And I intentionally omitted all the \mathbb,\mathscr,\mathfrak and \mathcal which are really not used for text usually.)

In addition, MathJax also supports the \text command which allows one to insert text mid-math mode (and thus retain some basic spacing between words and letters which are otherwise ignored). It also supports $\textbf{textbf}$ and $\textrm{textrm}$ and $\textit{textit}$ explicitly. However $\textsf{textsf}\$ and $\texttt{texttt}$ -- are unsupported.

Still, not all is lost. We can use a small hack and do the following: \mathsf{\text{...}} to get the same functionality as \textsf{...} would have given us: $$\mathsf{\text{This is a short sentence in mathmode using a \textsf{} hack}.}$$

Since this functionality "almost" exists in MathJax, two questions are needed to be asked:

1. Why isn't \textsf and \texttt are part of MathJax, like their boldface/italics/serif counterparts?


• +1, thanks for bringing this up; it's bugged me too. While we're requesting fonts: I would really like support for the Euler calligraphic font (from the eucal package). If I were king of MathJax, I would keep the command \mathcal as is, and use \eucal for the Euler calligraphic font. – Zev Chonoles May 21 '13 at 7:48
• Zev, I know that this bugged you. ;-) But it also bugged me for quite a long time now... – Asaf Karagila May 21 '13 at 8:21
• I have opened a feature request for this on the MathJax issue tracker: github.com/mathjax/MathJax/issues/477 – Davide Cervone May 21 '13 at 10:33
• @Davide: Thanks. I was hoping you'll see this and reply (Peter didn't know to tell me why these commands are not implemented, and suggested I post on the github tracker, or here for a custom macro until such feature is inserted. I chose the latter so that you might come and shed some light, but opening this request seems like there's no actual reason...) – Asaf Karagila May 21 '13 at 10:44
• There is no reason not to have \textsf and \texttt (other than my ignorance of all the LaTeX macros out there that people use). They weren't in the list I was working from. As for \eucal, that is another story, for two reasons: 1) it would require additional web fonts, and 2) since MathJax maps everything to MathML, there would need to be a way to notate it. There is no mathvariant that could be used for that, so MathJax would need to use something non-standard to do that. It is possible, but a bit awkward. – Davide Cervone May 21 '13 at 10:49
• @Zev: Ping.${}{}$ – Asaf Karagila May 21 '13 at 16:14
• @Davide: Thank you for that last comment. – Asaf Karagila May 21 '13 at 16:15
• @Zev But we already have \mathscr and \mathcal (which are distinct)! Yet another calligraphic font seems excessive... – Zhen Lin May 21 '13 at 23:20
• @Zev: Happy day. – Asaf Karagila May 12 '14 at 20:57

$$\Large\textsf{This is}\ldots\texttt{awesome.}$$
• For other people as lazy as me: The source for the above is $$\Large\textsf{This is}\ldots\texttt{awesome.}$$ – Martin Sleziak May 13 '14 at 5:17