texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: \obeycr for @example in latex


From: Gavin D. Smith
Subject: branch master updated: \obeycr for @example in latex
Date: Sat, 14 Aug 2021 08:08:15 -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 c146459  \obeycr for @example in latex
c146459 is described below

commit c14645993d753e70651a8488b94899f71503949e
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sat Aug 14 13:07:49 2021 +0100

    \obeycr for @example in latex
---
 tp/Texinfo/Convert/LaTeX.pm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index ab428e3..e66e305 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -45,7 +45,7 @@
 # LaTeX flushleft and flushright are filled but not aligned.
 # 
 # Other non filled environments @example, @display...  No similar
-# environment found in LaTeX
+# environment found in LaTeX.  Basic implementation done with \obeycr.
 #
 # @group should also be done together with the non filled environments.
 #
@@ -1366,6 +1366,14 @@ sub _convert($$)
 
       if ($LaTeX_block_commands{$command}) {
         $result .= "\\begin{".$LaTeX_block_commands{$command}."}\n";
+      } elsif ($preformatted_commands{$command}) {
+        $result .= '\\par\\begingroup\\obeycr';
+        # TODO how to indent block?
+
+        if ($preformatted_code_commands{$command}) {
+          $result .= '\\ttfamily';
+        }
+        $result .= '\\noindent{}';
       }
       if ($block_raw_commands{$command}) {
         push @{$self->{'style_context'}->[-1]->{'context'}}, 'raw';
@@ -1840,6 +1848,8 @@ sub _convert($$)
     }
     if ($LaTeX_block_commands{$command}) {
       $result .= "\\end{".$LaTeX_block_commands{$command}."}\n";
+    } elsif ($preformatted_commands{$command}) {
+      $result .= '\\endgroup{}'; # \obeycr
     }
     if ($cell) {
       $result = '';



reply via email to

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