[Tex/LaTex] Reduce spacing around colons in math mode

math-mode

I'm working on math. Here I want to reduce the spacing around the colon (':'). By default spaces are inserted before and after the colon. Could you please advise me as to how this could be rectified?

MWE:

\documentclass{book}
\usepackage{amsmath}
\begin{document}
$$
DE:AB = 18:6 \quad AB:12 = CE:15
$$
\end{document}

Best Answer

You can redeclare : to be of class \mathord. If have to restore the original behaviour, use \mathrel{:}.

\documentclass{book}

\usepackage{amsmath}

\DeclareMathSymbol{:}{\mathord}{operators}{"3A}

\begin{document}

\[ DE:AB = 18:6 \quad AB:12 = CE:15 \]

\end{document}

enter image description here