[tex4ht-commits] [SCM] tex4ht updated: r1235 - trunk/lit

Michal Hoftich INVALID.NOREPLY at gnu.org.ua
Fri Nov 4 16:46:19 CET 2022


Author: michal_h21
Date: 2022-11-04 15:46:19 +0000 (Fri, 04 Nov 2022)
New Revision: 1235

Modified:
   trunk/lit/ChangeLog
   trunk/lit/mktex4ht-cnf.tex
   trunk/lit/tex4ht-4ht.tex
   trunk/lit/tex4ht-html4.tex
Log:
Added support for the xskak package

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2022-11-02 22:09:27 UTC (rev 1234)
+++ trunk/lit/ChangeLog	2022-11-04 15:46:19 UTC (rev 1235)
@@ -1,3 +1,8 @@
+2022-11-04  Michal Hoftich  <michal.h21 at 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 at gmail.com>
 
 	* tex4ht-mathml.tex (mathml.4ht): added extra group for \mathcal, to

Modified: trunk/lit/mktex4ht-cnf.tex
===================================================================
--- trunk/lit/mktex4ht-cnf.tex	2022-11-02 22:09:27 UTC (rev 1234)
+++ trunk/lit/mktex4ht-cnf.tex	2022-11-04 15:46:19 UTC (rev 1235)
@@ -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}

Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex	2022-11-02 22:09:27 UTC (rev 1234)
+++ trunk/lit/tex4ht-4ht.tex	2022-11-04 15:46:19 UTC (rev 1235)
@@ -33442,6 +33442,74 @@
 
 
 %%%%%%%%%%%%%%%%%%%%%%%%
+\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}
 %%%%%%%%%%%%%%%%%%%%%%%%
 

Modified: trunk/lit/tex4ht-html4.tex
===================================================================
--- trunk/lit/tex4ht-html4.tex	2022-11-02 22:09:27 UTC (rev 1234)
+++ trunk/lit/tex4ht-html4.tex	2022-11-04 15:46:19 UTC (rev 1235)
@@ -19426,6 +19426,27 @@
 >>>
 
 %%%%%%%%%%%%%%%%%
+\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\><<<



More information about the tex4ht-commits mailing list.