Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LaTeX \url{} in italics

Tags:

url

latex

Is there a simple way of getting a LaTeX url to display in italics, i.e. emph{\url{http://www.stackoverflow.com}}? FYI I am also using \urlstyle{same} right before, which keeps the style looking like the document default style, but I don't want to set my document default to italics.

like image 949
Benjamin Avatar asked Dec 01 '25 21:12

Benjamin


2 Answers

You can easily set urls to italic text by setting the UrlFont in the document, like so:

\documentclass{article}
\usepackage{url}
\begin{document}

\def\UrlFont{\em}
\url{http://www.address.com}

\end{document}

The url should appear in italics.

like image 91
River Avatar answered Dec 04 '25 10:12

River


You might want to try setting \UrlFont to \itshape, i.e.

\renewcommand\UrlFont\itshape
like image 32
caustic Avatar answered Dec 04 '25 09:12

caustic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!