Exeter Chess Club

Techie Bit

CONTENTS

The esteemed Alastair Scott has constructed a whole [Chess
DTP] Page for budding Chess Authors.

To add to this, Dale Lehmann has a shareware Web Chess Page Authoring Tool for Windows out in beta test version: WebChess Designer v1.00.

[Jon Perry and Patrick Surry at Edinburgh offer more technical advice and programmes: if you're into UNIX, you can produce great diagrams like they do.]


Do you just want to know how to edit/print out the handouts?

To make these pages, the games are entered on a PC using Fritz, and then turned into teaching handouts using Word for Windows via Andy Duplain's superb CBASCII utilities, which have their own CBASCII homepage. They are also available via FTP from the Internet Chess Library (Caissa) ChessBase Tools directory and the Pittsburgh site Directory UTIL. There are hundreds of great PD/shareware files around; I've put the ones I use most for these pages on FTP here at Exeter, but I also get a lot out of Rob Weir's ChessBase Utilities.

All the diagrams in these pages exist as 8x8 arrays of squares. I could have used GIFs of the whole board (e.g. cut and paste from CHESSBD or CBDEMO) but this is memory-hungry (5k a diagram) and doesn't allow use of efficiencies in caching. The GIFs I scrounged from John Tamplin, although I believe they are originally from a release of xboard, author Tim Mann. Patrick uses a different set of pieces (watch for case of file names).

If you have a text-only browser the diagrams should still appear as 8x8 arrays using the alt="*" element; the light and dark squares are "-" and "+", the white pieces are "kqrbn" on light squares and "KQRBN" on dark, and the Black pieces are respectively "jdtls" and "JDTLS". If you have a chess font you should be able to save the file, and edit in the characters you need; this is pretty much the reverse of what I do to make them in the first place.

These Web pages are derived from either the Fritz database (Method 1) or the handouts (Method 2).

N.B. You don't need the Fritz programme itself to make handouts: try instead the ChessBase Windows Demo (which has its own FAQ), or see below! If you can use the CBWin demo., or any other piece of software that writes PGN or CBF files, you can bypass some of the CBASCII route I describe below: see the notes at the end of Method 1.

N.B. When I say Word for Windows, I imagine any other Windows word processor would do.

Of course, you can cut-and-paste bitmaps of whole diagrams, and have one separate large GIF file for each diagram. This is not efficient either in terms of storage on your machine or in download time for other people's machines. So, there may be advantages to using a set of standard images and making diagrams out of 64 of them.

This is how I do it. You need an IBM PC and a UNIX machine for this trick, although DOS versions of the UNIX-y tools are freely available. The thought of doing all 400 of the games in the Canon by hand makes me dizzy, but if you want to do lots of games/positions yourself, you might fancy either just

  1. typing in the positions like Jon Perry does, or
  2. setting up positions using SLICS/CHESSBD
  3. using xboard on a Unix machine like Patrick Surry does, then and using xbdtohtml on a Unix machine or DOS port of PERL.
See also notes on Creating handouts. Now read on...

Method 1: From Fritz .cbf database

  1. Download a copy of CBASCII to your PC from ICL/Pittsburgh or my FTP site or CBASCII homepage.
  2. Download a copy of SLICS/CHESSBD from my FTP site or Don Fong.
  3. Enter games and positions in PGN format using SLICS/CHESSBD. Set output option variable to 2 (PGN), and save as "games.pgn".
  4. Edit the PGN file manually: type in {DIAGRAM} wherever you want your arrays. (Actually {CTRL-D} will also work.)
  5. Convert from PGN to CHESSBASE using
    c:\ cbascii -i games.pgn games.cbf
  6. Convert back out to text with added 8x8 diagrams using
    c:\ cbascii -e -fcb -d8x8=squares.def games.txt games.cbf

    You need to set up a sed definition file: I use this one, which puts junky "^A" characters in, but you can't put nothing in, and lots of other characters have other meanings in chess. [In order to create Word handouts I use instead the mappings to Eric Schiller's Tilburg font: see notes below.]

  7. Upload the text file to Unix. Currently it has "junk" CTRL-A (^A) characters in, which can be removed easily using "mg" or "emacs".
  8. Edit using sed command file:
    % sed -f sq2img.sed games.txt > games.html
  9. Patch in header, footer and get it so as it looks right.

    The sed command file looks a bit of a nightmare but each line beginning with a "|" is a diagram line, I change all the KQRNB to <IMG> tags, and add in 'alt=' elements.

    I have to do it circuitously because I use "l" and "t" to stand for black bishop and rook, both of which are found in the word 'alt'!.

  10. Split your games up somehow: I have a little utility that does it for me but I don't think I'm free to give it away (yet).
  11. Breathe huge sigh thinking that however painful this was, making them manually is worse.
  12. Lastly, don't forget to e-mail Andy Duplain saying what a great programme CBASCII is. Also, write to Don Fong saying what a great programme CHESSBD is, and enclosing at least $12 registration.
