The error you get is known issue. More interesting question is how to actually support xskak
package. You will probably want to support at least two features: chess figures font and chess boards.
You can get support for chess figures with the following font definition file, SkakNew.htf
:
SkakNew 32 121
'' '' 32
'!' '' 33
'”' '' 34
'#' '' 35
'$' '' 36
'%' '' 37
'&' '' 38
'’' '' 39
'(' '' 40
')' '' 41
'*' '' 42
'+' '' 43
',' '' 44
'-' '' 45
'.' '' 46
'/' '' 47
'0' '' 48
'1' '' 49
'2' '' 50
'3' '' 51
'4' '' 52
'5' '' 53
'6' '' 54
'7' '' 55
'8' '' 56
'9' '' 57
':' '' 58
';' '' 59
'¡' '' 60
'=' '' 61
'¿' '' 62
'?' '' 63
'@' '' 64
'→' '' 65
'♗' '' 66
'↑' '' 67
'⊙' '' 68
'△' '' 69
'□' '' 70
'⇗' '' 71
'⇔' '' 72
'⊞' '' 73
'╳' '' 74
'♔' '' 75
'⟂' '' 76
'≪' '' 77
'♘' '' 78
'≫' '' 79
'Ⅱ' '' 80
'♕' '' 81
'♖' '' 82
'>' '' 83
'⊕' '' 84
'○' '' 85
'⇆' '' 86
'W' '' 87
'×' '' 88
'Y' '' 89
'Z' '' 90
'[' '' 91
'“' '' 92
']' '' 93
'ˆ' '' 94
'˙' '' 95
'‘' '' 96
'⧉' '' 97
'⌓' '' 98
'±' '' 99
'⦂' '' 100
'∓' '' 101
'⩲' '' 102
'⩱' '' 103
'h' '' I can't find it, it is plus followed by minus
'i' '' minus followed by plus
'=' '' 106
'k' '' 107
'l' '' 108
'#' '' 109
'n' '' 110
'o' '' 111
'p' '' 112
'q' '' 113
'r' '' 114
's' '' 115
't' '' 116
'u' '' 117
'v' '' 118
'w' '' 119
'x' '' 120
'y' '' 121
SkakNew 32 121
slightly more difficult is support for chess boards. tex4ht
can convert any LaTeX code to picture using \Picture*{} ... \EndPicture
commands. We only need to redefine \chessboard
command to incorporate them, which I wasn't successful in trying to do. Maybe Ulrike will know.
Anyway, as a workaround, we can define new command, let's say \mychessfigure
, which will call \chessfigure
with \Picture
commands when the document is compiled with tex4ht
.
Put in the document preamble:
\newcommand\mychessboard[1][]{\chessboard[#1]}
and modify your sample.cfg
:
\Preamble{xhtml}
\CutAt{section}
\begin{document}
\renewcommand\mychessboard[1][]{\HCode{<div class="chessboard">}\Picture*{}\chessboard[#1]\EndPicture\HCode{</div>}}
\EndPreamble
You need to change \chessboard
commands to \mychessboard
in your document:
\documentclass[12pt]{article}
\usepackage{xskak}
\newcommand\mychessboard[1][]{\chessboard[#1]}
\begin{document}
\newchessgame[id=main]
\mychessboard
\newchessgame
\mainline{1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6}
\xskakset{moveid=2w}
\mychessboard[setfen=\xskakget{nextfen}]\\[1ex]
Position after 2.\,\xskakget{lan}
\end{document}
as I said, this isn't a best solution, only a workaround, this shoulf be handled in configuration for chessboard
package, chessboard.4ht
.
The result: