texlive[60530] Master/texmf-dist: floating listings, tex4ht r982;

commits+karl at tug.org commits+karl at tug.org
Sat Sep 18 00:53:36 CEST 2021


Revision: 60530
          http://tug.org/svn/texlive?view=revision&revision=60530
Author:   karl
Date:     2021-09-18 00:53:36 +0200 (Sat, 18 Sep 2021)
Log Message:
-----------
floating listings, tex4ht r982; listings support for odt, tex4ht r983

Revision Links:
--------------
    http://tug.org/svn/texlive?view=revision&revision=982
    http://tug.org/svn/texlive?view=revision&revision=983

Modified Paths:
--------------
    trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
    trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex
    trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-ooffice.tex
    trunk/Master/texmf-dist/tex/generic/tex4ht/html4.4ht
    trunk/Master/texmf-dist/tex/generic/tex4ht/ooffice.4ht

Modified: trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog	2021-09-17 22:10:41 UTC (rev 60529)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/ChangeLog	2021-09-17 22:53:36 UTC (rev 60530)
@@ -1,3 +1,10 @@
+2021-09-17  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-html4.tex (html4.4ht): fixed support for floating listings.
+	https://tex.stackexchange.com/a/615703/2891
+	* tex4ht-ooffice.tex (ooffice.4ht): fixed listings support in the ODT
+	format.
+
 2021-09-14  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-mathjax.tex (mathjax-latex-4ht.4ht): fixed TOC support for \exp

Modified: trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex	2021-09-17 22:10:41 UTC (rev 60529)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex	2021-09-17 22:53:36 UTC (rev 60530)
@@ -1,4 +1,4 @@
-% $Id: tex4ht-html4.tex 978 2021-09-12 21:26:18Z michal_h21 $
+% $Id: tex4ht-html4.tex 982 2021-09-17 12:20:37Z michal_h21 $
 % Compile 4 times: latex tex4ht-html4
 % Copy html4.4ht into the work directory before all but the last compilation.
 %
@@ -15254,7 +15254,10 @@
     \gdef\start:LstLn{%
        \HCode{<div class="lstlisting" id="listing-\listingN">}%
        \gdef\start:LstLn{|<nbsp|>\HCode{<br />\Hnewline}}}
-    \bgroup 
+    \bgroup%
+    % we put the closing </div> here in order to support floating listings
+    % https://tex.stackexchange.com/a/615703/2891
+    \pend:def\lst at DeInit{\ifvmode\IgnorePar\fi\EndP\HCode{</div>}}%
        \Configure{listings}
          {{\everypar{}\leavevmode}}
          {{\everypar{}\leavevmode}}
@@ -15261,8 +15264,7 @@
          {\start:LstLn \HCode{<span class="label">}}
          {\HCode{</span>}}%
    }
