Template talk:Chess diagram

From Wikipedia, the free encyclopedia
Jump to: navigation, search
WikiProject Chess (Rated NA-class)
WikiProject icon This template is within the scope of WikiProject Chess, a collaborative effort to improve the coverage of Chess on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
 NA  This template does not require a rating on the project's quality scale.
 

Archives
Archive 1 Archive 2

Contents

[edit] Change to version with better alt text

{{editprotected}} I changed {{chess diagram small}} a while back to have better alt text. I'd like to change this one in the same way by changing it to the one shown here: User:H2g2bob/chess diagram. There's a test case here. --h2g2bob (talk) 23:43, 16 January 2010 (UTC)

discussion at wikiproject from a while back. --h2g2bob (talk) 00:29, 17 January 2010 (UTC)
YesY DoneTheDJ (talkcontribs) 16:15, 17 January 2010 (UTC)

[edit] Fix appearance in print

{{editprotected}} I've fixed the horrible stretching that was going on in the PDFs and Books versions of articles. So if you could copy-paste the Template:Chess diagram/sandbox version into the real template, that would be great. Once that's done, you can delete Template:Chess diagram/Print, as it will be uneeded. Headbomb {talk / contribs / physics / books} 01:54, 17 May 2010 (UTC)

I've been playing around with the template and improved its efficiency radically. Can you check if it's okay? — Martin (MSGJ · talk) 11:45, 17 May 2010 (UTC)
If you want to do that rewrite, we should also be able to use it on the other templates (Omega grand grid, 10x10 grid, 10x8 grid, 8x8 grid, 6x6 grid, 5x5 grid, 4x4 grid ...), and able to chose between 26px or 22px squares (18x/16px for the white/black corners). Headbomb {talk / contribs / physics / books} 13:36, 17 May 2010 (UTC)
MSJG, that was not the edit I requested. I spent over 16 hours making sure my code was fine and displayed correctly. The sandbox version was not tested, and now nothing displays in print! Please revert and place the code I requested. The sandbox version needs much testing before it can be used live. Headbomb {talk / contribs / physics / books} 14:18, 17 May 2010 (UTC)
I took your previous message as support for this version. I haven't actually changed the functionality, I just made it more efficient - it should work exactly as your proposed version. Can you check again and try to fix this version rather than we revert the whole thing? — Martin (MSGJ · talk) 14:22, 17 May 2010 (UTC)
I just said that if we were going to rewrite the whole thing, we should have the other templates in mind. I've recreated the /Print version for now, this will safeguard against problems. I'll test the new template series when I have time, which may not be anytime soon. Headbomb {talk / contribs / physics / books} 14:25, 17 May 2010 (UTC)
Well this version seems to work for me. Perhaps if you give me an example of a page where it wasn't working I can look again. — Martin (MSGJ · talk) 14:30, 17 May 2010 (UTC)

Well, the way the /Print templates works is that they override the main template when in print. So what you need to do to see the problem is set up a page that calls the sandbox version of the template (since Template:Chess diagram/sandbox/Print doesn't exist) such as User:Headbomb/Sandbox20. (You can see that the diagram of the starting position is not rendered at all).

Also this only tests the PDF. The template may still cause problem in printed book (which uses a different renderer), although it is very rare that the book does not render fine when the PDF does. To test the printed books, you need a book that includes a version of the article that uses the sandbox template, as well as being on an email whitelist. I can arrange for this if you are interested, although it may take a day or so (you can send me your email if you are interested). Headbomb {talk / contribs / physics / books} 16:01, 17 May 2010 (UTC)

Okay I accept that there is a problem. I only tested it by printing it from the browser, not with PDF. Do you know why it's not working with this version? (By the way, I guess we don't need to revert right now as you have recreated /Print?) — Martin (MSGJ · talk) 18:00, 17 May 2010 (UTC)
Alright, now that the below problem is fixed, there's no more hurry in synchronizing the live Main and /Print versions. I don't yet know what causes the problem, but I haven't checked things in details. Don't know when I'll be able to either. Headbomb {talk / contribs / physics / books} 18:56, 17 May 2010 (UTC)

[edit] errors

Something that was done to Template:Chess diagram today has messed it up. Diagrams that are not marked "small" seem to have the pieces on ranks 1-7 shifted one rank file to the right. Bubba73 (You talkin' to me?), 17:33, 17 May 2010 (UTC)

Yes, that's because on the current version, there are "||" which should be "|". I asked for the template to be reverted to a working version, but I'm still waiting on that.Headbomb {talk / contribs / physics / books} 17:42, 17 May 2010 (UTC)
Fixed, sorry about that! — Martin (MSGJ · talk) 17:55, 17 May 2010 (UTC)

[edit] rank and file labels

I don't think the labels of the files and ranks need to be on the top and right side - along the left and bottom only would be better. Bubba73 (You talkin' to me?), 18:54, 17 May 2010 (UTC)

Or we could make it optional? — Martin (MSGJ · talk) 19:39, 17 May 2010 (UTC)
OK, but have it default to "off" because very little literature labels all sides. Bubba73 (You talkin' to me?), 22:22, 17 May 2010 (UTC)
The labels are always present on both sides in every book I saw on the topic. See this for example. Headbomb {talk / contribs / physics / books} 22:25, 17 May 2010 (UTC)
I have about 250 chess books and the only ones that have the labels on all four sides are for beginners. I don't see a point to duplicating them on the right and top. It wastes space. Bubba73 (You talkin' to me?), 23:07, 17 May 2010 (UTC)
As Bubba says, labels on all four sides are rare and in fact most chess books don't label the files and ranks on their diagrams at all. It may still be desirable to mark one side in Wikipedia since it is not expected that all readers will be avid chess players. In some past versions of the chess diagram template labeling all four sides helped make the diagram symmetrical so that centering the caption would center below the board portion only (space used by rank labels on one side shouldn't be considered in the caption placement). I don't know if that is still an issue. Quale (talk) 03:01, 18 May 2010 (UTC)
Yes, I think that labeling along the left and bottom is great - a lot of readers will not be that accustomed to algebraic notation. But doing it on all four sides is an unneeded redundancy that doesn't accomplish anything (except perhaps center the diagram). Bubba73 (You talkin' to me?), 03:21, 18 May 2010 (UTC)
Okay I have removed the top and right labels. — Martin (MSGJ · talk) 10:48, 18 May 2010 (UTC)

I like that better. What do others think? Bubba73 (You talkin' to me?), 16:35, 18 May 2010 (UTC)

I find that horrible. And now this template stands alone in the sea of chess templates, which all have labels on all sides. Headbomb {talk / contribs / physics / books} 22:35, 18 May 2010 (UTC)
It's horrible without letters top and right, it's out of balance. Please revert. Regards, SunCreator (talk) 22:52, 18 May 2010 (UTC)
Solid white.svg a b c d e f g h Solid white.svg
8  black rook  black knight  black bishop  black queen  black king  black bishop  black knight  black rook 8
7  black pawn  black pawn  black pawn  black pawn  black pawn  black pawn  black pawn  black pawn 7
6  black king  black king  black king  black king  black king  black king  black king  black king 6
5  black king  black king  black king  black king  black king  black king  black king  black king 5
4  black king  black king  black king  black king  black king  black king  black king  black king 4
3  black king  black king  black king  black king  black king  black king  black king  black king 3
2  white pawn  white pawn  white pawn  white pawn  white pawn  white pawn  white pawn  white pawn 2
1  white rook  white knight  white bishop  white queen  white king  white bishop  white knight  white rook 1
Solid white.svg a b c d e f g h Solid white.svg
Removing the top and right rows creates a huge style clash with all the animations which were generated through the use of this template.
Removing the top and right rows creates a huge style clash with all the animations which were generated through the use of this template.
Here's another reason why this should be reverted. With all the animations and images which used the chess diagrams, this will introduce chaos were non existed. Headbomb {talk / contribs / physics / books} 03:45, 19 May 2010 (UTC)

Looking at the animation, I would say there should be a simple text based way to create such an animation. I mean it is we can all follow a game that starts 1.d4 d5 2.Nf3, but how about when it becomes 10 moves deep? We should be able to input a starting position and a starting move number and enter moves to annimate as simple as moves=2...Nf6 3.c4--Mokru (talk) 15:55, 7 October 2010 (UTC)

I like the change, but the consensus seems to go back to the other way. Of course, I'll go along with the consensus. Bubba73 (You talkin' to me?), 04:00, 19 May 2010 (UTC)
Okay I'll revert this for now. (Or add an option and make the default on both sides.) — Martin (MSGJ · talk) 09:08, 19 May 2010 (UTC)
Thanks guys. Regards, SunCreator (talk) 13:53, 19 May 2010 (UTC)
Please don't add the option. It'll only encourage style forks, and we don't need that. The only option we need is whether labels should be present or not (Template:Chess diagram 4x5 doesn't use them, but Template:Chess diagram 6x6 does). Headbomb {talk / contribs / physics / books} 15:14, 19 May 2010 (UTC)
I agree that it should not be an option. I don't see any point in doing it one way on some diagrams and another way on others. Bubba73 (You talkin' to me?), 15:43, 19 May 2010 (UTC)

