[texinfo-pretest] conditional macros problem

Werner LEMBERG wl at gnu.org
Thu Feb 10 18:50:44 EST 2005


>     parse the contents of @tex to recognize `\gdef\foo#1{...}' being
>     a macro definition for @foo{...} which must not be expanded.
> 
> It's obviously not going to do that.

Why not?  Where's the problem?  Currently, --iftex fails for most code
in @tex environments.  We can impose restrictions how raw TeX macros
must look like to make them easily parseable by makeinfo.

> I've totally lost track of the problem.
> 
> I'm adding @le and @ge.  If that doesn't solve it, let me know.

It is helpful, but it doesn't solve the issue.  To reiterate:

  . Macro @foo shall produce a typographically enhanced symbol if used
    with TeX output.  Let's assume that texinfo doesn't provide direct
    access, so we have to use a @tex environment to create a raw TeX
    definition of @foo.

  . For all other output modes, a simple solution using @macro shall
    be provided.

Normally this works fine if you simply say `@tex \gdef\foo{...} ...'
and `@ifnottex @macro foo ...'.  Unfortunately, this method fails if
you use `makeinfo -E'.

Fortunately, I've just found a working solution using @set (thanks for
the hint)!

  @tex
  \gdef\LEmacro{$\le$}
  @end tex

  @iftex
  @set LEmacro @LEmacro
  @end iftex

  @ifnottex
  @set LEmacro <=
  @end ifnottex

  @macro LE{}
  @value{LEmacro}
  @end macro


Now `a @LE{} b' works with both `makeinfo' and `makeinfo -E', and it
gives the typographically correct result if processed with TeX.  Maybe
this should be documented...


    Werner


More information about the texinfo-pretest mailing list