[Tex/LaTex] How to change font size of \ref

cross-referencingfontsize

How can I change the fontsize of a reference mark? My reference is something like:

this is a text \ref{figure1}

When compiled I get

this is a text 1

The "1" is in normal font size. How can I change the look of "1" to a smaller font size?

Best Answer

Here's an option that works with hyperref:

enter image description here

\documentclass{article}
\usepackage{hyperref,letltxmacro}% http://ctan.org/pkg/{hyperref,letltxmacro}
\newcommand{\reffont}{\small}% References will be \small
\AtBeginDocument{%
  \LetLtxMacro\oldref\ref% Capture \ref in \oldref
  \renewcommand{\ref}[1]{% Update \ref to use...
  {\reffont\oldref{#1}}}% ...\reffont
}
\begin{document}
\begin{figure}
  \caption{This is a figure}\label{figure}
\end{figure}
See Figure~\ref{figure}.
\end{document}

If hyperref is used, reference updating is (should be) delayed until the beginning of the document. If not, then a redefinition can be done earlier.

You can redefine \reffont at will to obtain a different font size (or style) of your reference.

Related Question