[l2h] conditional text \begin{latexonly} command counter intuitive?

Ross Moore ross at maths.mq.edu.au
Fri Feb 20 23:38:05 CET 2004


Hello Jorgen,

On 21/02/2004, at 4:31 AM, Jorgen Johansson wrote:

> Hello,
>
> In the l2h manual there is an example of using
> conditional text.
>
> --------------------------snip------------------
> \newcommand{\A}{The letter A.}
> \newcommand{\B}{The letter B.}
>
> \begin{latexonly}
> \renewcommand{\A}{Not the letter A.}
> \end{latexonly}
> %begin{latexonly}
> \renewcommand{\B}{Not the letter B.}
> %end{latexonly}
>
> \begin{document}
> \A \B
> \end{document}
>
> If you process this with LATEX , the result is:
>  The letter A. Not the letter B.
>
> -------------------end snip------------------------
>
> I don't understand why
> "\renewcommand{\A}{Not the letter A.}"
> does not get processed by latex. I expected the result

It *does* get processed.
But it is limited to the scope of the {latexonly} environment.

> to be:
> "Not The letter A. Not the letter B."
> and NOT
> "The letter A. Not the letter B."
>
> What am I missing or is the \begin{latexonly} command
> somehow counter intuitive?

Compare the above with:

\newcommand{\A}{The letter A.}
\newcommand{\B}{The letter B.}

\begin{document}
\begin{latexonly}
\renewcommand{\A}{Not the letter A.}
\A \B
\end{latexonly}
%begin{latexonly}
\renewcommand{\B}{Not the letter B.}
%end{latexonly}
\A \B
\end{document}


Hope this helps,

	Ross

>
> jorgen
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail SpamGuard - Read only the mail you want.
> http://antispam.yahoo.com/tools
> _______________________________________________
> latex2html mailing list
> latex2html at tug.org
> http://tug.org/mailman/listinfo/latex2html
>
------------------------------------------------------------------------
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