conditional macros problem

Werner LEMBERG <[email protected]> Wed, 09 Feb 2005 05:41:07 +0100 (CET)
Newsgroups gmane.comp.tex.texinfo.pretest
Message-ID <[email protected]>
[texinfo 4.8]

I want a macro @LE which produces a real less-than sign in TeX output
and `<=' everywhere else.  I tried this simple version (which fails if
used within @math):

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

  @ifnottex
  @macro LE
  <=
  @end macro
  @end ifnottex

  ...

  a @LE{} b

This works fine for both `makeinfo' and `tex'.  Now my problem: I need
to pass --macro-expand to `makeinfo' before calling.  Consequently, it
expands to

  a <= b

instead of staying unexpanded.

Passing --iftex isn't a solution since I get fatal errors.  Any ideas?

To make this work I can only imagine to introduce a new environment
`@emacro' which makes --macro-expand register the definition without
expanding the macro.  In all other cases it behaves like @macro.

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

  @ifnottex
  @emacro LE
  <=
  @end emacro
  @end ifnottex


    Werner
_______________________________________________
Texinfo home page: http://www.gnu.org/software/texinfo/
[email protected]
http://ff0.org/mailman/listinfo/texinfo-pretest