\sout defined by \usepackage{ulem} (doc) is designed for text mode. While it seems to be allowed in math mode it doesn't actually do the right thing. For example, in LuaLaTeX:
\text{\sout{ab}} works fine
\text{\sout{$ab$}} works fine
$\sout{ab}$ compiles but shows an underline, which is not the intended use of \sout
KaTeX seems to do the opposite:
- In text mode, it incorrectly gives: "KaTeX parse error: Can't use function '\sout' in text mode"
- In math mode, it behaves like a proper strike-out, even though it doesn't seem intended to be used as such with
ulem's current behavior.
Screenshot of LuaLaTeX behavior for the following LaTeX
a\sout{bc}d
a\sout{$bc$}d
$a\sout{bc}d$

\soutdefined by\usepackage{ulem}(doc) is designed for text mode. While it seems to be allowed in math mode it doesn't actually do the right thing. For example, in LuaLaTeX:\text{\sout{ab}}works fine\text{\sout{$ab$}}works fine$\sout{ab}$compiles but shows an underline, which is not the intended use of\soutKaTeX seems to do the opposite:
ulem's current behavior.Screenshot of LuaLaTeX behavior for the following LaTeX