[l2h] newbie, problem with \url + lyx

Ross Moore ross at ics.mq.edu.au
Mon Mar 22 22:31:29 CET 2004


Hello Frank,

On 23/03/2004, at 12:42 AM, Frank Altpeter wrote:

> Hello!
>
> Sorry to disturb you with this again, but i found this in the l2h web
> archive and have a question for this:
>
>
> You wrote on Wed, 13 Sep 2000 09:58:44 +1100 (EST):
>
>> There is no name clash in LaTeX, because e.g.
>> \begin_inset LatexCommand \htmlurl[LyX]{http://www.lyx.org/}
>> \end_inset
>> is translated as:
>>
>> \IfFileExists{url.sty}{\usepackage{url}}
>>                       {\newcommand{\url}{\texttt}}
>>
>> in the preamble (to cope with (La)TeX installation not knowing about
>> url.sty),
>> and:
>> LyX \url{http://www.lyx.org/}
>> in the LaTeX code.
>>
>
> Well, i'm just about having the same problem. I use LyX-1.3.4 and
> latex2html-2002.2.1_2 here, and want to define URLs in a lyx file to
> convert into html.
>
> I find the above translated line in the tex file, but it seems that
> latex2html doesn't know about \IfFileExists{} and so doesn't load
> the url.sty and therefore the URLs are not generated.

Have you loaded  html.sty  ?
This is vital for proper use of hyperlinks with LaTeX2HTML,
since it
   a.  causes certain markup to be recognised in the LaTeX source
   b.  loads the translation modules for hyperlinking constructions
and features to be used with the document translation.

This includes defining  \url  and  \htmlurl  to do the
right thing, so that it is not necessary to load other packages.

*All* documents that make significant use of hyperlinking
should  \usepackage{html}  when being translated into HTML
using  LaTeX2HTML.
That is a general rule for which there are no real exceptions,
in normal LaTeX usage.


>
> If i export the LyX file into LaTeX and try to convert the LaTeX
> file into html, i get the following eror:
>
> Unknown commands: IfFileExists

Yes. \IfFileExists  is a programming construction, which implies
that programming code (which LaTeX2HTML probably cannot deal with)
is about to be loaded.
LaTeX2HTML interprets markup; it does not execute arbitrary
(La)TeX programming code.


>
> If i remove the if routine and put a plain \usepackage{url} into it,
> the error sounds like this:
>
> No implementation found for style `url'
>
> though the url.sty is present (comes with latex2html in texinputs
> subdir).

With  html.sty  there is no need for loading  url.sty  separately.
It has nothing to add that isn't already handled by LaTeX2HTML.

>
> Do you have any idea where the problem might be?

Is there in fact a problem in the HTML that is generated ?
If not, then just ignore these "warning" messages.


If there are problems in the translation, or you really want to
suppress the warnings, then try starting your document as follows:


\documentclass......

\usepackage{html}
%begin{latexonly}
\IfFileExists{url.sty}{\usepackage{url}}
                       {\newcommand{\url}{\texttt}}
%end{latexonly}


Those special comments do not change the result when processing
with any TeX-based software, such as LaTeX or pdflatex or lyx,
but tell the Perl-based LaTeX2HTML to ignore the coding in-between.



Hope this helps,

	Ross Moore


>
> With kind regards,
>
> 	Frank Altpeter
>
>
------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia                                  fax: +61 +2 9850 8114
------------------------------------------------------------------------



More information about the latex2html mailing list