Saturday, March 14, 2015

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.


No comments:

Post a Comment