summaryrefslogtreecommitdiff
path: root/support/TeX4ht
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-02-18 03:01:44 +0000
committerNorbert Preining <norbert@preining.info>2022-02-18 03:01:44 +0000
commit41041c6bdcedcc33698491c2caec4cd725a4fe97 (patch)
tree59aa0f9e0235ceee2474351b4b1a90a1eace6619 /support/TeX4ht
parentbd0e05b5b4dba5b38512acb2e7104f180fdb97e6 (diff)
CTAN sync 202202180301
Diffstat (limited to 'support/TeX4ht')
-rw-r--r--support/TeX4ht/source/ChangeLog11
-rw-r--r--support/TeX4ht/source/tex4ht-4ht.tex16
-rw-r--r--support/TeX4ht/source/tex4ht-html4.tex22
3 files changed, 35 insertions, 14 deletions
diff --git a/support/TeX4ht/source/ChangeLog b/support/TeX4ht/source/ChangeLog
index 8c0e114eb3..f6ae9d408d 100644
--- a/support/TeX4ht/source/ChangeLog
+++ b/support/TeX4ht/source/ChangeLog
@@ -1,3 +1,14 @@
+2022-02-16 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-html4.tex (html4.4ht): write CSS for table column width
+ only once.
+ * tex4ht-4ht.tex (listings.4ht): use normal space instead of \:nbsp,
+ in order to enable line breaking.
+ https://tex.stackexchange.com/a/634033/2891
+ * tex4ht-4ht.tex (listings.4ht): load Xcolor with Listings to
+ prevent compilation errors with the syntax color detection.
+ * tex4ht-html4.tex (html4.4ht): use <pre> for Listings.
+
2022-02-10 Michal Hoftich <michal.h21@gmail.com>
* tex4ht-4ht.tex (usepackage.4ht, breakurl-hooks.4ht): fixed
diff --git a/support/TeX4ht/source/tex4ht-4ht.tex b/support/TeX4ht/source/tex4ht-4ht.tex
index 72be0a6972..40696a0a64 100644
--- a/support/TeX4ht/source/tex4ht-4ht.tex
+++ b/support/TeX4ht/source/tex4ht-4ht.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-4ht.tex 1076 2022-02-10 16:55:31Z michal_h21 $
+% $Id: tex4ht-4ht.tex 1079 2022-02-16 21:13:48Z michal_h21 $
% tex tex4ht-4ht or ht tex tex4ht-4ht
%
% Copyright 2009-2022 TeX Users Group
@@ -30722,6 +30722,14 @@ d|<haddr prefix|>\last:haddr
\endinput
>>> \AddFile{9}{listings}
+We use Xcolor's features to extract color information for syntax highlighting.
+We need to load it if it isn't used yet
+\<listings sty\><<<
+\@ifpackageloaded{xcolor}{}{%
+\RequirePackage{xcolor}
+}
+>>>
+
For some reason we need the followng version of \`|\@makecaption| in order to
get correct cross-references. There were duplicate IDs sometimes.
@@ -30833,14 +30841,14 @@ Configure list of listings
\setbox\z@\hbox{{\lst@currstyle{\:tempc}}}%
\lst@OutputBox\z@}
\HLet\lst@Kern\:tempa
-\NewConfigure{lst@Kern}{2}
-\Configure{lst@Kern}{0.499em}{0.1em}
>>>
Configure lst@Kern: character width, inter character space size
\<listings sty\><<<
-\def\lst@outputspace{\:nbsp}
+\NewConfigure{lst@Kern}{2}
+\Configure{lst@Kern}{0.499em}{0.1em}
+\def\lst@outputspace{\HCode{ }}
>>>
Test cases:
diff --git a/support/TeX4ht/source/tex4ht-html4.tex b/support/TeX4ht/source/tex4ht-html4.tex
index ede8404fff..455078e9df 100644
--- a/support/TeX4ht/source/tex4ht-html4.tex
+++ b/support/TeX4ht/source/tex4ht-html4.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-html4.tex 1073 2022-02-06 19:29:41Z michal_h21 $
+% $Id: tex4ht-html4.tex 1080 2022-02-16 21:37:32Z michal_h21 $
% Compile 4 times: latex tex4ht-html4
% Copy html4.4ht into the work directory before all but the last compilation.
%
@@ -15269,12 +15269,12 @@ Configuration for the inline code
\gHAdvance\listingN by 1
\HCode{<!--l. \the\inputlineno-->}%
\gdef\start:LstLn{%
- \HCode{<div class="lstlisting" id="listing-\listingN">}%
+ \HCode{<pre class="lstlisting" id="listing-\listingN">}%
\gdef\start:LstLn{|<nbsp|>\HCode{<br />\Hnewline}}}
\bgroup%
% we put the closing </div> here in order to support floating listings
% https://tex.stackexchange.com/a/615703/2891
- \pend:def\lst@DeInit{\ifvmode\IgnorePar\fi\EndP\HCode{</div>}}%
+ \pend:def\lst@DeInit{\ifvmode\IgnorePar\fi\EndP\HCode{</pre>}}%
\Configure{listings}
{{\everypar{}\leavevmode}}
{{\everypar{}\leavevmode}}
@@ -15284,7 +15284,7 @@ Configuration for the inline code
{\egroup\par}
{} {}
\Css{.lstlisting .label{margin-right:0.5em; }}
-\Css{div.lstlisting{font-family: monospace,monospace; white-space: nowrap;
+\Css{pre.lstlisting{font-family: monospace,monospace; white-space: nowrap;
margin-top:0.5em; margin-bottom:0.5em;
}}
>>>
@@ -15293,7 +15293,7 @@ Configuration for the inline code
\Configure{lstinputlisting}
{\ifvmode \IgnorePar\fi \EndP
\HCode{<!--l. \the\inputlineno-->}%
- \HCode{<div class="lstinputlisting">}%
+ \HCode{<pre class="lstinputlisting">}%
\bgroup \tt %\special{t4ht@(}%
\Configure{listings}
{{\everypar{}\leavevmode}}
@@ -15304,8 +15304,8 @@ Configuration for the inline code
}
{%\special{t4ht@)}
\egroup
- \ifvmode \IgnorePar\fi \EndP \HCode{</div>}\par}
-\Css{div.lstinputlisting{
+ \ifvmode \IgnorePar\fi \EndP \HCode{</pre>}\par}
+\Css{pre.lstinputlisting{
font-family: monospace,monospace;
white-space: nowrap;
}}
@@ -19752,10 +19752,12 @@ changes.
\:CheckOption{p-width} \if:Option
|<10 em constant|>
\Configure{HColWidth}
- {\tmp:dim=\HColWidth \divide\tmp:dim by \ten:Em\relax
+ {\ifnum\HRow=1% output CSS only on the first row, to prevent duplication
+ \tmp:dim=\HColWidth \divide\tmp:dim by \ten:Em\relax
\tmp:dim=10\tmp:dim
- \Css{\#TBL-\TableNo-\HRow-\HCol
- {width:\expandafter\x:Em \the\tmp:dim em;}}}
+ \Css{\#TBL-\TableNo-\HCol% CSS selects ID of the current table column
+ {width:\expandafter\x:Em \the\tmp:dim em;}}
+ \fi}
\else
\Log:Note{for width specifications of tabular p entries, use
the `p-width' command line option or a configuration similar