bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'texi2any --pdf' isn't always equivalent to 'texi2pdf'


From: Karl Berry
Subject: Re: 'texi2any --pdf' isn't always equivalent to 'texi2pdf'
Date: Thu, 16 Oct 2014 18:01:18 GMT

Hi Ken,

    'texi2any --pdf' isn't always equivalent to 'texi2pdf'

After revisiting what we did ... it's intentional.  Valid documents are
equivalent.  Invalid documents are not equivalent.  Our idea was that if
someone runs texi2any, they probably want texi2any error messages.  So
the usual parsing is done, even though the results are not used (the
original file is just handed off to texi2dvi/texi2pdf).

Whereas if a manual has done lots of advanced TeX things because they
know all about texinfo.tex, like auctex.texi does, and doesn't want such
error messages, then fine, just run texi2dvi/pdf directly.  I
could/should make this clearer in the manual.

The stated error messages are because auctex's macros.texi looks like
this, schematically:
@ifnottex
@macro AUCTeX ...
@end macro
..
@end ifnottex
@tex
..
\gdef\AUCTeX{AUC\TeX} 
..
@end tex

texi2any --pdf naturally parses the document with @iftex and @tex in
effect, so the @ifnottex block is not read.  On the other hand, texi2any
is not TeX, so obviously it's not going to know that a TeX \gdef is
going to magically make @AUCTeX{} work.  Hence the macro @AUCTeX, so far
as texi2any can see, is undefined.

What works around this one problem is simply to eliminate the @ifnottex
conditional and always define the Texinfo macros, which texi2any can
understand.  Then the @tex block overrides those definitions.

When I did that, I got the subsequent error from this block in auctex.texi:

@iftex
@tolerance 10000 @emergencystretch 3em
@end iftex

This is because @tolerance and @emergencystretch are not Texinfo
commands.  To go through texi2any, it would need to be rewritten as

@tex
\globaldefs 1 \tolerance 10000 \emergencystretch 3em
@end tex

(I also don't think that these settings are a good idea nowadays, but
that's a different topic.)

I didn't go beyond that.  In general, you can either take the trouble to
make the manual be processable as "pure" Texinfo without the tricks that
makeinfo4 allowed, or (my recommendation) just run texi2pdf in the first
place.

Best,
Karl



reply via email to

[Prev in Thread] Current Thread [Next in Thread]