by Steve Lopez

In last week's ETN we learned how to create a new empty textfile as part of a ChessBase database and examined a few of the available commands. This week we're going to examine more textfile options, primarily those used for hypertext linking.

We've all used tables of contents and indexes in paper books -- you look something up and then flip to the listed page. Obviously, you can't "riffle the pages" of an electronic book to get to the "page" you want, and this is why hypertext linking was invented. A hypertext link is simply a pre-programmed "jump" that takes you to another part of the e-book.

If you've looked at a ChessBase training CD, you've seen these links in action. The author will explain a concept and then you'll see a game reference (in green and underlined) immediately following the explanation (for example, "Nunn, J - Miles, A Amsterdam 1985"). When you click on this game reference, the game in question opens in a new window and you can replay it. When you're finished, you just close that game window and return to the text. That green, underlined game reference is a link -- it jumps you to a different part of the database (in this case an illustrative game).

There are a number of different types of links you can use in a ChessBase database text. You get to the commands for many of these by going to the Format menu in a ChessBase text window (as we saw last week) and selecting "ChessBase". A submenu opens containing a number of commands for adding links and other external items to your textfile.

"Game" is a pretty simple one to use. You just open a game (from the same database), return to your text, and select this command. An underlined green link to this game is inserted into the text. Obviously, this requires that you work a bit "backwards": if the game you want is not currently in the database, you'll need to copy it into the database first (there's no point in linking to a non-existent game, right?). Then you open the game. When you click on the "Game" command, a link is inserted pointing to the last game you opened.

So this requires a bit of "thinking ahead". For example, I just finished writing an e-book on computer chess. One chapter discusses the Kasparov-Deep Blue matches. I knew the subject of the chapter going in, so after I created the empty database text for that chapter I immediately copied all of the required games into the database. As I was writing the chapter and I wanted a link to a specific game, I just went to the database's game list, double-clicked on the game, returned to the text screen (by using the button for that window on the Windows Toolbar), and popped the link into the text. This was easier than copying the games into the database one at a time as I wrote references to them.

