summaryrefslogtreecommitdiff
path: root/support/TeX4ht/source
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2022-11-06 03:01:22 +0000
committerNorbert Preining <norbert@preining.info>2022-11-06 03:01:22 +0000
commit0a7c9b85de9aeaffafa0cf8944fa81ffe9652d09 (patch)
treea8a932b3f786cf3601808c4e352b3b6b07731742 /support/TeX4ht/source
parent5a47812f51f3d10a580db0c74aa20d73f5ed2ae4 (diff)
CTAN sync 202211060301
Diffstat (limited to 'support/TeX4ht/source')
-rw-r--r--support/TeX4ht/source/ChangeLog5
-rw-r--r--support/TeX4ht/source/mktex4ht-cnf.tex3
-rw-r--r--support/TeX4ht/source/tex4ht-4ht.tex70
-rw-r--r--support/TeX4ht/source/tex4ht-html4.tex23
4 files changed, 98 insertions, 3 deletions
diff --git a/support/TeX4ht/source/ChangeLog b/support/TeX4ht/source/ChangeLog
index f65184fe92..ed15608655 100644
--- a/support/TeX4ht/source/ChangeLog
+++ b/support/TeX4ht/source/ChangeLog
@@ -1,3 +1,8 @@
+2022-11-04 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (xskak.4ht),
+ * tex4ht-html4.tex (html4.4ht): added support for the Xskak package.
+
2022-11-02 Michal Hoftich <michal.h21@gmail.com>
* tex4ht-mathml.tex (mathml.4ht): added extra group for \mathcal, to
diff --git a/support/TeX4ht/source/mktex4ht-cnf.tex b/support/TeX4ht/source/mktex4ht-cnf.tex
index 3d85a09637..bb78f1e571 100644
--- a/support/TeX4ht/source/mktex4ht-cnf.tex
+++ b/support/TeX4ht/source/mktex4ht-cnf.tex
@@ -1,4 +1,4 @@
-% $Id: mktex4ht-cnf.tex 1219 2022-10-20 14:40:14Z michal_h21 $
+% $Id: mktex4ht-cnf.tex 1235 2022-11-04 15:46:19Z michal_h21 $
% Manually-maintained file, listing *.4ht files created by tex4ht-4ht.tex.
% Read by tex4ht-cond4ht.
%
@@ -373,6 +373,7 @@
\AddFile{9}{parallel}
\AddFile{9}{skak}
\AddFile{9}{chessboard}
+\AddFile{9}{xskak}
\AddFile{9}{texmate}
\AddFile{9}{menukeys}
\AddFile{9}{animate}
diff --git a/support/TeX4ht/source/tex4ht-4ht.tex b/support/TeX4ht/source/tex4ht-4ht.tex
index 88324fc0db..29bfdaf2db 100644
--- a/support/TeX4ht/source/tex4ht-4ht.tex
+++ b/support/TeX4ht/source/tex4ht-4ht.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-4ht.tex 1229 2022-10-31 11:23:43Z michal_h21 $
+% $Id: tex4ht-4ht.tex 1235 2022-11-04 15:46:19Z michal_h21 $
% tex tex4ht-4ht or ht tex tex4ht-4ht
%
% Copyright 2009-2022 TeX Users Group
@@ -33442,6 +33442,74 @@ of \''\:temp' below.
%%%%%%%%%%%%%%%%%%%%%%%%
+\Section{xskak.sty}
+%%%%%%%%%%%%%%%%%%%%%%%%
+
+\<xskak.4ht\><<<
+% xskak.4ht (|version), generated from |jobname.tex
+% Copyright 2022 TeX Users Group
+|<TeX4ht license text|>
+|<xskak depth|>
+|<xskak inline elements|>
+|<xskak.sty|>
+\Hinput{xskak}
+\endinput
+>>>\AddFile{9}{xskak}
+
+This command calculates vertical align for Xskak commands that can be used inline,
+so the image is aligned correctly to the baseline of the surrounding text.
+
+\<xskak depth\><<<
+\ExplSyntaxOn
+\def\:xskakdepth{vertical-align:-\fp_eval:n{
+ \dim_to_fp:n{\dp0}/(\dim_to_fp:n{\ht0}+\dim_to_fp:n{\dp0}) * 100
+}\@percentchar;}
+\ExplSyntaxOff
+>>>
+
+The following commands are used in text, so we save the result in a box, which can
+be used for calculation of vertical alignment.
+
+\<xskak inline elements\><<<
+\NewConfigure{mainline}{2}
+\def\:tempa#1{%
+ \setbox0=\hbox{\o:mainline:{#1}}%
+ \edef\:xskakalt{\detokenize{#1}}%
+ %\a:mainline\Picture*[\detokenize{#1}]{ style="\:xskakdepth"}\box0\EndPicture\b:mainline%
+ \a:mainline\box0\b:mainline%
+}
+\HLet\mainline\:tempa
+
+\NewConfigure{xskakget}{2}
+\def\:tempa#1{%
+ \edef\:xskakalt{\detokenize{#1}}%
+ \setbox0=\hbox{\o:xskakget:{#1}}%
+ \a:xskakget\box0\b:xskakget%
+}
+\HLet\xskakget\:tempa
+>>>
+
+The chessboard configuration is defined by chessboard.4ht too. We declare it here
+because
+
+\<xskak.sty\><<<
+\NewConfigure{chessboard}{2}
+>>>
+
+\<xskak.sty\><<<
+\def\:tempa{%
+ % reset to the original version of \chessboard
+ \let\:currchesboard\chessboard
+ \let\chessboard\o:chessboard:%
+ \o:newchessgame:%
+ % set the TeX4ht version of \chessboard back
+ \let\chessboard\:currchesboard
+}
+\HLet\newchessgame\:tempa
+>>>
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%
\Section{texmate.sty}
%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/support/TeX4ht/source/tex4ht-html4.tex b/support/TeX4ht/source/tex4ht-html4.tex
index b9119693d3..00502d272b 100644
--- a/support/TeX4ht/source/tex4ht-html4.tex
+++ b/support/TeX4ht/source/tex4ht-html4.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-html4.tex 1226 2022-10-27 14:19:24Z michal_h21 $
+% $Id: tex4ht-html4.tex 1235 2022-11-04 15:46:19Z michal_h21 $
% Compile 4 times: latex tex4ht-html4
% Copy html4.4ht into the work directory before all but the last compilation.
%
@@ -19426,6 +19426,27 @@ latex.ltx, fontmath.ltx, plain.tex
>>>
%%%%%%%%%%%%%%%%%
+\section{xskak}
+%%%%%%%%%%%%%%%%%
+
+\<configure html4 xskak\><<<
+\Configure{mainline}{\Picture*[\:xskakalt]{ style="\:xskakdepth"}}{\EndPicture}
+\Configure{xskakget}{\Picture*[\:xskakalt]{ style="\:xskakdepth"}}{\EndPicture}
+>>>
+
+%%%%%%%%%%%%%%%%%
+\section{chessboard}
+%%%%%%%%%%%%%%%%%
+
+If called from Xskak, we can use the xskakget command to get
+chess notation as an alt text.
+
+\<configure html4 chessboard\><<<
+\def\chessboard:alt{\ifdefined\o:xskakget:\o:xskakget:{nextfen}\fi}
+\Configure{chessboard}{\Picture*[\chessboard:alt]{}}{\EndPicture}
+>>>
+
+%%%%%%%%%%%%%%%%%
\section{texmate}
\<configure html4 texmate\><<<