Skip to content

\providecommand overwrites the existing macro #3928

@artakase

Description

@artakase

Before reporting a bug

Describe the bug:
\providecommand overwrites the existing macro if already defined.

(La)TeX code:

\newcommand{\foo}{a}
\providecommand{\foo}{b}
\foo

Expected behavior:
\providecommand should do nothing if the macro already exists.

QuickLaTeX screenshot:
ss2

Screenshots:
ss1

Environment (please complete the following information):

  • KaTeX Version: 0.16.9
  • Device: Desktop
  • OS: macOS 14.2.1
  • Browser: Firefox
  • Version: 122.0.1

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