Standard chess diagram

From Wikimedia Commons, the free media repository

Jump to: navigation, search

Standard chess diagram template is a result of discussions and votings which took place in WikiProject Chess on Meta-Wiki. It is based on the template "Chess position" widely used in English Wikipedia. Both the template and the images of pieces were modified.


Contents

[edit] Syntax

There are two standard chess diagram templates:

and some templates for special purposes:

The syntax is similar for all of them.

{{Chess diagram|=
| <alignment>
| <header>
| <a8> | <b8> | <c8> | <d8> | <e8> | <f8> | <g8> | <h8>
| <a7> | <b7> | <c7> | <d7> | <e7> | <f7> | <g7> | <h7>
| <a6> | <b6> | <c6> | <d6> | <e6> | <f6> | <g6> | <h6>
| <a5> | <b5> | <c5> | <d5> | <e5> | <f5> | <g5> | <h5>
| <a4> | <b4> | <c4> | <d4> | <e4> | <f4> | <g4> | <h4>
| <a3> | <b3> | <c3> | <d3> | <e3> | <f3> | <g3> | <h3>
| <a2> | <b2> | <c2> | <d2> | <e2> | <f2> | <g2> | <h2>
| <a1> | <b1> | <c1> | <d1> | <e1> | <f1> | <g1> | <h1>
| <footer>
}}

Parameters:

  • <alignment> - defines horizontal alignment of the whole image, must be "tright" or "tleft";
  • <header> - the text which appears above the diagram, may be empty;
  • <a8>, <b8>, ... <h1> - define corresponding squares of the chessboard, see below;
  • <footer> - the text which appears beneath the diagram, may be empty.

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

  • k = king
  • q = queen
  • r = rook
  • b = bishop
  • n = knight
  • p = pawn

Also, several fairy chess pieces are present:

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. You can also use "xx" for a cross, "xo" for a circle on an empty square, and "x1" through "x9" for a space marked with a number.

[edit] Examples

To see how it works, compare the diagrams below and the code which generates them. To use it - just copy the code, paste it into your article and change parameters.

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.


Some practical hints:

  • be careful not to change general schema, especially leave "|" and "=" characters just where they are,
  • you cannot use "|" character in the captions (footers and headers),
  • if you want to use "=" in the caption you have to enclose it in nowiki tags,
  • you can use some formatting like bolds, italics.



[edit] Standard diagram

Image:chess_zhor_26.png
Image:chess_zver_26.png
a8 b8 c8 d8 e8 f8 g8 h8
a7 b7 c7 d7 e7 f7 g7 h7
a6 b6 c6 d6 e6 f6 g6 h6
a5 b5 c5 d5 e5 f5 g5 h5
a4 b4 c4 d4 e4 f4 g4 h4
a3 b3 c3 d3 e3 f3 g3 h3
a2 b2 c2 d2 e2 f2 g2 h2
a1 b1 c1 d1 e1 f1 g1 h1
Image:chess_zver_26.png
Image:chess_zhor_26.png
The position of the pieces at the start of a game of chess.

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.

More examples:


{{Chess diagram|=
| tright
| 
|= 

 8 |rd|nd|bd|qd|kd|bd|nd|rd|=
 7 |pd|pd|pd|  |  |pd|pd|pd|=
 6 |  |  |  |  |pd|  |  |  |=
 5 |  |  |  |pd|  |  |  |  |=
 4 |  |  |pl|pl|  |  |  |  |=
 3 |  |  |  |  |  |  |  |  |=
 2 |pl|pl|  |  |  |  |pl|pl|=
 1 |rl|nl|bl|ql|kl|bl|nl|rl|=
    a  b  c  d  e  f  g  h

| The Queen's Gambit Declined
}}


Image:chess_zhor_26.png
Image:chess_zver_26.png
a8 b8 c8 d8 e8 f8 g8 h8
a7 b7 c7 d7 e7 f7 g7 h7
a6 b6 c6 d6 e6 f6 g6 h6
a5 b5 c5 d5 e5 f5 g5 h5
a4 b4 c4 d4 e4 f4 g4 h4
a3 b3 c3 d3 e3 f3 g3 h3
a2 b2 c2 d2 e2 f2 g2 h2
a1 b1 c1 d1 e1 f1 g1 h1
Image:chess_zver_26.png
Image:chess_zhor_26.png

[edit] Diagram without captions

Image:chess_zhor_26.png
Image:chess_zver_26.png
a8 b8 c8 d8 e8 f8 g8 h8
a7 b7 c7 d7 e7 f7 g7 h7
a6 b6 c6 d6 e6 f6 g6 h6
a5 b5 c5 d5 e5 f5 g5 h5
a4 b4 c4 d4 e4 f4 g4 h4
a3 b3 c3 d3 e3 f3 g3 h3
a2 b2 c2 d2 e2 f2 g2 h2
a1 b1 c1 d1 e1 f1 g1 h1
Image:chess_zver_26.png
Image:chess_zhor_26.png

See the corresponding code below. If you don't want the captions, just remove them, but don't delete "|" character.

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


