I am using the commath
package to typeset the derivative operator "D" with the command \Dif
. This work well unless I want to add subscripts or superscripts. In this case, the spacing after operator is too small and the exponent / index "touches" the operator:
where the first operator is created via \Dif
and the second one via \mathrm{D}
(full MWE see below).
Is there some way to "redefine" the \Dif
command in order to fix the spacing?
\documentclass{article}
\usepackage{commath}
\begin{document}
\begin{align*}
\Dif^2_x f(x) \\
\mathrm{D}^2_x f(x)
\end{align*}
\end{document}
{\Dif\,}^2_x
will do it, but that might be a nuisance, and not generally applicable.\Dif
work as it currently does almost always, but to produce something like{\Dif\,}^2_x
when sub/superscripts are used?commath
is inherently wrong and should never be used.\renewcommand{\Dif}{\operatorname{D}}