# Defining upright codimension math operator [duplicate]

How to write $\text{codim}(Y)$ without \text{codim}?

Is there command like \dim that I can use to write codimension?

• Never ever use \text for this. Use \DeclareMathOperator{\codim} {codim}  to define it. – daleif Aug 16 '16 at 16:33