texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: LaTeX.pm: ignore top node and sectionning command


From: Patrice Dumas
Subject: branch master updated: LaTeX.pm: ignore top node and sectionning commands until next node, as Texinfo TeX does. Add tests and latex test output files.
Date: Sun, 15 Aug 2021 17:18:57 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 840d2bf  LaTeX.pm: ignore top node and sectionning commands until next 
node, as Texinfo TeX does. Add tests and latex test output files.
840d2bf is described below

commit 840d2bf82cdfbed7e0bc7db335648ef85dd5fb60
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Aug 15 23:18:00 2021 +0200

    LaTeX.pm: ignore top node and sectionning commands
    until next node, as Texinfo TeX does.
    Add tests and latex test output files.
---
 tp/Texinfo/Convert/LaTeX.pm                        |  84 ++--
 tp/t/30sectioning.t                                |  42 +-
 .../node_sectop_before_chapter_no_node.pl          | 336 ++++++++++++++
 .../node_sectop_before_chapter_no_node.tex         |  61 +++
 .../sectioning/node_sectop_before_lone_node_Top.pl |  63 ++-
 .../res_latex/node_sectop_before_lone_node_Top.tex |  68 +++
 .../sectioning/section_before_after_top_node.pl    | 412 +++++++++++++++++
 .../section_before_after_top_node_last_node.pl     | 495 +++++++++++++++++++++
 8 files changed, 1519 insertions(+), 42 deletions(-)

diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index 96f4e59..024c020 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -808,6 +808,8 @@ sub output($$)
   $self->_set_outfile();
   return undef unless $self->_create_destination_directory();
 
+  print STDERR "output_file".$self->{'output_file'}."\n";
+
   my $fh;
   if (! $self->{'output_file'} eq '') {
     $fh = $self->Texinfo::Common::open_out ($self->{'output_file'});
@@ -828,43 +830,61 @@ sub output($$)
   if ($elements) {
     # Check if the document ends with a lone Top node, that
     # will be ignored
-    my $top_node_in_end_element;
-    my $node_following_top_node_in_end_element = 0;
-    foreach my $element_content (@{$elements->[-1]->{'contents'}}) {
-      if ($element_content->{'cmdname'}
-          and $element_content->{'cmdname'} eq 'node') {
-        if ($element_content->{'extra'}->{'normalized'} eq 'Top') {
-          $top_node_in_end_element = 1;
-        } elsif ($top_node_in_end_element) {
-          $node_following_top_node_in_end_element = 1;
-          last;
-        }
-      }
-    }
-    my $converted_elements = $elements;
-    if ($top_node_in_end_element and not 
$node_following_top_node_in_end_element) {
-      # the document ends with a lone to node, replace by a text
-      # stating that the Top nodei s ignored as in Texinfo TeX
-      $converted_elements = [ @$elements ];
-      my $last_element = pop @$converted_elements;
-      my $modified_last_element = {'contents' => []};
-      foreach my $key ($last_element) {
-        if ($key ne 'contents') {
-          $modified_last_element->{$key} = $last_element->{$key};
+    my $converted_elements = [];
+    my $current_modified_element;
+    my $in_top_node = 0;
+    foreach my $element (@$elements) {
+      $current_modified_element = undef;
+      if ($in_top_node) {
+        $current_modified_element = {'contents' => []};
+        foreach my $key ($element) {
+          if ($key ne 'contents') {
+            $current_modified_element->{$key} = $element->{$key};
+          }
         }
       }
-      foreach my $element_content (@{$last_element}) {
+      foreach my $element_content (@{$element->{'contents'}}) {
         if ($element_content->{'cmdname'}
-          and $element_content->{'cmdname'} eq 'node'
-          and $element_content->{'extra'}->{'normalized'} eq 'Top') {
-          push @{$modified_last_element->{'contents'}},
-           {'text' => "(`Top' node ignored)\n", 'type' => 'ignored_top_node'};
-          last;
-        } else {
-          push @{$modified_last_element->{'contents'}}, $element_content;
+            and $element_content->{'cmdname'} eq 'node') {
+          if ($element_content->{'extra'}->{'normalized'} eq 'Top') {
+            $in_top_node = 1;
+            if (not $current_modified_element) {
+              $current_modified_element = {'contents' => []};
+              foreach my $key ($element) {
+                if ($key ne 'contents') {
+                  $current_modified_element->{$key} = $element->{$key};
+                }
+              }
+              foreach my $previous_element_content (@{$element->{'contents'}}) 
{
+                if ($previous_element_content eq $element_content) {
+                  last;
+                }
+                push @{$current_modified_element->{'contents'}}, 
+                   $previous_element_content;
+              }
+            }
+          } else {
+            $in_top_node = 0;
+          }
+        } elsif (not $in_top_node) {
+          if ($current_modified_element) {
+            push @{$current_modified_element->{'contents'}},
+              $element_content;
+          }
         }
       }
-      push @$converted_elements, $modified_last_element;
+      if ($current_modified_element) {
+        push @$converted_elements, $current_modified_element;
+      } else {
+        push @$converted_elements, $element;
+      }
+    }
+    if ($in_top_node) {
+      # This is very simple, not in a paragraph, for instance, nor in
+      # a tree piece appearing typically in element such as @node or
+      # sectionning command.
+      push @{$current_modified_element->{'contents'}},
+          {'text' => "\n(`Top' node ignored)\n", 'type' => 'ignored_top_node'};
     }
     my $result = '';
     foreach my $element (@$converted_elements) {
diff --git a/tp/t/30sectioning.t b/tp/t/30sectioning.t
index ae8e438..4334592 100644
--- a/tp/t/30sectioning.t
+++ b/tp/t/30sectioning.t
@@ -506,13 +506,23 @@ $nodes_after_top_before_chapter_text
 $nodes_after_top_before_chapter_text
 ,{}, {'USE_NODE_DIRECTIONS' => 0}
 ],
+['node_sectop_before_chapter_no_node',
+'@setfilename node_sectop_before_chapter_no_node.info
+
+@node Top
+@top top section
+
+@chapter chap
+'],
 # automatic directions are confused by the following setup
 # as @node Top next is with the first non Top node which
 # happens to be before.  Then the next node for the 
 # node before node is obtained with toplevel next which is
 # the node associated with the chapter, after the Top node!
 ['node_sectop_before_lone_node_Top',
-'@node node before
+'@setfilename node_sectop_before_lone_node_Top.info
+
+@node node before
 @top top sectionning
 
 in node before
@@ -854,6 +864,28 @@ section.
 
 @contents
 ', {}, {'CONTENTS_OUTPUT_LOCATION' => 'inline'}],
+['section_before_after_top_node_last_node',
+'@unnumbered before
+
+@node Top
+@top top section
+
+@chapter Chapter
+
+in chapter
+
+@node node after
+'],
+['section_before_after_top_node',
+'@unnumbered before
+
+@node Top
+@top top section
+
+@chapter Chapter
+
+in chapter
+'],
 ['part_node_before_top',
 '@node part node before top, Top,,Top
 @part part
@@ -1981,6 +2013,10 @@ my @xml_tests_converted_tests = ('section_before_part', 
'chapter_before_part',
   'chapter_before_and_after_part');
 
 my @latex_tests_converted_tests = ('two_nodes_at_the_end',
+  'node_sectop_before_chapter_no_node',
+  'node_sectop_before_lone_node_Top');
+
+my @file_latex_tests_converted_tests = ('node_sectop_before_chapter_no_node',
   'node_sectop_before_lone_node_Top');
 
 foreach my $test (@tests_converted) {
@@ -1990,6 +2026,8 @@ foreach my $test (@tests_converted) {
     if (grep {$_ eq $test->[0]} @xml_tests_converted_tests);
   push @{$test->[2]->{'test_formats'}}, 'latex'
     if (grep {$_ eq $test->[0]} @latex_tests_converted_tests);
+  push @{$test->[2]->{'test_formats'}}, 'file_latex'
+    if (grep {$_ eq $test->[0]} @file_latex_tests_converted_tests);
 }
 
 my @xml_tests_info_tests = ('part_chapter_after_top', 
@@ -2008,6 +2046,8 @@ my @xml_tests_info_tests = ('part_chapter_after_top',
 my @docbook_tests_info_tests = ('double_node_anchor_float');
 
 my @latex_tests_info_tests = ('chapter_between_nodes',
+  'section_before_after_top_node_last_node',
+  'section_before_after_top_node',
   'section_chapter_before_top_nodes', 'unnumbered_top_without_node_sections');
 
 foreach my $test (@tests_info) {
diff --git a/tp/t/results/sectioning/node_sectop_before_chapter_no_node.pl 
b/tp/t/results/sectioning/node_sectop_before_chapter_no_node.pl
new file mode 100644
index 0000000..533b28e
--- /dev/null
+++ b/tp/t/results/sectioning/node_sectop_before_chapter_no_node.pl
@@ -0,0 +1,336 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors 
+   %result_indices %result_sectioning %result_nodes %result_menus
+   %result_floats %result_converted %result_converted_errors 
+   %result_elements %result_directions_text);
+
+use utf8;
+
+$result_trees{'node_sectop_before_chapter_no_node'} = {
+  'contents' => [
+    {
+      'contents' => [
+        {
+          'args' => [
+            {
+              'contents' => [
+                {
+                  'parent' => {},
+                  'text' => 'node_sectop_before_chapter_no_node.info'
+                }
+              ],
+              'extra' => {
+                'spaces_after_argument' => '
+'
+              },
+              'parent' => {},
+              'type' => 'line_arg'
+            }
+          ],
+          'cmdname' => 'setfilename',
+          'extra' => {
+            'spaces_before_argument' => ' ',
+            'text_arg' => 'node_sectop_before_chapter_no_node.info'
+          },
+          'line_nr' => {
+            'file_name' => '',
+            'line_nr' => 1,
+            'macro' => ''
+          },
+          'parent' => {}
+        },
+        {
+          'parent' => {},
+          'text' => '
+',
+          'type' => 'empty_line'
+        }
+      ],
+      'parent' => {},
+      'type' => 'text_root'
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => 'Top'
+            }
+          ],
+          'extra' => {
+            'spaces_after_argument' => '
+'
+          },
+          'parent' => {},
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'node',
+      'contents' => [],
+      'extra' => {
+        'node_content' => [
+          {}
+        ],
+        'nodes_manuals' => [
+          {
+            'node_content' => [
+              {}
+            ],
+            'normalized' => 'Top'
+          }
+        ],
+        'normalized' => 'Top',
+        'spaces_before_argument' => ' '
+      },
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 3,
+        'macro' => ''
+      },
+      'parent' => {}
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => 'top section'
+            }
+          ],
+          'extra' => {
+            'spaces_after_argument' => '
+'
+          },
+          'parent' => {},
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'top',
+      'contents' => [
+        {
+          'parent' => {},
+          'text' => '
+',
+          'type' => 'empty_line'
+        }
+      ],
+      'extra' => {
+        'spaces_before_argument' => ' '
+      },
+      'level' => 0,
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 4,
+        'macro' => ''
+      },
+      'parent' => {}
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => 'chap'
+            }
+          ],
+          'extra' => {
+            'spaces_after_argument' => '
+'
+          },
+          'parent' => {},
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'chapter',
+      'contents' => [],
+      'extra' => {
+        'spaces_before_argument' => ' '
+      },
+      'level' => 1,
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 6,
+        'macro' => ''
+      },
+      'number' => 1,
+      'parent' => {}
+    }
+  ],
+  'type' => 'document_root'
+};
+$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
 = 
$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'parent'}
 = 
$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[0]{'contents'}[0];
+$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[0];
+$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[0]{'contents'}[1]{'parent'}
 = $result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[0];
+$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[0]{'parent'} = 
$result_trees{'node_sectop_before_chapter_no_node'};
+$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'}
 = 
$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[1]{'args'}[0];
+$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[1]{'args'}[0]{'parent'}
 = $result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[1];
+$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[1]{'extra'}{'node_content'}[0]
 = 
$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[1]{'args'}[0]{'contents'}[0];
+$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[1]{'extra'}{'nodes_manuals'}[0]{'node_content'}[0]
 = 
$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[1]{'args'}[0]{'contents'}[0];
+$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[1]{'parent'} = 
$result_trees{'node_sectop_before_chapter_no_node'};
+$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[2]{'args'}[0]{'contents'}[0]{'parent'}
 = 
$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[2]{'args'}[0];
+$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[2]{'args'}[0]{'parent'}
 = $result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[2];
+$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[2]{'contents'}[0]{'parent'}
 = $result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[2];
+$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[2]{'parent'} = 
$result_trees{'node_sectop_before_chapter_no_node'};
+$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[3]{'args'}[0]{'contents'}[0]{'parent'}
 = 
$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[3]{'args'}[0];
+$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[3]{'args'}[0]{'parent'}
 = $result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[3];
+$result_trees{'node_sectop_before_chapter_no_node'}{'contents'}[3]{'parent'} = 
$result_trees{'node_sectop_before_chapter_no_node'};
+
+$result_texis{'node_sectop_before_chapter_no_node'} = '@setfilename 
node_sectop_before_chapter_no_node.info
+
+@node Top
+@top top section
+
+@chapter chap
+';
+
+
+$result_texts{'node_sectop_before_chapter_no_node'} = '
+top section
+***********
+
+1 chap
+******
+';
+
+$result_sectioning{'node_sectop_before_chapter_no_node'} = {
+  'level' => -1,
+  'section_childs' => [
+    {
+      'cmdname' => 'top',
+      'extra' => {
+        'associated_node' => {
+          'cmdname' => 'node',
+          'extra' => {
+            'normalized' => 'Top',
+            'spaces_before_argument' => ' '
+          }
+        },
+        'spaces_before_argument' => ' '
+      },
+      'level' => 0,
+      'section_childs' => [
+        {
+          'cmdname' => 'chapter',
+          'extra' => {
+            'spaces_before_argument' => ' '
+          },
+          'level' => 1,
+          'number' => 1,
+          'section_up' => {},
+          'toplevel_prev' => {},
+          'toplevel_up' => {}
+        }
+      ],
+      'section_up' => {}
+    }
+  ]
+};
+$result_sectioning{'node_sectop_before_chapter_no_node'}{'section_childs'}[0]{'section_childs'}[0]{'section_up'}
 = 
$result_sectioning{'node_sectop_before_chapter_no_node'}{'section_childs'}[0];
+$result_sectioning{'node_sectop_before_chapter_no_node'}{'section_childs'}[0]{'section_childs'}[0]{'toplevel_prev'}
 = 
$result_sectioning{'node_sectop_before_chapter_no_node'}{'section_childs'}[0];
+$result_sectioning{'node_sectop_before_chapter_no_node'}{'section_childs'}[0]{'section_childs'}[0]{'toplevel_up'}
 = 
$result_sectioning{'node_sectop_before_chapter_no_node'}{'section_childs'}[0];
+$result_sectioning{'node_sectop_before_chapter_no_node'}{'section_childs'}[0]{'section_up'}
 = $result_sectioning{'node_sectop_before_chapter_no_node'};
+
+$result_nodes{'node_sectop_before_chapter_no_node'} = {
+  'cmdname' => 'node',
+  'extra' => {
+    'associated_section' => {
+      'cmdname' => 'top',
+      'extra' => {
+        'spaces_before_argument' => ' '
+      },
+      'level' => 0
+    },
+    'normalized' => 'Top',
+    'spaces_before_argument' => ' '
+  }
+};
+
+$result_menus{'node_sectop_before_chapter_no_node'} = {
+  'cmdname' => 'node',
+  'extra' => {
+    'normalized' => 'Top',
+    'spaces_before_argument' => ' '
+  }
+};
+
+$result_errors{'node_sectop_before_chapter_no_node'} = [];
+
+
+$result_floats{'node_sectop_before_chapter_no_node'} = {};
+
+
+
+$result_converted{'plaintext'}->{'node_sectop_before_chapter_no_node'} = 'top 
section
+***********
+
+1 chap
+******
+
+';
+
+
+$result_converted{'html'}->{'node_sectop_before_chapter_no_node'} = '<!DOCTYPE 
html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>top section</title>
+
+<meta name="description" content="top section">
+<meta name="keywords" content="top section">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="#Top" rel="start" title="Top">
+<style type="text/css">
+<!--
+a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em}
+a.summary-letter {text-decoration: none}
+blockquote.indentedblock {margin-right: 0em}
+div.display {margin-left: 3.2em}
+div.example {margin-left: 3.2em}
+kbd {font-style: oblique}
+pre.display {font-family: inherit}
+pre.format {font-family: inherit}
+pre.menu-comment {font-family: serif}
+pre.menu-preformatted {font-family: serif}
+span.nolinebreak {white-space: nowrap}
+span.roman {font-family: initial; font-weight: normal}
+span.sansserif {font-family: sans-serif; font-weight: normal}
+span:hover a.copiable-anchor {visibility: visible}
+ul.no-bullet {list-style: none}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+
+<div class="top" id="Top">
+<span id="top-section"></span><h1 class="top">top section</h1>
+
+<ul class="section-toc">
+<li><a href="#chap" accesskey="1">chap</a></li>
+</ul>
+<div class="chapter" id="chap">
+<h2 class="chapter">1 chap</h2>
+<hr></div>
+</div>
+
+
+
+</body>
+</html>
+';
+
+
+$result_converted{'latex'}->{'node_sectop_before_chapter_no_node'} = '
+\\chapter{chap}
+';
+
+1;
diff --git 
a/tp/t/results/sectioning/node_sectop_before_chapter_no_node/res_latex/node_sectop_before_chapter_no_node.tex
 
b/tp/t/results/sectioning/node_sectop_before_chapter_no_node/res_latex/node_sectop_before_chapter_no_node.tex
new file mode 100644
index 0000000..26a2d5b
--- /dev/null
+++ 
b/tp/t/results/sectioning/node_sectop_before_chapter_no_node/res_latex/node_sectop_before_chapter_no_node.tex
@@ -0,0 +1,61 @@
+\documentclass{book}
+\usepackage{makeidx}\makeindex
+\usepackage{amsfonts}
+\usepackage{amsmath}
+\usepackage[gen]{eurosym}
+\usepackage[T1]{fontenc}
+\usepackage{textcomp}
+\usepackage{graphicx}
+\usepackage{needspace}
+\usepackage{etoolbox}
+\usepackage{fancyhdr}
+\usepackage[utf8]{inputenc}
+
+% command that does nothing used to help with substitutions in commands
+\newcommand{\GNUTexinfoplaceholder}[1]{}
+
+% called when setting single headers
+% use \nouppercase to match with Texinfo TeX style
+\newcommand{\GNUTexinfosetsingleheader}{\pagestyle{fancy}
+\fancyhf{}
+\lhead{\nouppercase{\leftmark}}
+\rhead{\thepage}
+}
+
+% called when setting double headers
+\newcommand{\GNUTexinfosetdoubleheader}[1]{\pagestyle{fancy}
+\fancyhf{}
+\fancyhead[LE,RO]{\thepage}
+\fancyhead[RE]{#1}
+\fancyhead[LO]{\nouppercase{\leftmark}}
+}
+
+% for part and chapter, which call \thispagestyle{plain}
+\fancypagestyle{plain}{ %
+ \fancyhf{}
+ \fancyhead[LE,RO]{\thepage}
+}
+
+% match Texinfo TeX style
+\renewcommand{\headrulewidth}{0pt}%
+
+% avoid pagebreak and headings setting for a sectionning command
+\newcommand{\GNUTexinfonopagebreakheading}[2]{\let\clearpage\relax 
\let\cleardoublepage\relax \let\thispagestyle\GNUTexinfoplaceholder #1{#2}}
+
+
+\renewcommand{\includegraphics}[1]{\fbox{FIG #1}}
+
+%temporary to avoid "no line here to end" errors in test suite constructs
+\renewcommand{\obeycr}{\relax}
+
+% set default for @setchapternewpage
+\makeatletter
+\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{\GNUTexinfoplaceholder{setchapternewpage
 placeholder}\clearpage}{}{}
+\makeatother
+\GNUTexinfosetsingleheader{}%
+
+\begin{document}
+
+
+(`Top' node ignored)
+\end{document}
diff --git a/tp/t/results/sectioning/node_sectop_before_lone_node_Top.pl 
b/tp/t/results/sectioning/node_sectop_before_lone_node_Top.pl
index e03ec4e..2c58756 100644
--- a/tp/t/results/sectioning/node_sectop_before_lone_node_Top.pl
+++ b/tp/t/results/sectioning/node_sectop_before_lone_node_Top.pl
@@ -8,7 +8,43 @@ use utf8;
 $result_trees{'node_sectop_before_lone_node_Top'} = {
   'contents' => [
     {
-      'contents' => [],
+      'contents' => [
+        {
+          'args' => [
+            {
+              'contents' => [
+                {
+                  'parent' => {},
+                  'text' => 'node_sectop_before_lone_node_Top.info'
+                }
+              ],
+              'extra' => {
+                'spaces_after_argument' => '
+'
+              },
+              'parent' => {},
+              'type' => 'line_arg'
+            }
+          ],
+          'cmdname' => 'setfilename',
+          'extra' => {
+            'spaces_before_argument' => ' ',
+            'text_arg' => 'node_sectop_before_lone_node_Top.info'
+          },
+          'line_nr' => {
+            'file_name' => '',
+            'line_nr' => 1,
+            'macro' => ''
+          },
+          'parent' => {}
+        },
+        {
+          'parent' => {},
+          'text' => '
+',
+          'type' => 'empty_line'
+        }
+      ],
       'parent' => {},
       'type' => 'text_root'
     },
@@ -48,7 +84,7 @@ $result_trees{'node_sectop_before_lone_node_Top'} = {
       },
       'line_nr' => {
         'file_name' => '',
-        'line_nr' => 1,
+        'line_nr' => 3,
         'macro' => ''
       },
       'parent' => {}
@@ -102,7 +138,7 @@ $result_trees{'node_sectop_before_lone_node_Top'} = {
       'level' => 0,
       'line_nr' => {
         'file_name' => '',
-        'line_nr' => 2,
+        'line_nr' => 4,
         'macro' => ''
       },
       'parent' => {}
@@ -167,7 +203,7 @@ $result_trees{'node_sectop_before_lone_node_Top'} = {
       },
       'line_nr' => {
         'file_name' => '',
-        'line_nr' => 6,
+        'line_nr' => 8,
         'macro' => ''
       },
       'parent' => {}
@@ -208,7 +244,7 @@ $result_trees{'node_sectop_before_lone_node_Top'} = {
       },
       'line_nr' => {
         'file_name' => '',
-        'line_nr' => 10,
+        'line_nr' => 12,
         'macro' => ''
       },
       'parent' => {}
@@ -256,7 +292,7 @@ $result_trees{'node_sectop_before_lone_node_Top'} = {
       'level' => 1,
       'line_nr' => {
         'file_name' => '',
-        'line_nr' => 11,
+        'line_nr' => 13,
         'macro' => ''
       },
       'number' => 1,
@@ -265,6 +301,10 @@ $result_trees{'node_sectop_before_lone_node_Top'} = {
   ],
   'type' => 'document_root'
 };
+$result_trees{'node_sectop_before_lone_node_Top'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
 = 
$result_trees{'node_sectop_before_lone_node_Top'}{'contents'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'node_sectop_before_lone_node_Top'}{'contents'}[0]{'contents'}[0]{'args'}[0]{'parent'}
 = 
$result_trees{'node_sectop_before_lone_node_Top'}{'contents'}[0]{'contents'}[0];
+$result_trees{'node_sectop_before_lone_node_Top'}{'contents'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'node_sectop_before_lone_node_Top'}{'contents'}[0];
+$result_trees{'node_sectop_before_lone_node_Top'}{'contents'}[0]{'contents'}[1]{'parent'}
 = $result_trees{'node_sectop_before_lone_node_Top'}{'contents'}[0];
 $result_trees{'node_sectop_before_lone_node_Top'}{'contents'}[0]{'parent'} = 
$result_trees{'node_sectop_before_lone_node_Top'};
 
$result_trees{'node_sectop_before_lone_node_Top'}{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'node_sectop_before_lone_node_Top'}{'contents'}[1]{'args'}[0];
 
$result_trees{'node_sectop_before_lone_node_Top'}{'contents'}[1]{'args'}[0]{'parent'}
 = $result_trees{'node_sectop_before_lone_node_Top'}{'contents'}[1];
@@ -299,7 +339,9 @@ 
$result_trees{'node_sectop_before_lone_node_Top'}{'contents'}[5]{'contents'}[1]{
 
$result_trees{'node_sectop_before_lone_node_Top'}{'contents'}[5]{'contents'}[1]{'parent'}
 = $result_trees{'node_sectop_before_lone_node_Top'}{'contents'}[5];
 $result_trees{'node_sectop_before_lone_node_Top'}{'contents'}[5]{'parent'} = 
$result_trees{'node_sectop_before_lone_node_Top'};
 
-$result_texis{'node_sectop_before_lone_node_Top'} = '@node node before
+$result_texis{'node_sectop_before_lone_node_Top'} = '@setfilename 
node_sectop_before_lone_node_Top.info
+
+@node node before
 @top top sectionning
 
 in node before
@@ -315,7 +357,8 @@ in chap
 ';
 
 
-$result_texts{'node_sectop_before_lone_node_Top'} = 'top sectionning
+$result_texts{'node_sectop_before_lone_node_Top'} = '
+top sectionning
 ***************
 
 in node before
@@ -482,6 +525,7 @@ ul.no-bullet {list-style: none}
 </head>
 
 <body lang="en">
+
 <div class="top" id="node-before">
 <div class="header">
 <p>
@@ -522,7 +566,8 @@ Up: <a href="#node-before" accesskey="u" rel="up">top 
sectionning</a> &nbsp; </p
 ';
 
 
-$result_converted{'latex'}->{'node_sectop_before_lone_node_Top'} = 
'\\part*{top sectionning}
+$result_converted{'latex'}->{'node_sectop_before_lone_node_Top'} = '
+\\part*{top sectionning}
 \\label{anchor:node-before}%
 
 in node before
diff --git 
a/tp/t/results/sectioning/node_sectop_before_lone_node_Top/res_latex/node_sectop_before_lone_node_Top.tex
 
b/tp/t/results/sectioning/node_sectop_before_lone_node_Top/res_latex/node_sectop_before_lone_node_Top.tex
new file mode 100644
index 0000000..a76bb70
--- /dev/null
+++ 
b/tp/t/results/sectioning/node_sectop_before_lone_node_Top/res_latex/node_sectop_before_lone_node_Top.tex
@@ -0,0 +1,68 @@
+\documentclass{book}
+\usepackage{makeidx}\makeindex
+\usepackage{amsfonts}
+\usepackage{amsmath}
+\usepackage[gen]{eurosym}
+\usepackage[T1]{fontenc}
+\usepackage{textcomp}
+\usepackage{graphicx}
+\usepackage{needspace}
+\usepackage{etoolbox}
+\usepackage{fancyhdr}
+\usepackage[utf8]{inputenc}
+
+% command that does nothing used to help with substitutions in commands
+\newcommand{\GNUTexinfoplaceholder}[1]{}
+
+% called when setting single headers
+% use \nouppercase to match with Texinfo TeX style
+\newcommand{\GNUTexinfosetsingleheader}{\pagestyle{fancy}
+\fancyhf{}
+\lhead{\nouppercase{\leftmark}}
+\rhead{\thepage}
+}
+
+% called when setting double headers
+\newcommand{\GNUTexinfosetdoubleheader}[1]{\pagestyle{fancy}
+\fancyhf{}
+\fancyhead[LE,RO]{\thepage}
+\fancyhead[RE]{#1}
+\fancyhead[LO]{\nouppercase{\leftmark}}
+}
+
+% for part and chapter, which call \thispagestyle{plain}
+\fancypagestyle{plain}{ %
+ \fancyhf{}
+ \fancyhead[LE,RO]{\thepage}
+}
+
+% match Texinfo TeX style
+\renewcommand{\headrulewidth}{0pt}%
+
+% avoid pagebreak and headings setting for a sectionning command
+\newcommand{\GNUTexinfonopagebreakheading}[2]{\let\clearpage\relax 
\let\cleardoublepage\relax \let\thispagestyle\GNUTexinfoplaceholder #1{#2}}
+
+
+\renewcommand{\includegraphics}[1]{\fbox{FIG #1}}
+
+%temporary to avoid "no line here to end" errors in test suite constructs
+\renewcommand{\obeycr}{\relax}
+
+% set default for @setchapternewpage
+\makeatletter
+\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{\GNUTexinfoplaceholder{setchapternewpage
 placeholder}\clearpage}{}{}
+\makeatother
+\GNUTexinfosetsingleheader{}%
+
+\begin{document}
+
+\part*{top sectionning}
+\label{anchor:node-before}%
+
+in node before
+
+\chapter{chap}
+\label{anchor:chap}%
+
+in chap
+\end{document}
diff --git a/tp/t/results/sectioning/section_before_after_top_node.pl 
b/tp/t/results/sectioning/section_before_after_top_node.pl
new file mode 100644
index 0000000..70a1303
--- /dev/null
+++ b/tp/t/results/sectioning/section_before_after_top_node.pl
@@ -0,0 +1,412 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors 
+   %result_indices %result_sectioning %result_nodes %result_menus
+   %result_floats %result_converted %result_converted_errors 
+   %result_elements %result_directions_text);
+
+use utf8;
+
+$result_trees{'section_before_after_top_node'} = {
+  'contents' => [
+    {
+      'contents' => [],
+      'parent' => {},
+      'type' => 'text_root'
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => 'before'
+            }
+          ],
+          'extra' => {
+            'spaces_after_argument' => '
+'
+          },
+          'parent' => {},
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'unnumbered',
+      'contents' => [
+        {
+          'parent' => {},
+          'text' => '
+',
+          'type' => 'empty_line'
+        }
+      ],
+      'extra' => {
+        'spaces_before_argument' => ' '
+      },
+      'level' => 1,
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 1,
+        'macro' => ''
+      },
+      'parent' => {}
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => 'Top'
+            }
+          ],
+          'extra' => {
+            'spaces_after_argument' => '
+'
+          },
+          'parent' => {},
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'node',
+      'contents' => [],
+      'extra' => {
+        'node_content' => [
+          {}
+        ],
+        'nodes_manuals' => [
+          {
+            'node_content' => [
+              {}
+            ],
+            'normalized' => 'Top'
+          }
+        ],
+        'normalized' => 'Top',
+        'spaces_before_argument' => ' '
+      },
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 3,
+        'macro' => ''
+      },
+      'parent' => {}
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => 'top section'
+            }
+          ],
+          'extra' => {
+            'spaces_after_argument' => '
+'
+          },
+          'parent' => {},
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'top',
+      'contents' => [
+        {
+          'parent' => {},
+          'text' => '
+',
+          'type' => 'empty_line'
+        }
+      ],
+      'extra' => {
+        'spaces_before_argument' => ' '
+      },
+      'level' => 1,
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 4,
+        'macro' => ''
+      },
+      'parent' => {}
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => 'Chapter'
+            }
+          ],
+          'extra' => {
+            'spaces_after_argument' => '
+'
+          },
+          'parent' => {},
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'chapter',
+      'contents' => [
+        {
+          'parent' => {},
+          'text' => '
+',
+          'type' => 'empty_line'
+        },
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => 'in chapter
+'
+            }
+          ],
+          'parent' => {},
+          'type' => 'paragraph'
+        }
+      ],
+      'extra' => {
+        'spaces_before_argument' => ' '
+      },
+      'level' => 1,
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 6,
+        'macro' => ''
+      },
+      'number' => 1,
+      'parent' => {}
+    }
+  ],
+  'type' => 'document_root'
+};
+$result_trees{'section_before_after_top_node'}{'contents'}[0]{'parent'} = 
$result_trees{'section_before_after_top_node'};
+$result_trees{'section_before_after_top_node'}{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node'}{'contents'}[1]{'args'}[0];
+$result_trees{'section_before_after_top_node'}{'contents'}[1]{'args'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node'}{'contents'}[1];
+$result_trees{'section_before_after_top_node'}{'contents'}[1]{'contents'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node'}{'contents'}[1];
+$result_trees{'section_before_after_top_node'}{'contents'}[1]{'parent'} = 
$result_trees{'section_before_after_top_node'};
+$result_trees{'section_before_after_top_node'}{'contents'}[2]{'args'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node'}{'contents'}[2]{'args'}[0];
+$result_trees{'section_before_after_top_node'}{'contents'}[2]{'args'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node'}{'contents'}[2];
+$result_trees{'section_before_after_top_node'}{'contents'}[2]{'extra'}{'node_content'}[0]
 = 
$result_trees{'section_before_after_top_node'}{'contents'}[2]{'args'}[0]{'contents'}[0];
+$result_trees{'section_before_after_top_node'}{'contents'}[2]{'extra'}{'nodes_manuals'}[0]{'node_content'}[0]
 = 
$result_trees{'section_before_after_top_node'}{'contents'}[2]{'args'}[0]{'contents'}[0];
+$result_trees{'section_before_after_top_node'}{'contents'}[2]{'parent'} = 
$result_trees{'section_before_after_top_node'};
+$result_trees{'section_before_after_top_node'}{'contents'}[3]{'args'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node'}{'contents'}[3]{'args'}[0];
+$result_trees{'section_before_after_top_node'}{'contents'}[3]{'args'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node'}{'contents'}[3];
+$result_trees{'section_before_after_top_node'}{'contents'}[3]{'contents'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node'}{'contents'}[3];
+$result_trees{'section_before_after_top_node'}{'contents'}[3]{'parent'} = 
$result_trees{'section_before_after_top_node'};
+$result_trees{'section_before_after_top_node'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node'}{'contents'}[4]{'args'}[0];
+$result_trees{'section_before_after_top_node'}{'contents'}[4]{'args'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node'}{'contents'}[4];
+$result_trees{'section_before_after_top_node'}{'contents'}[4]{'contents'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node'}{'contents'}[4];
+$result_trees{'section_before_after_top_node'}{'contents'}[4]{'contents'}[1]{'contents'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node'}{'contents'}[4]{'contents'}[1];
+$result_trees{'section_before_after_top_node'}{'contents'}[4]{'contents'}[1]{'parent'}
 = $result_trees{'section_before_after_top_node'}{'contents'}[4];
+$result_trees{'section_before_after_top_node'}{'contents'}[4]{'parent'} = 
$result_trees{'section_before_after_top_node'};
+
+$result_texis{'section_before_after_top_node'} = '@unnumbered before
+
+@node Top
+@top top section
+
+@chapter Chapter
+
+in chapter
+';
+
+
+$result_texts{'section_before_after_top_node'} = 'before
+******
+
+top section
+***********
+
+1 Chapter
+*********
+
+in chapter
+';
+
+$result_sectioning{'section_before_after_top_node'} = {
+  'level' => 0,
+  'section_childs' => [
+    {
+      'cmdname' => 'unnumbered',
+      'extra' => {
+        'spaces_before_argument' => ' '
+      },
+      'level' => 1,
+      'section_up' => {}
+    },
+    {
+      'cmdname' => 'top',
+      'extra' => {
+        'associated_node' => {
+          'cmdname' => 'node',
+          'extra' => {
+            'normalized' => 'Top',
+            'spaces_before_argument' => ' '
+          }
+        },
+        'spaces_before_argument' => ' '
+      },
+      'level' => 1,
+      'section_prev' => {},
+      'section_up' => {},
+      'toplevel_prev' => {}
+    },
+    {
+      'cmdname' => 'chapter',
+      'extra' => {
+        'spaces_before_argument' => ' '
+      },
+      'level' => 1,
+      'number' => 1,
+      'section_prev' => {},
+      'section_up' => {},
+      'toplevel_prev' => {},
+      'toplevel_up' => {}
+    }
+  ]
+};
+$result_sectioning{'section_before_after_top_node'}{'section_childs'}[0]{'section_up'}
 = $result_sectioning{'section_before_after_top_node'};
+$result_sectioning{'section_before_after_top_node'}{'section_childs'}[1]{'section_prev'}
 = $result_sectioning{'section_before_after_top_node'}{'section_childs'}[0];
+$result_sectioning{'section_before_after_top_node'}{'section_childs'}[1]{'section_up'}
 = $result_sectioning{'section_before_after_top_node'};
+$result_sectioning{'section_before_after_top_node'}{'section_childs'}[1]{'toplevel_prev'}
 = $result_sectioning{'section_before_after_top_node'}{'section_childs'}[0];
+$result_sectioning{'section_before_after_top_node'}{'section_childs'}[2]{'section_prev'}
 = $result_sectioning{'section_before_after_top_node'}{'section_childs'}[1];
+$result_sectioning{'section_before_after_top_node'}{'section_childs'}[2]{'section_up'}
 = $result_sectioning{'section_before_after_top_node'};
+$result_sectioning{'section_before_after_top_node'}{'section_childs'}[2]{'toplevel_prev'}
 = $result_sectioning{'section_before_after_top_node'}{'section_childs'}[1];
+$result_sectioning{'section_before_after_top_node'}{'section_childs'}[2]{'toplevel_up'}
 = $result_sectioning{'section_before_after_top_node'}{'section_childs'}[1];
+
+$result_nodes{'section_before_after_top_node'} = {
+  'cmdname' => 'node',
+  'extra' => {
+    'associated_section' => {
+      'cmdname' => 'top',
+      'extra' => {
+        'spaces_before_argument' => ' '
+      },
+      'level' => 1
+    },
+    'normalized' => 'Top',
+    'spaces_before_argument' => ' '
+  }
+};
+
+$result_menus{'section_before_after_top_node'} = {
+  'cmdname' => 'node',
+  'extra' => {
+    'normalized' => 'Top',
+    'spaces_before_argument' => ' '
+  }
+};
+
+$result_errors{'section_before_after_top_node'} = [
+  {
+    'error_line' => ':4: warning: lowering the section level of @top appearing 
after a lower element
+',
+    'file_name' => '',
+    'line_nr' => 4,
+    'macro' => '',
+    'text' => 'lowering the section level of @top appearing after a lower 
element',
+    'type' => 'warning'
+  }
+];
+
+
+$result_floats{'section_before_after_top_node'} = {};
+
+
+
+$result_converted{'info'}->{'section_before_after_top_node'} = 'This is , 
produced from .
+
+before
+******
+
+
+File: ,  Node: Top,  Up: (dir)
+
+top section
+***********
+
+1 Chapter
+*********
+
+in chapter
+
+
+Tag Table:
+Node: Top42
+
+End Tag Table
+
+
+Local Variables:
+coding: utf-8
+End:
+';
+
+
+$result_converted{'html'}->{'section_before_after_top_node'} = '<!DOCTYPE html 
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>top section</title>
+
+<meta name="description" content="top section">
+<meta name="keywords" content="top section">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="#Top" rel="start" title="Top">
+<style type="text/css">
+<!--
+a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em}
+a.summary-letter {text-decoration: none}
+blockquote.indentedblock {margin-right: 0em}
+div.display {margin-left: 3.2em}
+div.example {margin-left: 3.2em}
+kbd {font-style: oblique}
+pre.display {font-family: inherit}
+pre.format {font-family: inherit}
+pre.menu-comment {font-family: serif}
+pre.menu-preformatted {font-family: serif}
+span.nolinebreak {white-space: nowrap}
+span.roman {font-family: initial; font-weight: normal}
+span.sansserif {font-family: sans-serif; font-weight: normal}
+span:hover a.copiable-anchor {visibility: visible}
+ul.no-bullet {list-style: none}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<div class="unnumbered" id="before">
+<h2 class="unnumbered">before</h2>
+
+</div>
+<div class="top" id="Top">
+<span id="top-section"></span><h2 class="unnumbered">top section</h2>
+
+</div>
+<div class="chapter" id="Chapter">
+<h2 class="chapter">1 Chapter</h2>
+
+<p>in chapter
+</p><hr></div>
+
+
+
+</body>
+</html>
+';
+
+
+$result_converted{'latex'}->{'section_before_after_top_node'} = 
'\\chapter*{before}
+
+\\chapter{Chapter}
+
+in chapter
+';
+
+1;
diff --git a/tp/t/results/sectioning/section_before_after_top_node_last_node.pl 
b/tp/t/results/sectioning/section_before_after_top_node_last_node.pl
new file mode 100644
index 0000000..dad116e
--- /dev/null
+++ b/tp/t/results/sectioning/section_before_after_top_node_last_node.pl
@@ -0,0 +1,495 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors 
+   %result_indices %result_sectioning %result_nodes %result_menus
+   %result_floats %result_converted %result_converted_errors 
+   %result_elements %result_directions_text);
+
+use utf8;
+
+$result_trees{'section_before_after_top_node_last_node'} = {
+  'contents' => [
+    {
+      'contents' => [],
+      'parent' => {},
+      'type' => 'text_root'
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => 'before'
+            }
+          ],
+          'extra' => {
+            'spaces_after_argument' => '
+'
+          },
+          'parent' => {},
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'unnumbered',
+      'contents' => [
+        {
+          'parent' => {},
+          'text' => '
+',
+          'type' => 'empty_line'
+        }
+      ],
+      'extra' => {
+        'spaces_before_argument' => ' '
+      },
+      'level' => 1,
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 1,
+        'macro' => ''
+      },
+      'parent' => {}
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => 'Top'
+            }
+          ],
+          'extra' => {
+            'spaces_after_argument' => '
+'
+          },
+          'parent' => {},
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'node',
+      'contents' => [],
+      'extra' => {
+        'node_content' => [
+          {}
+        ],
+        'nodes_manuals' => [
+          {
+            'node_content' => [
+              {}
+            ],
+            'normalized' => 'Top'
+          }
+        ],
+        'normalized' => 'Top',
+        'spaces_before_argument' => ' '
+      },
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 3,
+        'macro' => ''
+      },
+      'parent' => {}
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => 'top section'
+            }
+          ],
+          'extra' => {
+            'spaces_after_argument' => '
+'
+          },
+          'parent' => {},
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'top',
+      'contents' => [
+        {
+          'parent' => {},
+          'text' => '
+',
+          'type' => 'empty_line'
+        }
+      ],
+      'extra' => {
+        'spaces_before_argument' => ' '
+      },
+      'level' => 1,
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 4,
+        'macro' => ''
+      },
+      'parent' => {}
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => 'Chapter'
+            }
+          ],
+          'extra' => {
+            'spaces_after_argument' => '
+'
+          },
+          'parent' => {},
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'chapter',
+      'contents' => [
+        {
+          'parent' => {},
+          'text' => '
+',
+          'type' => 'empty_line'
+        },
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => 'in chapter
+'
+            }
+          ],
+          'parent' => {},
+          'type' => 'paragraph'
+        },
+        {
+          'parent' => {},
+          'text' => '
+',
+          'type' => 'empty_line'
+        }
+      ],
+      'extra' => {
+        'spaces_before_argument' => ' '
+      },
+      'level' => 1,
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 6,
+        'macro' => ''
+      },
+      'number' => 1,
+      'parent' => {}
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => 'node after'
+            }
+          ],
+          'extra' => {
+            'spaces_after_argument' => '
+'
+          },
+          'parent' => {},
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'node',
+      'contents' => [],
+      'extra' => {
+        'node_content' => [
+          {}
+        ],
+        'nodes_manuals' => [
+          {
+            'node_content' => [
+              {}
+            ],
+            'normalized' => 'node-after'
+          }
+        ],
+        'normalized' => 'node-after',
+        'spaces_before_argument' => ' '
+      },
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 10,
+        'macro' => ''
+      },
+      'parent' => {}
+    }
+  ],
+  'type' => 'document_root'
+};
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node_last_node'};
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'}
 = 
$result_trees{'section_before_after_top_node_last_node'}{'contents'}[1]{'args'}[0];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[1]{'args'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node_last_node'}{'contents'}[1];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[1]{'contents'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node_last_node'}{'contents'}[1];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[1]{'parent'}
 = $result_trees{'section_before_after_top_node_last_node'};
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[2]{'args'}[0]{'contents'}[0]{'parent'}
 = 
$result_trees{'section_before_after_top_node_last_node'}{'contents'}[2]{'args'}[0];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[2]{'args'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node_last_node'}{'contents'}[2];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[2]{'extra'}{'node_content'}[0]
 = 
$result_trees{'section_before_after_top_node_last_node'}{'contents'}[2]{'args'}[0]{'contents'}[0];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[2]{'extra'}{'nodes_manuals'}[0]{'node_content'}[0]
 = 
$result_trees{'section_before_after_top_node_last_node'}{'contents'}[2]{'args'}[0]{'contents'}[0];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[2]{'parent'}
 = $result_trees{'section_before_after_top_node_last_node'};
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[3]{'args'}[0]{'contents'}[0]{'parent'}
 = 
$result_trees{'section_before_after_top_node_last_node'}{'contents'}[3]{'args'}[0];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[3]{'args'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node_last_node'}{'contents'}[3];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[3]{'contents'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node_last_node'}{'contents'}[3];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[3]{'parent'}
 = $result_trees{'section_before_after_top_node_last_node'};
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'parent'}
 = 
$result_trees{'section_before_after_top_node_last_node'}{'contents'}[4]{'args'}[0];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[4]{'args'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node_last_node'}{'contents'}[4];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[4]{'contents'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node_last_node'}{'contents'}[4];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[4]{'contents'}[1]{'contents'}[0]{'parent'}
 = 
$result_trees{'section_before_after_top_node_last_node'}{'contents'}[4]{'contents'}[1];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[4]{'contents'}[1]{'parent'}
 = $result_trees{'section_before_after_top_node_last_node'}{'contents'}[4];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[4]{'contents'}[2]{'parent'}
 = $result_trees{'section_before_after_top_node_last_node'}{'contents'}[4];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[4]{'parent'}
 = $result_trees{'section_before_after_top_node_last_node'};
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[5]{'args'}[0]{'contents'}[0]{'parent'}
 = 
$result_trees{'section_before_after_top_node_last_node'}{'contents'}[5]{'args'}[0];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[5]{'args'}[0]{'parent'}
 = $result_trees{'section_before_after_top_node_last_node'}{'contents'}[5];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[5]{'extra'}{'node_content'}[0]
 = 
$result_trees{'section_before_after_top_node_last_node'}{'contents'}[5]{'args'}[0]{'contents'}[0];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[5]{'extra'}{'nodes_manuals'}[0]{'node_content'}[0]
 = 
$result_trees{'section_before_after_top_node_last_node'}{'contents'}[5]{'args'}[0]{'contents'}[0];
+$result_trees{'section_before_after_top_node_last_node'}{'contents'}[5]{'parent'}
 = $result_trees{'section_before_after_top_node_last_node'};
+
+$result_texis{'section_before_after_top_node_last_node'} = '@unnumbered before
+
+@node Top
+@top top section
+
+@chapter Chapter
+
+in chapter
+
+@node node after
+';
+
+
+$result_texts{'section_before_after_top_node_last_node'} = 'before
+******
+
+top section
+***********
+
+1 Chapter
+*********
+
+in chapter
+
+';
+
+$result_sectioning{'section_before_after_top_node_last_node'} = {
+  'level' => 0,
+  'section_childs' => [
+    {
+      'cmdname' => 'unnumbered',
+      'extra' => {
+        'spaces_before_argument' => ' '
+      },
+      'level' => 1,
+      'section_up' => {}
+    },
+    {
+      'cmdname' => 'top',
+      'extra' => {
+        'associated_node' => {
+          'cmdname' => 'node',
+          'extra' => {
+            'normalized' => 'Top',
+            'spaces_before_argument' => ' '
+          }
+        },
+        'spaces_before_argument' => ' '
+      },
+      'level' => 1,
+      'section_prev' => {},
+      'section_up' => {},
+      'toplevel_prev' => {}
+    },
+    {
+      'cmdname' => 'chapter',
+      'extra' => {
+        'spaces_before_argument' => ' '
+      },
+      'level' => 1,
+      'number' => 1,
+      'section_prev' => {},
+      'section_up' => {},
+      'toplevel_prev' => {},
+      'toplevel_up' => {}
+    }
+  ]
+};
+$result_sectioning{'section_before_after_top_node_last_node'}{'section_childs'}[0]{'section_up'}
 = $result_sectioning{'section_before_after_top_node_last_node'};
+$result_sectioning{'section_before_after_top_node_last_node'}{'section_childs'}[1]{'section_prev'}
 = 
$result_sectioning{'section_before_after_top_node_last_node'}{'section_childs'}[0];
+$result_sectioning{'section_before_after_top_node_last_node'}{'section_childs'}[1]{'section_up'}
 = $result_sectioning{'section_before_after_top_node_last_node'};
+$result_sectioning{'section_before_after_top_node_last_node'}{'section_childs'}[1]{'toplevel_prev'}
 = 
$result_sectioning{'section_before_after_top_node_last_node'}{'section_childs'}[0];
+$result_sectioning{'section_before_after_top_node_last_node'}{'section_childs'}[2]{'section_prev'}
 = 
$result_sectioning{'section_before_after_top_node_last_node'}{'section_childs'}[1];
+$result_sectioning{'section_before_after_top_node_last_node'}{'section_childs'}[2]{'section_up'}
 = $result_sectioning{'section_before_after_top_node_last_node'};
+$result_sectioning{'section_before_after_top_node_last_node'}{'section_childs'}[2]{'toplevel_prev'}
 = 
$result_sectioning{'section_before_after_top_node_last_node'}{'section_childs'}[1];
+$result_sectioning{'section_before_after_top_node_last_node'}{'section_childs'}[2]{'toplevel_up'}
 = 
$result_sectioning{'section_before_after_top_node_last_node'}{'section_childs'}[1];
+
+$result_nodes{'section_before_after_top_node_last_node'} = {
+  'cmdname' => 'node',
+  'extra' => {
+    'associated_section' => {
+      'cmdname' => 'top',
+      'extra' => {
+        'spaces_before_argument' => ' '
+      },
+      'level' => 1
+    },
+    'normalized' => 'Top',
+    'spaces_before_argument' => ' '
+  },
+  'node_next' => {
+    'cmdname' => 'node',
+    'extra' => {
+      'normalized' => 'node-after',
+      'spaces_before_argument' => ' '
+    },
+    'node_prev' => {}
+  }
+};
+$result_nodes{'section_before_after_top_node_last_node'}{'node_next'}{'node_prev'}
 = $result_nodes{'section_before_after_top_node_last_node'};
+
+$result_menus{'section_before_after_top_node_last_node'} = {
+  'cmdname' => 'node',
+  'extra' => {
+    'normalized' => 'Top',
+    'spaces_before_argument' => ' '
+  }
+};
+
+$result_errors{'section_before_after_top_node_last_node'} = [
+  {
+    'error_line' => ':4: warning: lowering the section level of @top appearing 
after a lower element
+',
+    'file_name' => '',
+    'line_nr' => 4,
+    'macro' => '',
+    'text' => 'lowering the section level of @top appearing after a lower 
element',
+    'type' => 'warning'
+  }
+];
+
+
+$result_floats{'section_before_after_top_node_last_node'} = {};
+
+
+
+$result_converted{'info'}->{'section_before_after_top_node_last_node'} = 'This 
is , produced from .
+
+before
+******
+
+
+File: ,  Node: Top,  Next: node after,  Up: (dir)
+
+top section
+***********
+
+1 Chapter
+*********
+
+in chapter
+
+
+File: ,  Node: node after,  Prev: Top
+
+
+
+Tag Table:
+Node: Top42
+Node: node after153
+
+End Tag Table
+
+
+Local Variables:
+coding: utf-8
+End:
+';
+
+
+$result_converted{'html'}->{'section_before_after_top_node_last_node'} = 
'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd";>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>top section</title>
+
+<meta name="description" content="top section">
+<meta name="keywords" content="top section">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<link href="#Top" rel="start" title="Top">
+<style type="text/css">
+<!--
+a.copiable-anchor {visibility: hidden; text-decoration: none; line-height: 0em}
+a.summary-letter {text-decoration: none}
+blockquote.indentedblock {margin-right: 0em}
+div.display {margin-left: 3.2em}
+div.example {margin-left: 3.2em}
+kbd {font-style: oblique}
+pre.display {font-family: inherit}
+pre.format {font-family: inherit}
+pre.menu-comment {font-family: serif}
+pre.menu-preformatted {font-family: serif}
+span.nolinebreak {white-space: nowrap}
+span.roman {font-family: initial; font-weight: normal}
+span.sansserif {font-family: sans-serif; font-weight: normal}
+span:hover a.copiable-anchor {visibility: visible}
+ul.no-bullet {list-style: none}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<div class="unnumbered" id="before">
+<div class="header">
+<p>
+Next: <a href="#node-after" accesskey="n" rel="next">node after</a> &nbsp; </p>
+</div>
+<h2 class="unnumbered">before</h2>
+
+</div>
+<div class="top" id="Top">
+<span id="top-section"></span><h2 class="unnumbered">top section</h2>
+
+</div>
+<div class="chapter" id="Chapter">
+<h2 class="chapter">1 Chapter</h2>
+
+<p>in chapter
+</p>
+<hr>
+<span id="node-after"></span><div class="header">
+<p>
+Previous: <a href="#Top" accesskey="p" rel="prev">top section</a> &nbsp; </p>
+</div>
+<h4 class="node-heading">node after</h4>
+</div>
+
+
+
+</body>
+</html>
+';
+
+
+$result_converted{'latex'}->{'section_before_after_top_node_last_node'} = 
'\\chapter*{before}
+
+\\chapter{Chapter}
+
+in chapter
+
+\\label{anchor:node-after}%
+';
+
+1;



reply via email to

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