An argument's been made that notation on top and right is good for beginners who aren't experienced players yet. But did you ever think, that notation all the way around the board, like bees buzzing around a hive, looks complicated and could *intimidate* a beginner player? (Who many feel as a result, the game is probably "too complex" for them to understand, because all that notation gives an overall impression the game is probably too "technical" and "difficult" for them?)

If there's a cosmetic/esthetic argument that two-sided notation is "out of balance", there is also a counter-argument that four-sided notation destroys the beauty of the board (alternating-color squares), and destroys the visual simplicy of the board (which should be just squares as much as possible) by surrounding the board with unneeded orbiting letters & numbers - as though escaped from a can of Campbell's Alphabet Soup! (I think the counter-argument trumps the first.)

Chess is hard enough. Excess border notation = additional distraction. (When you try solving a chess problem from a diagram, or any other kind of analysis from it, the less visual distraction, the better. The greater simplicity, the better. I would venture to even say that is *always* true, for *everyone*. Because the mind never profits from distraction.) Ihardlythinkso (talk) 07:24, 5 July 2011 (UTC)

[edit] Size of fonts

[The] "small" version ... still has the problem with the squares not being squares in Firefox. Bubba73 (You talkin' to me?), 16:35, 18 May 2010 (UTC)
The squares are square with default settings. You use bigger fonts and that screw things up. Doesn't mean we should stop looking for a solution however. Headbomb {talk / contribs / physics / books} 22:35, 18 May 2010 (UTC)
No matter what I size I set the Firefox fonts, the squares of the small diagrams are not square. Bubba73 (You talkin' to me?), 01:06, 19 May 2010 (UTC)
I'm using Firefox 3.6.3 they look square to me. Regards, SunCreator (talk) 01:18, 19 May 2010 (UTC)
The problem with the squares on Firefox just started yesterday, and another computer with Firefox doesn't have the problem. Changing font sizes doesn't affect. IE and Chrome on this computer don't have the problem - only Firefox (3.6.3). I still have the problem if I'm not logged in. Bubba73 (You talkin' to me?), 01:22, 19 May 2010 (UTC)
Even after rebooting and starting Firefox in safe mode (no add-ons, etc), I still have the problem with small diagrams (this computer but not the other one). Bubba73 (You talkin' to me?), 01:51, 19 May 2010 (UTC)
Is it the size of the font I have set that is displaying the ranks (1-8) that is forcing the square to be taller than it should? Bubba73 (You talkin' to me?), 04:52, 19 May 2010 (UTC)

screenshot: File:Screenshot castling.jpg

On Firefox on this computer I have a minimum size font set so I can read text. Is this what is happening: that minimum size font is forcing the "small" squares to be that tall? Bubba73 (You talkin' to me?), 16:37, 19 May 2010 (UTC)
I doubt if font can make any difference at all. What screen resolution are you on? Try setting to 1280x800 and see if the board is square. Regards, SunCreator (talk) 16:45, 19 May 2010 (UTC)
I'm using the screen's native resolution of 1280x1024. If I change that and it makes the squares of the small diagrams square, wouldn't that make the regular squares not square? Bubba73 (You talkin' to me?), 18:20, 20 May 2010 (UTC)
The font size is the problem, not the resolution. Use the default option (16pt) and it should be fine. Headbomb {talk / contribs / physics / books} 18:45, 20 May 2010 (UTC)
In Firefox I have the default as 16-point Times New Roman. Bubba73 (You talkin' to me?), 18:51, 20 May 2010 (UTC)
Under Advanced, I had the minimum font size set to 18. Setting it to 16 and the small diagrams are square. Thanks all. Bubba73 (You talkin' to me?), 18:53, 20 May 2010 (UTC)

[edit] Divs

We seem to have some unnecessary formatting here. For example why is it necessary to have two boxes around the chess board? — Martin (MSGJ · talk) 10:50, 18 May 2010 (UTC)

I think the two boxes are good - the caption is between them. It helps separate the caption from the a-h. Bubba73 (You talkin' to me?), 16:37, 18 May 2010 (UTC)
I think it would probably be better if the header was inside the outer box. Bubba73 (You talkin' to me?), 04:02, 19 May 2010 (UTC)

[edit] Unnamed parameters

Currently all parameters are unnamed. This makes sense for the 64 chess pieces, but there are a few which would be better named I think:

  • The CSS class of the first div, currently {{{1}}}
  • The optional title, currently {{{2}}}
  • The caption underneath, currently {{{67}}}

Naming these {{{class}}}, {{{title}}} and {{{caption}}} respectively would make the syntax clearer and avoid complications where removing a parameter could potentially shift the position of the chess pieces. — Martin (MSGJ · talk) 10:55, 18 May 2010 (UTC)

All chess templates follow the same convention by starting piece placement at {{{3}}}. If you rename {{{1}}} and {{{2}}}, you effectively shift the assignments by two, breaking all templates. Headbomb {talk / contribs / physics / books} 01:39, 19 May 2010 (UTC)
Well yes, obviously we would have to update them if we were to make this change. — Martin (MSGJ · talk) 09:04, 19 May 2010 (UTC)
But what would be the point of that, and how would it prevent "pieces shifting"?? This is a family of roughly 20 templates, who all have this behaviour (in every language of Wikipedia), used on thousands of pages. Changing things would only confuse/annoy people, break interwiki compatibility, and some Chess template-writing software would become broken. Headbomb {talk / contribs / physics / books} 15:09, 19 May 2010 (UTC)

[edit] PNG -> SVG

I posted an RFC at meta:Talk:WikiProject Chess and Wikipedia talk:WikiProject Chess. Please feel free to comment. Cburnett 04:05, 2 January 2007 (UTC)

the white horse is missing... --Lazer erazer 11:51, 4 February 2007 (UTC)
Got a version on the /sandbox using these pieces. Any comments? — Martin (MSGJ · talk) 22:17, 17 May 2010 (UTC)

[edit] Conversion to SVG

Main: Finish {{chess diagram}} pieces SVG-ification; Create {{chess diagram svg}} pieces for the remaining colors

I've made a request at the graphic labs so we get all pieces in all colors in SVG. Once it's done, which may take a while considering the scope of the request, this would allow us to make a switch from the PNGs to SVGs. Headbomb {talk / contribs / physics / books} 03:35, 19 May 2010 (UTC)

There's a version sitting in the sandbox actually. (I didn't know we were missing some.) See the section above which I retrieved from the archive. By the way, there is no point making separate pieces with the different coloured backgrounds. Just make them transparent and we can use a background colour in the table. — Martin (MSGJ · talk) 09:03, 19 May 2010 (UTC)
Bumping this topic, as no-one responded on MetaWiki. I've finished all the requested pieces in SVG form, and am in the process of creating more gap-fills. Is it worth continuing this process? Equally, some standardisation on non-standard piece lettering is needed, as, for example, the unicorn/inverted knight piece shares its letter with the ship, so could (and, arguably, should) be moved to U, for unicorn, where it belongs. Anyway, there's a page on my userspace with the table as it stands here. NikNaks talk - gallery - commons 10:48, 3 June 2010 (UTC)
Just a fair waring, there might be a reason to create each piece with a colored background. The SVG images rendered in IE6 might not be transparent and could have a white background. Before deploying any template I suggest you test with IE6 first.--Svgalbertian (talk) 17:29, 11 June 2010 (UTC)
I just tried Template:Chess_diagram/testcases, and yeap everything is white. Until bugzilla:2074 is fixed, I recommend creating tiles for each color.--Svgalbertian (talk) 17:34, 11 June 2010 (UTC)
I don't think it falls under our responsibility to do that, as it is an issue with the WikiMedia software as a whole. If anything, forcing users who can to upgrade is no bad thing, but is there any chance that there could be a line in the template to use the PNGs if the browser appears as IE6? Or is that too complex for the markup to deal with? NikNaks talk - gallery - commons 12:08, 12 June 2010 (UTC)

[edit] Header inside outer box?

How about putting the header inside the outer box (like the caption)? I think it would be a good idea. Bubba73 (You talkin' to me?), 18:57, 23 May 2010 (UTC)

[edit] an "=" in the caption causes error

EXAMPLE OF EQUALS SIGN IN CAPTION CAUSING ERROR
Solid white.svg a b c d e f g h Solid white.svg
8  black king  black king  black king  black king  black king  black king  white queen  white queen 8
7  black king  black king  black king  black king  black king  black king  black king  black king 7
6  black king  black king  black pawn  black queen  black king  black king  black king  black king 6
5  black king  black king  black king  black king  black pawn  black king  black king  black king 5
4  black king  black king  white pawn  black pawn  white pawn  black king  black king  black king 4
3  black king  black king  black knight  white pawn  black king  black king  white pawn  black king 3
2  black king  black king  black king  black king  black king  black king  black king  black king 2
1  black queen  black king  black king  black king  black king  white bishop  white king  black king 1
Solid white.svg a b c d e f g h Solid white.svg

An "=" in the caption causes the whole caption to not be displayed. It has been this way for a long time. Bubba73 (You talkin' to me?), 20:32, 28 May 2010 (UTC)

You need to use {{=}} when writing = in templates. This is a limitation of all templates. Headbomb {talk / contribs / physics / books} 04:54, 29 May 2010 (UTC)
Thanks, are there any others like that? Bubba73 (You talkin' to me?), 05:03, 29 May 2010 (UTC)
Any other what? Headbomb {talk / contribs / physics / books} 05:06, 29 May 2010 (UTC)
Any other characters that you have to put in the double braces to use correctly in a caption. Bubba73 (You talkin' to me?), 05:08, 29 May 2010 (UTC)
Yes, the pipe character "|", which you input with ({{!}}) (for technical reasons {{|}} wouldn't work. Headbomb {talk / contribs / physics / books} 05:35, 29 May 2010 (UTC)

[edit] problem with white dots

Today white dots are not showing up correctly on SMALL chess diagrams. They are OK on regular diagrams. Bubba73 (You talkin' to me?), 14:44, 5 June 2010 (UTC)

Nunn, 2007, p. 152
Solid white.svg a b c d e f g h Solid white.svg
8 a8 black king b8 black king c8 black king d8 black king e8 xw f8 black circle g8 black circle h8 black circle 8
7 a7 black king b7 black king c7 black king d7 black king e7 xw f7 black circle g7 black circle h7 black circle 7
6 a6 black king b6 black king c6 black king d6 black king e6 black circle f6 black circle g6 black circle h6 black circle 6
5 a5 xw b5 black king c5 white pawn d5 black king e5 black circle f5 black circle g5 black circle h5 black circle 5
4 a4 xw b4 black king c4 white king d4 black king e4 black circle f4 black circle g4 black circle h4 black circle 4
3 a3 black circle b3 black king c3 black king d3 white queen e3 black circle f3 black circle g3 black circle h3 black circle 3
2 a2 black circle b2 black circle c2 black circle d2 black circle e2 black circle f2 black circle g2 black circle h2 black circle 2
1 a1 black circle b1 black circle c1 black circle d1 black circle e1 black queen f1 black circle g1 black circle h1 black circle 1
Solid white.svg a b c d e f g h Solid white.svg
Nunn, 2007, p. 152
Solid white.svg a b c d e f g h Solid white.svg
8  black king  black king  black king  black king  xw  black circle  black circle  black circle 8
7  black king  black king  black king  black king  xw  black circle  black circle  black circle 7
6  black king  black king  black king  black king  black circle  black circle  black circle  black circle 6
5  xw  black king  white pawn  black king  black circle  black circle  black circle  black circle 5
4  xw  black king  white king  black king  black circle  black circle  black circle  black circle 4
3  black circle  black king  black king  white queen  black circle  black circle  black circle  black circle 3
2  black circle  black circle  black circle  black circle  black circle  black circle  black circle  black circle 2
1  black circle  black circle  black circle  black circle  black queen  black circle  black circle  black circle 1
Solid white.svg a b c d e f g h Solid white.svg
It appears someone has made the transition to SVG without telling anyone! I've uploaded a replacement file, so all should be well. I'll also revert my change earlier if it hasn't already been done. NikNaks talk - gallery - commons 16:09, 5 June 2010 (UTC)
Thanks, that fixed it! Bubba73 (You talkin' to me?), 16:12, 5 June 2010 (UTC)

[edit] Alt text is wrong

Looks like the template is emitting alt="{{{square}}} black king" as the alt text for blank squares. This is evidently nonsense. Can someone who knows the code have a look? Chris Cunningham (not at work) - talk 16:46, 18 July 2010 (UTC)

[edit] border

The border of the diagram encloses the footer caption, but not the header. I think it would be much better if the border enclosed the header too. Can this be changed? Bubba73 (You talkin' to me?), 22:42, 1 September 2010 (UTC)

[edit] Printing of chess diagrams

Printing of chess diagrams, either from the PDF or the printable version of the page, does not work properly. On PDF, white squares are superimposed within each empty square on the board resulting in what looks like tan and brown outlines instead of tan and brown squares. On the printable page, the tan and brown are missing completely, and all you see is the chess pieces on a single large undivided white box. I am using IE8 on WIN7 and Adobe Reader 10. —Preceding unsigned comment added by 24.229.98.8 (talk) 16:47, 19 March 2011 (UTC)

I just printed Fool's mate on a color printer, and the three diagrams all printed properly. Bubba73 You talkin' to me? 16:52, 19 March 2011 (UTC)
It's a known issue. See PediaPress Ticket #937. Headbomb {talk / contribs / physics / books} 13:57, 20 March 2011 (UTC)

[edit] size parameter

According to the documentation, the size parameter should be just a number, as required by Template:Chess diagram/square (wich have the parameter {{{size|26}}}px ). So, can someone remove the "px" from "{{{size|26px}}}" in this template? This will avoid the "26pxpx" as image size (in the pdf output, the diagram rendering is broken and this may be the reason). Giro720 (talk) 05:40, 1 July 2011 (UTC)

Might this affect some existing uses? — Martin (MSGJ · talk) 08:56, 1 July 2011 (UTC)
No. An alternative solution (and more elegant) would be replace {{{size|26}}}px by {{{size|26px}}} in Template:Chess diagram/square, but this would break the pages wich set the size manually (with a number only, without the "px") in {{Chess diagram}} template (I'm not sure if there is any). Giro720 (talk) 19:38, 2 July 2011 (UTC)

[edit] All available geometries

Could someone update the Doc to reflect all available board geomety templates? (For e.g. I see a 8x10 template exists, used in Courier chess.) Ihardlythinkso (talk) 15:49, 8 January 2012 (UTC)

Personal tools
Namespaces

Variants
Actions
Navigation
Interaction
Toolbox