7

By default, LaTeX typesets tildes "too high", but the hyperref package ordinarily corrects this behaviour for URLs (it vertically centers tildes, as expected). However \usepackage[T1]{fontenc} seems to break this, and the tilde is "too high" again.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\begin{document}
\url{http://lyle.smu.edu/~tspell/jaws}
\end{document}

any idea how to fix this?

0

2 Answers 2

4

If you

\usepackage{lmodern}

before

\usepackage[T1]{fontenc}

It will work as you expect. (see Correctly typesetting a tilde)

18

Package hyperref only uses package url. There the tilde can be changed via option lowtilde:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[lowtilde]{url}
\usepackage{hyperref}

\begin{document}
\url{http://lyle.smu.edu/~tspell/jaws}
\end{document}

Result

Also a tilde from a different font can be used. The following example takes the tilde from Times Roman (ghostscript's clone), e.g.:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{hyperref} 

\makeatletter
\renewcommand*{\UrlTildeSpecial}{%
  \do\~{%
    \mbox{%
      \fontfamily{ptm}\selectfont
      \textasciitilde
    }%
  }%  
}%    
\let\Url@force@Tilde\UrlTildeSpecial
\makeatother

\begin{document}
\url{http://lyle.smu.edu/~tspell/jaws}
\end{document}

Result ptm

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .