| 1 |
% xskak.4ht (2023-07-28-13:49), generated from tex4ht-4ht.tex |
| 2 |
% Copyright 2022-2023 TeX Users Group |
| 3 |
% |
| 4 |
% This work may be distributed and/or modified under the |
| 5 |
% conditions of the LaTeX Project Public License, either |
| 6 |
% version 1.3c of this license or (at your option) any |
| 7 |
% later version. The latest version of this license is in |
| 8 |
% http://www.latex-project.org/lppl.txt |
| 9 |
% and version 1.3c or later is part of all distributions |
| 10 |
% of LaTeX version 2005/12/01 or later. |
| 11 |
% |
| 12 |
% This work has the LPPL maintenance status "maintained". |
| 13 |
% |
| 14 |
% The Current Maintainer of this work |
| 15 |
% is the TeX4ht Project <http://tug.org/tex4ht>. |
| 16 |
% |
| 17 |
% If you modify this program, changing the |
| 18 |
% version identification would be appreciated. |
| 19 |
\immediate\write-1{version 2023-07-28-13:49} |
| 20 |
|
| 21 |
\ExplSyntaxOn |
| 22 |
\def\:xskakdepth{vertical-align:-\fp_eval:n{ |
| 23 |
\dim_to_fp:n{\dp0}/(\dim_to_fp:n{\ht0}+\dim_to_fp:n{\dp0}) * 100 |
| 24 |
}\@percentchar;} |
| 25 |
\ExplSyntaxOff |
| 26 |
|
| 27 |
\NewConfigure{mainline}{2} |
| 28 |
\def\:tempa#1{% |
| 29 |
\setbox0=\hbox{\o:mainline:{#1}}% |
| 30 |
\edef\:xskakalt{\detokenize{#1}}% |
| 31 |
%\a:mainline\Picture*[\detokenize{#1}]{ style="\:xskakdepth"}\box0\EndPicture\b:mainline% |
| 32 |
\a:mainline\box0\b:mainline% |
| 33 |
} |
| 34 |
% I've found that mainline redefinition can lead to compilation errors |
| 35 |
% As it prints text and chess symbols are retrieved from SkakNew.htf, maybe we don't need |
| 36 |
% to compile it to image at all, unless we get further bug reports. |
| 37 |
% \HLet\mainline\:tempa |
| 38 |
|
| 39 |
\NewConfigure{xskakget}{2} |
| 40 |
\def\:tempa#1{% |
| 41 |
\edef\:xskakalt{\detokenize{#1}}% |
| 42 |
\setbox0=\hbox{\o:xskakget:{#1}}% |
| 43 |
\a:xskakget\box0\b:xskakget% |
| 44 |
} |
| 45 |
\HLet\xskakget\:tempa |
| 46 |
|
| 47 |
\NewConfigure{chessboard}{2} |
| 48 |
\newcommand\:newchessgame[1][]{% |
| 49 |
% reset to the original version of \chessboard |
| 50 |
\let\:currchesboard\chessboard |
| 51 |
\let\chessboard\o:chessboard:% |
| 52 |
\o:newchessgame:[#1]% |
| 53 |
% set the TeX4ht version of \chessboard back |
| 54 |
\let\chessboard\:currchesboard |
| 55 |
} |
| 56 |
\HLet\newchessgame\:newchessgame |
| 57 |
|
| 58 |
\Hinput{xskak} |
| 59 |
\endinput |
| 60 |
|