CHESSBASE AND HTML

by Steve Lopez

One of the interesting aspects of the Internet explosion is that it allows anyone to be a writer/editor/publisher. To see the truth of this, one need go no farther than firing up an Internet search engine and typing in the word "chess". There are literally hundreds of web pages devoted to chess. Most of them are merely links to other web pages about chess, which are in turn other pages of links, and so on. But once you've taken a couple of laps around the barnyard, you discover that there are still a few dozen worthwhile chess pages out there, with new ones appearing all the time.

I got a nice e-mail the other week from longtime ChessBase user Mark Kaprielian. Mark is interested in doing a chess web page and wants to know how ChessBase 6 can help him in this endeavor.

Well, Mark, there's good news and bad news. Allow me first to digress a bit...

About six years ago, I used to write and edit a club newsletter (the late, lamented Pawnography) and, let me tell you, it was very tough going. I had to do all the writing on notebook paper in longhand (as I didn't own a computer back then and I'm a terrible typist). I had the great fortune of being married to a typesetter (of the human variety, as opposed to mechanical). She would take my notes and create a great-looking newsletter out of it, complete with headlines, graphics, etc. Want to know how we did the diagrams? I had to take a vinyl travel set (the kind with the stick-on "Colorforms" pieces) to work, set up the positions by hand, photocopy each position individually, and give her the photocopies. She would then physically paste them in place and photocopy as many copies of Pawnography as I needed.

Between my lousy handwriting and the fact that she doesn't understand chess notation, I'm amazed that we had as great-looking a newsletter as we did (with amazingly few typographical errors). But it was a heap of work. It took me a weekend to write a four-page publication, and it took her most of a day to create the actual product from my notes and photocopied diagrams. What a grind!

Today, chess publication (especially on the Web) is surprisingly easy. All you need are something to write about, a copy of ChessBase, an HTML program, a graphics program, and a Web browser to check your work.

That's the good news. The bad news is that there are still things you can't get using ChessBase (like Informant-style symbols or algebraic coordinates in diagrams).

Here's an example how I typically do this sort of this for our Web pages. First, I'll enter and annotate a game in Chessbase and save it in a database. However, I do not use Informant-style symbols. There's a reason for this: HTML only supports certain types of fonts and our specialized ChessBase chess fonts are not on that list. While there is a way to specify that these fonts be used as part of the HTML formatting of a page, they still won't be visible to the readers unless they have the same fonts on their own computer. So, when annotating, use text wherever possible.

I also do not use the [CTRL-D] combination to add diagrams to the annotations. I prefer to add the diagrams manually. If you use this switch, you'll get a grid of characters in your text file instead of a diagram. You'll need to delete the grid later and put in a HTML image tag anyway, so save a step now and don't even bother with [CTRL-D].

The next step is to make sure you're using letters for the piece names and not symbols. Go to the "Status" window and click "Options". Click on the button marked "KQNBRP.x+" and then click "OK". This will prevent you from becoming embittered by opening your text file and seeing high-ASCII gibberish instead of piece names.

Next, with your game on the screen, go to the "Printing" menu and click "Create textfile". A new box opens and allows you to name a text file. After doing so, another box appears and allows you to specify parameters for the textfile you're about to create.

I prefer to select "CBS" for the format. This will give you a straight ASCII text file, with the exception of a couple of control characters in the header. I also select "indentation"; this will put variations in brackets and indent them a few spaces so that they can easily be identified as separate from the main gamescore. "Max width" is a matter of preference. If you're going to create an HTML file, this really won't matter as HTML sets its own widths anyway. But since I'll be using an HTML program to edit the text, I select "75" to make it easier on myself later.

Why "CBS" format instead of "RTF"? Because RTF will insert tons of control characters that will be invisible to your word processor but will stick out like a sore thumb on your Web page. I'll talk more about word processors in a minute.

Now we come to the actual writing part of the process. Obviously, you're going to want to have some sort of article surrounding your game to give it some sort of context, right? This will require some writing on your part.

If you've never written, it's harder than it looks. It typically takes me two to three hours to write Electronic T-Notes and that's just for the first draft. It'll take me another thirty to sixty minutes to clean it up, edit, and proofread it (and I usually fail miserably at the latter step). If you have no previous writing experience, do yourself a favor and pick up a book on the elements of writing style. You can easily find one at a college bookstore. I snagged my copy on the Beacon Handbook (Second Edition) on sale for $5 at a chain bookstore at the mall. It will really help you when you come across those tricky cases.

Another tip: speaking as a professional writer, word processors are very overrated. These things are designed for desktop paper publishing, not publishing in the electronic medium. Consequently, most word processors will put hidden control characters and other junk into your file and make it look like you used a word cuisinart instead of a word processor.

If you're going to write for the Web, just use a text editor. You can get away with using DOS Editor if you like. I prefer several shareware programs, though, as they usually include a margin feature. I can set the on-screen margin for 75 characters, and when that number is reached the program shifts down and starts a new line automatically (without inserting little control characters, too!).

Start your article and when you reach the point where the game should appear in your text, just import the text file you created with ChessBase into your article. If your text editor doesn't allow this, just use DOS Editor to do the cut and paste. Leave yourself notes in the gamescore as to where you'd like diagrams to appear; you can edit these out later.

Speaking of editing, this is the place where you'll edit out the control characters that ChessBase puts into your game header. These characters are a leftover from the days of ChessBase's old hypertext (like we used in ChessBase University) and are certainly not needed for your HTML document. ChessBase only sticks a half-dozen or so of these characters into your header, so it will only be a second's work to remove them.

Now we come to the problem of diagrams. The easy way to create a diagram is to just go to that position in your gamescore and click "Clip diagram" in the "Printing" menu. This will send a copy of the diagram (as control characters) to the Windows clipboard. Then open up the graphics program that comes with Windows ("Paint") and click "Paste" in the Edit menu. Windows will automatically change ("bitmap") the diagram from a grid of control characters into an actual chessboard diagram.

You can then save the diagram to disk. Unfortunately, Windows Paint will only save diagrams into .BMP format, which is not recognized by HTML as a valid file format. So you'll need to use another graphics program to convert the file into either .JPG or .GIF format, either of which is recognized by HTML (tip: use .JPG -- the files are smaller in size than .GIFs). There are a number of shareware/freeware programs available that will allow you to perform this conversion.

In fact, your graphics program may actually convert the diagram from control characters directly into a chessboard diagram for immediate saving into any format you choose. Try it with your graphics program; you may be able to altogether eliminate the step of using Windows Paint.

The hard way to do it (but one which will retain the algebraic coordinates) is to eliminate the display of the notation/commentary while still in ChessBase and reduce the size of the game window until just the board and the coordinates are displayed therein. Then just hit [ALT-PRINT SCREEN] to create a screen capture of the contents of your active game window. You can then import this into Windows Paint or another graphics program and resize/crop/alter it to your heart's content, while retaining the algebraic coordinates.

Whichever method you choose, once you have a diagram created all you need to do to have the diagram appear on your page is to insert the proper HTML tag into your text.

Take your text file, tag it up with all the required HTML commands, and you're done. Voila! Gorgeous Web page!

Thus the bad news is that you can't use Informant symbols or figurines for piece names in HTML. The good news is that it doesn't take a lot of time or effort to publish a professional-looking chess Web page using the tools provided by the ChessBase program.

As for questions about HTML itself, writing, editing, or journalistic ethics (the latter being a commodity in short supply on the Web, unfortunately), I can't help you because I'm out of time! See you next week!

I want to hear from you! Please post comments to our ChessBase Users Group or e-mail me directly.