summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-02-16 23:07:18 +0000
committerKarl Berry <karl@freefriends.org>2022-02-16 23:07:18 +0000
commitd8f873973727c80b845fa9ced1cc311bcc04d985 (patch)
tree235036c3541a6a50e77bdd908fdbb8d8967c3674 /Master/texmf-dist/source/generic
parent9a2e259625722487a887ac1c24e4aaec11e718fe (diff)
xcolor, <pre>, normal space in listings, tex4ht r1077-9; css table column width once, tex4ht r1080
git-svn-id: svn://tug.org/texlive/trunk@62051 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/generic')
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/ChangeLog11
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex16
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex22
3 files changed, 35 insertions, 14 deletions
diff --git a/Master/texmf-dist/source/generic/tex4ht/ChangeLog b/Master/texmf-dist/source/generic/tex4ht/ChangeLog
index 8c0e114eb37..f6ae9d408dd 100644
--- a/Master/texmf-dist/source/generic/tex4ht/ChangeLog
+++ b/Master/texmf-dist/source/generic/tex4ht/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/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
index 72be0a6972d..40696a0a643 100644
--- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/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/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex
index ede8404fffc..455078e9df1 100644
--- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-html4.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/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