[l2h] varioref package

Ross Moore ross@ics.mq.edu.au
Fri, 2 Feb 2001 06:21:44 +1100 (EST)


> "Martin Wolf" <martin@familiewolf.de> writes:
> 
> > Von: Martin Geisler <gimpster@gimpster.com>
> > 
> > Hi Martin,
> 
> Hi there :-)
>  
> > > But it complains that there is no style for the 'varioref' package
> > > by
> > 
> > > Could anybody point me in the right direction?
> > 
> > I don't know, whether that is a nice way, but I would try to put
> > before \begin{document}: (not tested)
> > 
> > \latex{\usepackage{varioref}}
> > \html{\newcommand{\vref}[1]{\ref{#1}}}
> 
> It works beautifully! Thanks.

Nice to hear it.

However, this isn't quite the complete solution,
as the varioref package also allows a command  \vpageref
which should be made to behave as \pageref .

Other macros defined in the package are mainly used internally,
so need not concern us.
 
> First I tried to combine the two statements into one with like this
> 
> \latexhtml{\usepackage{varioref}}{\newcommand{\vref}[1]{\ref{#1}}}
> 
> but that produces a warning about latex2html, whereas it works when
> separated. I thought that \latexhtml{a}{b} was a kind of shorthand for
> \latex{a}\html{b}?

The effect is the same, with unexpandable tokens 'a' and 'b',
or with lists of tokens or macros expanding into static lists.

However, the \usepackage command, and \newcommand definitions
are not at all "static".
These cannot be used within the \latex part of \latexhtml ,
as the order of expansion for such things is different to what
is used in standard TeX-based models.


My advice is that \latexhtml is only good for alternative text strings,
within the body of the document.

Within the preamble, when decisions are needed for which packages
to load, and expansions for macros need to be determined,
it is best to use conditional environment constructs such as:

%begin{latexonly}
 \usepackage{varioref}
%end{latexonly}

\begin{htmlonly}
 \newcommand{\vref}[1]{\ref{#1}}
\end{htmlonly}


Hope this helps,

	Ross Moore


> > Working?
> > 
> > Martin
> > 
> >   ##         ##     Martin Wolf
> >  ####   #    ##     München, Germany
> > ##  ## ###  ##      <martin@familiewolf.de>
> > ##   ### ####         http://www.familiewolf.de
> > 
> > 
> > 
> > _______________________________________________
> > latex2html mailing list
> > latex2html@tug.org
> > http://tug.org/mailman/listinfo/latex2html
> > 
> 
> -- 
> Best regards,
> Martin Geisler
> 
> Checkout http://www.gimpster.com for:
> PHP Weather => Shows the current weather on your webpages.
> PHP Shell   => A telnet-connection (almost :-) in a PHP page.
> _______________________________________________
> latex2html mailing list
> latex2html@tug.org
> http://tug.org/mailman/listinfo/latex2html