Definitely $erf$ should be printed upright, like $\sin$ and so on. Unfortunately LaTeX and standard packages do not know this command (macro) \erf. Neither does MathJax with standard extensions. But there is mechanism: I place* in the preamble of the LaTeX document
\newcommand{\erf}{\operatorname{erf}}
and now I can use \erf. In Mathjax I place* on the page the same command, surrounded by dollar signs
$\newcommand{\erf}{\operatorname{erf}}$
and again! $\newcommand{\erf}{\operatorname{erf}}$
$\erf\bigl(\frac{x}{\sqrt{4kt}}\bigr)$
*) Only once