Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am new to LaTeX/skak. I use htlatex to generate a small ebook html.

\documentclass{book}

\usepackage[ps,mover]{skak}

\title{test1\\Test}
\author{Asim}

\begin{document}

\parindent=0pt

\maketitle


\newgame
\mainline{1. d4 d5} \mainline{2. c4 Nf6 }


\end{document}

But the resultant notation shows up as an english letter 'N' instead of the figurine notation. What wrong am I doing?

I have attached the log file (when I run htlatex), resultant .mobi file and the locations where I have Figurine fonts: https://docs.google.com/folder/d/0B5UN6Nh9m6BjZmxPNjV5NHhGcU0/edit

Appreciate if somebody could help, since I have tried everything that I could.

share|improve this question
    
Welcome to TeX.sx! The tex4ht documentation has quite a bit about enabling different fonts. Which methods there have you tried? –  Andrew Swann Jan 21 '13 at 18:02
    
Which version of skak are you using? I tested now with skak 1.4 and MacTex and the font shows the pieces not the letters. –  Pouya Jan 21 '13 at 22:26
    
Try adding \usepackage{chess-workshop-symbols} –  Pouya Jan 21 '13 at 22:51
    
Thanks Andrew/Pouya. I noticed that with my original .tex pasted above, the .dvi file actually shows the figurine notation! I use Calibre to generate the .mobi file and the final .mobi file shows plain font instead of Figurine. What does this mean? –  asim Jan 22 '13 at 2:36
    
Noticed that immediately after the htlatex command, the console shows '--- warning --- Couldn't find font `SkakNew-FigurineBold.htf' (char codes: 32--121)'. Although the .dvi still shows with correct figurine font. I have skak version: (/usr/share/texlive/texmf-dist/tex/latex/skak/skak.sty Package: skak 2008/10/09 v1.5 Chess typesetting –  asim Jan 22 '13 at 2:54
add comment

1 Answer 1

up vote 3 down vote accepted

You need to provide file SkakNew-FigurineBold.htf. This is virtual hypertext font, is used by tex4ht to convert characters from font encoding to xml encoding.

This file should look like this:

SkakNew-FigurineBold 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
'A' ''  65
'♗' '1'  66
'C' ''  67
'D' ''  68
'E' ''  69
'F' ''  70
'G' ''  71
'H' ''  72
'I' ''  73
'J' ''  74
'♔' '1'  75
'L' ''  76
'M' ''  77
'♘' '1'  78
'O' ''  79
'P' ''  80
'♕' '1'  81
'♖' '1'  82
'S' ''  83
'T' ''  84
'U' ''  85
'V' ''  86
'W' ''  87
'X' ''  88
'Y' ''  89
'Z' ''  90
'[' ''  91
'“' ''     92
']' ''  93
'ˆ' ''     94
'˙' ''     95
'‘' ''     96
'a' ''  97
'b' ''  98
'c' ''  99
'd' ''  100
'e' ''  101
'f' ''  102
'g' ''  103
'h' ''  104
'i' ''  105
'j' ''  106
'k' ''  107
'l' ''  108
'm' ''  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-FigurineBold 32 121

Important lines for you are

'♗' '1'  66
'♔' '1'  75
'♘' '1'  78
'♕' '1'  81
'♖' '1'  82

these lines means that characters B, N, P, Q and R are converted as xml entities for unicode representation of chess characters. Number 1 in second column means, that these characters will be converted to images. This is needed in your case, because in ebooks you don't have much control about fonts. Particularly older versions of kindle doesn't support chess unicode characters, so you should insert them as images. You also should create custom config file for tex4ht conversion scripts, because by default, images are suited for computer screen with lower resolution, but e-ink devices have resolution about 167 ppi. For more info about this, see this answer. If you want characters instead of images, just delete these 1 on these lines.

You should also create config file for skak, because if you try to print chessboard, instead of image, you will also get only some characters.

File skak.4ht

\NewConfigure{showboard}{2}
\let\oldshowboard\showboard
\Configure{showboard}{\Picture*{}}{\EndPicture}
\renewcommand\showboard{\a:showboard\oldshowboard\b:showboard}

Some sample file skak-sample.tex:

\documentclass{book}
\usepackage[ps,mover]{skak}
\begin{document}
\parindent=0pt
\newgame
\mainline{1. d4 d5} \mainline{2. c4 Nf6 }
\mainline{3.Ka1 Qa1 4.Ra1 Ba1 5.Na1 a1}
\showboard
\end{document}               

Now with htlatex skak-sample you will get:

enter image description here

share|improve this answer
    
Thanks for such a detailed answer. I shall definitely try it. As a backup I plan to convert the dvi to PNG images and then insert them into html and prepare the eBook manually! sigh –  asim Jan 29 '13 at 2:55
    
It worked! T.H.A.N.K.S! –  asim Jan 29 '13 at 18:55
    
@asim you are welcome :) –  michal.h21 Jan 29 '13 at 19:27
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.