[Tex/LaTex] Equations, autoref and parenthesis

equationshyperref

In a document at my workplace, \autoref is redefined in the following way:

\renewcommand{\autoref}[1]{\cref{#1}}

I suppose this is important because it probably means that I cannot just overwrite \equationautorefname.

For equations, this results in something like "Equation (5.1)". The parenthis are fine when they are shown next to the equation, but in the text we want them to be displayed without the parenthesis.

How can I achieve this?

Best Answer

The presence of \cref in your question suggests the use of cleveref; in this case, use \crefformat to (re)format how the aspect of the cross-reference should be:

\documentclass{article}
\usepackage{amsmath}
\usepackage{hyperref}
\usepackage[noabbrev]{cleveref}

\crefformat{equation}{equation~\textup{#2#1#3}}
\Crefformat{equation}{Equation~\textup{#2#1#3}}

\renewcommand\autoref[1]{\cref{#1}}

\begin{document}

\autoref{equ:test}
\begin{equation}
\label{equ:test}
a = b.
\end{equation}

\end{document}

enter image description here

\textup makes sure the equation number will always be upright.

By the way, instead of redefining \autoref, it would be better perhaps to define your own new command.

Related Question