1

I would like to know if someone has a solution to the following problem:

I have recently start to create shortcut to certain operator to display directly the parenthesis around their arguments.

\providecommand{\ker}[1]{\operatorname{ker}\left ( #1 \right )}

for when I want to give the "ker" operator an argument and the command

\providecommand{\Ker}{\operatorname{ker}}

for when I only want to display the operator name.

I would like if there is a way to have those tow command in one such as

\providecommand{\ker}[1][...]{
ifthenelse{...=#1}{
   \operatorname{ker}
}{
   \operatorname{ker} \left ( #1 \right )
}
}

Where ... is the whitespace character \

I would like to avoid to use number in case I have to put them inside or some other characters that could be used to express a vector space.

Thanks to everyone who will take the time to read my question.

Matsune
  • 11
  • 3
  • Also https://tex.stackexchange.com/questions/474424/different-behavior-if-no-arguments?noredirect=1&lq=1 or https://tex.stackexchange.com/questions/388225/how-to-check-if-optional-argument-has-its-default-value or https://tex.stackexchange.com/questions/567937/use-xifthen-package-to-determine-if-optional-argument-is-provided and other questions linked from there. – Marijn Feb 29 '24 at 08:49
  • 1
    \providecommand{\ker} will do nothing at all, because \ker is already defined in the kernel. – egreg Feb 29 '24 at 09:27

0 Answers0