Wikipedia talk:Chemical infobox
From Wikipedia, the free encyclopedia
This current discussion is about format, layout, content (parameters), and application howto of the Chemical infoboxes. Discussion older than several months, and now outdated, are archived. Planning and progress of implementation of these infoboxes to the numerous articles is discussed and (where possible) organized in the Chemicals WikiProject, part of the Chemistry WikiProject.
[edit] Please use Transcluded Infobox syntax
Can this page be changed to recommend the use of Template:Chembox transcluded syntax instead. This has many advantages
- Simpler and shorter syntax
- Allows easy translation of all tables
- Stores values like molar mass as values that could be sorted numerically
- Temperatures would only need to be stored in C but could still be displayed as 0 C (32 F)
- Allows the wikipedians of individual chemical pages to easily pick and choose which sections are applicable/sensable
- Would allow other requested sections to be added to the template (Optical property, NMR spectra)
Jeff Carr 09:25, 23 January 2006 (UTC)
-
- The challenge using transclusions poses to the chemical articles is that there are enough variations on which properties or groups of properties are most appropriate to a given compound, that a single template doesn't fill the need. Rather, substitution has been used to provide the basic framework, which can be edited to fit any given compound's peculiarities. If some of the functionality discussed at meta:Extended_template_syntax were to be implemented, this situation would be changed. But as it is, chemical articles have enough variety of needs that I don't perceive templates with their present powers as fitting the bill. Shimmin 14:25, 23 January 2006 (UTC)
-
-
- The Extended template syntax is interesting. I think I understand what you want. The standard wiki table syntax allows you to define your own rows and sections. The transcluded version does not. I added questions to the transcluded talk page about that same problem. If I understand the way templates work, you can change the main template page, and it will change for future people that past it into a new page. Kind of interesting cut and paste idea, but the transcluded concept is far superior. I can't yet find how one edits a transcluded template. Maybe it's admin's only or is something done via cvs? Jeff Carr 16:56, 24 January 2006 (UTC)
-
-
-
- Indeed you are fully right, Shimmin! I agree with you completely. In the archives, one can find plenty of discussion of the pros and cons of transclusion, including the conclusion that it won't work for the {{chembox}}. Wim van Dorst 20:03, 23 January 2006 (UTC).
-
-
-
-
- I did post the above note after reading the archives because it seemed inconclusive and contradictary at times. It also intermingled with the advent of the transcluded option. I may have groked things wrong so this was an attempt to clarify things. Jeff Carr 16:56, 24 January 2006 (UTC)
-
-
-
-
- We do make both options available, however, and personally I have begun to use the transcluded version - I just pick the variables that are appropriate for that type of compound. Our current transcluded version does allow flexibility since every variable has a separate template. I think we should post information on using BOTH options on this page. I'd prefer someone more knowledgable on this to explain how to use them properly (PC, how wrote the transcluded version, perhaps?). Walkerma 20:32, 23 January 2006 (UTC)
-
-
-
-
- Perhaps User:Physchim62 can explain how to make and how to modify trancluded infobox's. Jeff Carr 16:56, 24 January 2006 (UTC)
-
-
-
-
-
- Last time I looked into actual use of the transcluded chembox, there were some significant deviations from working well. Have they been solved? PC? Wim van Dorst 21:30, 23 January 2006 (UTC).
- Take a look at alpha-Pinene, my last effort. I think there were one or two variables with problems, but mostly it's OK. It won't accept pipes, though, e.g. for solubility in ether. Walkerma 23:01, 23 January 2006 (UTC)
-
-
Huh! What? Someone called? ;) Wim is quite correct, the transcluded version still doesn't work properly, notably for the safety section; in fact, it is not a fully transcluded version and most of the benefits that Jeff Carr claims are not there for the moment. The (semi)-transcluded version does have the advantage of a shorter length of code in the article, and it is just as flexible as the traditional version. This last point is very important given the wide variety of "interesting data" which may or may not be appropriate for different compounds. We're a long way from the {{taxobox}}, and I have a feeling things will stay that way: chemical compounds are just more complicated than living organisms ;) Physchim62 (talk) 18:44, 25 January 2006 (UTC)
- The French are currently working on a transcluded chembox here: I'll see if I can get some ideas from them. Physchim62 (talk) 00:27, 3 February 2006 (UTC)
Transclusion could work if we took an even more radical stance against table creep. If the standard chemboxes included only a few, generally relevant fields, and all other data were relegated to the data page, the trouble of every compound being exceptional in some way would go away. Shimmin 03:01, 16 March 2006 (UTC)
[edit] Can I add "Optical property" in this table?
Optical property | |
---|---|
Refractive index | ? for 589.2 nm (nD) ? for 486.1 nm (nF) ? for 656.3 nm (nC) |
V-number | ? |
Physchim62 deleted these. So I want to know why I cannot add these.. by Weihao.chiu 15:00, 10 November 2005 (UTC)
- I think these are secondary chemical properties, and belong on the supplemental data page. ~K 16:16, 10 November 2005 (UTC)
-
- I agree with K and Physchim62. We at WP:Chem actually debated refractive index both here and on my talk page when we set up the page, and we decided to put it on the supplement page. Join WP:Chem and convince us otherwise if you wish! There are hundreds of data we could put in, but we can't fit them all on the main page. Walkerma 17:04, 10 November 2005 (UTC)
- In particular, these are properties which are not important (or even known) for many compounds: that's why I didn't think they should go into the template which is downloaded every time someone wants to insert a table. If you wanted to add a refractive index to a table in an article about an organic liquid, I wouldn't have a problem with it (although don't go too far, the tables are already quite long): add a line in the "Properties" section. Physchim62 (talk) 18:01, 10 November 2005 (UTC)
-
- Okay~~I will not add these in this table. However these properties are just not important for you but they are important for me. I can understand this, because I am not a chemist. This is jut like that I don't care the Molecular shape, Crystal structure,etc. But I will still add these properties in the individual compound page that is important for me. by Weihao.chiu 07:37, 11 November 2005 (UTC)
- Please can you make sure you add these to the supplement page if at all possible, rather than the main page? I disagree with PC on this, I'm concerned about "table creep" For example, I would love to add NMR spectra for all organics to the table, but I got overruled by others! If there isn't a supplement page as yet, click on the link to it and enter your table on there, as described here. We have a rough template for the supplement page, but we haven't had a formal vote on it yet, just make sure that optical properties are there. We will be sure to include your comments when we formalise the supplement. I have added Abbe number into the "structure and properties" table right below refractive index. Thanks, Walkerma 14:06, 11 November 2005 (UTC)
- I agree with Martin here: let's prevent table creep. Wim van Dorst 21:10, 11 November 2005 (UTC).
[edit] External links in tables
I am busy reverting another well meant example of table creep: External links do not work well in tables (they get expanded by some explorers when the table is printed), and to place them there is contrary to the MoS. They should go in the External links section at the bottom of the article. Physchim62 (talk) 10:24, 12 November 2005 (UTC)
- The example in question is {{PubChemRow}}, of which I am the instigator. Please note that one reason I developed it was precisely to avoid table creep — some of the detail available on PubChem (an authoritative, public resource) can be omitted in the infobox (e.g. perhaps the SMILES, which can be very long). Unfortunately, I was not aware of the IE issue, and was wondering if there is a way around it. (TinyURL does not help.) In the meantime, feel free to use {{PubChemLink}} (created by Physchim62). Peak 17:21, 12 November 2005 (UTC)
-
- PubChem is public, but it is not authoritative. I hoped to use their InChIs in my Compendium of Pesticide Common Names, but I found so many wrong names and structures that I had to generate my own InChIs using ChemSketch. Alan Wood 17:29, 3 March 2006 (UTC)
[edit] InChi
Should InChi's be added to the Chembox underneath SMILES? It would make google searching an InChi pull up the wiki page which would be usefull.
For details about InChi see http://wwmm.ch.cam.ac.uk/inchifaq/ (the InChi FAQ)
- I would give this a cautious welcome, although I know that other editors are concerned about keeping table length down to a reasonable size. Physchim62 (talk) 18:02, 19 January 2006 (UTC)
-
- As one of those "other editors" I would give it a cautious welcome too; I think if this does turn out to be official IUPAC policy then we need to take it seriously, and it would only add one line. I think as an online resource, our users are sitting at a computer - the place where an InChI is most useful. One major problem; When someone like myself writes a table like for alpha-Pinene (done last night) I want to be able to fill out the table completely in one go, using the Aldrich book, the Merck, the CRC and perhaps a couple of other books. As far as I know, none of these lists the InChI at present. With SMILES (which I never personally use) I can ask ChemDraw to do the conversion for me. This InChI generator looks way too difficult for a simpleton like me, and bear in mind that many of our editors do not even have access to ChemDraw. A few pages like ethene already have the InChI listed, but I don't want to see 1000 tables where 990 of them have ? as the entry. Could we make it an optional feature? Walkerma 21:47, 19 January 2006 (UTC)
- If Martin is merely one of 'the other editors' I must consider myself on the far side of the other editors: I'm dead against table creep. And the only way I could agree with InChi in the table is by systematically having it replace the SMILES, which serves exactly the same purpose. Personally I don't use either, and before the WP:Chem I hadn't even heard of either. So not a longer table. Wim van Dorst 22:38, 19 January 2006 (UTC).
- As one of those "other editors" I would give it a cautious welcome too; I think if this does turn out to be official IUPAC policy then we need to take it seriously, and it would only add one line. I think as an online resource, our users are sitting at a computer - the place where an InChI is most useful. One major problem; When someone like myself writes a table like for alpha-Pinene (done last night) I want to be able to fill out the table completely in one go, using the Aldrich book, the Merck, the CRC and perhaps a couple of other books. As far as I know, none of these lists the InChI at present. With SMILES (which I never personally use) I can ask ChemDraw to do the conversion for me. This InChI generator looks way too difficult for a simpleton like me, and bear in mind that many of our editors do not even have access to ChemDraw. A few pages like ethene already have the InChI listed, but I don't want to see 1000 tables where 990 of them have ? as the entry. Could we make it an optional feature? Walkerma 21:47, 19 January 2006 (UTC)
[edit] Template:Chembox new
Chemical infobox | |
---|---|
Except where noted otherwise, data are given for materials in their standard state (at 25 °C, 100 kPa) Infobox disclaimer and references |
Thanks to all who have worked on transcludable versions of the chembox: I am pleased to announce the arrival of {{chembox new}}, which is a fully transcludable version with all parameters optional. This means that the default version is as right! I have included all parameters used in chemboxes, and also some found in {{drugbox}} and {{explosivebox}}, in order to ensure the compatibility with existing versions. The same template can be used for both "simple" and "full" chemboxes. The appearance of the chembox is unchanged from the current versions. See {{chembox subst}} for a list of parameters. Enjoy! Physchim62 (talk) 07:40, 12 April 2006 (UTC)
[edit] Potassium hydrogen phthalate
Anyone know what's wrong with this article? --M1ss1ontomars2k4 05:13, 7 May 2006 (UTC)
- Now fixed. The box expands to the width of the widest entry - in this case the many alternative names widened it a lot. If you insert those br tags (see the changes I made) you can get it to a good width. Also, I noticed that the external link was written like an internal link - for ext links you only use one square bracket, not two, and you use a space instead of a | between the URL and the text part. Thanks for alerting us. Walkerma 05:28, 7 May 2006 (UTC)
[edit] MSDS
The MSDS link in the template is written like an internal link with double cornered brackets. Why is that? Do you expect people to copy the MDSD to the wikipedia possibly infringing on copyrights? May this should be changed to external link. I just used the chembox from HCl. Jasu 11:58, 26 May 2006 (UTC)
- You'll notice that if you click on the redlink, it asks you to create a supplementary data page called {{PAGENAME}} (data page). When creating chemboxes, you should also create the associated data page as a home for MSDS links, thermodynamic data, spectral information, etc. Please add in as much of those data as you can! Hydrochloric acid was a featured article before the supplement was created, so it's not quite standard. An article like toluene and Toluene (data page) show how it's to be done. Walkerma 16:29, 26 May 2006 (UTC)
[edit] NFPA Fire Diamond
There's a problem with one of the struck Ws in this section, but I don't know enough about the language to fix it. ejstheman 04:09, 31 May 2006 (UTC)
[edit] When should they be used?
When should chemboxes be used? This article says it should be used with all chemical articles, but does that include alloys? I am aware of the drugbox and the explosivebox and the elementbox, but what about alloys and dyes? What if I come across drugs article with no box at all? what about ones where the line of distinction is blurred (eg. ascorbic acid). Is it ok to replace old style chemboxes? mastodon 14:52, 2 June 2006 (UTC)
- The article is correct: all. But you have of course found that there is no fine line between 'chemical' and 'non-chemical' articles. When the article is about a subject only marginally about a chemical substance, then it will certainly be difficult to find the chemical (and physical) data to fill the chembox table with. Generally alloys would be out of scope of the chembox, but it may well be that a specific alloy (e.g., stainless steel 317) is of a fixed composition for which these data can well be found. If there's a certain group of chemical compounds (e.g. alloys) with specific data (e.g., shine, tensile strength, etc), perhaps it would be worthwhile to make a wikiproject of your own, with an own alloybox? Wim van Dorst (Talk) 15:59, 2 June 2006 (UTC). PS. Yes, it is highly recommended to update old chembox. Have a look at the worklist of Chemicals wikiproject if you feel like stepping in.
[edit] Ethylene glycol
Can someone fix the box in Ethylene glycol? — Omegatron 03:45, 10 August 2006 (UTC)
- I'll have a look. Wim van Dorst (Talk) 18:09, 23 August 2006 (UTC).
[edit] Template:Chembox new
It is recomended that the template Template:Chembox new is used.
- I propose a move of Template:Chembox to Template:Chembox old, and a move of Template:Chembox new to Template:Chembox. Any objections? This would make it much easier for beginners to find and start using the chemboxes. Zephyris 15:45, 24 August 2006 (UTC)
-
- Strong object. This format of the chemical infobox, as used in the wikipedia:WikiProject Chemicals, has been extensively discussed and formalized. See above paragraphs for my and others' arguments to not change the format. I agree, though, that transcluded version has good arguments too. Please do not declare this fixed chembox template out of date or otherwise as 'recommended' to be replaced by something else unless after sufficient discussion on the wikiproject talk page. Wim van Dorst (Talk) 20:27, 24 August 2006 (UTC).
[edit] Subst
Hi all, I saw that User:BetacommandBot started subst-ing the template last night, I have reverted the edits, and blocked the template from substing by betacommanderbot. I am sorry, but I like it in a non-subst way, since it is more easy to see what is there, and it is a lot less code on the page. Any comments? --Dirk Beetstra T C 09:42, 27 August 2006 (UTC)
- I fully agree with you, but I haven't read the arguments that the bot has for subst'ing templates. Having an uncluttered page to edit is my preference too, hence my support for staying with the fixed chembox with the fixed wikitable instead of transclusion. Wim van Dorst (Talk) 22:25, 27 August 2006 (UTC).
[edit] Replacement
I am trying dry runs in which I try to replace old 'chemical boxes' with the 'chembox new' (see User:Beetstra/Chemical; don't worry, I won't press save until controversy over this new chemobx is over, and if I do, either this rule will be turned of, or I will revert). But I encounter many problems. I will list problems here:
- Drugbox ({{drugbox}}) contains sometimes more than one image, how to implement? (drugbox var 'image2') Dirk Beetstra T C 10:30, 27 August 2006 (UTC)
- Drugbox contains much more info than I can use in chembox new, anyway Dirk Beetstra T C 10:39, 27 August 2006 (UTC)
- Would it be possible to provide the image size? Dirk Beetstra T C 11:27, 27 August 2006 (UTC)
Could someone look into this? --Dirk Beetstra T C 10:30, 27 August 2006 (UTC)
-
- Combined images are considered a Nice Thing (tm): see benzene and the talk archives for examples
- If the chemical compound is more important as a drug than as a standard chemical compound, the drugbox takes precedence over the chembox. Choose which is the subject of the article, and then use THAT infobox.
- I gladly leave that to others.
- Wim van Dorst (Talk) 22:21, 27 August 2006 (UTC).
- Why do I now get the feeling, that {{chembox new}} is not accepted, while it is already used on pages. {{Chembox new}} incorporates the {{drugbox}}. --Dirk Beetstra T C 22:45, 27 August 2006 (UTC)
See section 1 and section 13 above how the discussion stood. Indeed some articles have been provided with a new chembox, but these were merely try-outs by PC while developing the transcluded version, and some new people in the WP:Chem project not aware of this point. IIRC, there were several important issues:
- some technicalities on fields with links, now perhaps solved??
- prevention of table creep
IMHO, there has been no further discussion on the chembox, hence the decision of the Chemicals wikiprojects still stands at the fixed wikitable. Wim van Dorst (Talk) 23:05, 27 August 2006 (UTC).
-
- I thought that I had left things at a state where {{chembox new}} was equivalent to {{chembox}}: never mind! Image size can be changed using the optional parameter ImageSize, which defaults to 200px width. Combined images are a nightmare to code for, the only option I can provide on {{chembox new}} is to ask users to combine the images into a single file. I deliberately created fields for all data which was used on current infoboxes, ie {{drugbox}} and {{explosivebox}}, so that conversion could go ahead without loss of data (even though this might lead to table creep in some isolated cases): on the other hand, if the drugbox has developed since I wrote the code.... please provide examples of the fields which you would like to include but can't. I am currently testing a fix for fields which include URLs, but these still cause problems in a few circumstances (notably printing from IE). The general quetion of table creep is not for me to answer! Physchim62 (talk) 10:11, 31 August 2006 (UTC)
- Oops, forgot to answer this, thanks for the 'reminder' on my talk-page, PC.
- I was programming AWB-box-replacement on a drugbox-page, moving it into a chembox, I seem to be able to do that all automatically. But I indeed encountered quite some variables that did not fit, and then I saw Wim's remark above, so I decided to remove the box-conversion. For a list of things that are not programmed into the {{chembox new}}, see {{drugbox}} (full template). Maybe the drugbox-template should be copy-pasted into the chembox-new? And could you then give a full list (including the optional parameters, like given on {{drugbox}})?
- By the way, I would be in favour of moving all the boxes on chemical pages into the chembox-new, sorting variables into the subboxes where needed (so a page which originally had a drugbox, the template chembox-new would now have a header drugbox in it). How do you chembox-loving Wikipedians think about that! --Dirk Beetstra T C 21:02, 4 September 2006 (UTC)
- I thought that I had left things at a state where {{chembox new}} was equivalent to {{chembox}}: never mind! Image size can be changed using the optional parameter ImageSize, which defaults to 200px width. Combined images are a nightmare to code for, the only option I can provide on {{chembox new}} is to ask users to combine the images into a single file. I deliberately created fields for all data which was used on current infoboxes, ie {{drugbox}} and {{explosivebox}}, so that conversion could go ahead without loss of data (even though this might lead to table creep in some isolated cases): on the other hand, if the drugbox has developed since I wrote the code.... please provide examples of the fields which you would like to include but can't. I am currently testing a fix for fields which include URLs, but these still cause problems in a few circumstances (notably printing from IE). The general quetion of table creep is not for me to answer! Physchim62 (talk) 10:11, 31 August 2006 (UTC)
- I have copied Aspirin to User:Beetstra/aspirin, and run my AWB script with box-replacement on it over it:
- This is a fully automatic run, I don't do anything afterwards (in this case, to show what I do, normally I might change some things). What happens now is that the drugbox gets depopulated in favour of the new chembox, things that do not fit into the chembox, stay in the old box, which is then a second box on the page. If I am sure everything gets depopulated out of a box, I would dare to remove the second, empty box.
- There is still a lot of tweaking to be done (on this specific page I see now that I leave a lot of empty lines, and I should do something about the image size in the new chembox. I should be able to capture that as well).
- I will not run the box-replacement in the real .. I am waiting for comments for now (maybe I should give Martin Walker a hand before I do more tweaking on this script). --Dirk Beetstra T C 22:34, 4 September 2006 (UTC)
-
- I think start-chembox new-end seems much easier to enter data into, but I'm a bit puzzled by the multiply duplicated fields. Can someone enlighten all of us here, how to use it? --Rifleman 82 00:12, 4 November 2006 (UTC)
[edit] subst (encore)
Not sure exactly what substs the bot was making in the above discussion, so I'll just ask straight-out: are we preferring to subst:chembox or just template:chembox unsubstituted? To fix a spacing inconsistency/style issue, I found three different templates all explicitly contained the same footer, and now I see that lots of pages have been subst'ed so the fix will have to be done manually in each page. DMacks 20:19, 5 September 2006 (UTC)
- That is my mistake, the subst were on {{chembox new}}, which, IMHO, is better unsubstituted. So I went to the talk-page of chembox new, not noticing I ended up here. So the discussion was about chembox new. The {{chembox}} needs to be substituted, it is not built in the way chembox new is. What I am trying to program, is a AWB-script that moves all possible chemboxes into the chembox new, but for that the chembox new has to be finished. --Dirk Beetstra T C 20:26, 5 September 2006 (UTC)
[edit] Width of chemical infobox
I realize that the chemical infobox usually expands to the width of the longest line. Can we set a default width of perhaps 300 or 350 px in the template to be substituted such that long lines will wrap automatically? This is more aesthetically pleasing than the use of manual line breaks which result in poorly aligned lines. --Rifleman 82 19:15, 3 November 2006 (UTC)
- although a nice idea, I don't believe you can do that: wrapping doesn't occur (or is highly browser dependant) and the box simply as wide as the longest line. The size that you give is the minimum width, not the maximum width. Wim van Dorst (Talk) 22:24, 3 November 2006 (UTC).
- Take a look at benzophenone. I've found that by setting "width=250" in the first line defining the table, I am able to get the "Other solvents" line to wrap:
{| class="toccolours" border="1" width="300" style="float: right; clear: right; margin: 0 0 1em 1em; border-collapse: collapse;"
-
-
I've tested this on Firefox and IE on Windows XP and they both work fine. Would you like to test it out on your system? --Rifleman 82 22:57, 3 November 2006 (UTC)
-
- Good example: the table is as wide as the smiles entry. And the wrapping is within that limit. Note that setting to 150 doesn't have any effect. I don't think implementing will be effective, but as it won't change the table, feel free to give it a try. Do choose a small value, to prevent the browser from making the table too wide. Wim van Dorst (Talk) 23:48, 3 November 2006 (UTC).
- Done. I've set it as 300px which should be adequate for most stuff. Many SMILES even with small are longer than that, but this might reduce the number of line breaks needed! --Rifleman 82 23:58, 3 November 2006 (UTC)
- Check out User:Rifleman_82/Benzophenone. I believe the table width setting defines the maximum possible width, and will wrap text to fit. HOWEVER, if there is a line which exceeds the table width, this length of line will take precedence. That being the case, I'm setting the table width for the template as 200, the same as the default width of the image. --Rifleman 82 00:12, 4 November 2006 (UTC)
- 250px is a set width which is widely used for other infoboxes I deal with (I had forgotten than the chembox didn't have one). It is also possible to set widths for individual columns, although wider text without spaces will override the specification. I suggest the application of the principle that "Chemistry is an experimental science".... Physchim62 (talk) 09:37, 6 November 2006 (UTC)
- Check out User:Rifleman_82/Benzophenone. I believe the table width setting defines the maximum possible width, and will wrap text to fit. HOWEVER, if there is a line which exceeds the table width, this length of line will take precedence. That being the case, I'm setting the table width for the template as 200, the same as the default width of the image. --Rifleman 82 00:12, 4 November 2006 (UTC)
- Done. I've set it as 300px which should be adequate for most stuff. Many SMILES even with small are longer than that, but this might reduce the number of line breaks needed! --Rifleman 82 23:58, 3 November 2006 (UTC)