Friday, March 20, 2015

The OoChess FAQ

At the moment, I've not been asked any questions yet. But I expect there will be lots of them in the weeks and months ahead, so this is where to look if you have some question that is not answered either in the blog or the manual:

The OoChess Manual


http://1drv.ms/1GgiIXt

When you click on the above link, the manual will be displayed in Word Online. Just below the top left corner, just below Word Online, you'll see the  DOWNLOAD button. Click on this to download a copy of the manual for yourself.

The FAQ




Contact Information

If you need to contact me for any reason, email me at:

andrewinthematrix 

The above is my Gmail address minus the @gmail.com. Just append that to the end and you'll have a valid email address. (Sorry for the extra trouble this may cause you, but it is necessary to avoid email robots.)


I check my email periodically through the week, so don't be disappointed if you don't get a reply for a couple of days. I'll do my best to answer your OChess questions.

Before you send me an email, you may be able to save a lot of your time by first checking with the manual to see if you can find a solution to your problem there:


The OoChess Manual


http://1drv.ms/1GgiIXt

When you click on the above link, the manual will be displayed in Word Online. Just below the top left corner, just below Word Online, you'll see the  DOWNLOAD button. Click on this to download a copy of the manual for yourself.

The OoChess FAQ


Another place to look for answers is the OoChess FAQ. It can be found here:

http://oochess.blogspot.ca/2015/03/the-oochess-faq.html


Sunday, March 15, 2015

The OoChess Configuration File

What's it For?


In the C:\Users\Public\OoChess folder you'll find a text file called: OoChess.txt. This is a special configuration file that the OoChess helper program reads each time it is called upon to insert a PGN, a Quiz or Game or Opening Index. It's main use is to provide the user with a method of controlling the formatting of the information about each game. It also allows users of languages other than English to better adapt the output to suite their own linguistic needs.


The Two Sections of a PGN Game


The helper program will format all the games you choose to insert from a PGN file. Each game in the PGN file is formatted into two sections. The first section contains all the information of the game, such as the names of the players, the event and site of the game, etc. This information is taken from the start of each game in the PGN file. An example of this, from a PGN file, would look like this:

[Event "74th Tata Steel GMA"]
[Site "Wijk aan Zee NED"]
[Date "2012.01.14"]
[Round "1"]
[White "Navara,D"]
[Black "Topalov,V"]
[Result "1/2-1/2"]
[WhiteTitle "GM"]
[BlackTitle "GM"]
[WhiteElo "2712"]
[BlackElo "2770"]
[ECO "A20"]
[Opening "English Opening"]
[EventDate "2012.01.14"]


It would be a very tiresome and tedious process if this information was simply inserted 'as is' into the document and the user had to edit it all into some presentable form. The helper program formats all this information into a presentable form for you. Here is an example:


The second style for the game information uses a simple text-based display:

Game 1
 Navara  D   GM  (2712) -  Topalov  V   GM  (2770)
74th Tata Steel R1
Wijk aan Zee, NED, 14/01/2012


The second part of a game in a PNG file is referred to as the movetext section. This is the section that contains the score, or the moves of the game, along with any commentary. In a PGN file, the movetext of a game looks something like this:

1. c4 e5 2. g3 Nf6 3. Bg2 d5 4. cxd5 Nxd5 5. Nc3 Nb6 6. Nf3 Nc6 7. O-O Be7 8. a3
O-O 9. b4 Be6 10. Rb1 f6 11. d3 Nd4 12. Nxd4 exd4 13. Ne4 Bd5 14. Bb2 f5 15. Nd2
Bxg2 16. Kxg2 Kh8 17. Nf3 Bf6 18. Qc2 Qd7 19. Rfc1 c6 20. a4 f4 21. b5 cxb5 22.
axb5 Nd5 23. Nxd4 Rae8 24. Nf3 Bxb2 25. Qxb2 Qe6 26. Qd4 fxg3 27. hxg3 Qxe2 28.
Qxd5 Re3 29. Re1 Qxf3+ 30. Qxf3 Rexf3 31. Rb2 Rxd3 1/2-1/2

This section can contain commentary, enclosed in { and } brackets, chess symbols, designated by a dollar sign, $, followed by a number from 1 to 255, and, often, something called a 'diagram marker,' which is a request to print a diagram of the current position in the game. The helper program of OoChess nicely formats this section for you, using a number of options that you can choose from.

The Configuration File Itself


The OoChess configuration file is a simple text file that contains formatting options to be used by the OoChess helper program when processing a PGN file for insertion. Here is an example:

; Here we do some format options 'o'+

ow = ""
ob = ""
oc = ""

This file, which resides in the C:\OoChess folder, can be edited with any simple text editor, like Notepad. Empty lines, or lines that begin with a semicolon, are skipped during the reading of the file by OoChess, so you can use the semicolon to add comments to your configuration file as a reminder of what each option is and what you have selected.

The options themselves begin with a group letter, almost always 'o', followed by an option command letter, then the '=' sign, and the actual option setting itself. Option settings can be numbers or "strings" depending upon the option.

Formatting Options for the Game Information


Almost all of the options deal with the game information section of the PGN game and how the information will be formatted. This is especially useful for languages other than English.

Output format White ow = "string"
("string" = Language-specific 'White', default = "")

This is used to set the name of the color 'White' to precede the name of the White player in the InfoBox. Use this only if you wish to have the color of the White player written before his or her name. For example, in Spanish you might want to set the option to:

ow = "Blanco"

If you don't want any color name to be written before the name of the White player, you can set this option to an empty string:

ow = ""

Output format Black ob = "string"
("string" = Language-specific 'Black', default = "")

This is used to set the name of the color 'Black' to precede the name of the Black player in the InfoBox. Use this only if you wish to have the color of the Black player written before his or her name. For example, in Spanish you might want to set the option to:

ob = "Negro"

If you don't want any color name to be written before the name of the Black player, you can set this option to an empty string:

ob = ""

Using Spanish as an example, the two player's names in our game would appear in the InfoBox as:

Blanco:   Navara D GM (2712)
Negro:    Topalov V GM (2770)

Output Format Strings in General


The OoChess helper program uses a system of place-markers within formatting strings to indicate the position of some data at which it is to be printed. Each place-marker begins with a '%' character, followed by the letter that represents the data. This sounds complicated, but it really isn't. Let's start with a very simple example, the game number output format.

The game number output format string uses the place-marker, %g, to indicate the placement of the actual game number. (The game number is incremented by one after each game in the PGN file is formatted. Thus the first game is game 1, the second is game 2, etc.) The simplest game number format string would be:

"%g"

In this case, only the number of the game would be printed, nothing more. But that might not be very useful, so you can add any other text that you like inside the format string, and it will be printed along with the game number. Here is an example:

"Game %g"

That is much more useful. Now the game number will be printed as: Game 1 … Game 2 … etc. You can already see how much more useful this method is for working with other languages.

