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: handle FIXMEs


From: Patrice Dumas
Subject: branch master updated: tp/Texinfo/Convert/LaTeX.pm: handle FIXMEs
Date: Sun, 14 Aug 2022 06:39:35 -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 1f614cc3e1 tp/Texinfo/Convert/LaTeX.pm: handle FIXMEs
1f614cc3e1 is described below

commit 1f614cc3e134ce6103d2c147911692a8e4bd3435
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Aug 14 12:38:49 2022 +0200

    tp/Texinfo/Convert/LaTeX.pm: handle FIXMEs
---
 tp/Texinfo/Convert/LaTeX.pm | 33 +++++++++++++--------------------
 1 file changed, 13 insertions(+), 20 deletions(-)

diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index 6325243145..e492be34f8 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -269,9 +269,8 @@ foreach my $def_command (keys(%def_commands)) {
 # There are stacks that define the context.
 # formatting_context: for a whole context, for instance in a
 #                footnote.
-#       text_context: relevant for math versus text mode, raw
-#                (no text protection) and preformatted. Inside
-#                formatting_context.
+#       text_context: relevant for math versus text mode or raw
+#                (no text protection). Inside formatting_context.
 
 
 my %block_raw_commands = %format_raw_commands;
@@ -1136,7 +1135,10 @@ sub copy_options_for_convert_to_latex_math($)
 }
 
 # convert texinfo tree to LaTeX math
-# FIXME pass errors somehow?  Return converter for instance?
+# Errors are not passed, nor the converter.  However the errors and warnings
+# generated by the LaTeX conversion are few and not relevant for math tree
+# fragments.  Relevant errors should be generated when parsing the Texinfo,
+# or when converting the final LaTeX.
 sub convert_to_latex_math($$;$$)
 {
   my $self = shift;
@@ -1977,7 +1979,9 @@ sub _set_environment_options($$$)
       # but using an empty label is more consistent with the Texinfo manual
       return {$environment => 'label={}'};
     } elsif ($element->{'args'} and $element->{'args'}->[0]->{'contents'}) {
-      # FIXME start a new top context?
+      # NOTE when @itemize is in a preformatted environment (@example...),
+      # we are not in a preformatted type here, such that the conversion
+      # does not take into account the preformatted environment.  Ok or best.
       my $itemize_label = _convert($self, $element->{'args'}->[0]);
       if ($itemize_label ne '') {
         return {$environment => 'label='.$itemize_label};
@@ -2665,7 +2669,6 @@ sub _convert($$)
             push @args, undef;
           }
         }
-        # FIXME is the condition scalar(@args) == 3 really needed/ok?
         if ($cmdname eq 'inforef' and scalar(@args) == 3) {
           $args[3] = $args[2];
           $args[2] = undef;
@@ -2700,20 +2703,9 @@ sub _convert($$)
             and $self->{'labels'}
             and 
$self->{'labels'}->{$element->{'extra'}->{'node_argument'}->{'normalized'}}) {
           # internal reference
-          # FIXME or $element->{'extra'}->{'label'}?  Both should be
-          # the same, but for node_content $element->{'extra'}->{'label'}
-          # is used, while above $self->{'labels'} is used.  It could be better
-          # to be consistent
           my $reference
            = 
$self->{'labels'}->{$element->{'extra'}->{'node_argument'}->{'normalized'}};
-          my $reference_node_content;
-          if ($element->{'extra'}
-              and $element->{'extra'}->{'label'}) {
-            $reference_node_content = 
$element->{'extra'}->{'label'}->{'extra'}->{'node_content'};
-          } else {
-            # FIXME this is probably impossible
-            $reference_node_content = $args[0];
-          }
+          my $reference_node_content = $reference->{'extra'}->{'node_content'};
           
           my $section_command;
           if ($reference->{'extra'}->{'associated_section'}) {
@@ -3817,8 +3809,9 @@ sub _convert($$)
     } elsif ($cmdname eq 'quotation'
                or $cmdname eq 'smallquotation') {
       if ($element->{'extra'} and $element->{'extra'}->{'authors'}) {
-        # FIXME push a formatting context to have a formatting independent
-        # of the context in particular the preformatted context?
+        # NOTE when @quotation is in a preformatted environment (@example...),
+        # we are not in a preformatted type here, such that the conversion
+        # does not take into account the preformatted environment.  Probably 
best.
         foreach my $author (@{$element->{'extra'}->{'authors'}}) {
           $result .= _convert($self,
                  $self->gdt('@center --- @emph{{author}}',



reply via email to

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