texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/Convert/LaTeX.pm (_convert): add a c


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Convert/LaTeX.pm (_convert): add a context if in heading formatting. In heading formating, use 'error' as a string instead of a \fbox for @error formatting in contents bookmark string using \texorpdfstring{}. Based on Ulrike Fischer suggestion: https://github.com/latex3/hyperref/issues/207#issuecomment-920712424
Date: Mon, 21 Feb 2022 13:05:49 -0500

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 474312378a * tp/Texinfo/Convert/LaTeX.pm (_convert): add a context if 
in heading formatting.  In heading formating, use 'error' as a string instead 
of a \fbox for @error formatting in contents bookmark string using 
\texorpdfstring{}. Based on Ulrike Fischer suggestion: 
https://github.com/latex3/hyperref/issues/207#issuecomment-920712424
474312378a is described below

commit 474312378a825daf3abd848b48f884167b184678
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Feb 21 19:05:31 2022 +0100

    * tp/Texinfo/Convert/LaTeX.pm (_convert): add a context if
    in heading formatting.  In heading formating, use 'error'
    as a string instead of a \fbox for @error formatting in
    contents bookmark string using \texorpdfstring{}.
    Based on Ulrike Fischer suggestion:
    https://github.com/latex3/hyperref/issues/207#issuecomment-920712424
---
 ChangeLog                                          |   9 +
 tp/Texinfo/Convert/LaTeX.pm                        |  40 +-
 tp/t/latex_tests.t                                 |  15 +-
 .../latex_tests/error_in_sectioning_command.pl     | 574 +++++++++++++++++++++
 .../res_latex/error_in_sectioning_command.tex      |  66 +++
 5 files changed, 687 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 62dd1ff141..1cde6e1fed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2022-02-21  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/LaTeX.pm (_convert): add a context if
+       in heading formatting.  In heading formating, use 'error'
+       as a string instead of a \fbox for @error formatting in
+       contents bookmark string using \texorpdfstring{}.
+       Based on Ulrike Fischer suggestion:
+       https://github.com/latex3/hyperref/issues/207#issuecomment-920712424
+
 2022-02-20  Patrice Dumas  <pertusus@free.fr>
 
        * tp/texi2any.pl: call get_conf() only after conf is setup.
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index 29e46b1c1f..efdb003cf1 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -85,21 +85,6 @@
 #
 # RELEVANT BUT NOT DECISIVE
 #
-# Rendering of @error using \fbox{} in sectioning commands leads to erroneous
-# table of contents with hyperref, and with xcolor there is even a failure.
-# The hyperref maintainer does not want to handle explicitely \fbox{} in
-# sectioning commands given the rarity of this use and also because there are
-# some workarounds.
-# In particular
-# \chapter{\texorpdfstring{\fbox{fbox}}{}}
-# or
-# \pdfstringdefDisableCommands{%
-# \def\fbox#1{[#1]}%
-# }
-#
-# See
-# https://github.com/latex3/hyperref/issues/207#issuecomment-920712424
-#
 # breaking in urls is not implemented, maybe there is some support already in
 # hyperref.  @urefbreakstyle, @/
 #
@@ -2173,7 +2158,28 @@ sub _convert($$)
         }
       }
       if 
(exists($LaTeX_no_arg_brace_commands{$command_context}->{$converted_command})) {
-        $result .= 
$LaTeX_no_arg_brace_commands{$command_context}->{$converted_command};
+        if ($converted_command eq 'error'
+            and 
$self->{'formatting_context'}->[-1]->{'in_sectioning_command_heading'}) {
+          # in a sectioning command, the contents bookmark is also generated, 
and
+          # some commands do not play well with the contents bookmark.  In 
particular
+          # \fbox.  \texorpdfstring allows to specify a different output for
+          # the string in contents bookmark.
+          #
+          # TODO Note that other commands than @error are not perfect in 
contents
+          # bookmarks, in particular all the commands formatted in math 
disappear.
+          # However the other commands have no clear string representations,
+          # being removed in the contents bookmark strings is not so bad until
+          # a better solution is found
+          #
+          # See also
+          # 
https://github.com/latex3/hyperref/issues/207#issuecomment-920712424
+          $result .= '\texorpdfstring{'.
+            
$LaTeX_no_arg_brace_commands{$command_context}->{$converted_command}
+            # FIXME translation
+            .'}{error}'
+        } else {
+          $result .= 
$LaTeX_no_arg_brace_commands{$command_context}->{$converted_command};
+        }
       } else {
         die "BUG: unknown brace_no_arg_commands $cmdname $converted_command\n";
       }