There are three special characters that can be used inside a format string to indicate the use of BoldItalic and Underlined text. These are the * character for Bold, ~ for Italics and _ for Underlined. You can use these characters to surround any text within the format string. Putting it all together, we could then write a game format string like this:

"~Game~ *%g*"

This would give us a result something like: Game 1 ... Game 2 … etc.

This is pretty much all you need to know about format strings in general. Now on to specific cases.

Output format Game number og = "string"
(Uses %g for game number, default  =  "~Game~ %g")

This is used to write the game number at the top of each game. For example:

og = "~Game~ %g"

Setting the og string to an empty string indicates that you don't want any game number printed at all.

Output format ECO opening code oo = "string"
(Uses %o for ECO code, default  =  "ECO %o")

This is used to write the ECO code in the infoBox of each game. For example:

oo = "ECO %o"

Setting the oo string to an empty string indicates that you don't want the ECO code printed at all.


Output format Elo oe = "string"
(Uses %e for Elo, default  =  "(%e)")

This is used to write each player's Elo rating in the infoBox of each game. For example:

oe = "(%e)"

The Elo format string is printed immediately following the player's name. Setting the oe string to an empty string indicates that you don't want the Elo printed at all.


Output format Event ov = "string"
(Uses %v for Event, default  =  "%v")

This is used to write the Event of the game in the infoBox. For example:

or = "*%v*"

Setting the ov string to an empty string indicates that you don't want the Event printed at all.


Output format Site os = "string"
(Uses %s for Site, default  =  "%s")

This is used to write the Site of the game in the infoBox. For example:

os = "*%s*"

Setting the or string to an empty string indicates that you don't want the Site printed at all.


Output format Round or = "string"
(Uses %r for Round number, default  =  "*R%r*")

This is used to write the Round of the game in the infoBox. For example:

or = "*R%r*"

The Round format string is printed immediately following the Event name, on the same line. Setting the or string to an empty string indicates that you don't want the Round printed at all.


Output format Date oy = "string"
(Uses %Y for Year, %M for Month, %D for Day, %N, %n for Month Name, default  =  "%D/%M/%Y")

This is used to write the Date of the game in the infoBox. For example:

oy = "%D/%M/%Y"

In the PGN game, the Date Tag looks like this:

[Date "2012.01.14"] or, showing the placement of our place-markers: [Date "YYY.MM.DD"]

You will often run across games that have a Date Tag that looks like this:

[Date "2012.??.??"]

This simply means that the month and day of the game are unknown. In such a case, only the year will be printed.

You can use the place-markers to arrange the date in any way that you like. You can also use the %N as a place-marker for the name of the month, rather than just its number. A lowercase %n shortens the name of the month to just the first 3 letters.

The Date format string is printed immediately following the Site name, on the same line. Setting the oy string to an empty string indicates that you don't want the Date printed at all.

NOTE: The use of %N and %n only provides the English names of the months! Support for other language month names is yet to be supported.

Output format Player Name op = "string"
("string" uses %L,%l for Last Name, %F,%f for Fist Name, %I,%i for Initial, %T,%t for Title, default = "*%l, %i* ~%T~")

A player's name appears in the PGN White, Black or Annotator Tag as:

[White "Navara,David"]
[Black "Topalov,Veselin"]


Each of these player's can also have an associated Title Tag:
 

[WhiteTitle "GM"]
[BlackTitle "GM"]


The place-markers can be used to construct any format you wish to display a player's name. The %T place-marker is for the player's Title, if one is available in the corresponding WhiteTitle or BlackTitle PGN Tag. This too can be added to the player's name. The use of uppercase place-markers tells the program to convert that portion of the name to uppercase, whereas the use of lowercase markers tells the program to preserve the case of the name.

The op format command is applied to both the White and Black player names. There is a special format command just for the  Annotator. Here are a few examples using the above player's names:

op = "*%l, %i* ~%T~"          Navara, D GM
op = "*%L* %T"                NAVARA GM
op = "%T %f *%l*"              GM David Navara



Output format Annotator Name oa = "string"
("string" uses %L,%l for Last Name, %F,%f for Fist Name, %I,%i for Initial, %T,%t for Title, default = "*[%l, %i* ~%T~*]*")

The Annotator's name appears in the PGN  Annotator Tag as:

[Annotator "Navara,David"]

The Annotator can also have an associated AnnotatorTitle Tag:

[AnnotatorTitle "GM"]


