texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: Warn for @shortcontents in LaTeX


From: Gavin D. Smith
Subject: branch master updated: Warn for @shortcontents in LaTeX
Date: Sat, 01 Oct 2022 15:07:52 -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 78863da1ad Warn for @shortcontents in LaTeX
78863da1ad is described below

commit 78863da1adc3ce81c6728745fa6d2184f1e01216
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sat Oct 1 20:07:43 2022 +0100

    Warn for @shortcontents in LaTeX
    
    * tp/Texinfo/Convert/LaTeX.pm (convert) <@shortcontents>:
    Issue a warning if it @shortcontents or @summarycontents
    is used.  Add a comment in TODO section saying that we may
    not have to implement it.
---
 ChangeLog                                          |  9 +++++++
 tp/Texinfo/Convert/LaTeX.pm                        | 29 ++++++++++++++--------
 .../res_parser/formatting_latex/formatting.2       |  1 +
 3 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4e59708a85..8d4dcb290a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2022-10-01  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       Warn for @shortcontents in LaTeX
+
+       * tp/Texinfo/Convert/LaTeX.pm (convert) <@shortcontents>:
+       Issue a warning if it @shortcontents or @summarycontents
+       is used.  Add a comment in TODO section saying that we may
+       not have to implement it.
+
 2022-10-01  Gavin Smith  <gavinsmith0123@gmail.com>
 
        * tp/Texinfo/XS/parsetexi/api.c: Initialize a variable that
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index bca7312805..b42c920c0f 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -17,17 +17,6 @@
 #
 # TODO
 #
-# @shortcontent is not implemented.  Tried shorttoc package but it
-# has two limitations that are not in Texinfo, need a main \tableofcontents
-# and need to be before @contents.  A code snippet looked good for a
-# @shortcontents after @contents, but not before:
-#{
-#\renewcommand*{\contentsname}{Short contents}
-#\setcounter{tocdepth}{0}
-#\expandafter\def\csname 
@starttoc\endcsname#1{\InputIfFileExists{\jobname.#1}{}{}}%
-#\tableofcontents
-#}
-#
 # LaTeX seems to always break at -, and never at _.  If @allowcodebreaks
 # is true \_ should be set to be a possible break point.  Seems that it
 # may be done with something like:
@@ -99,6 +88,20 @@
 # We can also imagine people wanting different euro symbols.
 # Maybe each one of the default \usepackage's should be configurable.
 #
+# @shortcontents is not implemented.  Tried shorttoc package but it
+# has two limitations that are not in Texinfo, need a main \tableofcontents
+# and need to be before @contents.  A code snippet looked good for a
+# @shortcontents after @contents, but not before:
+#{
+#\renewcommand*{\contentsname}{Short contents}
+#\setcounter{tocdepth}{0}
+#\expandafter\def\csname 
@starttoc\endcsname#1{\InputIfFileExists{\jobname.#1}{}{}}%
+#\tableofcontents
+#}
+#We could treat LaTeX like HTML with CONTENTS_OUTPUT_LOCATION=aftertop and
+#ignore both @contents and @shortcontents.
+#
+#
 # CAN WAIT
 #
 # Use texinfo.cnf?  Here?  in texi2any.pl?
@@ -3461,6 +3464,10 @@ sub _convert($$)
       }
       return $result;
     } elsif ($cmdname eq 'shortcontents' or $cmdname eq 'summarycontents') {
+      $self->line_warn($self,
+                     sprintf(__("\@%s not implemented for LaTeX output"),
+                             $cmdname),
+                       $element->{'source_info'});
       if ($self->{'structuring'}
             and $self->{'structuring'}->{'sectioning_root'}) {
         # TODO see notes at the beginning
diff --git a/tp/tests/layout/res_parser/formatting_latex/formatting.2 
b/tp/tests/layout/res_parser/formatting_latex/formatting.2
index 40da37a516..957ff7ea9b 100644
--- a/tp/tests/layout/res_parser/formatting_latex/formatting.2
+++ b/tp/tests/layout/res_parser/formatting_latex/formatting.2
@@ -331,3 +331,4 @@ formatting.texi:73: warning: @image file `f-ile' (for 
LaTeX) not found (possibly
 formatting.texi:73: warning: @image file `f-ile' (for LaTeX) not found 
(possibly involving @mymacro)
 formatting.texi:73: warning: @image file `f--ile@.' (for LaTeX) not found 
(possibly involving @mymacro)
 formatting.texi:73: warning: @image file `filejk _" %@' (for LaTeX) not found 
(possibly involving @mymacro)
+formatting.texi:215: warning: @shortcontents not implemented for LaTeX output



reply via email to

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