4

I'm completely new to TeX/LaTeX so I could be missing something easy. I'm trying to create a simple chess board diagram with highlighted squares via the "skak" package. Here is a test case:

\documentclass{article}
\usepackage[ps]{skak}
\begin{document}
\newgame
\showmoverOn
\notationOff
\showboard
\highlight{a1,a3}
\highlight[x]{c1,c3}
\highlight[X]{c4}
\highlight[o]{d6}
\highlight[O]{c6}
\printarrow{e2}{e4}
\printknightmove{g8}{f6}
\end{document}

Based on the reading I've done, this should result in several highlighted/marked squares - however it does not. It compiles fine and results in a board with all the pieces, but no markings at all.

I'm compiling it with the latex command on Ubuntu Lucid if that's relevant. Skak is version 1.5 (the latest).

Any thoughts?

Caramdir
  • 89,023
  • 26
  • 255
  • 291
MPT
  • 143

1 Answers1

5

Apparently it depends on how you compile to produce your document and, because of the ps option, you have to go the long route

> latex board.tex
> dvips board.dvi
> ps2pdf board.ps

Doing this I was able to obtain the markings on the board as you expected.

Juan A. Navarro
  • 62,139
  • 32
  • 140
  • 169
  • Ok, that's really strange. The marking don't show up in the .dvi file - but they do in the .ps and .pdf files? I thought all the processing was complete when the .dvi file was produced. Is the dvips command adding these marking in somehow or perhaps the dvi viewer I'm using doesn't render the dvi file properly? – MPT Nov 11 '10 at 22:31
  • 3
    Usually the .dvi is just a “preview” of the final document and some effects, specially postscript effects, sometimes do not show in the .dvi. The best thing would be to find a chess package that can produce pdf directly (using pdflatex), but I have no idea about that. – Juan A. Navarro Nov 11 '10 at 22:35
  • Excellent, thank you. My first day with LaTeX and I've learned some valuable lessons. To the best of my knowledge skak is the best available package for this. I have no problem running the three step process. – MPT Nov 11 '10 at 22:56
  • @MPT: by the way, there is a simpdftex command in TeX Live that does the three steps automatically, just do simpdftex latex file.tex. A more advanced option is latexmk -pdfps file.tex which automatically takes care of running latex as many times as needed to get cross-references right, and more... – mpg Nov 12 '10 at 02:08
  • 1
    \begin{advertising} I would suggest a look at the packages xskak and chessboard \end{advertising} – Ulrike Fischer Nov 12 '10 at 10:07
  • 1
    @Ulrike, I think these are very good suggestions, and it would be extremely useful if you can post a simple example using either of those with pdflatex. – Juan A. Navarro Nov 12 '10 at 10:38
  • @mpg Excellent, thank you very much! I see that I also have a program called "rubber" which appears to have this capability as well. – MPT Nov 12 '10 at 15:49
  • @Sudheer you'll probably get more help asking as a new question. – Juan A. Navarro Apr 19 '17 at 08:20