The rules that apply to formatting the White and Black player's names also apply to formatting the Annotator's name. But there are two differences to note. The first is that while the OoChess helper program understands the AnnotatorTitle Tag, it is not a recognized tag in PGN, so you are unlikely to come across other software that writes this tag. So you can either edit the PGN file to add this tag yourself, or you can just ignore it altogether. (If no  AnnotatorTitle Tag is present, the OoChess program will simply ignore the %T in the format string. You can always add the Annotator's title yourself directly in the document, once the game has been inserted.) The second difference is in the placement of the Annotator's name. It is written at the very end of the game itself, as in the Informant style. For that reason, the default format string encloses the Annotator's name in square brackets. You are free to change this to suite yourself.


Output format game Termination ot = "string"
(Uses %w for White result, %b for Black result default  =  "*%w:%b*")

This is used to write the game termination, or game result. This is written immediately at the end of the game itself, just before the Annotator's name. The values of %w and %b are taken from the PGN Result Tag:

[Result "1/2-1/2"] or, with of our place-markers: [Result "w-b"]

This format option allows you to specify just how you would like the game result to be displayed.

ot = "*%w:%b*"


Output format 1/2 Character o2 = "string"
(default = "½")

This format options simply allows you to set the "string" to be used for the Result Tag's "1/2" used to indicate a draw.  The default is to use the single character, ½, in place of the "1/2" string used by PGN. This o2 string is used when formatting the game Termination above. You could choose to go with PGN's "1/2" or you could use the "=" sign, another common method.


Formatting Options for the Game Itself


Now we come to the formatting of the game itself. There are a number of options here, most of which control the creation and formatting of automated diagrams. But first we'll look at the options that affect the appearance of the game itself.


Output format Diagram Number od= "string"
(Uses %d for diagram number, default  =  "No. %d")

This is used to format the diagram number at the top of each diagram. For example:

od = "No. %d"

Another example might be:

od = "~Diagram~ *%d*"

Setting the od string to an empty string indicates that you don't want any diagram number printed at all.


Output format Diagram Caption oc= "string"
(Uses %m for last move, default  =  "Position after %m")

The OoChess helper program can write a caption under each diagram it creates as you can see in this example:

Position after 3... b6


The Diagram Caption format option allows you to set your own formatting. The last move played, the move that sets up the position in the diagram, uses the place-marker %m in this formatting option. The default for this option is shown in the above diagram. It would be written as:

oc = "Position after %m"

You might prefer to have nothing but the last move played as the caption. In that case you could set this option as:

oc = "%m"

If you wish to have no captions to your diagrams at all, you can do this easily be setting the Diagram Caption format string to an empty string:

oc = ""



Output format FEN Caption of = "string" (The FENCap)
(Uses %w %b %e %s %r %y %m %c, default  =  "")

For PGN game fragments, you can have the OoChess helper program ignore the usual game information formatting that is used for a complete game and have the information formatted under a diagram of the initial position.

When we encounter a FEN game to be inserted, we will first check to see if the user has declared an of string. (The FENCap string.) If so, we then ignore writing the game info at the top of the game altogether, only writing the game number along with the game info, and then leave the rest to be written under the diagram in the FENCap. A example of a FENCap command is:





For this diagram, the following was used:

of = "*%w – %b*/~%s %y~ %c"

For all other normal games, that begin at the initial position, the selected info type will be used.

Note that the options available for this command are:

of = "FENCap String"

You can use any of these PGN tags as part of the FENCap string:

%w – White player (Last name only)
%b – Black player (Last name only)
%e – Eventually
%s – Site
%r – Round
%y – Year
%m – Move Number (As in 13... ?)
%c – Color to Move (Shown as a box)



Output format Quiz Caption oq = "string"
(Uses %d %m %c %v, default  =  "*%d*|%m")

The caption for a Quiz diagram is controlled by the Output Format Quiz Caption command. This is placed inside the OoChess configuration file. There area four place-markers available:

%d    The current diagram number.
%m    The move number (as in 13... ?)
%c    Color to move (shown as either a white or black box)
%v    Evaluation of the position (shown as i or o depending upon game result)

You are free to use the special formatting characters, * ~ and _ for Bold, Italics and Underlined. Note especially the use of the vertical bar character |. This is a special character that tells the helper program that you want the caption to be divided into two separate parts, one displayed at the left edge of the diagram, and the other on the right edge of the diagram. This can be clearly seen in the example below. If the vertical bar is not used in the oq command, then it is understood that the user wants the text of the caption to be centered over the diagram. In this case, it is more likely that all you would want is the diagram number.



Five Miscellaneous Formatting Options



Diagram Marker am = "string"
(default = "Diagram #")

If your chess editing software does not have a mechanism for inserting Diagram Markers into a game, you can simply create your own Diagram Marker string, and then type it at the start of a comment after the move that gives rise to the position you want a diagram for. Once you have decided upon a Diagram Marker string, all you have to so is let the OoChess helper program know what it is. You do this using the Diagram Marker option.

am = "Diagram #"

The helper program will look at the start of every comment to see if it beings with the Diagram Marker string. If it does, it creates a diagram of the current board position and writes it to the file that will be inserted into your document. It's as easy as that.

The Diagram Marker option can also be used to set the Diagram Marker string to whatever string is used by your chess software to indicate a diagram is to be printed.


Move Column Placement ac = "string"
(default = "25,30,70")

This setting is used only if you have chosen the Classical Game Style. It is the only style that uses columned game moves. You can use this option to refine the placement of the three columns. The first is the move number column, followed by the White move column and the Black move column. Here is an example:

ac = "25,30,70"

In this example, the helper program will place the move number column at 25% width of the text column. The White moves will be written at 30% of the text column width, and the Black moves will be written at 70% of the width.

One thing to note about this option: The move number is a special right-justified tab stop, so its percentage value is set at the end of the numeric string, whereas the moves themselves are left-justified, so their percentage values are set at the start of the move:

     23.    Nxd4       cxd4
_______|____|__________|___
       25   30         70



Info background Color ic = "rgb(R,G,B)"
("rgb(R,G,B)"= ?, Default = ?)

This option sets the background color to use for the InfoBox. It is only used when Info Style is set to 1, the InfoBox. To set the background color, you must use an rgb color string as in the following example:

ic = "rgb(255, 255, 240)"

The above line will set the background color to the light yellow color used in the above examples. The rgb letters refer to the primary colors, Red Green and Blue. The numbers for each color must be between 0 and 255, with 0 meaning no color at all, and 255 meaning full color. So rgb(0,0,0) is the color black, whereas rgb(255,255,255) is white. A nice light-gray is obtained using rgb(230, 230, 230).

The next group of options deal with the formatting and display of individual items from the game information section. These options make it much easier to use the helper program in languages other than English, and to tailor the program's output to meet the needs of the writer.


Game Index Title ox = "string"
(default = "*Game Index*")

This setting allows you to set the name to be used for the Game Index. Alternatively, you can just as easily edit the default Game Index title once it has been inserted into your document. That is probably the easiest option. You may wish to do this in order to make the game index title a heading, such a Heading 1, so that it will automatically be included in the TOC.


Opening Index Title oz = "string"
(default = "*Opening Index*")

This setting allows you to set the name to be used for the Opening Index.  Alternatively, you can just as easily edit the default Opening Index title once it has been inserted into your document. That is probably the easiest option. You may wish to do this in order to make the opening index title a heading, such a Heading 1, so that it will automatically be included in the TOC.


User-configurable Start Variables

While it is easy to quickly change most of the settings in the Template, it can become tedious if every time you start it you find yourself having to reset the Figurine Language or the chess font that you always use, etc. For this reason, a number of important variable settings have been placed at the top of the Basic script of the Template to allow you to modify their starting values permanently. This is not at all difficult to do, and you only have to do this only once.

TIP: Before modifying the Template file itself, you should make a backup copy of it!

To modify the Template itself, you must right-click on the Template file and then select Open. When the Template file has finished opening, click:

Tools → Macros → Organize Macros → Openoffice.org Basic
This will bring up the Openoffice.org Basic Macros Dialog.



Now click on the small box in front of the Template's name to open up the subheadings Standard and then ChessDiag1. You should now see all the Basic Subroutines listed on the right side of the dialog window. It should look like the following:


 
Now click on the Edit button. This will bring up the IDE (Integrated Development Environment) Window. Scroll to the very top of that window. You should now see something like this:


At the very top in the Macro editor you should see the User-configurable Start Variable list. It will look something like this:

' The User-configurable Start Variables ----------------

Const StartDiagramAlignment = 3 ' 0 = LEFT, 1 = RIGHT, 2 = BLOCK , 3 = CENTER
Const StartWaitTime = 500 ' the time to delay before making the next move after taking one or more back
Const StartSkipVars = 0 ' by default we don't skip over variations when parsing moves (Use 1 to skip over them)
Const StartStrictParsing = 1 ' tells the move parser to skip orphaned moves if set to 1 otherwise try to parse them

Const StartDiagSmall = 12 ' 10 to 32 in increments of 2
Const StartDiagMedium = 18 ' 10 to 32 in increments of 2
Const StartDiagLarge = 22 ' 10 to 32 in increments of 2
Const StartFont = 0 ' 0 = Linares 1 = Zurich, 2 = Hastings
Const StartLanguage = 0 ' 0 = English "PNBRQK" 1 = "BSLTDK" 2 = "PSLTDK" 3 = "PCFTDR" 4 = "PCATDR"
Const StartBorder = 2 ' 2 = Single border (1 = Thick, 2 = Single 3 = Double, 4 = Wide, 5 = Single Algebraic, 6 = Double Algebraic)
Const StartSingleFigs = 1 ' Convert single letters to Figs (0 diables this.)

Const StartFigNudge = 1 ' Nudge Figurines up 1 pt. (0 disables this)

' Start Variables for the Insert Opening Index Dialog ---------

Const StartOpenIndexGameReference = 2 ' 0=Number Only 1=Page Number 2=Hyperlink
Const StartOpenIndexOpeningNames = 1 ' 0=None 1=Opening Only 2=Openign+Variation 3=Opening+Var+SubVar
Const StartOpenIndexIgnoreGameFragment = 1 ' 0=Use Game Fragments 1=Ignore Game Fragments
Const StartOpenIndexFigurines = 1 ' 0=Dont use Figurines, 1=Use Figurines

' Start Variables for the Insert Game Index Dialog ---------

Const StartGameIndexGameReference = 2 ' 0=Number Only 1=Page Number 2=Hyperlink
Const StartGameMainPlayerName = "" ' Used for the name of the player to make an Oppoent Index of
Const StartGameIndexUseLetterHeadings = 1 ' 0=Don't use them 1=Use them
Const StartGameIndexCapEntryName = 1 ' 0=Don't captitalize Entry Names 1=Capitalize them
Const StartGameIndexIncludeOpponentNames = 1 ' 0=Don't Include them 1=Include them
Const StartGameIndexIgnoreGameFragment = 1 ' 0=Use Game Fragments 1=Ignore Game Fragments
Const StartGameIndexTabLetterHeadings = 0 ' 0=Don't wrie a Tab for letter headings 1=Write a Tab
Const StartGameCreateOpponentIndex = 0 ' 0=Don't create an opponent index 1Do


' Start Variables for the Insert PGN & Quiz Dialog ------------

Const StartPGNGameFormatStyle = 0 ' 0=Traditional 1=Classical, 2=Modern
Const StartPGNBoldGameMoves = 1 ' Use Bold for actual Game Moves (not variations) 0=Don't use Bold
Const StartPGNUseFigurines = 1 ' Use Figurines for Game Moves 0=Don't use Figurines
Const StartPGNResetDiagramNumber = 1 ' Reset Diagram Number to 1 for each new Game (0 disbles this)
Const StartPGNGameNumber = 1 ' First Game Numbered 1
Const StartPGNDiagramNumber = 0 ' First Diagram Numbered 1 (0 cancels diagram numbering)
Const StartUseQuizInfo = 0 ' Don't use Game Info in Quiz Solution (set to 1 if you want it)
Const StartQuizSelection = 3 ' Start with 3 Diagrams across the page (Legal values are 1 to 4)
Const StartMoveNumberPeriod = 0 ' Don't write a Period after the Move Nubmber (set to 1 if you want it)
Const StartDiagramCaptions = 0 ' Don't write a Caption under the Diagrams (set to 1 if you want them)

Const StartCaptionSize = 12 ' Font size to use for Diagram Captions. Valid options are 8,10,12,14 ONLY!
Const StartInfoSize = 10 ' Font size to use for Game Information. Valid options are 8,10,12,14 ONLY!
Const StartUseInfoBox = 1 ' If you don't want the InfoBox for your games, set this to zero
Const StartInfoWidth = 75 ' Width of Game InfoBox as a % of columns width
Const StartInfoBorder = 1 ' Single Border for InfoBox (2 is Double border)
Const StartTextSize = 12 ' Font size to use forGame Text. Valid options are 8,10,12,14 ONLY!
Const StartLinkedQuiz = 0 ' Detemines whether we link the Quiz diagram number to hte solution New Code: May 30, 2014
Const StartTwoQuizSolColumns = 0 ' Determines if we use two columns for Quiz solutions New Code: July 21, 2014
Const StartQuizSolDiagSize = 16 ' Determines the size to use diagrams created as part of the Quiz solutions New Code: July 23, 2014
Const StartBracket1stLevelVars = 0 ' by defualt we don't bracket 1st level vars in Quiz solutions! New Code: July 26, 2014

' Start Variables for the Insert Crosstable  Dialog ------------

Const StartXTableBorders = 1 ' 1=Borders
Const StartXTableFontSize = 10 '
Const StartXTablePadding = 10 '
Const StartXTableTitles = 0 '
Const StartXTableElos = 0 '
Const StartXTableNameFormat = 0 ' Last name only
Const StartXTableMaxSwissPlayers = 20 ' Maximum no. of player to add to a Swiss crosstable
Const StartXTablePerfElo = 0 ' Don't bothe writing a Performance Rating Column

The numbers, in red, are the values that you can change.

Most of the above Start Variables are clear enough to understand and the comments following them describe the allowable options.

There is, however, one more important pseudo-start variable that you may wish to alter. This is the small array of available fonts to be used for the text of inserted PNG games or a Quiz. By default, the Template has four different text fonts pre- recognized. They are: Times New Roman, Palatino Linotype, Calibri and Gisha. In almost all instances you'll want to stick with Times New Roman, but you can choose any text font that you wish. In fact, in the Insert PGN Dialog or the Insert Quiz Dialog, you can select any of the available text fonts shown in the list, or you can enter your own favorite text font in the list and it will be remembered for the duration of your editing session. But you can easily add any text font that you wish to the Template permanently, just as you can do for the Start Variables. All you have to do is ad the name of your favorite font to the TextFontNames list that is located inside the OoChess Sub. This is the Template's initialization subroutine that gets called whenever you open a document with the Template. It is located near the top of the Template's Basic code, just after the long list of various variables. It looks like this:

' ------ This is the Initialization Macro ----------------------------
Sub OoChess
   TextFontNames = array("Times New Roman", "Palatino Linotype", "Calibri", "Gisha", "", "", "", "", "", "")
   TextFont = "Times New Roman"

As you can see above, there are already four fonts in the list, but there is room for ten font names in total. Let's assume that you wanted to add the font Arial to the list permanently. All you would need to do is simply find the first empty string in the list, and replace it with "Arial". If you did this in the above example, you'd end up with:

   TextFontNames = array("Times New Roman", "Palatino Linotype", "Calibri", "Gisha", "Ariel", "", "", "", "", "")

 This will permanently add the font Arial to your Template file and it will always be available to you in the font list of both the Insert PGN and Insert Quiz Dialogs.

This might seem like a strange way to add fonts to a list, but it is much better than trying to add all the fonts installed on a computer to a drop down list. Almost all of the fonts installed on your computer are unsuitable to use as a text font for chess, and all of these fonts would have to be sorted by name as well. Furthermore, many of the fonts that should be removed from such a list, such as mathematical symbols or web symbols, etc., are poorly identified as 'symbol' fonts, and so they cannot be reliably removed from a font list. For this reason, I chose to use the current system for choosing a text font. It is both simple and flexible.

Once you have edited the values of the user-configurable start variables, all you need to do is save the new Template file. To do this, simply click on the Save button in the IDE window. (It is the button that looks like a floppy disk.) Close your Template file, and then right-click on it and select New to start a new document.

Reorder Games

The ability to insert a PGN game into your document, and have all the formatting done for you, is a nice, helpful feature. But it is quite possible that you may end up with your inserted games being out of order in your document. As an example, you may have inserted the first five games, and then later decide that you would like to insert another game between the 2nd and 3rd game. But now all the game numbers will be out of order, something like this:

Game 1
Game 2
Game 6
Game 3
Game 4
Game 5


You can't just simply rename the game numbers, as that will not change the underlying game information that is attached to it in a bookmark. (And in any case, renumbering all these games by hand is a pain!) What to do?

Well, you can use the Reorder Games tool to renumber all your inserted PGN games both by number and by their bookmark name. Here is the Reorder Games icon:


When you click on the icon, it will bring up the Reorder Games dialog:


In almost every situation you'll want to set Starting Game Number to 1, so that is provided as the default. But there may be unusual situations where you might want to set this to some other number. An example may be where you have an on going chess magazine where each subsequent issue begins with the last issue's last game number plus one. The idea here is to be able to refer to any year's game by number directly without reference to the month. (I know it is an odd idea, but there you go.)

Every inserted game in your document will ultimately be renumbered, from the very first game to the very last. You cannot ask it to only renumber so many games starting with some game in the middle.

The Game Number Intro Text allows you to tell the template what text you used before the actual game number. (This text is part of the configuration Output format Game number, or og = “String”.) An example of this option would appear in your configuration file as:

og = "~Game~ %g"

Your game would then be written something like this:

Game 3
Nenarokov - Perlis
[D35]

In the dialog above, you can see that the Game Number Intro Text has been set to Game. The Space between just informs the template that you have a space between Game and the actual game number.

When you click on OK, the template code will rename all of the game's bookmarks and will also attempt to rewrite the game number as well. The end result should be a complete reordering of all the games and their numbers.

Note that it is possible to reorder the games even if you have not chosen to number them explicitly. For example, If you wished to suppress game numbering , you would set the Output format Game string in your configuration file as:

og = ""

This suppresses explicit game numbering. If have chose to do this, then you must leave the Game Number Intro Text empty and make sure that the Space between is not checked.


Insert Opening Index

Assuming that you have inserted a number of games into your document using Insert PGN, you can also have an opening index inserted into your document by clicking on the Insert Opening Index icon:


This will bring up the Opening Index Dialog:



Game Reference


 The options in this section work the same as they do above in the game index.

With the Number Only option selected, the games are referenced only by their game number.

With the Page Number option selected, the games are referenced by their page number. This uses a special page number field for the page number. So even if the page that your game first appeared on when you created the index changes, all you have to do is update the fields and the proper new page number will appear in the index. (You can update all the fields by pressing F9, or press Tools → Update → Fields.)

With the Hyperlink option selected, the games are referenced by a hyperlink in much the same way that a link works on a web page. You can hold down the Ctrl key and click on the hyperlink to go directly to the game. This feature is particularly useful if you plan to export your document to a PDF file. In that case, your readers will be able to click on the hyperlink to go directly to the game inside the PDF file.

Opening Names


These options allow you to determine how much opening name information you wish to include in the opening index. This opening name information is taken from the following file:

The Uucpokeys.eco File

In the OoChess folder (C:\Users\Public\OoChess) you'll find a file named, ucpokeys.eco. This is a special file that the program uses to match ECO codes with actual opening names. Every time that you insert a PGN game into your document, OoChess uses this file to classify the opening of that game, or games. It inserts a special hidden number into the document to indicate the ECO code, opening name, variation and subvariation name. This information can then be used to insert an Opening Index into the same document.

The option that you choose under Opening Names determine show much of this information that you wish to include in your opening index. You can also choose to Use None.

Figurines


In a number of opening lines, you'll notice that they sometimes include chess moves. For example:

D14 QGD : Slav : Exchange 6. Bf4 Bf5

If you select Figurines, these chess moves will be converted to figurines in the opening index.

Ignore Game Fragments


This operates in the same way as it does in the game index dialog. All game fragments will be ignored and will not be included in the opening index.

The Opening Index Title


By default, the opening index will be given the title: Opening Index. You can set your own title for the opening index by using the oz configuration file command. As an example, you could add the following line to your OoChess configuration file to change the name of the title:

oz = "*Openings*"

Of course, you can just as easily edit the default Opening Index title once it has been inserted into your document. That is probably the easiest option. You may wish to do this in order to make the opening index title a heading, such a Heading 1, so that it will automatically be included in the TOC.

An example Opening Index

Opening Index

A06: Reti : Nimzovich-Larsen Attack (...Bd7) - 24
A14: English : Neo-Catalan, with b3 - 21
A25: English : Closed System : Modern Line - 23
A26: English : Botvinnik System - 18
A26: English : Closed System : Modern Line - 3, 30
A30: English : Symmetrical : Hedgehog - 12
A36: English : Symmetrical : Botvinnik System Reversed - 4
A87: Dutch : Leningrad : Modern Line - 10
B03: Alekhine's Defense : Exchange Variation - 9
B05: Alekhine's Defense : Modern : Flohr Variation - 34
B12: Caro-Kann : Advance : (Karpov, Seirawan) - 33
B15: Caro-Kann : Gurgenidze : (e5 f4) - 13
B21: Sicilian : Grand Prix Attack - 8
B22: Sicilian-Alekhine-Alapin : (Smith-Morra) - 17
B23: Sicilian : Grand Prix Attack : Schofman Variation - 20
B25: Sicilian : Closed - 31
B25: Sicilian : Closed : Spassky Variation 6.f4 - 14
B38: Sicilian : Accelerated Fianchetto : Maroczy Bind 6.Be3 Nf6 - 15
B40: Sicilian Defense - 5
B40: Sicilian Defense : Honfi Variation (b3) - 32
B44: Sicilian : Szen Variation : Dely-Kasparov Gambit - 26
B80: Sicilian : Scheveningen : Variation (f3) - 22
C01: French : Exchange : 3.Nc3 - 29
C78: Ruy Lopez : Archangel Variation (...Bc5) - 19
D15: QGD : Slav : 4...a6 - 25
D15: QGD : Slav : 5.e3 (Alekhine Variation) - 2
D24: QGA : Bogolyubov Variation - 1
D36: QGD : Exchange : Modern Line - 11
D45: QGD : Semi-Slav : Stoltz Variation - 28
E15: Queen's Indian : Nimzovich Variation : (Exaggerated Fianchetto), Main Line - 6
E32: Nimzo-Indian : Classical Variation - 16
E81: King's Indian : Kramer System Saemisch - 7
E81: King's Indian : Saemisch : Benoni Formation - 27


A Note About the Opening Index


The opening index code uses a 64-bit Zobrist has code to represent each of the 9,000 or more opening positions that are contained within the  ucpokeys.eco file. This is not a 100% perfect system, but is robust enough that the chances of a mis-classification are extremely remote, so much so that I wouldn't  expect it to happen at all.


Insert Game Index

The OoChess helper program can also be called upon to create a game or opening index that can be inserted into your document. This feature is only available for games that you have inserted into your document using the template's Insert PGN command. Each time that you insert a game, or a number of games, the OoChess program writes a bookmark along with the game that contains information about the game. (Essentially, it is saving a few of the basic PGN Tags along with the game.) This information is hidden from view, but the indexing commands can access it and pass it along to the OoChess helper program to build either a game or opening index.

Insert Game Index

Assuming that you have inserted a number of games into your document using Insert PGN, you can have a game index inserted into your document by clicking on the Insert Game Index icon:


This will bring up the Game Index dialog:


As you can see from the Game Index Dialog above, there are a number of options available.

Game Reference Section

 

This section allows you to select how the games are to be referenced by your game index. Also note that when the player is playing White in a game, the game reference will be displayed in bold.

With the Number Only option selected, the games are referenced only by their game number.

With the Page Number option selected, the games are referenced by their page number. This uses a special page number field for the page number. So even if the page that your game first appeared on when you created the index changes, all you have to do is update the fields and the proper new page number will appear in the index. (You can update all the fields by pressing F9, or press Tools → Update → Fields.)

With the Hyperlink option selected, the games are referenced by a hyperlink in much the same way that a link works on a web page. You can hold down the Ctrl key and click on the hyperlink to go directly to the game. This feature is particularly useful if you plan to export your document to a PDF file. In that case, your readers will be able to click on the hyperlink to go directly to the game inside the PDF file.


Index Options:


This section allows you to select a number of features that affect how the game index appears. Consider this small illustrative game index example:

B
BERNSTEIN - Duras 10

In the above example, the capital letter 'B' is a letter heading. If you want these headings, then check the Use Letter Headings setting.

If you are using letter headings, you may wish to have a Tab stop written before each heading so that it sits out from the left edge of the page. By default, a Tab stop of 1 cm is applied:

    B
BERNSTEIN - Duras 10

You can edit the style, GiHeading, to change the length and type of Tab stop used. Set the Tab Letter Headings setting if you want this.

Again, using the above example, the first name on the line, Bernstein, appears entirely in capital letters in order to distinguish it from the names of the opponents. To use this, set Capitalize Entry Name.

Once more from the above example, after the name of the first player, in this case, Bernstein, you'll normally see a list of all his opponents and the reference for each game played against each opponent. You can choose to have the names of the opponents listed along with the game reference, or just have the game references instead. If you chose not to include the opponent names, then the above example would become:

B
BERNSTEIN - 10

To get the opponents listed, set Include Opponent Names.

Ignore Game Fragments simply tells the OoChess helper program to ignore inserted PGN games that are game fragments. That is to say, a game that does not begin from the normal starting position. (Such games have a FEN Tag.)

The Game Index Title

 

By default, the game index will be given the title: Game Index. You can set your own title for the game index by using the ox configuration file command. As an example, you could add the following line to your OoChess configuration file to change the name of the title:

ox = "*Games*"

Note the use of the '*' to indicate bold. (You can also use ~ for italics and _ for underline.)

Of course, you can just as easily edit the default Game Index title once it has been inserted into your document. That is probably the easiest option. You may wish to do this in order to make the game index title a heading, such a Heading 1, so that it will automatically be included in the TOC.

An example Game Index


Game Index

B
BERNSTEIN
- Duras 10
BURN - Cohn 2
C
COHN
- Burn 2
D
DURAS
- Bernstein 10
DUS CHOTIMIRSKY - Mieses 1
F
FORGACS
- Speijer 6
FREIMAN - Tartakower 8
L
LASKER
- Schlechter 5
M
MIESES
- Dus chotimirsky 1
N
NENAROKOV
- Perlis 3
P
PERLIS
- Nenarokov 3
R
RUBINSTEIN
- Znosko borovsky 7
S
SALWE
- Spielmann 9
SCHLECHTER - Lasker 5
SPEIJER - Forgacs 6
SPIELMANN - Salwe 9
T
TARTAKOWER
- Freiman 8
TEICHMANN - Vidmar 4
V
VIDMAR
- Teichmann 4
Z
ZNOSKO BOROVSKY
- Rubinstein 7

The Opponent Game Index

 

Another useful type of game index is the opponent game index. This is especially useful if you are writing a book about a particular player, or if you are writing a book about your own games. As an example, consider Fischer's very famous book, My 60 Memorable Games. Other examples of such books are: My Best Games of Chess – Anand, My Life and Games – Kramnik, etc. In such a case, it is common to create an index of the games based upon the opponents of the main player.

If you look at the bottom of the Game Index Dialog, you'll see the following options:


If you wish to create an opponent index you must check the Create Opponent Index box.

The Main Player (Opponent Index) is where you enter the name of the player to be used for creating the opponent index. This player should be the main player, the player who appears in every game (or almost every game.) As an example, In Fischer's My 60 Memorable Games, the main player is, of course, Fischer. So this is the name that you would type in the Main Player text box.


An example Opponent Game Index


An Opponent Game Index is just a special case of a regular game index. Consider the example below of an opponent game index that was generated from a handful of games by Fischer:

Game Index

B
BYRNE
- 1
C
CARDOSO
-  3,  4
E
EUWE
-  2
K
KERES
- 5


As you can see, this is really just an expanded form of Fischer's entry from a regular game index:

F
FISCHER
- Byrne 1 - Cardoso 3, 4 - Euwe 2 - Keres 5


A Note About the Game Index


The game index has certain limitations. For one, it only uses the last name of each player. This should not prove to be too great a problem for anyone, unless they are planning on writing a book on the games of the Polgar sisters. In that case, you're in big trouble! (I may implement a change for this too in a future version, if there is enough of a demand for it.)

One other thing to note about the game index: the letter headings use European ordering rules (EOR / EN 13710), so they appear in this order:

AÁÀÂÅÄÃÆBCÇDÐEÉÈÊËFGHIÍÌÎÏJKLMNÑOÓÒÔÖÕØŒPQRSߊTUÚÙÛÜVWXYÝŸZŽÞ

The actual names in the index are sorted in the order that is applicable to the locale of the computer that is used to creating the index. So my Danish friend should get an index ordered by Danish rules, whereas a user in Spain should get an index ordered by Spanish rules. It should also be pointed out that the program uses Windows-1252 for its character encoding. This means that most common European accented letters are supported, but certainly not all of them.


Saturday, March 14, 2015

Crosstable Insertion With OoChess

The OoChess Template's handy helper program can perform a number of complex tasks. One of those tasks is the ability to create a crosstable from an event selected from within a PGN file, and then insert that table into the Writer document at the cursor. Inserting a crosstable is actually a two-stage process. In the first stage, the PGN file is read by the helper program to generate a list of the events that are in the file so that they can be displayed in the Insert Crosstable Dialog. In the second stage, the Dialog is presented to the user allowing him to select an event from the PGN file and to set a number of formatting options. Once the event and the options have been set, the user can press the OK button to complete the insertion process.

To begin, click on the Insert Crosstable Icon on the Chess Insertion Toolbar:


 Find the PGN file that contains the games of the event you want a crosstable generated for and then inserted into your document. Then click Open. You will see a brief flash of a black window on the screen. Don't worry, this is the OoChess helper program. It is a simple Console program written in C. After a PGN file is selected, it gets called to generate a list of all the events in the file so that it can be used by the Insert Crosstable Dialog which appears next:


There are a number of options for inserting a Crosstable.

Borders, quite naturally, determines whether there will be a border around your crosstable.

Padding provides left and right padding around the crosstable elements. The units are in twips. Here is the same crosstable with a 10 twip padding and another with a 50 twip padding:


The maximum twip value allowed is 100.

Font Size sets the font size to be used for all the text in the crosstable. The options are 8, 10, 12 and 14 points.

Name Format determines the format used for displaying each players name in the crosstable. The options are: Last Name Only, Last Name + First Name Initial, and Complete Name. These correspond to:

Fischer
Fischer, R
Fischer, Robert James


Max Swiss Players. Many chess tournaments are Open tournaments where there are a set number of rounds to be played, but there are a great many participants, far too many to be able to have every player play against each other as in a Round Robin. Such a tournament is generally called a Swiss tournament. You can use the Max Swiss Players setting to tell the program to limit the number of players to include in the Swiss crosstable to what you want. With the default set at 20, the program will only include the top 20 player's results in the crosstable. This applies only to a Swiss crosstable!

Title simply tells the program to include the titles of each player in the crosstable if they are available.

Elo tells the program to include the Elo ratings of each player in the crosstable if they are available.

Perf Elo determines whether or not the program will include a Performance Rating column at the end of the crosstable. This uses FIDEs own formula for determining a player's performance rating. In order to be able to use this option, all the players in an event must have an Elo rating. If any player is found to not have a rating, the program will not write the Performance Rating column.

The helper program can create only three types of crosstables: Match, Round Robin and Swiss. Luckily, these three comprise almost all types of chess events.

The Match Crosstable


Here is an example of the Match crosstable:


The Round Robin Crosstable


Here is the Round Robin crosstable from the recently held Tata Steel tournament in Wijk aan Zee:


OoChess can also create Round Robin crosstables for multi-round events:

For Round Robin events, the program uses Sonneborn-Berger for tiebreaks.

The Swiss Crosstable


Here is an example of the Swiss crosstable commonly used for Open events:



PGN Quiz Insertion With OoChess

The OoChess Template's handy helper program can do more than just convert and format a PGN file into a set of games. It can also take a PGN file and create a Quiz or a set of Exercise positions that are then inserted into the Writer document at the cursor. To insert a Quiz, click on the Insert Quiz button on the Chess Insertion Toolbar:


Once you click on the Insert Quiz Icon, you'll see the Quiz Dialog pop up:


As you can see from the Quiz Dialog above, there are a number of options for inserting a Quiz. A number of them have the same name and function as their counterparts in the Insert PGN Dialog.

Text Font Section

 

This section allows you to select a font and a font size to use for the text of the Quiz to be inserted.

Text Size, quite naturally, determines the test size to use for the text. You can choose a text size of 8, 10, 12 and 14. This is for the text of the solutions.

Text Font. Initially, there are only four fonts available: Times New Roman, Polatino Linotype, Calibri and Gisha. If you have a font that you would like to use that is not in the list, simply type its name into the font-selector, say for example Georgia, and that font will be accepted and used. Any font name that you type in yourself will be remembered for the duration of your editing session and will be added to the list of available fonts. (It is also possible to modify the Basic code of the template to permanently add any font that you would like. For more on this, read the manual.)

Cap Size determines the test size to use for the Quiz diagram captions. You can choose a text size of 8, 10, 12 and 14.

Info Size determines the test size to use for the Game Info that can be written after each solution. You can choose a text size of 8, 10, 12 and 14. (See Game Info in Solution below.)

Moves Section

 

The Bold option, when checked, will use bold for all the moves in the Quiz, or exercise solutions that were actually played. It does not affect variation moves or moves that appear in textual commentary.

Figurines is exactly like its Insert PGN counterpart. When this is checked, the moves of the Quiz, or exercise solutions will be written with figurines rather than the piece letters:






The Period option determines whether a period is written after each game move number. It is the same as described earlier in the section on PGN File Insertion.

Quiz Data Section

 

The Starting Number option sets the initial value for Quiz diagram and solution numbering. The first diagram to be inserted into your document gets this number. Subsequently, the number is incremented for the next diagram or solution. (You'll see this in the examples below.)

Game Info in Solution. When this option is checked, the OoChess helper program will insert the game data at the end of each solution. Here is an example:
9

1. e6 f6 [1... g6 2. Bh6i] 2. Bh6i Qxc4 3. Rxg7+ Kh8 4. Rg8+!! Kxg8 [4... Rxg8 5. Qxf6+] 5. Qg1+! (Ljubojevic - Honfi, Yugoslavia) 1:0 [Maric]

In example above, you'll see that the player's names and other information about the game is displayed just before the game result:

(Ljubojevic - Honfi, Yugoslavia)

This is fine for tactical exercises, but for chess problems, which don't have any players or other game information, it would be best to uncheck this option.

The Starting Number option sets the initial value for Quiz diagram and solution numbering. The first diagram to be inserted into your document gets this number. Subsequently, the number is incremented for the next diagram or solution. (You'll see this in the examples below.)

When the Link to Solution option is set, the diagram number, in the caption above the diagram, will be turned into a hyperlink to the corresponding solution. This is very useful if you are creating a Tactics book that you intend to export to PDF. The user will be able to quickly move from the Quiz diagram to the solution and then directly back again by clicking on the solution number.

Quiz Format Section

 

When the Use Two Columns for Solutions option is set, the solutions to the exercises will be written into two columns. You can see this in the example below.

The Bracket 1st Level Variations option can be used to control whether first level variations in the Quiz solutions are enclosed within square brackets. You wouldn't normally want to do this, especially if you were creating a document intended for publication. In most cases you'd use bold for the game moves themselves so that they would stand out from the rest of solution text, including variation moves. But if your audience is an international one, you might want to restrict yourself to just using international chess symbols in your solutions, much as you would see in the popular Informant books. In that case, you'd probably want to have the first level variations enclosed in the square brackets. (See example below.)

Solution Diagram Size. While it is unusual to have diagrams as part of the solutions, it is possible to do so. All you need to do in ChessBase is select the move that gives rise to the position you want printed, and then Right-click on the move and select 'Diagram (Print)' from the pop up menu. This will insert a Diagram Marker that will be exported as part of the game when it is exported to PGN.

Solution diagrams can be any size from 14 to 24 pts. Such diagrams are not numbered and they don't have any captions. Here is an example:


Quiz Formats

 

In general, there are really two Quiz formats to choose from. In the first format, the diagram of the Quiz, or Exercise position, is placed in the left side of a table with the solution in the right side. This is a handy method of presenting exercises in which the reader uses a sheet of paper to 'hide' the solution side of the page while he attempts to solve each exercise. Here is an example of the first format:

First Quiz Format: Diagram / Solution Share Table

 


In the second format, several diagrams are placed in a table that spans the width of the page. The solutions to the Quiz are written below the last table. You can choose to have two, three or four diagrams per table. The diagrams are all numbered so that the reader can easily match each exercise with its numbered solution. This is a particularly good method for magazines or books that make heavy use of such exercises. The 'Solution' section, written below the last diagram table, can be moved to any section of your document as is commonly done in many chess books. Quite often these 'Solutions' are found at the end of a chapter or the very end of the book itself. Along with tactical exercises, chess problems can be nicely displayed using this second Quiz format. (More on this below.) Here is an example of the second format:

Second Quiz Format: Multiple Diagrams / Solutions Below Table

 

Solutions

1
1... Qa6! 2. g4 [2. Bxa6?? Nxa2#] 2... Qxa2! 3. Be3 Bxc3 [3... Bxc3 4. bxc3 Qc2#] (Allies - Blackburne 1894) 0-1 [Fritz 5.32]
2
1... Ne4 2. Bxd8 [2. Nxf7 Qc7 (2... Qb8 3. Qxe4+ dxe4 4. Nh6 Ne2+ 5. Kh1 Rxh6+ 6. Bxh6 Qe5 and mate cannot be stopped ) 3. Nxh8 Nf3+ 4. gxf3 Qg3+ 5. Kh1 Qh3+ 6. Kg1 gxf3 7. Qxe4+ dxe4 8. Bf7+ Kd7 9. Be6+ Kxe6 10. dxe4 Qg2#] [2. dxe4 Qxg5 3. exd5 O-O-O and White is hopelessly lost ] 2... Ng3 [Even more inspiring is 2... Ne2+ 3. Qxe2 Ng3 4. Bh4 Rxh4] 3. Nc6+ [3. fxg3?? Nf3#] 3... Nde2+ 4. Qxe2+ Nxe2# (Mandolfo - Kolisch 1859)  0-1 [Fritz 5.32]
3
1... Qxd5+! 2. Kxd5 Nf6+ 3. Kc4 Be6+ 4. Kb5 a6+ 5. Ka4 b5+ 6. Nxb5 axb5+ 7. Kxb5 Ra5+ 8. Kxc6 Bd5+ 9. Kd6 Ne8# (Matschego - Falkbeer 1853)  0-1 [Fritz 5.32]

It is important to note that a Quiz cannot be inserted into text columns. The Quiz requires the full width of the page (minus the left and right margins, of course.)

If the font size you have chosen for the diagram is too large, the helper program will automatically reduce the font size to the largest font size allowable for the number of diagrams requested in the table.

Just like diagrams written for games inserted from a PGN file, the Quiz tables will not break up across page boundaries. If Writer determines that there is not enough space left on the current page to hold any Quiz table row, it will move that row to the top of the next page.

Setting the Caption for the Quiz Diagram


The caption for a Quiz diagram is controlled by the Output Format Quiz Caption command. This is placed inside the OoChess configuration file. Here is the command that was used to generate the example below:

oq = “*%d*|%m”

There area four place-markers available:

%d    The current diagram number.
%m    The move number (as in 13... ?)
%c    Color to move (shown as either a white or black box)
%v    Evaluation of the position (shown as i or o depending upon game result)


There are a number of things to note about this command. You are free to use the special formatting characters, * ~ and _ for Bold, Italics and Underlined. Note especially the use of the vertical bar character |. This is a special character that tells the helper program that you want the caption to be divided into two separate parts, one displayed at the left edge of the diagram, and the other on the right edge of the diagram. This can be clearly seen in the example below. If the vertical bar is not used in the oq command, then it is understood that the user wants the text of the caption to be centered over the diagram. In this case, it is more likely that all you would want is the diagram number.

In the following example, not only can we see the use of the vertical bar character to divide the caption into two sections, but we can also see that the Quiz diagram numbers have been linked to the solution number. The solution number in turn has been linked back to the diagram. This would be very useful for a large book of tactics to be exported to PDF. A user simply has to CTRL-click on nay of the hyperlinks to go back and forth between the diagram and the corresponding solution.

 

Solutions


1
27. Rxd8+ Qxd8 28. Qd4 Qxd4 29. Nxd4 Kg7 30. f4 e5 31. fxe5 Re7 (Khismatullin (2682) - Dastan (2439) Nakhchivan AZE, 2014)  1-0
2
27. Qh7+ Kf8 28. Rfe1 Be5 29. Bxe5 fxe5 30. Rxe5 Ke7 31. Rxe6+ Qxe6 (Safarli (2656) - Sanal (2435) Nakhchivan AZE, 2014)  1-0
3
30. Qg6 (Paichadze (2535) - Agayev (2407) Nakhchivan AZE, 2014)  1-0


The Caption Space Below the Quiz Diagram


The caption space below the Quiz diagram is reserved for the user. He can take advantage of this space by placing whatever text he wishes to appear under the diagram in square brackets at the very start of a PGN game. An example is seen below of both the results and the initial PGN of the first of the Quiz diagrams:


Here is the PGN:

{[Mate in 2/J. Hartong] #1 by J. Hartong. The key is} 1. Qa2 {
Black is in zugzwang.} etc.


Notice that the very first element is a PGN comment and that the comment begins with {[…] The text enclosed in the square brackets is used as the lower caption for the Quiz diagram. Within this text, the user can use the forward slash character as a newline.

For chess Problems there really are no White or Black players, and the rest of the information that we normally associate with an actual game of chess is pretty much all spurious. For this reason, if you are using a Quiz to insert a set of chess problems, you should certainly uncheck the Game Info in Solution option.

One exception to the spurious game information is the name of the Annotator. This can be used to indicate the name of the problem composer as was done in our example:

[Annotator "A Cyril Pearson"]

This allows you to have the composer's name written at the end of each problem's solution as can be seen in the above Problem example.