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?

  • 9
    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. Commented Dec 21, 2012 at 21:52
  • 1
    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
    Commented Aug 10, 2015 at 14:18

5 Answers 5


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?

  • 1
    The twelfth upvote on this answer gave me 120K total reputation points. Many thanks to everyone who uses this great site!
    – Mico
    Commented Jul 13, 2015 at 23:38

Just redefine \ref:

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

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.

  • 1
    In general it's better to provide full examples, not just fragments of code. Please elaborate on your solution
    – user31729
    Commented Jul 13, 2015 at 17:25

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


Using Quarto, for some reason I had to do a mix of the answers above

- \usepackage[capitalise,noabbrev, nameinlink]{cleveref} # Allows \cref{} to cite latex table as "Table 3"
# Specify which cross-reference should automatically be bolded : Tables and Figures
# Use \cref{} ; For some reason this only works with this exact disposition :
# Only #1, nameinlink and each of the reference specified. namelink + #1#2#3 would give an error.
- \crefdefaultlabelformat{#2\textbf{#1}#3} # <-- Only #1 in \textbf
- \crefname{table}{\textbf{Table}}{\textbf{Tables}}
- \Crefname{table}{\textbf{Table}}{\textbf{Tables}}
- \crefname{figure}{\textbf{Figure}}{\textbf{Figures}} 
- \Crefname{figure}{\textbf{Figure}}{\textbf{Figures}}

You must log in to answer this question.

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