2

This is a follow-up of this question of mine and uses the same setup.

I am trying to typeset chess annotation symbols. The MWE is

\documentclass{article}
\usepackage{xskak}
\newcommand\mychessboard[1][]{\chessboard[#1]}
\usepackage{chess-workshop-symbols}

\begin{document}
\wbetter       \\   % fails
\bbetter       \\   % fails
\wupperhand    \\   % fails
\bupperhand    \\
\wdecisive     \\   % fails
\bdecisive     \\   % fails
\equal         \\
\unclear       \\   % fails
\compensation  \\   % fails
\withattack    \\
\withinit      \\
\counterplay   \\
\zugzwang      \\
\mate          \\
\withidea      \\
\onlymove      \\
\betteris      \\
\file          \\
\end{document}

All symbols display correctly if I process the file with pdflatex. Using tex4ebook, some don't display correctly as indicated by the fails comment above.

Is there a way to fix this? Thanks.

Edit: Added image to show calibre/ebook viewer result mentioned in my comment.calibre/ebook viewer result

1 Answer 1

3

The problem is that several symbols doesn't have Unicode counterparts, so we need to output them as two characters. In some cases it doesn't really fit the original.

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
'+-' ''  I can't find it, it is plus followed by minus
'-+' ''  minus followed by plus
'=' ''  106
'∞' ''  107
'l' ''  108
'#' ''  109
'=∞' ''  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

Resulting HTML:

enter image description here

And PDF:

enter image description here

\compensation command output isn't really ideal

The problem with Unicode characters is that especially smaller devices, like Kindle may not support all of them. In this case, there are two solutions. First is to request image generation for such characters. It can be requested if you put number 1 in the second column in the htf file:

'=∞' '1'  110

To ease the htf file editing and to find out which lines correspond to particular characters, you can generate font map for SkakNew font with the following Tex code:

\documentclass{article} 
  \input showfonts.4ht 
\begin{document} 
  \showfonts 
     {SkakNew-Figurine} 
     {} 
\end{document}  

compile it with pdflatex.

The second way is to convert the SkakNew-Figurine.otf to woff format, which can be used on web pages and configure the chess characters to use this font. You need to install the helpers4ht bundle and use the following .cfg:

\RequirePackage{addfont4ht}
\Preamble{xhtml}
\AddFontFace{SkakNewFigurine}{SkakNew-Figurine}{SkakNew-Figurine.woff}{}
\Css{.SkakNew-Figurine-{font-family:"SkakNewFigurine",sans-serif;}}
\begin{document}
\EndPreamble
16
  • Thanks for the fixes. My output is same except that \wbetter doesn't display correctly on the Calibre/ebook reader (see picture in updated question). Does it show correctly for you?
    – user41974
    May 24, 2016 at 2:30
  • @user41974 yes, it works for me even in Calibre's ebook viewer. It probably can't find font with glyph for this character on your system
    – michal.h21
    May 24, 2016 at 11:15
  • Thanks for confirming that it's ok for you. Transferring the converted epub file to my kindle didn't help. Is there any way around this problem?
    – user41974
    May 24, 2016 at 11:37
  • Only converting the chess characters as images, I am afraid. Which is far from ideal, as this causes problems with baseline alignment, font size resizing etc.
    – michal.h21
    May 24, 2016 at 12:04
  • Would it possible to install the missing font on my system? Which windows system font does tex4ebook use for these symbols?
    – user41974
    May 24, 2016 at 12:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .