TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I hope there is a solution for this. When I refer to some equation I always get something like 37, but I would like to have (37). I could make a new command but the problem is I use many kind of environments in my text: equation (needs \eqref), multline (needs \ref), theorems (need \ref). I don't want parantheses when referring to theorem numbers. Any advice is appreciated.

share|improve this question
Would you be able to provide an example of the equations causing these problems? You usage of \label could be incorrect. – Werner Jan 13 '12 at 20:09
Lockstep provided me a solution, thanks anyway. – Nadori Jan 13 '12 at 20:34
up vote 3 down vote accepted

One could use the "extension of counter referencing" described in section 53.2 of source2e and then redefine \p@equation.


  {\csname p@#1\expandafter\endcsname\csname the#1\endcsname}%



a^2 + b^2 = c^2

See equation~\ref{test} in section~\ref{foo}.


enter image description here

share|improve this answer

if you're using amsmath, just use \eqref{ <label> } which includes the parentheses and keeps the whole thing upright even in an italic (e.g. theorem) environment. it really doesn't matter what you're using it for; it should work with any label.

reading the question more carefully, you say you don't want parentheses when referring to thworems. then just use \ref -- but if you'd like them upright like \eqref, then use \textup{\ref{...}} when not in a "guaranteed" upright environment'

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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