On 11 December 2015 at 10:23, Paul Jakma <[email protected]> wrote:
> 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?
Yes, TeX error macros are inpenetrable:
./prec:8998: Missing \endgroup inserted.
<inserted text>
\endgroup
<to be read again>
$
\math ... \dotaccent =\dot \let \mathopsup =\sup $
\finishmath
l.1 @math
{\prec}\texinfoc
\scanmacro ...atspaces }\scantokens {#1\texinfoc }
\aftermacro
<argument> a\precb
{}b
...
l.16 @math {a@precb{}b}
?
It appears to be a problem with nested @math: defining the macro
without the @math works:
\input texinfo
@documentencoding UTF-8
@iftex
@macro precb{}
\\prec
@end macro
@end iftex
@ifnottex
@macro precb{}
≺
@end macro
@end ifnottex
@math {a@precb{}b}
@bye
This approach is not without its drawbacks: specifically, the
information that ≺ is a binary relation is lost when not processing as
TeX, and this would impact on the formatting.
I don't know which output formats are important to you but if HTML is
one, I believe there was a way to process TeX math code into something
viewable as HTML using one of the texi2any init files supplied with
Texinfo, possibly tex4ht.pm: I've never used them myself though.