# \href italic font for external links

I'm trying to make a document (using lualatex) with internal and external links, using the xcolor and hyperref packages. I want my link setup like this:

• no boxes around links (underlined in a defined color would be ok)
• external links: blue color, italic font

From others here on stackexchange, I thought it should work like this:

\documentclass[11pt, oneside, a4paper]{article}
\usepackage{xcolor}
\renewcommand\UrlFont{\color{blue}\rmfamily\itshape} % I thought this should make it italic, but it does not
\newcommand{\changeurlcolor}[1]{\hypersetup{urlcolor=#1}}

\begin{document}
Here is some basic url: \href{https://tex.stackexchange.com/questions}{https://tex.stackexchange.com/questions}.
But why is my link not \textit{italic}?
\end{document}


I guess there is something very basic I'm missing?

\UrlFont is for urls, but you have here a "simple" href text, for this only the urlcolor applies. Use either \url or in the \href \nolinkurl:

\documentclass[11pt, oneside, a4paper]{article}
\usepackage{xcolor}
\renewcommand\UrlFont{\color{blue}\rmfamily\itshape} % I thought this should make it italic, but it does not
\newcommand{\changeurlcolor}[1]{\hypersetup{urlcolor=#1}}

\begin{document}
Here is some basic url:
\url{https://tex.stackexchange.com/questions}.

But why is my link not \textit{italic}?
\end{document}


• Hmm... maybe \let\hreforig=\href \renewcommand{\href}{\hreforig{#1}{\nolinkurl{#2}}}? But I didn't test it... it works only if \href is a very simple definition. I wouldn't do that, better stick with your own macro name... – Rmano Feb 14 '20 at 12:33