[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: Can you explain the behaviour of the following?



On Sun, Jan 28, 2001 at 06:35:11PM +0100, Fritz Zaucker wrote:
> The three following constructs give different results when run through
> 
>     wml -DLaTeX -p1-7,9  (exclude pass 8 for better readability of output)
> 
> <if <get-var LaTeX /> <group
> \ifx\pdfoutput\undefined % We're not running pdftex
> \documentclass[dvips,a4paper,german,11pt]{article}
> \else
> \documentclass[pdftex,a4paper,german]{article}
> \fi
> \thispagestyle{empty}
> \begin{document}
> Bla bla
> \end{document}
> >
> />
> 
> <define-tag document endtag=required>
> \ifx\pdfoutput\undefined % We're not running pdftex
> \documentclass[dvips,a4paper,german,11pt]{article}
> \else
> \documentclass[pdftex,a4paper,german]{article}
> \fi
> \thispagestyle{empty}
> \begin{document}
> %body
> \end{document}
> </define-tag>
> 
> <document>Bla bla
> </document>
> 
> <if <get-var LaTeX /> <group
> <document>Bla bla
> </document>
> />
> />
> 
> Can someone explain? Obviously I'd like the second result, but need
> the if-statement somehow.

Hi Fritz,

there are 2 problemsa here:
  a) I can't remember why <group> concatenates all input without any
     whitespace; this is different from WML 1.7.4, i have to check
     if there is a good reason for such a behaviour
  b) But even if i decide to change it, it won't work because mp4h
     does not keep track of spaces within attributes, so in this case
     you may have a space-separated list of words, which is not what you
     want.

A workaround is to replace simple tags by container tags, e.g.
  <if <get-var LaTeX /> <compound>
  \ifx\pdfoutput\undefined % We're not running pdftex
  \documentclass[dvips,a4paper,german,11pt]{article}
  \else
  ...
  </compound> />
or
  <when <get-var LaTeX />>
  \ifx\pdfoutput\undefined % We're not running pdftex
  \documentclass[dvips,a4paper,german,11pt]{article}
  \else
  ...
  </when>


-- 
Denis Barbier
WML Maintainer
______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com