Last active
October 9, 2019 18:55
-
-
Save michal-h21/293d567ce11e1f1eba0112d908a26245 to your computer and use it in GitHub Desktop.
tex4ht configuraton file for xskak.sty. compile with `make4ht sample.tex svg`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[12pt]{article} | |
\ifdefined\HCode | |
\def\pgfsysdriver{pgfsys-dvisvgm4ht.def} | |
\fi | |
\usepackage{xskak} | |
\begin{document} | |
\newchessgame[id=main] | |
\chessboard | |
\end{document} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\NewConfigure{chessboard}{2} | |
% this should put configurable hooks around \newchessgame | |
% contents printed by this command should be printed to image | |
% \newcommand\:tempaboard[1][]{\a:chessboard\o:newchessgame:[#1]\b:chessboard} | |
\newcommand\Save:TikzPict{\let\old:a:tikzpicture\a:tikzpicture\let\old:b:tikzpicture\b:tikzpicture\let\a:tikzpicture\relax\let\b:tikzpicture\relax} | |
\newcommand\Restore:TikzPict{\let\a:tikzpicture\old:a:tikzpicture\let\b:tikzpicture\old:b:tikzpicture} | |
\newcommand\:tempaboard[1][]{\a:chessboard\o:chessboard:[#1]\b:chessboard} | |
% | |
\HLet\chessboard\:tempaboard | |
\Configure{chessboard}{\Picture*{}\Save:TikzPict}{\Restore:TikzPict\EndPicture} | |
\Hinput{chessboard} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It seems that this may be used by nested
\Picture*
commands, as they are used by the configuration for tikzpicture as well. Turning off this configuration seems to do the trick:\NewConfigure{chessboard}{2}