The advantage of using PGN is that (a) you can use existing database games, and (b) the computer gets all the piece positions right, and doesn't occasionally leave off pawns like I do.

A desire to do coordinates led me to lash out some of my hard-earned on the Linares font family. If you are compiling Handouts using the character sets appropriate to the ChessBase for Windows fonts, the sed scripts required to turn them into HTML are

sed -f CBWIN1.sed games.doc > games.tmp
sed -f CBWIN2.sed games.tmp > games.html
If you can use the CBWin demo., you can bypass the CBASCII route I describe above using cut-and-paste or Printing-CreateTextFile.

Method 2: From Word handouts

  1. Create a Word for Windows handout, as in steps 1-2 below.
  2. The Word for Windows handout is saved as a Rich Text Format file.
  3. Upload the RTF file to UNIX and apply rtftohtml to get an HTML version.
  4. Edit in piece image references using
    % sed -f tilburg.sed handout.html > tmp
    % sed -f addalt.sed tmp > handout.html
    With all the diagrams, about 12 pages of A4 in Word comes out at 100-150k of HTML.

Method 3: Creating handouts

There are several PC solutions to this task (if you aren't using a chess-playing programme with a print facility) but they all start with getting hold of a chess font. Alastair's [Chess
DTP] Page has got several freebies displayed at his site.

Then you need to create little 8x8 arrays of characters in your document to fit your font. You can do this either:

The last being the most accurate, and hence the one I use. And yes, they really do look better! [With Word for Windows 6 Alastair has some nice macros to do some of the stuff above, but I suspect you aren't using that with 2Mb]
  1. use CBASCII to create text files with 8x8 diagram arrays, as in steps 1-6 above. [I use Eric Schiller's Tilburg font (see below), which also can be used nicely with Anders Thulin's Chess Diagram Editor, available from my FTP site or the big US sites and their mirrors.] I get to a document I can edit by using a CBASCII character mapping that fits the chess font I use, that is, on the PC going:
    c:\ cbascii -e -fcb -d8x8=tilburg.def games.doc games.cbf

    CBASCII takes game number options, so you can output just the ones you want.

  2. edit the text file using your favourite word processor: I usually set the handout in two columns, with half-a-dozen or so separate paragraph styles to get the appearance of chess diagrams:
    normal text:
    Arial 12pt, paragraph 0.5 line before, 1.5 spacing
    game comment:
    normal + 1.0 spacing
    game moves:
    normal + indent and bold
    game variation:
    normal + italic
    game subvariation:
    normal + italic and indent
    diagram:
    Tilburg 12 pt, paragraph indented both sides, border
    variation diagram:
    diagram + Tilburg 10pt,extra indent, double border
    Here is a completed Word for Windows handout. There's also an example of a Word 6 file italian.doc among the Openings handouts. If you don't have Tilburg you'll have to edit in another font (change TILBURG to TASC) and change the characters (/0220 to A, /0221 to a, ...) to see these properly. The troff character translations to create a plain ASCII text are given here.
  3. Using other TrueType fonts: Tilburg was the firstest with the mostest as far as I was concerned, and is still advertised as the main commercial option by UK database agents, although I think it has been overtaken by Steve Smith's Alpine fonts (Linares, Zurich, Hastings, etc.).

    PD alternatives have appeared since I got going, including Hans Bodlaender's Chess Utrecht Font, TASC's Figurine font, and there's a TT version of the Adobe cheq font packed with Alastair Scott's FEN macros for Word for Windows. TASC and CHEQ fonts have borders but not coordinates. All praise and thanks to these folks for putting their hard work out free for us hacks...

    As these fonts use 'normal' characters like ABC to stand for chess pieces you have to use a different font for body text. [You might end up doing that anyhow with Tilburg as it uses characters in the 0220-0244 range for pieces, which is a royal pain to type in].

    Of course, you can use all these with CBASCII in the same way as Tilburg, viz.

    c:> cbascii -e -fcb -d8x8=normal.def normal.txt diagram.cbf
    c:> cbascii -e -fcb -d8x8=tilburg.def tilburg.txt diagram.cbf
    c:> cbascii -e -fcb -d8x8=utrecht.def utrecht.txt diagram.cbf
    c:> cbascii -e -fcb -d8x8=tasc.def tasc.txt diagram.cbf
    c:> cbascii -e -fcb -d8x8=cheq.def cheq.txt diagram.cbf
    c:> cbascii -e -fcb -d8x8=linares.def linares.txt diagram.cbf

    I have made up a demonstration file for these fonts in this way as a Windows Write file.

Steve Smith's commercial TT fonts e.g. Linares, also use "normal" characters and can offer borders and coordinates. If I was starting again I might start with one of these, as I think Tilburg doesn't yet support borders or coordinates. The Linares fonts include versions which will (a) work wonderfully with the Chessbase for Windows Demo, and (b) turn 'natural' chess text (1.Nf3) into figurines. If you can use the CBWin demo. with these fonts, you can bypass the CBASCII routes I describe above using cut-and-paste or Printing-CreateTextFile.


Clearly all these files still need a lot of tweaking with sundry UNIX tools to get them to look like web pages, and if I could get the hang of the TeX chess macros, I might even use them instead! If you have any comments or suggestions on how to do this more easily, I'd love to hear from you.

How do I print out the Web page handouts?

These notes arose after I got a note from a friend:
 [...] 
 I don't know how easy it is, but one suggestion I have is to make a
text/postscript printable version of the material, without the
diagrams! They are great in colour on the web page, but do take up a
lot of paper, and don't go into wordprocessors (mine, at least). I
made a copy of your French Defence ideas by dragging and dropping the
text around the diagrams into a text editor, a few Latex commands, and
the whole looks nice in six pages, very handy at home with the chess
board. 
 
Of course, most browsers have a simple print option. These notes are only for those who find this unsatisfactory (the diagrams are bulky, get split across page ends; the handouts are sometimes very long) and would like another route. [PC/UNIX users only, I'm afraid, until someone helps me out]
  1. The easiest way I know to create your own text-only printable version using the save (p) option in LYNX, which will include ASCI diagrams. This is very quick, although I'd find it a bore to do the lot that way. I've no idea how to do this in Netscape: you can turn images off but I don't think you can do that when you print. But Otherwise, you'll have to save the source and macro out the tags. I've had a go at doing this myself, i.e.
    sed -f html2txt.sed file.html > file.html.txt
  2. There are now text-only versions of all the .html files; they have the same name "file.html" with the extension ".txt", i.e. file.html.txt. You can edit and print these to suit yourselves.
Comments etc. to the usual mailbox.
Back to Table of Contents Back to Chess Coaching Page

This document (techie.html) was last modified on 21 Jan 97 by

Dr. Dave