1

I am looking to change the font of only the links in the LaTeX as italics.

\hypersetup{%
linkcolor=black,
font=italics,
unicode%
}
1

It's possible to modify the definition of colorlink to change the font to italics, similar to the existing frenchlinks option (which changes the font to small caps). Note that the definition should be provided after \begin{document}, otherwise hyperref can overwrite the modifications with the default values.

MWE:

\documentclass{article}
\usepackage[colorlinks]{hyperref}
\begin{document}
\makeatletter
\def\Hy@colorlink#1{\begingroup\fontshape{it}\selectfont}%
\makeatother
See \autoref{sec:first}.
\section{First section}
\label{sec:first}
\end{document}

Result:

enter image description here

  • 1
    Maybe \fontshape{\itdefault} in case the italic shape of the current font isn't called it. – Phelype Oleinik Jun 28 '18 at 11:34
  • @PhelypeOleinik that is probably better indeed. Note that the definition of frenchlinks (on which my answer is based) uses sc and not scdefault - but that doesn't mean that it's right of course :) – Marijn Jun 28 '18 at 12:04
  • Indeed. Try this, for example: \documentclass{article} \usepackage[garamond]{mathdesign} \usepackage[frenchlinks]{hyperref} \begin{document} \section{test}\label{sec:test} See~\ref{sec:test} \end{document}. I get a warning: Font shape T1/mdugm/m/sc' undefined(Font) using T1/mdugm/m/n' instead. Should it be reported to the maintainer? – Phelype Oleinik Jun 28 '18 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.