This is a follow-up question to Space between the two slashes in “http://” too big. Bianca Lobo's answer (defining a \twobar
command with proper kerning) is nice; however, it doesn't work in the argument of the \url
command of the package of the same name. How can one reduce the space between two slashes when using \url
? (I'm interested in a solution for sans-serif as well as for roman fonts.)
\documentclass{article}
\usepackage{url}
\newcommand{\twobar}{/\kern-0.2em/}
\begin{document}
\sffamily
\urlstyle{sf}
http:\twobar www.tex.stackexchange.com
\url{http://www.tex.stackexchange.com}
\url{http:\twobar www.tex.stackexchange.com}
\bigskip
\rmfamily
\urlstyle{rm}
http:\twobar www.tex.stackexchange.com
\url{http://www.tex.stackexchange.com}
\url{http:\twobar www.tex.stackexchange.com}
\end{document}
Best Answer
The
url
package has a way how to do search-and-replace in the url strings. See the self-documented code. We tweak into\Url@acthash
because it's called by\url
exactly at the right place.