TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using a lot of links with http:// in my document, but the two slashes are too much separated, I'd like them to be more near each other. How do I do this, in a neat way?

I'm using a sans-serif font: \renewcommand{\familydefault}{\sfdefault}

share|improve this question
I would use the url-command from the url package: \url{http://tex.stackexchange.com} – polyfunc Feb 16 '13 at 13:45
That makes a monospace font, I really want the sans-serif font. – Camil Staps Feb 16 '13 at 13:48
@CamilStaps Use \urlstyle{sf}. Also have a look at tex.stackexchange.com/questions/98466/… – lockstep Feb 16 '13 at 14:42
@lockstep There’s also \urlstyle{same} which picks \familydefault and is a tiny bit more comfortable. – Qrrbrbirlbel Feb 16 '13 at 16:27
up vote 12 down vote accepted

This should do what you want. Of course, you can choose the command name (\twobar) and the amount of kerning (–0.2em):




share|improve this answer
Or \def\http://{http:/\kern-.2em/} and \http://www.x.y :) – egreg Feb 16 '13 at 13:50
Welcome to TeX.sx! – Peter Jansson Feb 16 '13 at 14:03
@egreg : Thank you. I'm not very sure about how \def works, yet, so I was more comfortable to stay with \newcommand – Bianca Lobo Feb 16 '13 at 14:08
@PeterJansson Thank you, very kind. – Bianca Lobo Feb 16 '13 at 14:09
@Tobi You sure that was a typo? I always thought ex was a height – Brent.Longborough Feb 16 '13 at 15:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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