Dyskusja wikipedysty:Klin/Diagram
Z Wikipedii
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.
On this page I am going to place description of further modifications (if any). Please post your comments or questions in WikiProject Chess on Meta-Wiki. --Klin 23:29, 7 sie 2005 (CEST)
Spis treści |
[edytuj] Syntax
There are three standard chess diagram templates:
- "Chess diagram" (square size 26x26 px)
- "Chess diagram small" (square size 22x22 px)
- "Chess diagram chaturanga" (square size 25x25 px, uncheckered)
- "Chess diagram 8x10" (chessboard with ten columns, 26x26 px)
The syntax is the same for all of them.
{{Chess diagram|= | <alignment> | <header> | <a8> | <b8> | ... | <h8> | <a7> | <b7> | ... | <h7> ... | <a1> | <b1> | ... | <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
and for the Capablanca chess:
- a = archbishop
- c = chancelor
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 or "xo" for a circle on an empty square.
[edytuj] 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.
[edytuj] 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.
{{SzachyDiagram|= | tright | |= 8 |rd|nd|bd|qd|kd|bd|nd|rd|= 7 |pd|pd|pd|pd| |pd|pd|pd|= 6 | | | | | | | | |= 5 | | | | |pd| | | |= 4 | | | | |pl|pl| | |= 3 | | | | | | | | |= 2 |pl|pl|pl|pl| | |pl|pl|= 1 |rl|nl|bl|ql|kl|bl|nl|rl|= a b c d e f g h | The King's Gambit }}
[edytuj] 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 "<br>" to break the lines.
{{SzachyDiagram|= | tright | '''W. Langstaff''', ''Chess Amateur'' 1922 |= 8 | | | | |kd| | |rd|= 7 | | | | | | | | |= 6 | | | | | |bl| |pl|= 5 | | | |rl| |kl|pd|pl|= 4 | | | | | | | | |= 3 | | | | | | | | |= 2 | | | | | | | | |= 1 | | | | | | | | |= a b c d e f g h | '''Mate in two.''' <br> This problem uses ''partial retrograde analysis'' method. }}
[edytuj] Diagram without captions
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.
{{SzachyDiagram|= | 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 | }}
[edytuj] Small diagram
This one may be useful in articles with many diagrams. It uses another template named "Chess diagram small".
Note: for some technical reasons the small diagrams have no header. The second parameter is just ignored, left only for compatibility.
{{SzachyDiagramik|= | 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. }}
[edytuj] Capablanca chess diagram
Chessboards of nonstandard dimensions need special templates.
{{SzachyDiagram8x10|= | 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 }}
[edytuj] Chaturanga
Chaturanga template may be used in any games played on 8x8 board.
{{SzachyCzaturanga|= | 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 }}