Is it possible to replicate the behavior of NewDocumentCommand in KaTeX
I am working on a React project where I need to replicate the behavior of the NewDocumentCommand in KaTeX. As an example, I’d like to replicate the following LaTeX command definition:
NewDocumentCommand{nder}{ m O{} O{x}}{frac{mathrm{d}^{#1} #2}{mathrm{d} #3^{#1}}}
.
This command allows for optional parameters with default values.