help-texinfo
[Top][All Lists]

## Re: [help-texinfo] trying to make a unicode math char appear in all form

 From: Gavin Smith Subject: Re: [help-texinfo] trying to make a unicode math char appear in all formats Date: Fri, 11 Dec 2015 17:34:29 +0000

On 11 December 2015 at 10:23, Paul Jakma <address@hidden> 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
$\math ... \dotaccent =\dot \let \mathopsup =\sup$
\finishmath
l.1 @math
{\prec}\texinfoc
\scanmacro ...atspaces }\scantokens {#1\texinfoc }
\aftermacro
<argument> 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

@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.