On Thu, 10 Dec 2015, Gavin Smith wrote:

The following works

\input texinfo

@c @tracingmacros=1

@iftex
@macro precb{}
@math{\\prec}
@end macro
@end iftex
@ifnottex
@macro precb{}
≺
@end macro
@end ifnottex

a@precb{}b


@bye

Note the backslash before prec in the macro body has to be escaped with another backslash. I inverted the nesting of the macro and conditional here.

Aha :)

Note also that you can't do @macro prec because @prec is already
defined as a control sequence.

Ah..

The "@tex" and "@end tex" lines have to be on lines by themselves. Any
backslashes in a macro body should be doubled, as well.

Just adding newline to make that happen seems to break the inline format macro. So..

a @precb{} b

Seems to do the trick, just /one/ little issue is that it doesn't seem to allow you to format the whole thing as math in one go, e.g.:

  @math{a @precb{} b}

Makes stuff unhappy.

Is there a way to make that work?

Thanks very much! :)

regards,
--
Paul Jakma      [email protected]  @pjakma Key ID: 64A2FF6A
Fortune:
Anybody can win, unless there happens to be a second entry.

Reply via email to