TransWikia.com

How to use short names for "Figure" using the hyperref package

TeX - LaTeX Asked by IamNotaMathematician on July 20, 2021

I am using the hyperref package to write a document. I am referencing my figures using autoref{fig:my_figure_label}

As an example:

The results are shown in autoref{fig:termperature_field}

The output is:

The results are shown in Figure 1.

How can I force it to produce short name for the word "Figure" so it appears as "Fig." instead:

The results are shown in Fig. 1.

I appreciate your help.

2 Answers

hyperref uses <type>autorefname to determine how to call those.

documentclass[]{article}

usepackage[]{graphicx}
usepackage[]{hyperref}

AtBeginDocument{renewcommandfigureautorefname{Fig.}}

begin{document}
begin{figure}
  centering
  includegraphics{example-image-duck}%
  caption
    {%
      A duck.%
      label{fig:duck}%
    }%
end{figure}

See autoref{fig:duck}.
end{document}

gives what you want:

enter image description here

Correct answer by Skillmon on July 20, 2021

I recommend the cleveref package over hyperref’s autoref. In addition to supporting abbreviated label names out of the box, it provides other useful features as well. texdoc cleveref for the details.

Answered by Don Hosek on July 20, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP