Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Is possible to surround a cross-reference with brackets or parentheses? For example when I write a command like some text \ref{some label} then when compiled the output was some text (12) without manually placing parentheses in latex command, like some text (\ref{some label}).

share|improve this question
In case of equations, there is \eqref of package amsmath that adds parentheses around the equation number. –  Heiko Oberdiek Apr 22 '14 at 1:35
If I need to apply that for any referencing, not just the equation?? –  Mohammad Fajar Apr 22 '14 at 1:41
Have a good look at the cleveref package. It is (a) fully compatible with the hyperref package (and must be loaded after hyperref) and (b) allows full customization of the appearance of cross-references. –  Mico Apr 22 '14 at 1:46
I've taken the liberty of replacing hyperlink/hyperref with "cross-reference" since that's what your posting is mainly about. (A hyperlink is a special type of a cross-reference.) –  Mico Apr 22 '14 at 1:54

2 Answers 2

up vote 4 down vote accepted

You could renew the reference command, perhaps something like:


Here's a complete MWE to play with:

% arara: pdflatex
% arara: pdflatex


\section{Section heading}\label{sec:testlabel}

Reference: \ref{sec:testlabel}
share|improve this answer
You should probably provide a note that this solution isn't compatible with hyperref: regardless of whether that package is loaded before or after your code, the result is that no parentheses will be placed around the section number. –  Mico Apr 22 '14 at 11:09

I prefer the autoref function provided in the hyperref package.

Taking examples for tables and figures:

The Table reference is \autoref{tab:VHTRC}.
The equation reference is \autoref{eq:3}.

Next, new reference styles should be renewed at the preamble. Usually I define them just after including the hyperref package.

\def\equationautorefname~#1\null{Equation (#1)\null}

The \def define the auto-reference variable #1 in the style Equation (#1), which is enclosed in (). Then you will get the result like this:

enter image description here

If you want to use the parentheses {}, they should be escaped with the \.

\def\equationautorefname~#1\null{Equation \{#1\}\null}
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.