I'd like to have a version of \eqref that treats equations with a custom tag differently from the usual numbered equation. In particular, if I assign a tag to an equation, I'd like \eqref not to put parens around the reference. Below is an example.


   a = b
   y = max\{1,x\} \tag{$P(x)$}

Equations \eqref{eq:normal} will display as "(1)" (i.e., with parens)
and \eqeref{eq:tagged} will display as "$P(x)$" (i.e., without parens).


How would I modify the \eqref command?


1 Answer 1


don't use \eqref. just use \ref. the main purpose of \eqref is to put parens around tags in accordance with ams style. it also ensures that they're set in upright type, which is not done with \ref, so you may still want to apply \upshape or \textup, although that isn't a problem as long as you are explicitly treating the tag as math.

Addendum: you can just equate \myeqref to \ref so that references to the explicitly-tagged displays can easily be found:


although it's possible to adapt the amsmath definition to do what you want, it's more than i have time to unravel just now, especially when there's a simpler approach.

  • The problem with this (straightforward) approach is that if in a later draft I change my mind, and wish to remove the custom tag and just have a numbered citation, I have to change every \ref to \eqref.
    – Michael
    Feb 22, 2012 at 19:59
  • You can always do \renewcommand{\eqref}[1]{\textup{\ref{#1}}. Then if you change your mind, remove or comment this, or replace it with something else. Feb 22, 2012 at 20:26
  • Herald: Wouldn't this unintentionally affect the way that \eqref{eq:normal} is displayed? My goal is only to change the way that \eqref{eq:tagged} is displayed.
    – Michael
    Feb 22, 2012 at 20:34
  • @HaraldHanche-Olsen: Your code in the comment is missing a final }.
    – user6853
    Feb 4, 2014 at 5:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .