编译 LaTeX 文档时出现 xparse xstring 错误

编译 LaTeX 文档时出现 xparse xstring 错误

! LaTeX3 Error: Unknown argument type 'k' for the command while typesetting the document. the command used is \command**{\cmd}{\oldcmd}{\lparen\rparen}

定义是

\NewDocumentCommand{\NewMathFun}{ssmmm}{%
  \IfBooleanTF{#2}{%
    \expandafter\let\csname OP\CsToStr{#3}\endcsname#4%
  }{%
    \IfBooleanTF{#1}{%
      \expandafter\DeclareMathOperator\expandafter*\csname OP\CsToStr{#3}\endcsname{#4}%
    }{%
      \expandafter\DeclareMathOperator\csname OP\CsToStr{#3}\endcsname{#4}%
    }%
  }
  \NewDocumentCommand{#3}{ s k_ k^ k@ > {\SplitArgument{1}{}} D<>{#5} o}{%
    \csname OP\CsToStr{#3}\endcsname\IfNoValueF{##2}{_{##2}}\IfNoValueF{##3}{^{##3}}%
    \IfNoValueTF{##6}%
      {}%
      {\NewMathFunInternal{##1}##5{##6}\IfNoValueF{##4}{{##4}}%
    }%
  }%
}
\let\OLDdim\dim
\let\dim\undefined
\NewMathFun**{\dim}{\OLDdim}{\lparen\rparen}

相关内容