MathJax doesn't have the idea of stretchable glue that TeX uses to implement \hfill
, so it can only be used in limited situations in MathJax, namely at the beginning of end of table cells in order to change the default alignment of the cell. So you can use
$$\begin{array}{cc}
aaa & bbb\\
a \hfill & \hfill b \\
a & b
\end{array}
$$
to change the centering to left and right alignment on the middle row.
$$\begin{array}{cc}
aaa & bbb\\
a \hfill & \hfill b \\
a & b
\end{array}
$$
Since MathJax only processes math-mode material, it never even sees the \hfill
you used in the main text of your post, so that certainly is not a supported use (no macro other than \begin
, \ref
, and \eqref
) are processed outside of math delimiters).
Inside math, it only makes sense to use \hfill
inside a box that is larger than the math it contains, and those are hard to come by in MathJax, since it doesn't support \hbox to <dimen>
or other similar constructs. Table cells is one of the few places that can happen, and even there, the use of \hfill
is only allowed at the ends (not the interior) of the cell.
\fbox
'. This is because during editing, MathJax's error messages are displayed, but for finished posts, if an expression contains a TeX error, the original TeX is shown in a box, since it is usually more helpful to a reader to get to see what the author was trying to say rather than the error message. $\endgroup$