@@ -2915,7 +2921,9 @@ sub _convert($$)
       if (not $self->{'formatting_context'}->[-1]->{'in_skipped_node_top'}) {
         my $heading = '';
         if ($element->{'args'}->[0]->{'contents'}) {
+          
$self->{'formatting_context'}->[-1]->{'in_sectioning_command_heading'} = 1;
           $heading = $self->_convert({'contents' => 
$element->{'args'}->[0]->{'contents'}});
+          delete 
$self->{'formatting_context'}->[-1]->{'in_sectioning_command_heading'};
         }
 
         my $section_cmd = $section_map{$cmdname};
diff --git a/tp/t/latex_tests.t b/tp/t/latex_tests.t
index d0c84ff006..dbe1ec454a 100644
--- a/tp/t/latex_tests.t
+++ b/tp/t/latex_tests.t
@@ -615,7 +615,20 @@ New para
 @printindex cp
 
 @printindex fn
-']
+'],
+['error_in_sectioning_command',
+'@setfilename error_in_sectioning_command.info
+
+@contents
+
+@node Top
+@top top section
+
+@node @code{@@error@{@}} (@error{}): Indicating an Error Message
+@chapter @code{@@error@{@}} (@error{}): Indicating an Error Message
+
+Describe @error{}.
+'],
 
 );
 
diff --git a/tp/t/results/latex_tests/error_in_sectioning_command.pl 
b/tp/t/results/latex_tests/error_in_sectioning_command.pl
new file mode 100644
index 0000000000..6dcbe8e845
--- /dev/null
+++ b/tp/t/results/latex_tests/error_in_sectioning_command.pl
@@ -0,0 +1,574 @@
+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 %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'error_in_sectioning_command'} = {
+  'contents' => [
+    {
+      'contents' => [
+        {
+          'contents' => [
+            {
+              'args' => [
+                {
+                  'contents' => [
+                    {
+                      'parent' => {},
+                      'text' => 'error_in_sectioning_command.info'
+                    }
+                  ],
+                  'extra' => {
+                    'spaces_after_argument' => '
+'
+                  },
+                  'parent' => {},
+                  'type' => 'line_arg'
+                }
+              ],
+              'cmdname' => 'setfilename',
+              'extra' => {
+                'spaces_before_argument' => ' ',
+                'text_arg' => 'error_in_sectioning_command.info'
+              },
+              'line_nr' => {
+                'file_name' => '',
+                'line_nr' => 1,
+                'macro' => ''
+              },
+              'parent' => {}
+            },
+            {
+              'parent' => {},
+              'text' => '
+',
+              'type' => 'empty_line'
+            },
+            {
+              'args' => [
+                {
+                  'parent' => {},
+                  'text' => '
+',
+                  'type' => 'misc_arg'
+                }
+              ],
+              'cmdname' => 'contents',
+              'line_nr' => {
+                'file_name' => '',
+                'line_nr' => 3,
+                'macro' => ''
+              },
+              'parent' => {}
+            },
+            {
+              'parent' => {},
+              'text' => '
+',
+              'type' => 'empty_line'
+            }
+          ],
+          'parent' => {},
+          'type' => 'preamble_before_content'
+        }
+      ],
+      'parent' => {},
+      'type' => 'before_node_section'
+    },
+    {
+      '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' => 5,
+        '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' => ' '
+      },
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 6,
+        'macro' => ''
+      },
+      'parent' => {}
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'args' => [
+                {
+                  'contents' => [
+                    {
+                      'cmdname' => '@',
+                      'parent' => {}
+                    },
+                    {
+                      'parent' => {},
+                      'text' => 'error'
+                    },
+                    {
+                      'cmdname' => '{',
+                      'parent' => {}
+                    },
+                    {
+                      'cmdname' => '}',
+                      'parent' => {}
+                    }
+                  ],
+                  'parent' => {},
+                  'type' => 'brace_command_arg'
+                }
+              ],
+              'cmdname' => 'code',
+              'contents' => [],
+              'line_nr' => {
+                'file_name' => '',
+                'line_nr' => 8,
+                'macro' => ''
+              },
+              'parent' => {}
+            },
+            {
+              'parent' => {},
+              'text' => ' ('
+            },
+            {
+              'args' => [
+                {
+                  'contents' => [],
+                  'parent' => {},
+                  'type' => 'brace_command_arg'
+                }
+              ],
+              'cmdname' => 'error',
+              'contents' => [],
+              'line_nr' => {
+                'file_name' => '',
+                'line_nr' => 8,
+                'macro' => ''
+              },
+              'parent' => {}
+            },
+            {
+              'parent' => {},
+              'text' => '): Indicating an Error Message'
+            }
+          ],
+          'extra' => {
+            'spaces_after_argument' => '
+'
+          },
+          'parent' => {},
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'node',
+      'contents' => [],
+      'extra' => {
+        'node_content' => [
+          {},
+          {},
+          {},
+          {}
+        ],
+        'nodes_manuals' => [
+          {
+            'node_content' => [
+              {},
+              {},
+              {},
+              {}
+            ],
+            'normalized' => 
'_0040error_007b_007d-_0028error_002d_002d_003e_0029_003a-Indicating-an-Error-Message'
+          }
+        ],
+        'normalized' => 
'_0040error_007b_007d-_0028error_002d_002d_003e_0029_003a-Indicating-an-Error-Message',
+        'spaces_before_argument' => ' '
+      },
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 8,
+        'macro' => ''
+      },
+      'parent' => {}
+    },
+    {
+      'args' => [
+        {
+          'contents' => [
+            {
+              'args' => [
+                {
+                  'contents' => [
+                    {
+                      'cmdname' => '@',
+                      'parent' => {}
+                    },
+                    {
+                      'parent' => {},
+                      'text' => 'error'
+                    },
+                    {
+                      'cmdname' => '{',
+                      'parent' => {}
+                    },
+                    {
+                      'cmdname' => '}',
+                      'parent' => {}
+                    }
+                  ],
+                  'parent' => {},
+                  'type' => 'brace_command_arg'
+                }
+              ],
+              'cmdname' => 'code',
+              'contents' => [],
+              'line_nr' => {
+                'file_name' => '',
+                'line_nr' => 9,
+                'macro' => ''
+              },
+              'parent' => {}
+            },
+            {
+              'parent' => {},
+              'text' => ' ('
+            },
+            {
+              'args' => [
+                {
+                  'contents' => [],
+                  'parent' => {},
+                  'type' => 'brace_command_arg'
+                }
+              ],
+              'cmdname' => 'error',
+              'contents' => [],
+              'line_nr' => {
+                'file_name' => '',
+                'line_nr' => 9,
+                'macro' => ''
+              },
+              'parent' => {}
+            },
+            {
+              'parent' => {},
+              'text' => '): Indicating an Error Message'
+            }
+          ],
+          'extra' => {
+            'spaces_after_argument' => '
+'
+          },
+          'parent' => {},
+          'type' => 'line_arg'
+        }
+      ],
+      'cmdname' => 'chapter',
+      'contents' => [
+        {
+          'parent' => {},
+          'text' => '
+',
+          'type' => 'empty_line'
+        },
+        {
+          'contents' => [
+            {
+              'parent' => {},
+              'text' => 'Describe '
+            },
+            {
+              'args' => [
+                {
+                  'contents' => [],
+                  'parent' => {},
+                  'type' => 'brace_command_arg'
+                }
+              ],
+              'cmdname' => 'error',
+              'contents' => [],
+              'line_nr' => {
+                'file_name' => '',
+                'line_nr' => 11,
+                'macro' => ''
+              },
+              'parent' => {}
+            },
+            {
+              'parent' => {},
+              'text' => '.
+'
+            }
+          ],
+          'parent' => {},
+          'type' => 'paragraph'
+        }
+      ],
+      'extra' => {
+        'spaces_before_argument' => ' '
+      },
+      'line_nr' => {
+        'file_name' => '',
+        'line_nr' => 9,
+        'macro' => ''
+      },
+      'parent' => {}
+    }
+  ],
+  'type' => 'document_root'
+};
+$result_trees{'error_in_sectioning_command'}{'contents'}[0]{'contents'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[0]{'contents'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[0]{'contents'}[0]{'contents'}[0]{'args'}[0]{'parent'}
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[0]{'contents'}[0]{'contents'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[0]{'contents'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[0]{'contents'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[0]{'contents'}[0]{'contents'}[1]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[0]{'contents'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[0]{'contents'}[0]{'contents'}[2]{'args'}[0]{'parent'}
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[0]{'contents'}[0]{'contents'}[2];
+$result_trees{'error_in_sectioning_command'}{'contents'}[0]{'contents'}[0]{'contents'}[2]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[0]{'contents'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[0]{'contents'}[0]{'contents'}[3]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[0]{'contents'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[0]{'parent'} = 
$result_trees{'error_in_sectioning_command'};
+$result_trees{'error_in_sectioning_command'}{'contents'}[1]{'args'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[1]{'args'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[1]{'args'}[0]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[1];
+$result_trees{'error_in_sectioning_command'}{'contents'}[1]{'extra'}{'node_content'}[0]
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[1]{'args'}[0]{'contents'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[1]{'extra'}{'nodes_manuals'}[0]{'node_content'}[0]
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[1]{'args'}[0]{'contents'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[1]{'parent'} = 
$result_trees{'error_in_sectioning_command'};
+$result_trees{'error_in_sectioning_command'}{'contents'}[2]{'args'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[2]{'args'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[2]{'args'}[0]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[2];
+$result_trees{'error_in_sectioning_command'}{'contents'}[2]{'contents'}[0]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[2];
+$result_trees{'error_in_sectioning_command'}{'contents'}[2]{'parent'} = 
$result_trees{'error_in_sectioning_command'};
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[0]{'args'}[0]{'contents'}[1]{'parent'}
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[0]{'args'}[0]{'contents'}[2]{'parent'}
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[0]{'args'}[0]{'contents'}[3]{'parent'}
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[0]{'args'}[0]{'parent'}
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[1]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[2]{'args'}[0]{'parent'}
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[2];
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[2]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[3]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[3];
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'extra'}{'node_content'}[0]
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'extra'}{'node_content'}[1]
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[1];
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'extra'}{'node_content'}[2]
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[2];
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'extra'}{'node_content'}[3]
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[3];
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'extra'}{'nodes_manuals'}[0]{'node_content'}[0]
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'extra'}{'nodes_manuals'}[0]{'node_content'}[1]
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[1];
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'extra'}{'nodes_manuals'}[0]{'node_content'}[2]
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[2];
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'extra'}{'nodes_manuals'}[0]{'node_content'}[3]
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'args'}[0]{'contents'}[3];
+$result_trees{'error_in_sectioning_command'}{'contents'}[3]{'parent'} = 
$result_trees{'error_in_sectioning_command'};
+$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'args'}[0]{'contents'}[0]{'parent'}
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'args'}[0]{'contents'}[1]{'parent'}
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'args'}[0]{'contents'}[2]{'parent'}
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'args'}[0]{'contents'}[3]{'parent'}
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'args'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'args'}[0]{'parent'}
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0]{'contents'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0]{'contents'}[0]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0]{'contents'}[1]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0]{'contents'}[2]{'args'}[0]{'parent'}
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0]{'contents'}[2];
+$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0]{'contents'}[2]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0]{'contents'}[3]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0];
+$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'args'}[0]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[4];
+$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'contents'}[0]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[4];
+$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'contents'}[1]{'contents'}[0]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[4]{'contents'}[1];
+$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'contents'}[1]{'contents'}[1]{'args'}[0]{'parent'}
 = 
$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'contents'}[1]{'contents'}[1];
+$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'contents'}[1]{'contents'}[1]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[4]{'contents'}[1];
+$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'contents'}[1]{'contents'}[2]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[4]{'contents'}[1];
+$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'contents'}[1]{'parent'}
 = $result_trees{'error_in_sectioning_command'}{'contents'}[4];
+$result_trees{'error_in_sectioning_command'}{'contents'}[4]{'parent'} = 
$result_trees{'error_in_sectioning_command'};
+
+$result_texis{'error_in_sectioning_command'} = '@setfilename 
error_in_sectioning_command.info
+
+@contents
+
+@node Top
+@top top section
+
+@node @code{@@error@{@}} (@error{}): Indicating an Error Message
+@chapter @code{@@error@{@}} (@error{}): Indicating an Error Message
+
+Describe @error{}.
+';
+
+
+$result_texts{'error_in_sectioning_command'} = '
+
+top section
+***********
+
+1 @error{} (error-->): Indicating an Error Message
+**************************************************
+
+Describe error-->.
+';
+
+$result_sectioning{'error_in_sectioning_command'} = {
+  'structure' => {
+    'section_childs' => [
+      {
+        'cmdname' => 'top',
+        'extra' => {
+          'associated_node' => {
+            'cmdname' => 'node',
+            'extra' => {
+              'normalized' => 'Top'
+            },
+            'structure' => {}
+          }
+        },
+        'structure' => {
+          'section_childs' => [
+            {
+              'cmdname' => 'chapter',
+              'extra' => {
+                'associated_node' => {
+                  'cmdname' => 'node',
+                  'extra' => {
+                    'normalized' => 
'_0040error_007b_007d-_0028error_002d_002d_003e_0029_003a-Indicating-an-Error-Message'
+                  },
+                  'structure' => {}
+                }
+              },
+              'structure' => {
+                'section_level' => 1,
+                'section_number' => 1,
+                'section_up' => {},
+                'toplevel_prev' => {},
+                'toplevel_up' => {}
+              }
+            }
+          ],
+          'section_level' => 0,
+          'section_up' => {}
+        }
+      }
+    ],
+    'section_level' => -1
+  }
+};
+$result_sectioning{'error_in_sectioning_command'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0]{'structure'}{'section_up'}
 = 
