Document ClassesHow to modify \autoref?

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
kidnapper
Posts: 2
Joined: Sun Apr 12, 2009 11:06 pm

How to modify \autoref?

Post by kidnapper »

Hi all,

I am using \autoref and \hyperref commands, and now I have some trouble with them:

When I liked to create a link to a Figure, the text of the \autoref will be always "Figure 1", but I would like to get "1 Figure". I tried many things with renewcommand and so on, but there was no result.
So I would like to get a link with text "1 Figure", but for now I can only get link for "1" and then goes the non-link "Figure" word, which is not so good for me.

I would appreciate any help..

Peter Major
Hungary

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
corderin
Posts: 77
Joined: Sun Dec 14, 2008 2:27 pm

How to modify \autoref?

Post by corderin »

Using varioref package ...

Code: Select all

\usepackage{varioref}
\labelformat{figure}{#1~Figure}
:-)

In order to modify also the caption of the figures:

Code: Select all

\usepackage{caption}
\DeclareCaptionLabelFormat{number-fig}{#2~#1}
\captionsetup{labelformat=number-fig}
;-)
kidnapper
Posts: 2
Joined: Sun Apr 12, 2009 11:06 pm

How to modify \autoref?

Post by kidnapper »

corderin wrote:Using varioref package ...

Code: Select all

\usepackage{varioref}
\labelformat{figure}{#1~Figure}
:-)

In order to modify also the caption of the figures:

Code: Select all

\usepackage{caption}
\DeclareCaptionLabelFormat{number-fig}{#2~#1}
\captionsetup{labelformat=number-fig}
;-)
Thanks! It works like a charm, it doesn't work with \autoref, but it works perfectly with \ref or \aref.
Thanks again.

Best regards,
Peter Major
Post Reply