diff options
Diffstat (limited to 'support/TeX4ht/source')
-rw-r--r-- | support/TeX4ht/source/ChangeLog | 10 | ||||
-rw-r--r-- | support/TeX4ht/source/tex4ht-4ht.tex | 13 | ||||
-rw-r--r-- | support/TeX4ht/source/tex4ht-html4.tex | 17 |
3 files changed, 31 insertions, 9 deletions
diff --git a/support/TeX4ht/source/ChangeLog b/support/TeX4ht/source/ChangeLog index 8b452983ef..748c060d9c 100644 --- a/support/TeX4ht/source/ChangeLog +++ b/support/TeX4ht/source/ChangeLog @@ -1,3 +1,13 @@ +2025-02-20 Michal Hoftich <michal.h21@gmail.com> + + * tex4ht-4ht.tex (listings.4ht): fixed support for escaped LaTeX + code in comments. + https://puszcza.gnu.org.ua/bugs/index.php?648 + + * tex4ht-html4.tex (html4.4ht): remove spurious </p> tags from + Listings. + https://puszcza.gnu.org.ua/bugs/?648 + 2025-02-19 Michal Hoftich <michal.h21@gmail.com> * tex4ht-ooffice.tex (ooffice.4ht): make \OOstyle declarations diff --git a/support/TeX4ht/source/tex4ht-4ht.tex b/support/TeX4ht/source/tex4ht-4ht.tex index 5954687a49..56d8de8c5e 100644 --- a/support/TeX4ht/source/tex4ht-4ht.tex +++ b/support/TeX4ht/source/tex4ht-4ht.tex @@ -1,4 +1,4 @@ -% $Id: tex4ht-4ht.tex 1643 2025-02-18 12:03:37Z michal_h21 $ +% $Id: tex4ht-4ht.tex 1648 2025-02-20 16:59:57Z michal_h21 $ % tex tex4ht-4ht or ht tex tex4ht-4ht % % Copyright 2009-2025 TeX Users Group @@ -34139,6 +34139,17 @@ content. \NewConfigure{listings-init}{2} >>> +This configuration should prevent linebreaks and collapsed spaces for escaped LaTeX commands +inside listings. It assumes that listings-init contains TeX4ht specials that disables and enables spaces, +and OutputBox and PostOutput hooks provided by Listings should insert markup for the current text color. + +See \Link[https://puszcza.gnu.org.ua/bugs/?648]{}{}for example\EndLink. + +\<listings sty\><<< +\pend:def\lst@escapebegin{\csname b:listings-init\endcsname\nobreak\hbox\bgroup\lsthk@OutputBox} +\append:def\lst@escapeend{\lsthk@PostOutput\egroup\csname a:listings-init\endcsname} +>>> + Use the TextStyle hook to insert markup for inline listings. This hook can be used also in other contexts, so we need to execute it conditionally, based on the \Verb|\lst@ifmode| condition. diff --git a/support/TeX4ht/source/tex4ht-html4.tex b/support/TeX4ht/source/tex4ht-html4.tex index 2bdaf944bc..15d891a536 100644 --- a/support/TeX4ht/source/tex4ht-html4.tex +++ b/support/TeX4ht/source/tex4ht-html4.tex @@ -1,4 +1,4 @@ -% $Id: tex4ht-html4.tex 1642 2025-02-16 14:49:05Z karl $ +% $Id: tex4ht-html4.tex 1647 2025-02-20 11:12:32Z michal_h21 $ % Compile 4 times: latex tex4ht-html4 % Copy html4.4ht into the work directory before all but the last compilation. % @@ -15506,13 +15506,13 @@ This configuration is used mainly when user defines new environment using \verb| \Configure{listings} {\ifvmode \IgnorePar\fi \EndP% {\everypar{}\leavevmode}\HCode{<!--l. \the\inputlineno-->}% - \ifnum \listings:Depth=0 \HCode{<pre class="listings" id="listing-\listingN">}\else% + \ifnum \listings:Depth=0 \HtmlParOff\HCode{<pre class="listings" id="listing-\listingN">}\else% \HCode{<span class="listings-nested" id="listing-\listingN">}\fi% \gHAdvance\listings:Depth by 1% \gdef\start:LstLn{}% } {\gHAdvance\listings:Depth by -1 - \ifnum \listings:Depth=0 \HCode{</pre>}\else + \ifnum \listings:Depth=0 \HCode{</pre>}\HtmlParON\else \HCode{</span>}\fi } {\start:LstLn\HCode{<span class="label">}% @@ -15551,7 +15551,7 @@ This configuration is used mainly when user defines new environment using \verb| \<configure html4 listings\><<< \ConfigureEnv{lstlisting} - {\ifvmode \IgnorePar\fi \EndP + {\ifvmode \IgnorePar\fi \EndP\HtmlParOff \HCode{<!--l. \the\inputlineno-->}% \gdef\start:LstLn{% \HCode{<pre class="lstlisting" id="listing-\listingN">}% @@ -15566,17 +15566,17 @@ This configuration is used mainly when user defines new environment using \verb| {\start:LstLn \HCode{<span class="label">}} {\HCode{</span>}}% } - {\egroup\par} + {\egroup\HtmlParOn\par} {} {} \Css{.lstlisting .label{margin-right:0.5em; }} \Css{pre.lstlisting{font-family: monospace,monospace; white-space: pre-wrap; - margin-top:0.5em; margin-bottom:0.5em; + margin-top:0.5em; margin-bottom:0.5em; text-align: left; }} >>> \<configure html4 listings\><<< \Configure{lstinputlisting} - {\ifvmode \IgnorePar\fi \EndP + {\ifvmode \IgnorePar\fi \EndP\HtmlParOff \HCode{<!--l. \the\inputlineno-->}% \gdef\start:LstLn{\HCode{<pre class="lstinputlisting" id="listing-\listingN">}\gdef\start:LstLn{\HCode{\Hnewline}}}% ignore first newline, to prevent spurious line \bgroup\ttfamily%\special{t4ht@(}% @@ -15588,10 +15588,11 @@ This configuration is used mainly when user defines new environment using \verb| } {%\special{t4ht@)} \egroup% - \ifvmode \IgnorePar\fi \EndP \HCode{</pre>}\par}% + \ifvmode \IgnorePar\fi \EndP \HCode{</pre>}\HtmlParOn\par}% \Css{pre.lstinputlisting{ font-family: monospace,monospace; white-space: pre-wrap; + text-align: left; }} \Css{.lstinputlisting .label{margin-right:0.5em;}} >>> |