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'm writing a scientific report and it's required that the first reference to any figure or table (not to equations or sections) in the text is set bold like this:


Is there a package for this kind of task?

The acronym package does something similar giving the full description of an acronym when it's used for the first time, so I guess it's not a too special problem.

share|improve this question

The following works:

enter image description here

    \nfss@text{\reset@font\bfseries ??}%
    \@latex@warning{Reference `#3' on page \thepage \space
    \expandafter\ifx\csname used@#1\endcsname\relax
      \expandafter\global\expandafter\def\csname used@#1\endcsname{used}%
      {\bfseries\expandafter#2#1\null}% Formatting of first reference
  \caption{A figure}\label{fig:figure}
See Figure~\ref{fig:figure}. The same reference to Figure~\ref{fig:figure}.

It modifies the macro \@setref which is called from \ref to decide whether a reference exists or not. The formatting is based on a condition to check whether a newly defined macro used@<label> exists or not.

Formatting of the first reference is set using \bfseries and can be modified to suit.

share|improve this answer
Thanks for your prompt and detailed answer. Could you modify the example so that the ref{} command prints Fig. x instead of only the number and is still bold for the first time? Sorry for not having been specific enough in my question. – Deve Mar 15 '12 at 10:20
@Deve: this would require some package (like, AFAIR, cleveref), since in "vanilla" LaTeX you always have to supply the "Ref.~" part yourself. Don't have time to implement it now, if nobody answers (which is unlikely), I'll try to do it tomorrow. – mbork Mar 15 '12 at 12:23

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.