11

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}

4
  • I would use the url-command from the url package: \url{http://tex.stackexchange.com} – rtzll Feb 16 '13 at 13:45
  • 1
    That makes a monospace font, I really want the sans-serif font. – Keelan Feb 16 '13 at 13:48
  • 3
    @CamilStaps Use \urlstyle{sf}. Also have a look at tex.stackexchange.com/questions/98466/… – lockstep Feb 16 '13 at 14:42
  • 3
    @lockstep There’s also \urlstyle{same} which picks \familydefault and is a tiny bit more comfortable. – Qrrbrbirlbel Feb 16 '13 at 16:27
12

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

\documentclass{article}
\newcommand{\twobar}{/\kern-0.2em/}
\begin{document}
{\sffamily

http://www.jb.com.br

http:\twobar{}www.jb.com.br

}
\end{document}
6
  • 7
    Or \def\http://{http:/\kern-.2em/} and \http://www.x.y :) – egreg Feb 16 '13 at 13:50
  • 1
    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
  • 1
    @Tobi You sure that was a typo? I always thought ex was a height – Brent.Longborough Feb 16 '13 at 15:32
  • 1
    It doesn’t matter matter. An ex is based on the height of the small letter x and an em is based on the width of the capital M, but it is okay to measure a width in multiples of ex and heights in multiples of em. But on may consider it good style to use ex for heights and em for widths, so I’ll change my edit to ems … – Tobi Feb 16 '13 at 16:16

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.