I am writing an article for a journal with AMS math equation style, e.g. "Eq. (1)". I want to hyperref the entire "Eq. (1)" and not merely the "1". Currently I use \renewcommand{\equationautorefname}{Eq.}
. But this yields an hyperref'ed "Eq. 1". I prefer a solution in which I can continue using \autoref
.
A solution is presented at How to use the command \autoref to implement the same effect when use the command \eqref?, but it uses \def
and the journal style prohibits the use of Tex's low-level commands like \def
, \edef
, and \gdef
.
Best Answer
If you're not willing -- or allowed! -- to modify some lower-level TeX macros, you could still achieve your objective of getting parentheses placed automatically around cross-referenced equation numbers by (a) executing the following instruction in the preamble:
and (b) using
\cref
instead of\autoref
to generate cross-references.For more on various cross-referencing packages and, in particular, the capabilities of
hyperref
andcleveref
in this regard, see the posting Cross-reference packages: which to use, which conflict?Addendum: If you must use
\autoref
and want parentheses placed around the cross-referenced equation numbers, it's necessary to redefine the macro\theequation
. Assuming you also use theamsmath
package, it's also necessary to modify the auxilliary macro\tagform@
. The following MWE shows how this may be done. (The directives\makeatletter
and\makeatother
are needed because some of the code involves the "special" character@
.)A side remark: If the journal's guidelines prohibit the use of
\def
in your document, using\renewcommand
is probably frowned upon as well. If that's the case, you should probably use\cref
instead of\autoref
to create cross-references to equations...