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): simpler


From: Patrice Dumas
Subject: branch master updated: * tp/Texinfo/Convert/LaTeX.pm (_convert): simpler formatting of author outside of front cover.
Date: Sun, 02 Jan 2022 07:28:09 -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 e0d97c42b8 * tp/Texinfo/Convert/LaTeX.pm (_convert): simpler 
formatting of author outside of front cover.
e0d97c42b8 is described below

commit e0d97c42b81beb310206594b61fb5c3198fe0d95
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Jan 2 13:27:59 2022 +0100

    * tp/Texinfo/Convert/LaTeX.pm (_convert): simpler formatting of
    author outside of front cover.
---
 ChangeLog                                          |  5 +++++
 tp/Texinfo/Convert/LaTeX.pm                        | 26 +++++++++++++---------
 .../res_parser/formatting_latex/formatting.tex     |  9 +++++---
 3 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a3cf711551..d4ff0e307b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-01-02  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/Convert/LaTeX.pm (_convert): simpler formatting of
+       author outside of front cover.
+
 2022-01-02  Gavin Smith  <gavinsmith0123@gmail.com>
 
        No slant for @key
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index 2863f35e13..6a72089fde 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -2893,19 +2893,23 @@ sub _convert($$)
       #$result .= "\\end{flushright}\n";
       $result .= "\\rightline{$subtitle_text}\n";
     } elsif ($cmdname eq 'author') {
-      if ($self->{'titlepage_formatting'}->{'in_front_cover'}
-          and not $self->{'formatting_context'}->[-1]->{'in_quotation'}) {
-        if (not $self->{'titlepage_formatting'}->{'author'}) {
-          # first author, add space before
-          $self->{'titlepage_formatting'}->{'author'} = 1;
-          $result .= "\\vskip 0pt plus 1filll\n";
-        }
+      if (not $self->{'formatting_context'}->[-1]->{'in_quotation'}) {
         my $author_name = _convert($self,
                        {'contents' => $element->{'args'}->[0]->{'contents'}});
-        # use \leftline as in Texinfo TeX
-        # FIXME In Texinfo TeX the interline space between @author lines
-        # seems better
-        $result .= "\\leftline{\\Large \\bfseries $author_name}%\n";
+        if ($self->{'titlepage_formatting'}->{'in_front_cover'}) {
+          if (not $self->{'titlepage_formatting'}->{'author'}) {
+            # first author, add space before
+            $self->{'titlepage_formatting'}->{'author'} = 1;
+            $result .= "\\vskip 0pt plus 1filll\n";
+          }
+          # use \leftline as in Texinfo TeX
+          # FIXME In Texinfo TeX the interline space between @author lines
+          # seems better
+          $result .= "\\leftline{\\Large \\bfseries $author_name}%\n";
+        } else {
+          # author in regular text.  Should not happen
+          $result .= "{\\bfseries $author_name}%\n";
+        }
         return $result;
       }
     } elsif ($cmdname eq 'vskip') {
diff --git a/tp/tests/layout/res_parser/formatting_latex/formatting.tex 
b/tp/tests/layout/res_parser/formatting_latex/formatting.tex
index 6a3f1f4277..347753c524 100644
--- a/tp/tests/layout/res_parser/formatting_latex/formatting.tex
+++ b/tp/tests/layout/res_parser/formatting_latex/formatting.tex
@@ -345,9 +345,10 @@ but , ,\@
 \texttt{@page}\leavevmode{}\\
 \vskip4pt \hrule height 2pt width \hsize
   \vskip\titlepagebottomglue
+\endgroup
 \newpage{}%
 \phantom{blabla}%
-\leftline{\Large \bfseries author}%
+{\bfseries author}%
 
 \texttt{need 1002}
 \needspace{1.002pt}%
@@ -1511,7 +1512,7 @@ but , ,\@
 \texttt{@page}\leavevmode{}\\
 \newpage{}%
 \phantom{blabla}%
-\leftline{\Large \bfseries author}%
+{\bfseries author}%
 
 \texttt{need 1002}
 \needspace{1.002pt}%
@@ -2468,7 +2469,6 @@ Various deff lines
 \texttt{@inforef\{\}} 
 
 
-\endgroup
 \end{titlepage}
 \GNUTexinfosetsingleheader{}%
 \GNUTexinfomainmatter
@@ -2691,6 +2691,7 @@ but , ,\@
 \texttt{@page}\leavevmode{}\\
 \newpage{}%
 \phantom{blabla}%
+{\bfseries author}%
 
 \texttt{need 1002}
 \needspace{1.002pt}%
@@ -3853,6 +3854,7 @@ but , ,\@
 \texttt{@page}\leavevmode{}\\
 \newpage{}%
 \phantom{blabla}%
+{\bfseries author}%
 
 \texttt{need 1002}
 \needspace{1.002pt}%
@@ -5016,6 +5018,7 @@ but , ,\@
 \texttt{@page}\leavevmode{}\\
 \newpage{}%
 \phantom{blabla}%
+{\bfseries author}%
 
 \texttt{need 1002}
 \needspace{1.002pt}%



reply via email to

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