# A reference written in italics, but only locally

I'm faced with the following problem: given two references on the same line, I would like one to appear in regular shape, but the other to appear in italics. For instance:

...a similar effect was observed by \ref{abc}, but also in \ref{def} where...


the reference "abc" should appear as regular, but the reference "def" should appear in italics. How could this be achieved?

-

Does \textit{...} not work for you?

\documentclass{article}
\usepackage{hyperref}
\begin{document}
\section{Hello World}
\subsection{Subsection ABC}
\label{abc}
\subsection{Subsection DEF}
\label{def}
Normal reference \ref{abc} and reference \textit{\ref{def}} in italics.
\end{document}


-