-   {\egroup
-    \ifvmode \IgnorePar\fi \EndP \HCode{</div>}\par}
+   {\egroup\par}
    {} {}
 \Css{.lstlisting .label{margin-right:0.5em; }}
 \Css{div.lstlisting{font-family: monospace,monospace; white-space: nowrap; 

Modified: trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-ooffice.tex
===================================================================
--- trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-ooffice.tex	2021-09-17 22:10:41 UTC (rev 60529)
+++ trunk/Master/texmf-dist/source/generic/tex4ht/tex4ht-ooffice.tex	2021-09-17 22:53:36 UTC (rev 60530)
@@ -1,4 +1,4 @@
-% $Id: tex4ht-ooffice.tex 977 2021-09-09 13:53:34Z michal_h21 $
+% $Id: tex4ht-ooffice.tex 983 2021-09-17 14:27:15Z michal_h21 $
 % compile 3 times: latex tex4ht-ooffice
 %      htlatex tex4ht-ooffice "xhtml,4,sections+"
 %
@@ -10446,15 +10446,21 @@
 \ConfigureEnv{lstlisting}
    {\ifvmode \IgnorePar\fi \EndP  
     \HCode{<!--l. \the\inputlineno lstlisting-->}%
-    \HCode{<text:p\Hnewline text:style-name="Preformatted-Text">}%
-    \bgroup \special{t4ht@(}%
+    % \HCode{}%
+    \bgroup %
+    \gdef\start:LstLn{%
+       \ifvmode\IgnorePar\fi\EndP\HCode{<text:p\Hnewline text:style-name="Preformatted-Text">}%
+       \ht:special{t4ht@(}\ttfamily%
+       \gdef\start:LstLn{\HCode{<text:s/><text:line-break/>}}}
+    \pend:def\lst at DeInit{\ifvmode\IgnorePar\fi\EndP\HCode{</text:p>}}%
        \Configure{listings}
          {{\everypar{}\leavevmode}}
          {{\everypar{}\leavevmode}}
-         {\HCode{<text:s/><text:line-break/>}}{}%
+         {\start:LstLn}{}%
    }
-   {\special{t4ht@)}\egroup
-    \ifvmode \IgnorePar\fi \EndP   \HCode{</text:p>}\par}
+   {\ht:special{t4ht@)}\egroup
+    % \ifvmode \IgnorePar\fi \EndP   \HCode{</text:p>}\par}
+    \par}
    {} {}
 >>>
 
@@ -10462,16 +10468,20 @@
 \Configure{lstinputlisting}
    {\ifvmode \IgnorePar\fi \EndP
     \HCode{<!--l. \the\inputlineno lstinputlisting-->}%
-    \HCode{<text:p\Hnewline text:style-name="Preformatted-Text">}%
-    \bgroup \tt \special{t4ht@(}%
+    % \HCode{<text:p\Hnewline text:style-name="Preformatted-Text">}%
+    \bgroup%
+    \gdef\start:LstLn{%
+       \ifvmode\IgnorePar\fi\EndP\HCode{<text:p\Hnewline text:style-name="Preformatted-Text">}%
+       \ht:special{t4ht@(}\ttfamily%
+       \gdef\start:LstLn{\HCode{<text:s/><text:line-break/>}}}
+    \pend:def\lst at DeInit{\ifvmode\IgnorePar\fi\EndP\HCode{</text:p>}}%
        \Configure{listings}
          {{\everypar{}\leavevmode}}
          {{\everypar{}\leavevmode}}
-         {\HCode{<text:s/><text:line-break/>}} 
+         {\start:LstLn} 
          {\HCode{<text:line-break/>}}%
    }
-   {\special{t4ht@)}\egroup
-    \ifvmode \IgnorePar\fi \EndP   \HCode{</text:p>}\par}
+   {\special{t4ht@)}\egroup\par}
 >>>
 
 

Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/html4.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/html4.4ht	2021-09-17 22:10:41 UTC (rev 60529)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/html4.4ht	2021-09-17 22:53:36 UTC (rev 60530)
@@ -1,4 +1,4 @@
-% html4.4ht (2021-09-12-15:34), generated from tex4ht-html4.tex
+% html4.4ht (2021-09-17-15:30), generated from tex4ht-html4.tex
 % Copyright 2009-2021 TeX Users Group
 % Copyright 1997-2009 Eitan M. Gurari
 %
@@ -17,7 +17,7 @@
 %
 % If you modify this program, changing the
 % version identification would be appreciated.
-\immediate\write-1{version 2021-09-12-15:34}
+\immediate\write-1{version 2021-09-17-15:30}
 
 \exit:ifnot{8859-6,% 
 CJK,% 
@@ -37320,7 +37320,10 @@
        \HCode{<div class="lstlisting" id="listing-\listingN">}%
        \gdef\start:LstLn{\:nbsp%
 \HCode{<br />\Hnewline}}}
-    \bgroup
+    \bgroup%
+    % we put the closing </div> here in order to support floating listings
+    % https://tex.stackexchange.com/a/615703/2891
+    \pend:def\lst at DeInit{\ifvmode\IgnorePar\fi\EndP\HCode{</div>}}%
        \Configure{listings}
          {{\everypar{}\leavevmode}}
          {{\everypar{}\leavevmode}}
@@ -37327,8 +37330,7 @@
          {\start:LstLn \HCode{<span class="label">}}
          {\HCode{</span>}}%
    }
-   {\egroup
-    \ifvmode \IgnorePar\fi \EndP \HCode{</div>}\par}
+   {\egroup\par}
    {} {}
 \Css{.lstlisting .label{margin-right:0.5em; }}
 \Css{div.lstlisting{font-family: monospace,monospace; white-space: nowrap;

Modified: trunk/Master/texmf-dist/tex/generic/tex4ht/ooffice.4ht
===================================================================
--- trunk/Master/texmf-dist/tex/generic/tex4ht/ooffice.4ht	2021-09-17 22:10:41 UTC (rev 60529)
+++ trunk/Master/texmf-dist/tex/generic/tex4ht/ooffice.4ht	2021-09-17 22:53:36 UTC (rev 60530)
@@ -1,4 +1,4 @@
-% ooffice.4ht (2021-09-10-08:38), generated from tex4ht-ooffice.tex
+% ooffice.4ht (2021-09-17-15:31), generated from tex4ht-ooffice.tex
 % Copyright 2009-2021 TeX Users Group
 % Copyright 2001-2009 Maarten Wisse, James Naughton, Eitan M. Gurari
 %
@@ -17,7 +17,7 @@
 %
 % If you modify this program, changing the
 % version identification would be appreciated.
-\immediate\write-1{version 2021-09-10-08:38}
+\immediate\write-1{version 2021-09-17-15:31}
 
   \exit:ifnot{Preamble,% 
 algorithmicx,% 
@@ -19322,29 +19322,39 @@
 \ConfigureEnv{lstlisting}
    {\ifvmode \IgnorePar\fi \EndP
     \HCode{<!--l. \the\inputlineno lstlisting-->}%
-    \HCode{<text:p\Hnewline text:style-name="Preformatted-Text">}%
-    \bgroup \special{t4ht@(}%
+    % \HCode{}%
+    \bgroup %
+    \gdef\start:LstLn{%
+       \ifvmode\IgnorePar\fi\EndP\HCode{<text:p\Hnewline text:style-name="Preformatted-Text">}%
+       \ht:special{t4ht@(}\ttfamily%
+       \gdef\start:LstLn{\HCode{<text:s/><text:line-break/>}}}
+    \pend:def\lst at DeInit{\ifvmode\IgnorePar\fi\EndP\HCode{</text:p>}}%
        \Configure{listings}
          {{\everypar{}\leavevmode}}
          {{\everypar{}\leavevmode}}
-         {\HCode{<text:s/><text:line-break/>}}{}%
+         {\start:LstLn}{}%
    }
-   {\special{t4ht@)}\egroup
-    \ifvmode \IgnorePar\fi \EndP   \HCode{</text:p>}\par}
+   {\ht:special{t4ht@)}\egroup
+    % \ifvmode \IgnorePar\fi \EndP   \HCode{</text:p>}\par}
+    \par}
    {} {}
 \Configure{lstinputlisting}
    {\ifvmode \IgnorePar\fi \EndP
     \HCode{<!--l. \the\inputlineno lstinputlisting-->}%
-    \HCode{<text:p\Hnewline text:style-name="Preformatted-Text">}%
-    \bgroup \tt \special{t4ht@(}%
+    % \HCode{<text:p\Hnewline text:style-name="Preformatted-Text">}%
+    \bgroup%
+    \gdef\start:LstLn{%
+       \ifvmode\IgnorePar\fi\EndP\HCode{<text:p\Hnewline text:style-name="Preformatted-Text">}%
+       \ht:special{t4ht@(}\ttfamily%
+       \gdef\start:LstLn{\HCode{<text:s/><text:line-break/>}}}
+    \pend:def\lst at DeInit{\ifvmode\IgnorePar\fi\EndP\HCode{</text:p>}}%
        \Configure{listings}
          {{\everypar{}\leavevmode}}
          {{\everypar{}\leavevmode}}
-         {\HCode{<text:s/><text:line-break/>}}
+         {\start:LstLn}
          {\HCode{<text:line-break/>}}%
    }
-   {\special{t4ht@)}\egroup
-    \ifvmode \IgnorePar\fi \EndP   \HCode{</text:p>}\par}
+   {\special{t4ht@)}\egroup\par}
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   



More information about the tex-live-commits mailing list.