Re: [l2h] Tilde problem

2006-01-03 Thread Bob van der Poel



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 
deal.


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: [EMAIL PROTECTED]
WWW:   http://mypage.uniserve.com/~bvdp


___
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html


Re: [l2h] Tilde problem

2006-01-03 Thread Igor Peshansky
On Tue, 3 Jan 2006, Bob van der Poel wrote:

 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
 deal.

 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.

That's because latex2html handles \url internally, but doesn't know about
\path.

 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?

They are different characters.  url.sty redefines ~ to be
$\scriptstyle\sim$ (somewhat raised).  With \~{} in \texttt, you get the
tilde accent character.  You can define a \Tilde command as it's done in
url.sty (search for \UrlTildeSpecial), and use that in \texttt to get the
same result.

 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 :)

Someone will have to write a corresponding .perl implementation of url.sty
(non-trivial, since it uses lots of verbatim tricks).
HTH,
Igor
-- 
http://cs.nyu.edu/~pechtcha/
  |\  _,,,---,,_[EMAIL PROTECTED] | [EMAIL PROTECTED]
ZZZzz /,`.-'`'-.  ;-;;,_Igor Peshansky, Ph.D. (name changed!)
 |,4-  ) )-,_. ,\ (  `'-'   old name: Igor Pechtchanski
'---''(_/--'  `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte.
But no -- you are no fool; you call yourself a fool, there's proof enough in
that! -- Rostand, Cyrano de Bergerac

___
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html


Re: [l2h] Tilde problem

2006-01-03 Thread jos
Since we're on the topic of the classic tilde problem, I have not yet 
found a solution that works also for PDF links.  For years, I have 
been using \~{} within \htmladdnormallink{}{}, and that has worked 
fine for print and HTML, but for PDF links it fails since I started 
using, according to latex -v, pdfetex 3.14592-1.21a-2.2 (which came 
with Fedora Core 4).  I believe this version of pdfetex came with the 
recent tetex 3.0 package, and that it incorporates hyperref 
functionality.  I first generate PostScript which is then converted 
to PDF by ps2pdf.  (I can't generate PDF directly because of my 
PostScript figures.)  In the PDF link, \~{} comes out as ~%7b%7d, 
which doesn't work as a link.  Leaving out {} results in a working 
PDF link, but no '~' is printed in the footnote. To make PDF links 
work, I must leave out '{}' in the second argument to 
\htmladdnormallinkfoot{}{}, but then the footnote is printed without 
a '~', whether it is escaped with '\' or not.  Apparently, \url{} is 
not allowed in the second argument to \htmladdnormallinkfoot{}{} 
because it is a moving argument.


I notice that in the PostScript file, each link is included verbatim 
(escapes and all) in a context that knows it is a link (based on the 
associated function names /URI and /Link).  My guess is that ps2pdf 
(really ps2pdfwr, which uses ghostscript for the conversion) needs 
attention regarding link translation.


If there is a workaround in the LaTeX source, please let me know what it is!

Below is my test file in case anyone wants to try something out quickly:


%latex
\documentclass{article}
\usepackage{html}
\begin{document}
\begin{enumerate}

 \item This
\htmladdnormallinkfoot{link}{http://ccrma.stanford.edu/~jos/} uses
tilde as if it would simply work.  The link works in PDF and HTML, but
it is printed in PDF with a space in place of tilde.

 \item This
\htmladdnormallinkfoot{link}{http://ccrma.stanford.edu/\~{}jos/webpub/}
uses the standard \verb!\~{}! construct.  The PDF link fails, though it
prints ok.  The HTML link works.

 \item This
\htmladdnormallinkfoot{link}{http://ccrma.stanford.edu/\~jos/pubs.html}
uses \verb!\~! only.  The PDF link works, but it prints with the
tilde omitted (no space).  The HTML link fails (tilde omitted).

\end{enumerate}
\end{document}

At 10:24 AM 1/3/2006, Bob van der Poel wrote:



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 deal.


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: [EMAIL PROTECTED]
WWW:   http://mypage.uniserve.com/~bvdp


___
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html



___
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html


Re: [l2h] Tilde problem

2006-01-03 Thread Ian MacPhedran
On Tue, 3 Jan 2006, jos wrote:

 Since we're on the topic of the classic tilde problem, I have not yet 
 found a solution that works also for PDF links.
 
 If there is a workaround in the LaTeX source, please let me know what it is!

Use:
 http://ccrma.stanford.edu/%7Ejos/
Since % is a comment, you'll need to escape it in your source:
 http://ccrma.stanford.edu/\%7Ejos/

Ian.
-- 
  Itinerant students looking tired and sad
  I'd about had enough of that
  So we borrowed some money
  Bought a bed and cat
  And moved to the heights ...
   Jack Green Thought It Was Easy Humanesque 1980

___
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html


Re: [l2h] Tilde problem

2006-01-03 Thread Ross Moore

Hi all.

On 04/01/2006, at 6:57 AM, jos wrote:

Since we're on the topic of the classic tilde problem, I have not  
yet found a solution that works also for PDF links.


For years, I have been using \~{} within \htmladdnormallink{}{},  
and that has worked fine for
If there is a workaround in the LaTeX source, please let me know  
what it is!


Modify your LaTeX preamble as follows:


%latex
\documentclass{article}
\usepackage{html}

%begin{latexonly}
\renewcommand{\htmladdnormallinkfoot}[2]{#1{\footnote{\htmlurl{#2
%end{latexonly}


\begin{document}
\begin{enumerate}

 \item This
\htmladdnormallinkfoot{link}{http://ccrma.stanford.edu/~jos/} uses
tilde as if it would simply work.  The link works in PDF and HTML, but
it is printed in PDF with a space in place of tilde.

 \item This
\htmladdnormallinkfoot{link}{http://ccrma.stanford.edu/\~{}jos/ 
webpub/}
uses the standard \verb!\~{}! construct.  The PDF link fails,  
though it

prints ok.  The HTML link works.

 \item This
\htmladdnormallinkfoot{link}{http://ccrma.stanford.edu/\~jos/ 
pubs.html}

uses \verb!\~! only.  The PDF link works, but it prints with the
tilde omitted (no space).  The HTML link fails (tilde omitted).

\end{enumerate}
\end{document}


The 1st and 3rd examples now work in PDF, and moreover have become
active links there.


The 2nd example doesn't work however.
But that can be fixed too, by also including a redefinition of \~
that tests whether the argument is empty or not.

For example, using the following works for all 3 above examples...

%begin{latexonly}
\newcommand{\testtilde}[1]{%
  \ifx\relax#1\relax\noexpand~\else\noexpand\~#1\fi}
%
\renewcommand{\htmladdnormallinkfoot}[2]{#1{\bgroup
   \def~{\noexpand~}\let\~\testtilde
   \edef\next{\egroup \def\noexpand\thisurl{#2}}\next
  \expandafter\footnote\expandafter{\expandafter\htmlurl\expandafter
{\thisurl
%end{latexonly}


 ... but there are no guarantees of what it does when the URL
argument (that is, the #2) has active characters other than ~ .



Hope this helps,

Ross


Ross Moore [EMAIL PROTECTED]
Mathematics Department office: E7A-419
Macquarie University   tel: +61 +2 9850 8955
Sydney, Australia  2109fax: +61 +2 9850 8114



___
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html


Re: [l2h] Tilde problem

2006-01-02 Thread Les Richardson
Hi,

The tilde is a non-breaking space in TeX... can't one just escape it (\~)
and have it function normally?

Les Richardson
Open Admin for Schools


 Hi. I am using the url package and have some lines like:

   \path{~/foo}

 Without looking at the source for url I am assuming that \path is a
 special form of verbatim ... whatever, this works fine for latex.

 But, when I use latex2html the ~ disappears. In the manual for
 latex2html it does state that you need to use ~{}, but that inserts a
 visable {} in the latex output; and in latex2html both the ~ and the {}
 disappear.

 Hmm, looking further I see that I already changed the def of \path for
 latex2html to:

   \newcommand{\path}[1]{\texttt{#1}}

 So, that is wrong ... I'm lost just now. Suggestions?

 Oh, minor bug ... if one tries to make the html docs for latex2html the
 makefile will NOT create the needed 'manual' directory. Creating it by
 hand before invoking make html solves the problem.

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


 ___
 latex2html mailing list
 latex2html@tug.org
 http://tug.org/mailman/listinfo/latex2html


___
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html


Re: [l2h] Tilde problem

2006-01-02 Thread Bob van der Poel


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?

Les Richardson wrote:

Hi,

The tilde is a non-breaking space in TeX... can't one just escape it (\~)
and have it function normally?

Les Richardson
Open Admin for Schools


Hi. I am using the url package and have some lines like:

\path{~/foo}

Without looking at the source for url I am assuming that \path is a
special form of verbatim ... whatever, this works fine for latex.

But, when I use latex2html the ~ disappears. In the manual for
latex2html it does state that you need to use ~{}, but that inserts a
visable {} in the latex output; and in latex2html both the ~ and the {}
disappear.

Hmm, looking further I see that I already changed the def of \path for
latex2html to:

\newcommand{\path}[1]{\texttt{#1}}

So, that is wrong ... I'm lost just now. Suggestions?

Oh, minor bug ... if one tries to make the html docs for latex2html the
makefile will NOT create the needed 'manual' directory. Creating it by
hand before invoking make html solves the problem.

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


___
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html






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


___
latex2html mailing list
latex2html@tug.org
http://tug.org/mailman/listinfo/latex2html