LaTeXML
LaTeXML copied to clipboard
llncs: Weird `\url` behavior with math
When a tilde appears in an URL, LaTeX users will frequently and incorrectly replace it with $\sim$ (since the tilde character is a non-breaking space in LaTeX).
Here's a particularly weird case:
\documentclass{llncs}
\begin{document}
\url{http://example.com/$\sim$jdoe/}
\end{document}
LaTeX output:
LaTeXML output:
<p><ref href="http://example.com/$∼$jdoe/">http://example.com/$∼$jdoe/</ref></p>
Somehow, the "math" gets lost and the dollar signs are taken literally.
There's something stranger going on. The pdf shows http://example.com/~jdoe/ but the hyperref is to http://example.com
And if you \usepackage{url}, then the pdf shows http://example.com/$\sim$jdoe/ and the hyperref is to http://example.com/$%5Csim$jdoe/ and LaTeXML has http://example.com/$\sim$jdoe/ in both places.