$result_sectioning{'error_in_sectioning_command'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'error_in_sectioning_command'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0]{'structure'}{'toplevel_prev'}
 = 
$result_sectioning{'error_in_sectioning_command'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'error_in_sectioning_command'}{'structure'}{'section_childs'}[0]{'structure'}{'section_childs'}[0]{'structure'}{'toplevel_up'}
 = 
$result_sectioning{'error_in_sectioning_command'}{'structure'}{'section_childs'}[0];
+$result_sectioning{'error_in_sectioning_command'}{'structure'}{'section_childs'}[0]{'structure'}{'section_up'}
 = $result_sectioning{'error_in_sectioning_command'};
+
+$result_nodes{'error_in_sectioning_command'} = {
+  'cmdname' => 'node',
+  'extra' => {
+    'associated_section' => {
+      'cmdname' => 'top',
+      'extra' => {},
+      'structure' => {}
+    },
+    'normalized' => 'Top'
+  },
+  'structure' => {
+    'node_next' => {
+      'cmdname' => 'node',
+      'extra' => {
+        'associated_section' => {
+          'cmdname' => 'chapter',
+          'extra' => {},
+          'structure' => {
+            'section_number' => 1
+          }
+        },
+        'normalized' => 
'_0040error_007b_007d-_0028error_002d_002d_003e_0029_003a-Indicating-an-Error-Message'
+      },
+      'structure' => {
+        'node_prev' => {},
+        'node_up' => {}
+      }
+    }
+  }
+};
+$result_nodes{'error_in_sectioning_command'}{'structure'}{'node_next'}{'structure'}{'node_prev'}
 = $result_nodes{'error_in_sectioning_command'};
+$result_nodes{'error_in_sectioning_command'}{'structure'}{'node_next'}{'structure'}{'node_up'}
 = $result_nodes{'error_in_sectioning_command'};
+
+$result_menus{'error_in_sectioning_command'} = {
+  'cmdname' => 'node',
+  'extra' => {
+    'normalized' => 'Top'
+  },
+  'structure' => {}
+};
+
+$result_errors{'error_in_sectioning_command'} = [];
+
+
+$result_floats{'error_in_sectioning_command'} = {};
+
+
+
+$result_converted{'latex'}->{'error_in_sectioning_command'} = '
+
+\\begin{document}
+\\tableofcontents\\newpage
+\\chapter{\\texttt{@error\\{\\}} (\\texorpdfstring{\\fbox{error}}{error}): 
Indicating an Error Message}
+\\label{anchor:_0040error_007b_007d-_0028error_002d_002d_003e_0029_003a-Indicating-an-Error-Message}%
+
+Describe \\fbox{error}.
+';
+
+1;
diff --git 
a/tp/t/results/latex_tests/error_in_sectioning_command/res_latex/error_in_sectioning_command.tex
 
b/tp/t/results/latex_tests/error_in_sectioning_command/res_latex/error_in_sectioning_command.tex
new file mode 100644
index 0000000000..344a53add1
--- /dev/null
+++ 
b/tp/t/results/latex_tests/error_in_sectioning_command/res_latex/error_in_sectioning_command.tex
@@ -0,0 +1,66 @@
+\documentclass{book}
+\usepackage{amsfonts}
+\usepackage{amsmath}
+\usepackage[gen]{eurosym}
+\usepackage[T1]{fontenc}
+\usepackage{textcomp}
+\usepackage{graphicx}
+\usepackage{etoolbox}
+\usepackage{titleps}
+\usepackage{float}
+% use hidelinks to remove boxes around links to be similar with Texinfo TeX
+\usepackage[hidelinks]{hyperref}
+\usepackage[utf8]{inputenc}
+
+\newcommand{\GNUTexinfosettitle}{No Title}%
+
+% redefine the \mainmatter command such that it does not clear page
+% as if in double page
+\makeatletter
+\renewcommand\mainmatter{\clearpage\@mainmattertrue\pagenumbering{arabic}}
+\makeatother
+% add command aliases to use the same command in book and report
+\newcommand\GNUTexinfomainmatter{\mainmatter}
+\newcommand\GNUTexinfofrontmatter{\frontmatter}
+% command that does nothing used to help with substitutions in commands
+\newcommand{\GNUTexinfoplaceholder}[1]{}
+
+% plain page style, for part and chapter, which call \thispagestyle{plain}
+\renewpagestyle{plain}{\sethead[\thepage{}][][]
+                             {}{}{\thepage{}}}
+
+% single header
+\newpagestyle{single}{\sethead[\chaptername{} \thechapter{} 
\chaptertitle{}][][\thepage]
+                              {\chaptername{} \thechapter{} 
\chaptertitle{}}{}{\thepage}}
+
+% called when setting single headers
+\newcommand{\GNUTexinfosetsingleheader}{\pagestyle{single}}
+
+% double header
+\newpagestyle{double}{\sethead[\thepage{}][][\GNUTexinfosettitle]
+                              {\chaptername{} \thechapter{} 
\chaptertitle{}}{}{\thepage}}
+
+% called when setting double headers
+\newcommand{\GNUTexinfosetdoubleheader}{\pagestyle{double}}
+
+
+% 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}}
+
+% set default for @setchapternewpage
+\makeatletter
+\patchcmd{\chapter}{\if@openright\cleardoublepage\else\clearpage\fi}{\GNUTexinfoplaceholder{setchapternewpage
 placeholder}\clearpage}{}{}
+\makeatother
+\GNUTexinfosetsingleheader{}%
+
+
+
+\begin{document}
+\tableofcontents\newpage
+\chapter{\texttt{@error\{\}} (\texorpdfstring{\fbox{error}}{error}): 
Indicating an Error Message}
+\label{anchor:_0040error_007b_007d-_0028error_002d_002d_003e_0029_003a-Indicating-an-Error-Message}%
+
+Describe \fbox{error}.
+\end{document}



reply via email to

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