{{Chess diagram|=
| tleft
| 
|= 

 8 |  |  |  |  |  |  |  |  |=
 7 |  |  |  |  |  |  |  |  |=
 6 |  |xx|xo|xx|  |  |  |  |=
 5 |  |  |pl|  |  |  |  |  |=
 4 |  |  |  |  |  |xo|  |  |=
 3 |  |  |  |  |xx|xo|xx|  |=
 2 |  |  |  |  |  |pl|  |  |=
 1 |  |  |  |  |  |  |  |  |=
    a  b  c  d  e  f  g  h  

| 
}}

[edit] Small diagram

Image:chess_zhor_22.png
Image:chess_zver_22.png
a8 b8 c8 d8 e8 f8 g8 h8
a7 b7 c7 d7 e7 f7 g7 h7
a6 b6 c6 d6 e6 f6 g6 h6
a5 b5 c5 d5 e5 f5 g5 h5
a4 b4 c4 d4 e4 f4 g4 h4
a3 b3 c3 d3 e3 f3 g3 h3
a2 b2 c2 d2 e2 f2 g2 h2
a1 b1 c1 d1 e1 f1 g1 h1
Image:chess_zver_22.png
Image:chess_zhor_22.png
The position after 11. Bg5.

This one may be useful in articles with many diagrams. It uses another template named "Chess diagram small".


{{Chess diagram small|=
| tright
| 
|= 

 8 |rd|  |  |qd|  |rd|kd|  |=
 7 |pd|pd|  |  |pd|pd|bd|pd|=
 6 |  |nd|pd|  |  |nd|pd|  |=
 5 |  |  |ql|  |  |  |bl|  |=
 4 |  |  |  |pl|pl|  |bd|  |=
 3 |  |  |nl|  |  |nl|  |  |=
 2 |pl|pl|  |  |  |pl|pl|pl|=
 1 |  |  |  |rl|kl|bl|  |rl|=
    a  b  c  d  e  f  g  h  

| The position after 11. Bg5.
}}


[edit] Capablanca chess

Image:chess_zh10_26.png
Image:chess_zver_26.png
a8 b8 c8 d8 e8 f8 g8 h8 i8 j8
a7 b7 c7 d7 e7 f7 g7 h7 i7 j7
a6 b6 c6 d6 e6 f6 g6 h6 i6 j6
a5 b5 c5 d5 e5 f5 g5 h5 i5 j5
a4 b4 c4 d4 e4 f4 g4 h4 i4 j4
a3 b3 c3 d3 e3 f3 g3 h3 i3 j3
a2 b2 c2 d2 e2 f2 g2 h2 i2 j2
a1 b1 c1 d1 e1 f1 g1 h1 i1 j1
Image:chess_zver_26.png
Image:chess_zh10_26.png
Capablanca chess

Chessboards of nonstandard dimensions need special templates.


{{Chess diagram 8x10|=
| tright
| 
|= 

 8 |rd|nd|ad|bd|qd|kd|bd|cd|nd|rd|=
 7 |pd|pd|pd|pd|pd|pd|pd|pd|pd|pd|=
 6 |  |  |  |  |  |  |  |  |  |  |=
 5 |  |  |  |  |  |  |  |  |  |  |=
 4 |  |  |  |  |  |  |  |  |  |  |=
 3 |  |  |  |  |  |  |  |  |  |  |=
 2 |pl|pl|pl|pl|pl|pl|pl|pl|pl|pl|=
 1 |rl|nl|al|bl|ql|kl|bl|cl|nl|rl|=
    a  b  c  d  e  f  g  h  i  j

| Capablanca chess
}}

[edit] Chaturanga

Image:chess_zhor_26.png
Image:chess_zver_26.png
a8 b8 c8 d8 e8 f8 g8 h8
a7 b7 c7 d7 e7 f7 g7 h7
a6 b6 c6 d6 e6 f6 g6 h6
a5 b5 c5 d5 e5 f5 g5 h5
a4 b4 c4 d4 e4 f4 g4 h4
a3 b3 c3 d3 e3 f3 g3 h3
a2 b2 c2 d2 e2 f2 g2 h2
a1 b1 c1 d1 e1 f1 g1 h1
Image:chess_zver_26.png
Image:chess_zhor_26.png
Makruk - start position

Chaturanga template may be used in any games played on 8x8 board.

More examples:


{{Chaturanga diagram|=
| tright
| 
|= 

 8 |rd|nd|bd|qd|kd|bd|nd|rd|=
 7 |  |  |  |  |  |  |  |  |=
 6 |pd|pd|pd|pd|pd|pd|pd|pd|=
 5 |  |  |  |  |  |  |  |  |=
 4 |  |  |  |  |  |  |  |  |=
 3 |pl|pl|pl|pl|pl|pl|pl|pl|=
 2 |  |  |  |  |  |  |  |  |=
 1 |rl|nl|bl|ql|kl|bl|nl|rl|=
    a  b  c  d  e  f  g  h

| '''Makruk''' - start position
}}

[edit] Chess Mutation

Image:chess_zhor_26.png
Image:chess_zver_26.png
a8 b8 c8 d8 e8 f8 g8 h8
a7 b7 c7 d7 e7 f7 g7 h7
a6 b6 c6 d6 e6 f6 g6 h6
a5 b5 c5 d5 e5 f5 g5 h5
a4 b4 c4 d4 e4