Format:Diagramă șah mică

De la Wikipedia, enciclopedia liberă
abcdefgh
8
Chessboard480.svg
8
77
66
55
44
33
22
11
abcdefgh
Documentație
Documentație format
Această documentație este adusă de la pagina Format:Diagramă șah/doc.

Syntax

There are several standard chess diagram templates:

The syntax is basically the same for all of them.

{{Diagramă șah
| <alignment> (param #1)
| <header>    (#2) 
| <a8> | <b8> | ... | <h8>  (#3 to ...
| <a7> | <b7> | ... | <h7>
...
| <a1> | <b1> | ... | <h1>  ( ... #66)
| <footer> (#67)
}}

Parameters:

  • <alignment> – defines horizontal alignment (floating) of the whole table, must be tright or tleft (or nothing)
  • <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; 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 fll44.png Chess fld44.png Chess fdl44.png Chess fdd44.png f = upside-down king
  • Chess gld44.png Chess gll44.png Chess gdd44.png Chess gdl44.png g = upside-down queen
  • Chess mll44.png Chess mld44.png Chess mdl44.png Chess mdd44.png m = upside-down rook
  • Chess eld44.png Chess ell44.png Chess edd44.png Chess edl44.png e = upside-down bishop
  • Chess sll44.png Chess sld44.png Chess sdl44.png Chess sdd44.png s = upside-down knight
  • Chess hld44.png Chess hll44.png Chess hdd44.png Chess hdl44.png 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 <space> = 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 ood44.pngChess ool44.png oo = white circle

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

  • 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 the articles on chess openings, endings, games, positions etc. See the corresponding code below.

abcdefgh
8
Chessboard480.svg
a8 black rook
b8 black knight
c8 black bishop
d8 black queen
e8 black king
f8 black bishop
g8 black knight
h8 black rook
a7 black pawn
b7 black pawn
c7 black pawn
d7 black pawn
f7 black pawn
g7 black pawn
h7 black pawn
e5 black pawn
e4 white pawn
f4 white pawn
a2 white pawn
b2 white pawn
c2 white pawn
d2 white pawn
g2 white pawn
h2 white pawn
a1 white rook
b1 white knight
c1 white bishop
d1 white queen
e1 white king
f1 white bishop
g1 white knight
h1 white rook
8
77
66
55
44
33
22
11
abcdefgh
The King's Gambit
{{Diagramă șah
| tright
| 

|rd|nd|bd|qd|kd|bd|nd|rd
|pd|pd|pd|pd|  |pd|pd|pd
|  |  |  |  |  |  |  |  
|  |  |  |  |pd|  |  |  
|  |  |  |  |pl|pl|  |  
|  |  |  |  |  |  |  |  
|pl|pl|pl|pl|  |  |pl|pl
|rl|nl|bl|ql|kl|bl|nl|rl

| The King's Gambit
}}

Diagram with both captions

W. Langstaff, Chess Amateur 1922
abcdefgh
8
Chessboard480.svg
e8 black king
h8 black rook
f6 white bishop
h6 white pawn
d5 white rook
f5 white king
g5 black pawn
h5 white pawn
8
77
66
55
44
33
22
11
abcdefgh
Mate in two.
This problem uses partial retrograde analysis method.

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.

{{Diagramă șah
| tright
| '''W. Langstaff''', ''Chess Amateur'' 1922

|  |  |  |  |kd|  |  |rd
|  |  |  |  |  |  |  |  
|  |  |  |  |  |bl|  |pl
|  |  |  |rl|  |kl|pd|pl
|  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |   

| '''Mate in two.''' <br> This problem uses ''partial retrograde analysis'' method.
}}

Diagram without captions

abcdefgh
8
Chessboard480.svg
b6 black cross
c6 black circle
d6 black cross
c5 white pawn
f4 black circle
e3 black cross
f3 black circle
g3 black cross
f2 white pawn
8
77
66
55
44
33
22
11
abcdefgh

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.

{{Diagramă șah
| tleft
| 

|  |  |  |  |  |  |  |  
|  |  |  |  |  |  |  |  
|  |xx|xo|xx|  |  |  |  
|  |  |pl|  |  |  |  |  
|  |  |  |  |  |xo|  |  
|  |  |  |  |xx|xo|xx|  
|  |  |  |  |  |pl|  |  
|  |  |  |  |  |  |  |  
}}

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.


Chess zhor 22.png
Chess zver 22.png a8 rd b8 c8 d8 qd e8 f8 rd g8 kd h8 Chess zver 22.png
a7 pd b7 pd c7 d7 e7 pd f7 pd g7 bd h7 pd
a6 b6 nd c6 pd d6 e6 f6 nd g6 pd h6
a5 b5 c5 ql d5 e5 f5 g5 bl h5
a4 b4 c4 d4 pl e4 pl f4 g4 bd h4
a3 b3 c3 nl d3 e3 f3 nl g3 h3
a2 pl b2 pl c2 d2 e2 f2 pl g2 pl h2 pl
a1 b1 c1 d1 rl e1 kl f1 bl g1 h1 rl
Chess zhor 22.png
The position after 11. Bg5.
{{Diagramă șah mic
| tright
| 

|rd|  |  |qd|  |rd|kd|  
|pd|pd|  |  |pd|pd|bd|pd
|  |nd|pd|  |  |nd|pd|  
|  |  |ql|  |  |  |bl|  
|  |  |  |pl|pl|  |bd|  
|  |  |nl|  |  |nl|  |  
|pl|pl|  |  |  |pl|pl|pl
|  |  |  |rl|kl|bl|  |rl

| The position after 11. Bg5.
}}