[l2h] Tilde problem

Bob van der Poel bvdp at uniserve.com
Tue Jan 3 19:24:15 CET 2006

Robin Fairbairns wrote:
>> Thanks for the pointer, Les. After smacking the side of head a few times 
>> the light is slowly coming on :)
>> Yes, a tilde is a non-breaking space. So, with
>> \newcommand{\path}[1]{\texttt{#1}}
>> I can do something like \path{\~{}/foo} and it works just fine. But, if 
>> I use the \path{} from the url.sty file which provides some line 
>> breaking feature (?? I really have to go check why I'm using this I 
>> think ??) then "\" and "{}"s are printed verbatim. So, I guess I have to 
>> use the same macro for both latex and latex2html.
>> Anyone have a simple solution?
> url.sty provides "sensible" breaks that are useful in long urls.
> since it postdates the invention of l2h, there's never been an
> adequate way of dealing with it in l2h.
> if you want to have typeset urls in your documents, i would recommend
> having latex-only and html-only sections, load url in a latex-only
> section and do "proper" urls in that, and do the old-fashioned
> non-breakable \texttt-style urls in the html sections.
> otoh, if you don't need anything more complicated than your ~/foo
> things, you might as well forget url.sty altogether.
> r

Thanks for this.

I have just taken the easy way out and am using a macroized texttt{} to 
print my paths in the document. This now works fine in the l2h and latex 
version. Of course, I did have to fix the tildes, but that was not a big 

Interesting is that I have some tildes in urls, like 
\url{http://mypage.uniserve.com/~bvdp} and the tilde in this case prints 
find in both l2h and latex versions. I'm no tex-expert, but looking at 
url.sty I was assuming that \path{} and \url{} were pretty much the same.

Oh, one other interesting difference is that with the url version of 
\path{} I get a larger "~" centered (vertically) on the line; with 
\textt{} I get a smaller, raised "~". Why the difference?

I don't have any really long paths so my hack seems to work fine. But, 
it would be nice if url.sty worked with both versions. Maybe when you 
have absolutely nothing else to do :)

Bob van der Poel ** Wynndel, British Columbia, CANADA **
EMAIL: bvdp at uniserve.com
WWW:   http://mypage.uniserve.com/~bvdp

More information about the latex2html mailing list