bug-texinfo
[Top][All Lists]
Advanced

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

Re: correctly placed @part before @node can be in ignored Top node


From: Gavin Smith
Subject: Re: correctly placed @part before @node can be in ignored Top node
Date: Sun, 13 Mar 2022 19:11:11 +0000

On Sun, Mar 13, 2022 at 05:31:37PM +0100, Patrice Dumas wrote:
> Hello,
> 
> @part is naturally placed before @node and therefore would be ignored
> for the first node after the Top node.  Here is an example:
> 
>  @node Top
>  @top top
> 
>  @part Part 0
> 
>  @node chapter node
>  @chapter chapter
> 

I think it makes sense to consider the node to end at the @part command.
The following change to texinfo.tex produces good output:

diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index 5dbbd6596a..20bc49654f 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -5953,7 +5953,7 @@ might help (with 'rm \jobname.?? \jobname.??s')%
 % Chapters, sections, etc.
 
 % Let's start with @part.
-\outer\parseargdef\part{\partzzz{#1}}
+\parseargdef\part{\partzzz{#1}}
 \def\partzzz#1{%
   \chapoddpage
   \null
@@ -8674,7 +8674,9 @@ might help (with 'rm \jobname.?? \jobname.??s')%
 
 % Until the next @node or @bye command, divert output to a box that is not 
 % output.
-\def\ignorenode{\setbox\dummybox\vbox\bgroup\def\node{\egroup\node}%
+\def\ignorenode{\setbox\dummybox\vbox\bgroup
+\def\part{\egroup\part}%
+\def\node{\egroup\node}%
 \ignorenodebye
 }

Do you think you can do something similar for texi2any, i.e. not include
the @part line in the preceding node?

> If, instead, the @part is between the @node and @chapter, the output is
> correct in TeX, HTML, and DocBookbut this is not what is expected.
> 
>  @node Top
>  @top top
> 
>  @node chapter node
>  @part Part I
>  @chapter chapter
> 
>  @bye

Perhaps there will be no need for this unusual ordering.

> There is an error message:
> 
> ./texi2any.pl part_node_chapter_appendix.texi 
> part_node_chapter_appendix.texi:5: warning: @node precedes @part, but parts 
> may not be associated with nodes
> 
> 
> Any idea on how to improve on that?
> 
> 
> -- 
> Pat
> 



reply via email to

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