0

I need to place my figure references between parenthesis for my Thesis. I've tried package \hyperref but it doesn't solve my problem.

If I try:

\autoref{'fig:label'} I get something like

Figure (1);

However I need to get:

(Figure 1)

Is there any way I can do that?

Here is my MWE:

\usepackage[portuguese]{babel}
\usepackage[utf8]{inputenc}
\usepackage[colorlinks,allcolors=blue]{hyperref} % This will give us the hyperlinks

\documentclass[notitlepage, 12pt]{report}

\begin{document}

\end{document}
1
  • Please tell us which document class you employ and if you use any packages that modify the appearance of counter variables such as the figure counter.
    – Mico
    Commented Jun 17, 2020 at 5:52

1 Answer 1

3

This is a job for cleveref, better than autoref.

\documentclass{article}
\usepackage{hyperref}
\usepackage{cleveref}

\crefformat{figure}{#2(\figurename~#1)#3}

\begin{document}

In~\cref{foo} we see something.

\begin{figure}[htp]
\centering

\fbox{\rule{0pt}{3cm}\rule{3cm}{0pt}}

\caption{Something\label{foo}}

\end{figure}

\end{document}

enter image description here

If you don't want that the parentheses are part of the link, use

\crefformat{figure}{(#2\figurename~#1#3)}
2
  • Thank you so much. It has worked flawlessly!
    – raulindo
    Commented Jun 17, 2020 at 12:17
  • @raulindo I'm not sure what you mean with the two comments.
    – egreg
    Commented Jul 7, 2020 at 16:02

You must log in to answer this question.

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