The next command is "Position". This works two ways. If no game is currently open, clicking on this command gives you the standard ChessBase 8 position setup window, in which you can manually set up a board position. Note that this must be a legal position (with both a White and Black King on the board - there is a trick to doing illegal positions, which we'll look at next week). After you've set up the position, click "OK" and you'll get another dialogue which allows you to set the board size, lets you "crop" the board (letting you use just the top or bottom half, for example), and has a check box which lets you select whether or not algebraic coordinates will be displayed around the board's perimeter. Click "OK" after setting these parameters and you'll have a chess board diagram appear in your text. If you want to move this board (centering it, for example) just use your mouse to highlight the diagram and choose "Centered" from the alignment submenu.

By the way, the reason you might want to crop the board would occur in cases in which the whole board isn't required -- for example, illustrating a smothered mate by a Knight against the Black King on h8 would require only the top half of the board. You can save some space by only using that half and omitting ranks one through four from the diagram.

But let's say you have a specific position from an actual game which you want to include as a diagram. That's easy. Open the game, go to that position, return to the text screen, and select "Position". This takes you right to the second dialogue described above (in which you set the board size, etc.); after clicking "OK", you'll see the required board position as a diagram on the screen.

"Table" lets you insert a hypertext link to a tournament crosstable. Open the game list for your database and highlight the first game of that tournament (by single-clicking on it). Then return to the text screen and select the "Table" command. A green hypertext link appears; clicking on it will provide a new window displaying the crosstable for that event. Note that you must have all the games of the tournament present in the database for this function to work properly. By the way, you can conceivably cut and paste a crosstable and make it an actual part of the text (as opposed to making a link to a crosstable window -- see ETN for January 28, 2001 for details) in the event you don't want to include all of the tournament games as part of the database.

"Player" lets you create a hypertext link to a player's "ID card" (see ETN for January 7, 2001 for more on ID cards). A dialogue allows you to type in the player's name (remember to type his or her last name in the lefthand box, followed by the first name or initial in the righthand box). Click "OK" and a green link will be inserted into the text -- clicking on the link will bring up that player's ID card in a separate window.

"Text" allows you to create a link to another database text in the same database. Of course, this assumes that there are multiple database texts in the database, otherwise you'll get bupkis when you click on this command. If there are other database texts in the database, clicking on this command will provide a dialogue with a list of them. Click on the required text to highlight it and then click "OK". You'll see a new link appear in your text -- when the reader clicks on it, he'll be jumped to the linked text. This is an excellent way to create a "table of contents" for your e-book. You start your database with a text called "Table of Contents"; anytime you add a new database text "chapter", you provide a link for it in the table of contents. Keep this in mind -- I'll be ranting about it later.

"Game list" provides a link to the game list of the current database. The reader clicks on the link and he gets the game list window, exactly as if he'd double-clicked on the database's icon.

"Key" works in a couple of different way (just as "Position" did above). Obviously, if no keys are attached to a database, you get nada when you select this command. But if there are keys attached to the database, you'll get a couple of different results here. If no key is currently open, you'll get a link to the opening key by default (a "gold key" button will appear; when the reader clicks on it, he'll see the opening key for the database appear in a new window). But let's say you want a link to that database's endgame key. You just open the key first (go to the game list and click the "Endgames" tab). Leave that window open, return to your text, and click "Key". You'll now see a button that looks like a blue key (with the numeral "2" superimposed). When the reader clicks on that button, he'll get the database's endgame key in a new window. If you want a specific subkey to be the target of the link, you do it the same way -- make sure the proper listing is displayed in the key window, return to your text, and click the "Key" command. As an example, you want to create multiple jumps to the keys of several opening variations. Just display the key for the first variation, return to your text, and click the command. You'll get a button that will take the reader to that key. Then go back to the key display, go to the second variation's key to display it, return to your text, and click the command, etc.

As a side note, if you're going to include multiple key links, it's a great idea to preface each button with some text telling the reader what that jump will do (in other words, what variation they'll see). Otherwise you'll just be confusing people if you provide ten "gold key" buttons in succession with no explanations as to what each individual button does.

"Book" provides a jump to an opening book (a .CTG file). You need to have a book open first, otherwise you get nothing when this command is invoked. Also make sure that the opening book is included when you distribute your e-book. Opening books are huge, though -- if you're creating an e-book for download, you'll likely not be including an opening book. This command is most useful for when an e-book is to be distributed on CD.

"External database" creates a link to a second database (in other words, a database other than the current one in which the text resides). Open the second database by double-clicking its icon, return to your text, and invoke this command. A link to that database will be provided in your text. However, another caveat is required. I'll just quote the CB8 Help file on this one, since they worded it so succinctly: Naturally if you send the database with the text to somebody else you must also include the external database, otherwise the link will not work.

The final command is "Searchmask". This is an extremely cool little item that lets you add pre-programmed searches to your e-book. For example, you've just written a chapter on Kasparov's handling of the King's Indian Defense as Black and you'd like your readers to be able to see these games for themselves. Obviously, providing individual links to hundreds of games would be time and space consuming (as well as ugly as all get out). So you just copy the games into your e-book and, at the proper place in your text click on the "Searchmask" command. You'll see a dialogue that lets you give the link a title (the way the link will appear in your text -- in this case "Kasparov's KID games" will do nicely). Click "OK" and this brings up the CB8 searchmask into which you'll type the proper search parameters. In this case, you'd type "Kasparov" in the box for "Black", uncheck "Ignore colors", and place the values "E60" and "E99" in the ECO fields. Click "OK" and you'll see the link appear in your text just the way you titled it. When the reader clicks on this link, the requisite games will automatically be searched and he'll get the games in a new game list window. As I stated above, this is an excellent way to pre-program searches into your e-book. The reader doesn't have to set up the Search mask and perform the search -- the e-book does it for him.

Moving on down the Format menu, we see four additional commands. "Web site" lets you insert a link to an Internet site. You'll get a dialogue box into which you'll type the URL (and, to keep mistakes and typos from occurring, you'll probably want to cut and paste the URL straight from your browser into this dialogue, instead of just typing it). The reader will click on this link, his browser will fire up, and (assuming he's online at the time -- duh) he'll be taken to that web page.

"Pin note" replaces a block of text with a hypertext link. If you have some long-winded paranthetical aside that disrupts the flow of your text, you just highlight the rambling screed and select "Pin Note". A dialogue appears that lets you create a title for the link. Click "OK" and the highlighted text vanishes, to be replaced by a green hypertext link. When the reader clicks this link, he'll see a separate box open which contains your (formerly highlighted) rant in all its glory.

"Text label" brings up a dialogue that lets you type in a text string. When the reader clicks on the link that's created, it'll jump him to the next instance in which that text appears in the database. It's similar to the "Find" command in web browsers and word processors.

"Horizontal line" is just that -- a way to add a line to separate sections of text. Invoking this command brings up a dialogue that lets you set various parameters, such as the line color and thickness, as well as its positioning within the text.

That's it for the commands. Keep in mind that if you make a mistake (for example, you insert a board position and you later change your mind and want to remove it), just highlight the offending item and hit the Delete key.

Also realize that there is a big difference between "Save" and "Replace". Hitting "Save" will save a new copy of the database text into the database. If you keep hitting "Save", you'll wind up with whole heaping gobs of database texts in your database. If you add a paragraph to your text and want to save your work, use "Replace" instead -- this replaces your old database text with the updated version.

Last week I promised you a rant -- here we go. It's concerned primarily with instances in which a writer is creating a chess e-book. If you're just doing a database of your chess club's championship, with the 36 games of the event, and you want to start the database with a nice text containing info and some photos of the event, what I'm about to say won't be a big deal. But if you're planning on doing a multi-text, multi-chapter chess book in ChessBase electronic format, this rant will be crucial.

The way you'll typically structure your e-book is to divide it into chapters, with each chapter being contained in its own database text. A table of contents as the first database text in that database is a really useful thing; it will allow the reader to jump to the chapter of his choice with a minimum of effort.

There are a lot of various links you can put into a ChessBase database text: links to other texts, links to games, links to keys, etc. Many e-book authors tend to overdo the linking, though. "Cool! I can link to anything from anywhere!" they say and they start adding links like there's no tommorrow. A couple of examples will serve to illustrate the point.

Several years ago, I was employed (as part of my duties) as the editor of various electronic books. One particular author (who shall remain nameless) insisted on ending every section (not chapter, mind you, but every subsection within a chapter) of his book with hypertext links to every other section of his e-book. In other words, every section ended with what was (in effect) a complete table of contents. I argued bitterly with this guy: "Man, that's going to just confuse the reader!" His rejoinder was something to the effect of "But that's the beauty of electronic books! You can have links to every other part of the book, giving the reader instant access to anything!" We subsequently released the book in its original form and I don't guess I need to tell you what happened -- we were deluged with calls from readers who found the thing impossible to navigate.

The technique used by that author is known as "spaghetting the links". Instead of links being presented in a logical framework, they're "spaghettied" -- the links lead to more links, which lead to other links, which lead to other links, and the poor reader has no way to navigate back to where he was when he started clicking on links. Every book I've ever read on hypertext and electronic publishing (and I've read quite a few of them, as the subject is a particular interest of mine) will tell you to not do this to your reader.

Another example, almost as bad, also concerns navigation. I edited or tested a few e-books by another author who habitually buried his tables of contents. His e-books typically began with two or three files' worth of introduction before you ever got to the table of contents. Every stinking time you opened his e-book, you had to navigate through multiple files of yah-dah yah-dah before you could find the table of contents link -- just so you could get back to the point at which you'd previously stopped reading. His defense was that the introductory material was crucial for the reader the first time they opened the e-book, so he placed it ahead of the table of contents. I agree -- it was crucial for the reader the first time they opened the e-book but, for those of us who got past the first session and wanted to get to a later chapter, all of the extra clicking around was a real pain in the patoot. It would have been way better to have the TOC first, with links to every chapter of the book and with the introductory material clearly labelled with "Read this first", instead of burying the TOC (and the stupid link that even displayed it) inside a maze of intro text.

Unfortunately, I was basically powerless to change the structures of these books. It would have necessitated a complete and time-consuming restructuring process for which we just didn't have the time or resources. But I did learn a valuable lesson from the experience.

It boils down to this: you might think hypertext linking is a real whiz-bang technology (and I agree with you if you do), but that doesn't mean that you have to go nuts with the linking. That'll drive your readers crazy. It all boils down to structure. An e-book is still a book -- just in a non-paper format. The old tried and true methods of structuring a paper book (i.e. in a linear "start to finish" pattern) will still work wonderfully well in the electronic format -- even better in some cases, as we'll see.

Here's how a typical paper book is structured. You have your title page, your table of contents, your intro and foreword, your chapters, and any appendices, footnotes, and/or indexes tacked on at the end of the book. An electronic book will work the same way. You can combine the title page and the table of contents into a single database text -- just put the title and author name in a big header across the top of the text. Then, as you add chapters to the database you also add the corresponding links into the table of contents below the title header. One stone, two dead birds.

At the end of each chapter, you add two links: one to the next chapter and one to the table of contents. This gives the reader two options: to continue reading the book: in the traditional linear manner (each chapter following the last) or returning to the TOC to jump to an entirely unrelated chapter (but one in which he's interested). You don't reproduce the whole dang TOC at the end of each chapter (as we saw in the first bad example we looked at above) or add bunches of links to various other chapters or sections -- you just give the reader a link to the existing TOC. It's that simple. And be sure to put the TOC link after the link to the next chapter (i.e. make the TOC link the last link on the page); in case the reader is new to hypertext and he thinks (for some odd reason) that he has to click on every link, you're guiding the reader by directing him to the next chapter instead of back to the TOC.

Appendices are handled just like chapters -- you just put these texts at the end of the e-book and add the links to the table of contents. Indexes? Forget 'em -- you don't need them in a ChessBase e-book. You can do text string searches in the Search Mask (and, if you've structured your e-book with short chapters and clear chapter titles, the reader will likely be able to find references on his own). Footnotes can be handled with the "Pin note" command. Type your footnote, highlight it, click "Pin note", type in a number for the link (so it will appear as a numeral on the text page) and, when the reader clicks the link, he'll see your footnote.

Simple, isn't it? It's easy on everyone -- you the writer (when you're structuring and organizing your e-book), your editor (assuming you have one, when he's proofreading your e-book and checking things like structure and ease of use), and most of all on your readers.

An e-book is ideally just that -- a book, but in electronic format. The closer it is in structure to a traditional paper book, the more appealing it will be to your readers (because they won't have to "relearn" everything they've known about books since their childhood). If you spaghetti the danged thing with multiple text links every few paragraphs, you'll lose the reader. They'll exit your e-book and never go back. So the old idea of KISS applies here: Keep It Simple, Stupid. I've found that the "spaghetti syndrome" is part of what's holding e-books back in popularity -- some computer old-timers tried e-books a long time ago, found that the early efforts were a spaghettied muddled mess, and not only never went back to them but advised their friends to avoid them as well. That's a shame, but it's something that can be corrected. Make your e-book easy to navigate and you'll likely create a new "e-book convert" along the way.

I'll rant on about structure (as well as various "stupid text tricks") in next week's Electronic T-Notes. Until then, have fun!

You can e-mail me with your comments, suggestions, and analysis for Electronic T-Notes.