当我输入时
(Eq.\ref{eq.15})
输出是
显然“Eq.”和“1.15”之间的间距太小了。但是当我输入(添加一个空格)
(Eq. \ref{eq.15})
输出为:
显然“Eq.”和“1.15”之间的间距太大了!
我的问题是如何获得适当的间距。
答案1
加载cleveref
:输入更少,间距也更好。演示:
\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\usepackage{chngcntr}
\counterwithin{equation}{chapter}
\usepackage[colorlinks, linkcolor=blue]{hyperref}
\usepackage{cleveref}
\begin{document}
\setcounter{chapter}{1}
\begin{equation}
\label{eq-1st}
J = \frac{1}{2}(a - b)
\end{equation}
\begin{equation}
\label{eq-2nd}
K= \frac{1}{2}(a + b)
\end{equation}
I want to reference eq.\eqref{eq-1st}
I want to reference \cref{eq-1st}.
\Cref{eq-1st,eq-2nd} show that…
\end{document}