0

I am writing my thesis and I want to have italic figure label, but I want reference number of figure to be non italic(just normal text) in my later text. In preamble I have this part of code to get italic figure label:

\renewcommand{\fnum@figure}{\textit{{Figure}} \thefigure}
\makeatother
\renewcommand{\thefigure}{\textit{\arabic{section}.\arabic{figure}}}

When I am referencing figure in text I am doing it like this

We can see on picture ~\ref{fig - figurename} blah blah...

but this gives me italic reference number like this:

We can see on picture 2.1 blah blah...

but instead I want to have:

We can see on picture 2.1 blah blah...

How can I change this in whole text?

PS I am using overleaf.

1 Answer 1

0
\documentclass{article}
\usepackage{graphicx}
\usepackage[labelfont=it]{caption}
\counterwithin{figure}{section}
\begin{document}
\section{title}
\begin{figure}
\centering
\includegraphics[width=2cm]{example-image}
\caption{title}
\label{key}
\end{figure}
This is \figurename~\ref{key} in \LaTeX.
\end{document}

enter image description here

You must log in to answer this question.

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