Template:Chess diagram/doc

Syntax
There are several standard chess diagram templates:


 * Template:Chess diagram (square size 26x26 px)
 * Template:Chess diagram small (square size 22x22 px)
 * Template:Chess diagram 5x5; Template:Chess diagram 6x6 (bigger, 26px squares; can be used either for smaller sections of the board or Minichess and Los Alamos chess)

There are also templates for chess variants:


 * Template:Chess diagram 8x10 (Capablanca chess with ten columns, 26x26 px)
 * Template:Raumschach diagram (5x5x5 board for Three-dimensional chess, 22x22 px)
 * Template:Omega Chess diagram (Omega Chess with 10x10 board + 4 corners, 22x22 px)

The syntax is basically the same for all 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;
 * – 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:


 * [[Image:Chess kll44.png|26px]] [[Image:Chess kld44.png|26px]] [[Image:Chess kdl44.png|26px]] [[Image:Chess kdd44.png|26px]] k = king
 * [[Image:Chess qld44.png|26px]] [[Image:Chess qll44.png|26px]] [[Image:Chess qdd44.png|26px]] [[Image:Chess qdl44.png|26px]] q = queen
 * [[Image:Chess rll44.png|26px]] [[Image:Chess rld44.png|26px]] [[Image:Chess rdl44.png|26px]] [[Image:Chess rdd44.png|26px]] r = rook
 * [[Image:Chess bld44.png|26px]] [[Image:Chess bll44.png|26px]] [[Image:Chess bdd44.png|26px]] [[Image:Chess bdl44.png|26px]] b = bishop
 * [[Image:Chess nll44.png|26px]] [[Image:Chess nld44.png|26px]] [[Image:Chess ndl44.png|26px]] [[Image:Chess ndd44.png|26px]] n = knight
 * [[Image:Chess pld44.png|26px]] [[Image:Chess pll44.png|26px]] [[Image:Chess pdd44.png|26px]] [[Image:Chess pdl44.png|26px]] p = pawn

There are also some fairy chess pieces available:


 * [[Image:Chess all44.png|26px]] [[Image:Chess ald44.png|26px]] [[Image:Chess adl44.png|26px]] [[Image:Chess add44.png|26px]] a = archbishop (knight + bishop compound)
 * [[Image:Chess cld44.png|26px]] [[Image:Chess cll44.png|26px]] [[Image:Chess cdd44.png|26px]] [[Image:Chess cdl44.png|26px]] c = chancelor (knight + rook compound)
 * [[Image:Chess fll44.png|26px]] [[Image:Chess fld44.png|26px]] [[Image:Chess fdl44.png|26px]] [[Image:Chess fdd44.png|26px]] f = upside-down king
 * [[Image:Chess gld44.png|26px]] [[Image:Chess gll44.png|26px]] [[Image:Chess gdd44.png|26px]] [[Image:Chess gdl44.png|26px]] g = upside-down queen
 * [[Image:Chess mll44.png|26px]] [[Image:Chess mld44.png|26px]] [[Image:Chess mdl44.png|26px]] [[Image:Chess mdd44.png|26px]] m = upside-down rook
 * [[Image:Chess eld44.png|26px]] [[Image:Chess ell44.png|26px]] [[Image:Chess edd44.png|26px]] [[Image:Chess edl44.png|26px]] e = upside-down bishop
 * [[Image:Chess sll44.png|26px]] [[Image:Chess sld44.png|26px]] [[Image:Chess sdl44.png|26px]] [[Image:Chess sdd44.png|26px]] s = upside-down knight
 * [[Image:Chess hld44.png|26px]] [[Image:Chess hll44.png|26px]] [[Image:Chess hdd44.png|26px]] [[Image:Chess hdl44.png|26px]] h = upside-down pawn
 * [[Image:Chess zll44.png|26px]] [[Image:Chess zld44.png|26px]] [[Image:Chess zdl44.png|26px]] [[Image:Chess zdd44.png|26px]] z = champion (for Omega Chess)
 * [[Image:Chess wld44.png|26px]] [[Image:Chess wll44.png|26px]] [[Image:Chess wdd44.png|26px]] [[Image:Chess wdl44.png|26px]] 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.


 * [[Image:Chess d44.png|26px]][[Image:Chess l44.png|26px]] = empty square

You can also use "x" for a cross and "o" for a circle. End each parameter with "d" or "l" to color it.


 * [[Image:Chess xdd44.png|26px]][[Image:Chess xdl44.png|26px]] xd = black cross/x
 * [[Image:Chess xdd44.png|26px]][[Image:Chess xdl44.png|26px]] xl = white cross/x
 * [[Image:Chess odd44.png|26px]][[Image:Chess odl44.png|26px]] od = black circle
 * [[Image:Chess old44.png|26px]][[Image:Chess oll44.png|26px]] ol = white circle

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


 * [[Image:Chess x1d44.png|26px]][[Image:Chess x1l44.png|26px]] x1
 * [[Image:Chess x2d44.png|26px]][[Image:Chess x2l44.png|26px]] x2
 * [[Image:Chess x3d44.png|26px]][[Image:Chess x3l44.png|26px]] x3
 * [[Image:Chess x4d44.png|26px]][[Image:Chess x4l44.png|26px]] x4
 * [[Image:Chess x5d44.png|26px]][[Image:Chess x5l44.png|26px]] x5
 * [[Image:Chess x6d44.png|26px]][[Image:Chess x6l44.png|26px]] x6
 * [[Image:Chess x7d44.png|26px]][[Image:Chess x7l44.png|26px]] x7
 * [[Image:Chess x8d44.png|26px]][[Image:Chess x8l44.png|26px]] x8
 * [[Image:Chess x9d44.png|26px]][[Image:Chess x9l44.png|26px]] 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 the articles 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 articles with many diagrams. It uses another template named Chess diagram small.

The small diagrams can have header, too.

Different board size
Chess boards of non-standard dimensions need special templates. There are templates for the following boards: