texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: \vtop for @group


From: Gavin D. Smith
Subject: branch master updated: \vtop for @group
Date: Fri, 19 Aug 2022 18:17:20 -0400

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

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new dc95b11047 \vtop for @group
dc95b11047 is described below

commit dc95b11047f62ac68ea2a5ff52dca57b3cce8d0c
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Fri Aug 19 23:16:51 2022 +0100

    \vtop for @group
    
    * tp/Texinfo/Convert/LaTeX.pm (_convert) <@group>:
    Use \vtop for the output, even though it is not perfect.
---
 ChangeLog                                                  |  7 +++++++
 tp/Texinfo/Convert/LaTeX.pm                                | 11 +++++++++--
 tp/tests/layout/res_parser/formatting_latex/formatting.tex | 10 ++++++++++
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8b09364e93..7b03edd6a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-08-19  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       \vtop for @group
+
+       * tp/Texinfo/Convert/LaTeX.pm (_convert) <@group>:
+       Use \vtop for the output, even though it is not perfect.
+
 2022-08-19  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/Convert/HTML.pm (_css_string_accent)
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index 1cade6a413..0ecd47d062 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -28,8 +28,6 @@
 #\tableofcontents
 #}
 #
-# @group should also be added together with the non filled environments.
-#
 # There is something about form feeds to do.  There is some processing of form
 # feeds right now, which simply amounts to keeping them in ignorable spaces
 # (and with another condition that may not be relevant for LaTeX as the code
@@ -3080,6 +3078,12 @@ sub _convert($$)
         if ($LaTeX_list_environments{$cmdname}) {
           $self->{'list_environments'}->{$LaTeX_list_environments{$cmdname}} = 
1;
         }
+      } elsif ($cmdname eq 'group') {
+        $result .= "\\vtop{%\n";
+        # \vtop rather than \vbox makes vertical space above group correct.
+        # FIXME The space below it will not quite be correct.
+        # An alternative is to use a 'minipage' environment although this
+        # has difficulties with vertical space too.
       }
       if ($preformatted_commands{$cmdname}) {
         _open_preformatted_command($self, $cmdname);
@@ -3796,6 +3800,9 @@ sub _convert($$)
       foreach my $environment (reverse 
@{$LaTeX_environment_commands{$cmdname}}) {
         $result .= "\\end{".$environment."}\n";
       }
+    } elsif ($cmdname eq 'group') {
+      $result .= "\\strut}%\n";
+      # We use a \strut at the end of the \vtop to get more space beneath it.
     }
     if ($preformatted_commands{$cmdname}) {
       _close_preformatted_command($self, $cmdname);
diff --git a/tp/tests/layout/res_parser/formatting_latex/formatting.tex 
b/tp/tests/layout/res_parser/formatting_latex/formatting.tex
index 33aa6ab831..d9d5a6d139 100644
--- a/tp/tests/layout/res_parser/formatting_latex/formatting.tex
+++ b/tp/tests/layout/res_parser/formatting_latex/formatting.tex
@@ -1775,7 +1775,9 @@ Various deff lines
 \end{tabularx}
 
 
+\vtop{%
 g--roupe
+\strut}%
 
 \texttt{@ref\{node\}} node
 
@@ -3470,7 +3472,9 @@ Various deff lines
 \end{tabularx}
 
 
+\vtop{%
 g--roupe
+\strut}%
 
 \texttt{@ref\{node\}} node
 
@@ -5186,7 +5190,9 @@ Various deff lines
 \end{tabularx}
 
 
+\vtop{%
 g--roupe
+\strut}%
 
 \texttt{@ref\{node\}} node
 
@@ -6880,7 +6886,9 @@ Various deff lines
 \end{tabularx}
 
 
+\vtop{%
 g--roupe
+\strut}%
 
 \texttt{@ref\{node\}} node
 
@@ -9335,10 +9343,12 @@ Various deff lines
 \leftskip=2em\relax\ttfamily%
 
 \end{GNUTexinfopreformatted}
+\vtop{%
 \begin{GNUTexinfopreformatted}
 \leftskip=2em\relax\ttfamily%
 g{-}{-}roupe
 \end{GNUTexinfopreformatted}
+\strut}%
 \begin{GNUTexinfopreformatted}
 \leftskip=2em\relax\ttfamily%
 



reply via email to

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