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.

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'm writing my PhD thesis in LaTeX and I have a lot of figures - each one is referenced within the text. So I have:


then, later, in the text:

blah blah blah this is shown in \ref{fig:stuff}, which indicates blah blah

and I get:

blah blah blah this is shown in Figure 2.7, which indicates blah blah

I want to make "Figure 2.7" bold - I'm loading the caption package with the labelfont=bf option so that it's bold in the caption of the figure itself, but I'd also like it to be bold in the text. I guess I could do this with

blah blah blah this is shown in \textbf{\ref{fig:stuff}}, which indicates blah blah

but ideally I'd like not to have to change multiple references to all 71 figures...

Any ideas?

share|improve this question
Just from a typographic point of view: I don't think this is a good idea, as it will optically emphasize your references very much and make it stand out of the grey value of the text. – Benedikt Bauer Dec 21 '12 at 21:52
Some journals want you to emphasize the first occurrence of a figure reference in bold (not all). This is probably more difficult to achieve it automatically. – Hotschke Aug 10 '15 at 14:18

I assume that you want to bold-face your cross-references to make them stand out strongly in the text. However, this is a dubious practice from a typographic point of view. Rather than bold-facing the cross-references, I'd suggest that you make them into hyperlinks that can be assigned a color. To do this, start by loading the hyperref package with the colorlinks option set. Then, use the \autoref command that's provided by the hyperref package to create colored hyperlinks to the objects being cross-referenced. Note that the \autoref command is what one might term fully dynamic: it typesets both the type (such as equation, figure, table, section, etc.) and the number of the cross-referenced object. By using the \autoref command, the hyperlink "target" (the part that's colored) will be highly visible, because it consists of both the type and number of the item being cross-referenced.

An even more flexible and powerful cross-referencing command than \autoref is \cref, provided by the cleveref package; I suggest that you load the cleveref package the nameinlink option set. (Even if you do use \cref, I still recommend you also load the hyperref package with the colorlinks option set. If you load both hyperref and cleveref, be sure to load hyperref first.) Like \autoref, \cref is fully dynamic; the nameinlink option forces the link to consist of both the item's type and number. Unlike \autoref, \cref lets you create cross-references to multiple items of the same type (e.g., equations) and even multiple items of differing types all in one cross-referencing command; the cleveref package will nicely sort and typeset the cross-references being generated without the user having to worry about such details.

For much more on various cross-referencing commands and packages in general, and the hyperref and cleveref packages in particular, see the answers to the question Cross-reference packages: which to use, which conflict?

share|improve this answer
The twelfth upvote on this answer gave me 120K total reputation points. Many thanks to everyone who uses this great site! – Mico Jul 13 '15 at 23:38

Just redefine \ref:

share|improve this answer
If hyperref is loaded this is dangerous; it's better to say \LetLtxMacro{\latexref}{\ref} (it needs the letltxmacro package). – egreg Dec 21 '12 at 22:22
Surely. My answer is a quick hack which breaks a lot of things... – Boris Dec 21 '12 at 22:54
Instead of redefine \ref, why not define a new one: \newcommand{\bref}[1]{\textbf{\ref{#1}}? – Manuel Dec 21 '12 at 23:09
This also works, but if you have a long doc with \refs, it might be easier to redefine \ref. – Boris Dec 21 '12 at 23:24

To achieve this you can add in the preamble:

\usepackage[capitalise]{cleveref} % load after hyperref package
\crefdefaultlabelformat{\textbf{#2#1#3}} % boldface only the number

% boldface only the type in front of the number

share|improve this answer
Welcome to TeX.SX! – Claudio Fiandrino Nov 18 '13 at 10:49

The answer by Fallino is almost right, but it allows only for either the types ("Figure", "Table", "Section"...), or the labels to be bold. Example:

In \cref{sectionname} we review the initial conditions ...

Leads to different output depending on the lines in the preamble.

Case 1

\usepackage[capitalize, nameinlink]{cleveref}

results in:

Only the label has boldface

Case 2

\usepackage[capitalize, nameinlink]{cleveref}

results in:

Only "Section" has boldface.

Case 3

\usepackage[capitalize, nameinlink]{cleveref}
\crefdefaultlabelformat{#2\textbf{#1}#3} % <-- Only #1 in \textbf

gives the desired look

Both "Section" and the label number are bold.

share|improve this answer
Welcome to TeX.SX! I get no error with fallino's code, but an error with yours. Probably you also want #2 outside \textbf: \crefdefaultlabelformat{#2\textbf{#1}#3} (note that #2 should be at the beginning and #3 at the end). – egreg Jul 13 '15 at 16:52
In general it's better to provide full examples, not just fragments of code. Please elaborate on your solution – Christian Hupfer Jul 13 '15 at 17:25

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.