Template:Chess diagram/doc

Syntax
There are two standard chess diagram templates:


 * Template:Chess diagram (square size 26x26 px)
 * Template:Chess diagram small (square size 22x22 px)

The syntax is basically the same for both of them.

Parameters:


 * – defines horizontal alignment (floating) of the whole table, must be  or   (or nothing)
 * – the text which appears above the diagram, may be empty;
 * - specifies the size of each square in pixels, the default is 26.
 * - specifies whether the rows are numbered. Options are: left, right, both (default) or neither.
 * - specifies whether the columns are lettered. Options are: top, bottom, both (default) or neither.
 * – define corresponding squares of the chessboard, see below;
 * – the text which appears beneath the diagram, may be empty; optional – can be left out (currently not in the other templates)

A square is defined by the name of piece or empty parameter. The names of the pieces are those given in algebraic notation:


 * Chess kll45.svg Chess kld45.svg Chess kdl45.svg Chess kdd45.svg k = king
 * Chess qld45.svg Chess qll45.svg Chess qdd45.svg Chess qdl45.svg q = queen
 * Chess rll45.svg Chess rld45.svg Chess rdl45.svg Chess rdd45.svg r = rook
 * Chess bld45.svg Chess bll45.svg Chess bdd45.svg Chess bdl45.svg b = bishop
 * Chess nll45.svg Chess nld45.svg Chess ndl45.svg Chess ndd45.svg n = knight
 * Chess pld45.svg Chess pll45.svg Chess pdd45.svg Chess pdl45.svg p = pawn

There are also some fairy chess pieces available:


 * Chess all44.png Chess ald44.png Chess adl44.png Chess add44.png a = archbishop (knight + bishop compound)
 * Chess cld44.png Chess cll44.png Chess cdd44.png Chess cdl44.png c = chancelor (knight + rook compound)
 * Chess fll45.svg Chess fld45.svg Chess fdl45.svg Chess fdd45.svg f = upside-down king
 * Chess gld45.svg Chess gll45.svg Chess gdd45.svg Chess gdl45.svg g = upside-down queen
 * Chess mll45.svg Chess mld45.svg Chess mdl45.svg Chess mdd45.svg m = upside-down rook
 * Chess eld45.svg Chess ell45.svg Chess edd45.svg Chess edl45.svg e = upside-down bishop
 * Chess sll45.svg Chess sld45.svg Chess sdl45.svg Chess sdd45.svg s = upside-down knight
 * Chess hld45.svg Chess hll45.svg Chess hdd45.svg Chess hdl45.svg h = upside-down pawn
 * Chess zll44.png Chess zld44.png Chess zdl44.png Chess zdd44.png z = champion (for Omega Chess)
 * Chess wld44.png Chess wll44.png Chess wdd44.png Chess wdl44.png w = wizard (for Omega Chess)

These letters are combined with either "l" for Light=White, or "d" for Dark=Black. So "kl" is White's king, and "nd" is Black's knight.

An empty square is written either using underscores, spaces, or nothing at all. Two spaces are recommended.


 * Chess d45.svgChess l45.svg = empty square

You can also use "xx" for a cross, "xo" for a black circle on an empty square or "oo" for a white one.


 * Chess xxd45.svgChess xxl45.svg xx = cross/x
 * Chess xod45.svgChess xol45.svg xo = black circle
 * Chess ood45.svgChess ool45.svg oo = white circle

Numbers can also be added to squares by using "x0" for 0, "x1" for 1, "x2" for 2, ..., "x9" for 9.


 * Chess x0d45.svgChess x0l45.svg x0
 * Chess x1d45.svgChess x1l45.svg x1
 * Chess x2d45.svgChess x2l45.svg x2
 * Chess x3d45.svgChess x3l45.svg x3
 * Chess x4d45.svgChess x4l45.svg x4
 * Chess x5d45.svgChess x5l45.svg x5
 * Chess x6d45.svgChess x6l45.svg x6
 * Chess x7d45.svgChess x7l45.svg x7
 * Chess x8d45.svgChess x8l45.svg x8
 * Chess x9d45.svgChess x9l45.svg x9

Examples
In the following examples the rows and columns are numbered. Because any text between "|=" and the next "|" is ignored, numbers and letters can be added without affecting output.

Standard diagram
This diagram is recommended for common use as a main diagram in books on chess openings, endings, games, positions etc. See the corresponding code below.



Diagram with both captions
It may be convenient to use this in the articles on chess problems. Please note that in the header and footer you can use bolds or italics. You can also use  to break the lines.



Diagram without captions
See the corresponding code below. If you don't want the captions, just remove them, but don't delete the second "|" pipe character for the caption above; it is possible to delete the last pipe for the longer caption below.

The diagram floats to the left to illustrate the use of the first parameter.



Small diagram
This one may be useful in pages with many diagrams. It uses another template named chess diagram small.

The small diagrams can have header, too.

Chess diagram