Skip to content

\sout should be a text-mode command, not a math mode one #4166

@marcianx

Description

@marcianx

\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$
Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions