summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/ChangeLog7
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex51
-rw-r--r--Master/texmf-dist/tex/generic/tex4ht/piton.4ht39
3 files changed, 92 insertions, 5 deletions
diff --git a/Master/texmf-dist/source/generic/tex4ht/ChangeLog b/Master/texmf-dist/source/generic/tex4ht/ChangeLog
index 3ab632896aa..dbbfe9b73f6 100644
--- a/Master/texmf-dist/source/generic/tex4ht/ChangeLog
+++ b/Master/texmf-dist/source/generic/tex4ht/ChangeLog
@@ -1,3 +1,10 @@
+2024-10-01 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (piton.4ht): prevent default use of visible space
+ characters.
+
+ * tex4ht-4ht.tex (piton.4ht): load Xcolor if not already loaded.
+
2024-09-30 Michal Hoftich <michal.h21@gmail.com>
* tex4ht-4ht.tex (colortbl-hooks.4ht, colortbl.4ht): added support
diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
index 96f01b361a1..1ae8b1c07d5 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 1568 2024-09-30 10:54:58Z michal_h21 $
+% $Id: tex4ht-4ht.tex 1570 2024-10-01 16:06:59Z michal_h21 $
% tex tex4ht-4ht or ht tex tex4ht-4ht
%
% Copyright 2009-2024 TeX Users Group
@@ -26492,10 +26492,12 @@ Minted, it turns the breaklines option to false when it is used.
\<piton.4ht\><<<
% piton.4ht (|version), generated from |jobname.tex
-% Copyright 2023 TeX Users Group
+% Copyright 2023-2024 TeX Users Group
|<TeX4ht license text|>
\ExplSyntaxOn
+|<piton xcolor|>
+|<piton spaces|>
|<piton env|>
|<piton inlines|>
\ExplSyntaxOff
@@ -26503,6 +26505,51 @@ Minted, it turns the breaklines option to false when it is used.
\endinput
>>> \AddFile{9}{piton}
+If Xcolor is not loaded earlier, Piton loads it in the begindocument/before hook.
+It leads to a compilation error caused by catcodes mismatch. We can prevent it
+by loading Xcolor earlier.
+
+\<piton xcolor\><<<
+\IfPackageLoadedTF{xcolor}{}{\RequirePackage{xcolor}}
+>>>
+
+The current version of Piton started to show visible space character (U+2423) instead
+of spaces even if they are not requested using the show-spaces option. This code should
+prevent that.
+
+\<piton spaces\><<<
+\def\:pitonvisiblespace{ \HCode{\string&\#x2423;} }
+\cs_new_protected:Npn \:__piton_replace_spaces:n #1
+ {
+ \tl_set:Nn \l_tmpa_tl { #1 }
+ \bool_if:NTF \l__piton_show_spaces_bool
+ {
+ \tl_set:Nn \l__piton_space_tl {\:pitonvisiblespace} % U+2423
+ \regex_replace_all:nnN { \x20 } {\c{:pitonvisiblespace}} \l_tmpa_tl
+ }
+ {
+ \bool_if:NTF \l__piton_break_lines_in_Piton_bool
+ {
+ \regex_replace_all:nnN
+ { \x20 }
+ { \c { __piton_breakable_space: } }
+ \l_tmpa_tl
+ \regex_replace_all:nnN
+ { \c { l__piton_space_tl } }
+ { \c { __piton_breakable_space: } }
+ \l_tmpa_tl
+ }
+ {
+ \regex_replace_all:nnN { \x20 } { \x20 } \l_tmpa_tl
+ }
+ }
+ \l_tmpa_tl
+ }
+
+
+\HLet\__piton_replace_spaces:n\:__piton_replace_spaces:n
+>>>
+
\<piton env\><<<
\NewConfigure{pitonline}{3}
diff --git a/Master/texmf-dist/tex/generic/tex4ht/piton.4ht b/Master/texmf-dist/tex/generic/tex4ht/piton.4ht
index b1140b4094b..fc79912f695 100644
--- a/Master/texmf-dist/tex/generic/tex4ht/piton.4ht
+++ b/Master/texmf-dist/tex/generic/tex4ht/piton.4ht
@@ -1,5 +1,5 @@
-% piton.4ht (2023-10-13-14:15), generated from tex4ht-4ht.tex
-% Copyright 2023 TeX Users Group
+% piton.4ht (2024-10-01-13:46), generated from tex4ht-4ht.tex
+% Copyright 2023-2024 TeX Users Group
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
@@ -16,10 +16,43 @@
%
% If you modify this program, changing the
% version identification would be appreciated.
-\immediate\write-1{version 2023-10-13-14:15}
+\immediate\write-1{version 2024-10-01-13:46}
\ExplSyntaxOn
+\IfPackageLoadedTF{xcolor}{}{\RequirePackage{xcolor}}
+
+\def\:pitonvisiblespace{ \HCode{\string&\#x2423;} }
+\cs_new_protected:Npn \:__piton_replace_spaces:n #1
+ {
+ \tl_set:Nn \l_tmpa_tl { #1 }
+ \bool_if:NTF \l__piton_show_spaces_bool
+ {
+ \tl_set:Nn \l__piton_space_tl {\:pitonvisiblespace} % U+2423
+ \regex_replace_all:nnN { \x20 } {\c{:pitonvisiblespace}} \l_tmpa_tl
+ }
+ {
+ \bool_if:NTF \l__piton_break_lines_in_Piton_bool
+ {
+ \regex_replace_all:nnN
+ { \x20 }
+ { \c { __piton_breakable_space: } }
+ \l_tmpa_tl
+ \regex_replace_all:nnN
+ { \c { l__piton_space_tl } }
+ { \c { __piton_breakable_space: } }
+ \l_tmpa_tl
+ }
+ {
+ \regex_replace_all:nnN { \x20 } { \x20 } \l_tmpa_tl
+ }
+ }
+ \l_tmpa_tl
+ }
+
+
+\HLet\__piton_replace_spaces:n\:__piton_replace_spaces:n
+
\NewConfigure{pitonline}{3}
\NewConfigure{pitonnumber}{2}