What I would like to do is define a new command \kodim which I can index in math mode. With the following solution

\newcommand{\kodim}{kodim \,}

the result is unsatisfactory, because from

\kodim_V U

I get the space between the word kodim and the index V, instead of between kodim_V and the argument U.

How do I have to define the command instead to get the same result as from \dim_V U?

I also notice that my new word is not displayed in the same way in math mode as the built-in macro \dim. It is displayed in italic instead. How can I get the same result as with the built-in macro?

Thanks for help.

  • \DeclareMathOperator\kodim{kodim} (amsmath package) will make \kodim act like \log and just add the space when needed Oct 25, 2020 at 10:23

1 Answer 1


Do load the amsmath package and issue the instruction


in the preamble.

enter image description here

\usepackage{amsmath} % for "\DeclareMathOperator" macro
$\kodim_V U \quad \dim_V U$ 
  • Thanks a lot for the answer! Oct 25, 2020 at 10:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.