Bản mẫu:Chess diagram/doc

=== Cú pháp**
There are several standard chess diagram templates:- Bản mẫu:Chess diagram (square size 26x26 px)- Bản mẫu:Chess diagram small (square size 22x22 px)- Bản mẫu:Chess diagram 4x4 (square size 26x26 px)- Bản mẫu:Chess diagram 4x5 (square size 26x26 px)- Bản mẫu:Chess diagram 4x8 (square size 26x26 px)- Bản mẫu:Chess diagram 5x5 (square size 26x26 px)- Bản mẫu:Chess diagram 5x6 (square size 26x26 px)- Bản mẫu:Chess diagram 6x6 (square size 26x26 px)- Bản mẫu:Chess diagram 8x10 (Capablanca chess square size 26x26 px)- Bản mẫu:Chess diagram 8x12 (square size 26x26 px)- Bản mẫu:Chess diagram 9x9 (square size 26x26 px)- Bản mẫu:Chess diagram 10x10 (square size 26x26 px)- Bản mẫu:Chess diagram 10x10 small (square size 22x22 px)- Bản mẫu:Chess diagram 12x12 (square size 26x26 px)- Bản mẫu:Chess diagram 16x16 (square size 26x26 px)- Bản mẫu:Chess diagram 24x24 (square size 26x26 px)
There are also templates for chess variants: - Bản mẫu:Alice chess diagram (Alice Chess, square size 22x22 px)- Bản mẫu:Bughouse chess diagram (Bughouse chess, square size 22x22 px)- Bản mẫu:Omega Chess diagram (Omega Chess with 10x10 board + 4 corners, 22x22 px)- Bản mẫu:Raumschach diagram (5x5x5 board for Three-dimensional chess, 22x22 px)
The syntax is basically the same for all of them.
When the chess board is 8x8, there is an alternative syntax (see #Alternative way to place the pieces: FEN below):
Các tham số:-  – defines horizontal alignment (floating) of the whole table, must be tright or tleft (or nothing)-  – the text which appears above the diagram, may be empty;- size - specifies the size of each square in pixels, the default is 26.- numbers - specifies whether the rows are numbered. Options are: left, right, both (default) or neither.- letters - 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:- 26px 26px 26px 26px k = king- 26px 26px 26px 26px q = queen- 26px 26px 26px 26px r = rook- 26px 26px 26px 26px b = bishop- 26px 26px 26px 26px n = knight- 26px 26px 26px 26px p = pawn
There are also some fairy chess pieces available:- 26px 26px 26px 26px a = archbishop (knight+bishop compound)- 26px 26px 26px 26px c = chancellor (knight+rook compound)- 26px 26px 26px 26px f = inverted king- 26px 26px 26px 26px g = inverted queen- 26px 26px 26px 26px m = inverted rook- 26px 26px 26px 26px j(e) = inverted bishop- 26px 26px 26px 26px N(s) = inverted knight- 26px 26px 26px 26px h = inverted pawn- 26px 26px 26px 26px z = champion (for Omega Chess)- 26px 26px 26px 26px w = wizard (for Omega Chess)- 26px 26px 26px 26px t = fool (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.- 26px26px  = empty square
You can also use "xx" for a black cross, "ox" for a white cross, "xo" for a black circle on an empty square or "oo" for a white one.- 26px26px xx = black cross/x- 26px26px ox = white cross/x - 26px26px xo = black circle- 26px26px oo = white circle
When showing movement directions on the board, arrows are available- 26px26px ul = up & left- 26px26px ua = up- 26px26px ur = up & right- 26px26px la = left- 26px26px lr = left & right- 26px26px ud = up & down- 26px26px ra = right- 26px26px dl = down & left- 26px26px da = down- 26px26px dr = down & right
Numbers can also be added to squares by using "x0" for 0, "x1" for 1, "x2" for 2, ..., "x9" for 9. - 26px26px x0- 26px26px x1- 26px26px x2- 26px26px x3- 26px26px x4- 26px26px x5- 26px26px x6- 26px26px x7- 26px26px x8- 26px26px x9

**Các ví dụ**

**Sơ đồ tiêu chuẩn**
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.

**Movement example**
This can be used to show how pieces move.
In the board on the right, it is shown that the white queen can go any distance in any of these directions.
Another method for the rook example:

**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:

**Double boards**

**Alice Chess**

**Different shaped board**

**Alternative way to place the pieces: FEN**
It is possible to populate the board using Forsyth–Edwards Notation, instead of positional parameters. 
To do this, the "fen" parameter is used. For instance, this is the opening board of a chess game, defined using the "fen" parameter "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR":
It is also possible to show "fairy" pieces using the FEN notation. However, because the FEN notation uses uppercase and lowercase to denote the color of the piece, it is not possible to display the inverted knight fairy piece (denoted by "N") using the fen parameter. Here is a board where the pawns are replaced by fairy pieces:
Only 8x8 boards can use the "fen" parameter. For other size boards, positional parameters should be used.

**Displaying the board from the Black's point of view**
The "reverse=true" parameter causes the board to be shown from Black's point of view, that is, with the h8 square at lower-left corner, and a1 at the upper-right. This works for all sizes of the normal chessboard template, but not for the Alice, Bughouse, Omega, or Raumschach templates.  Here, the same FEN notation as in the previous example produces a board with Black's starting position at the bottom.

**Xem thêm**
Bản mẫu:Chess position, alternative template no longer in use