0

The following code:

\documentclass{article}
\usepackage{amsmath}
\usepackage{hyperref}
\renewcommand{\equationautorefname}{Eq.}
\renewcommand{\figureautorefname}{Fig.}

\begin{document}
\begin{equation}\label{eq1}
  x = 3.
\end{equation}
My reference to \autoref{eq1}.
\end{document}

produces output like "see Eq. 1" where the spacing will be an end-of-sentence spacing. Normally I would type something like Eq.\ 1 to prevent this. How to achieve this?

  • Don't show only snippets, make a complete example that can be tested directly. – Ulrike Fischer Jun 24 at 7:55
  • I don't get an end of sentence space, I get the same spacing as Eq.~1 – daleif Jun 24 at 8:20
3

The space is clearly an normal space (non-breaking) and not an end-of-sentence space. If you want a smaller space you can define the name to take an argument so that it "eats" this space, and replace it by e.g. \,:

\documentclass{article}
\usepackage{amsmath}
\usepackage{hyperref}

\renewcommand{\equationautorefname}{Eq.}
\renewcommand{\figureautorefname}{Fig.}

\begin{document}
\begin{equation}\label{eq1}
  x = 3.
\end{equation}
My reference to  \autoref{eq1}.   %normal, non-breaking

\noindent My reference to Eq.\ 1. %normal

\noindent My reference to Eq. 1.  %end of sentence

\renewcommand{\equationautorefname}[1]{Eq.\,}

\noindent My reference to \autoref{eq1}. %small
\end{document}

enter image description here

  • Thanks, not sure how I missed that. – Kappie001 Jun 24 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.