# Spacing issue in equation reference [duplicate]

When I type (Eq.\ref{eq.15}) The output is

Obviously the spacing between "Eq." and "1.15" is too closed. But when I type (adding a space) (Eq. \ref{eq.15})

The output is:

Obviously the spacing between "Eq." and "1.15" is too wide!

My question is how I can get appropriate spacing.

Load cleveref: you'll have less typing and the spacing will be fine. Demo:

\documentclass{report}

\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage{chngcntr}
\counterwithin{equation}{chapter}
\usepackage{cleveref}

\begin{document}

\setcounter{chapter}{1}
$$\label{eq-1st} J = \frac{1}{2}(a - b)$$

$$\label{eq-2nd} K= \frac{1}{2}(a + b)$$

I want to reference eq.\eqref{eq-1st}

I want to reference \cref{eq-1st}.

\Cref{eq-1st,eq-2nd} show that…

\end{document}