Category talk:Chemical element symbol templates
From Wikipedia, the free encyclopedia
I'm adding an optional parameter to specify the trailing <sub>
quantity. There will be some radicals which should be migrated into their own category. —Phil | Talk 12:23, 12 December 2005 (UTC)
No deuterium, etc? — Omegatron 11:49, 18 April 2006 (UTC)
- All templates so far listed have the optional parameter added. The template work is done. It can be done rapidly using tabbed browsing on firefox. Polonium 21:11, 20 April 2006 (UTC)
Contents |
[edit] Shortcuts
Putting the full name of the element for the template (ie. {{carbon}} for carbon) can be quite long. Therefore, I propose a shortcut template. The letter "e" will be typed, followed by a dash, then by the chemical symbol of the element (ie. {{carbon}} will become {{e-C}}). This new template will redirect to the element template. Does anyone have any thoughts on this concept? Polonium 21:17, 20 April 2006 (UTC)
- e is for element? — Omegatron 21:32, 20 April 2006 (UTC)
-
- Yes, it is. I will start to create these templates, but I need help. If anyone would like to improve these, they certainly can. Polonium 00:23, 21 April 2006 (UTC)
[edit] Superscript
I think there should be a way of using superscripts on there templates to indicate ions. I will add {{#if:{{{2|}}}|<sup>{{{2}}}</sup>}} to the francium template, and if there are no problems, I will add it to all of these templates. If it does not work, please remove it and say so on the talk page, I will fix this function and test it again. Polonium 23:41, 10 May 2006 (UTC)
- It worked under various conditions, therefore I will add it to all templates. If you see they do not work, revert them of remove them. Polonium 23:47, 10 May 2006 (UTC)
-
- I am done all of the templates before N now, it goes really fast useing tabbed browsing using Firefox. Also, a superscripted sign before the symbol could be useful when the atomic mass is needed, ie. 14C to indicate carbon 14. In the future, I will add this feature to the templates, but first I will finish with this. Polonium 00:15, 11 May 2006 (UTC)
-
- Done superscript job. Polonium 20:37, 12 May 2006 (UTC)
- Should all of the template talk pages should be redirected here? Since these are more complicated now, they need a usage note. — Omegatron 21:02, 12 May 2006 (UTC)
[edit] Standard
I think a standard is needed for all of the templates. It could look like this:
{{#if:{{{3|}}}|<sup>{{{3}}}</sup>}}[[element|symbol]]{{#if:{{{1|}}}|<sub>{{{1}}}</sub>|}}{{#if:{{{2|}}}|<sup>{{{2}}}</sup>}}}<noinclude> ---- This is a chmical element symbol template. To use this template, enter in {{element|number of atoms|charge|atomic mass}}. For example, {{subst:nitrogen|2|+|14}} would be {{nitrogen|2|+|14}}. This template should not be [[Wikipedia:Template substitution|substituted]] because they contain complex wikicode. [[Category:Chemical element symbol templates|{{PAGENAME}}]] [[Category:Templates using ParserFunctions|{{PAGENAME}}]] </noinclude>
—Preceding unsigned comment added by Polonium (talk • contribs)
- Or we could use a giant switch code that evaluates for all possible elements and merge all of these templates into one single template... An example that covers only oxygen and carbon would be like so:
{{#if:{{{4|}}}|<sup>{{{4}}}</sup>}} {{switch:{{lc:{{{1}}}}} |c |carbon=[[Carbon|C]] |o |oxygen=[[Oxygen|O]] }} {{#if:{{{2|}}}|<sub>{{{2}}}</sub>|}}{{#if:{{{3|}}}|<sup>{{{3}}}</sup>}}}
- Nihiltres 15:56, 17 November 2006 (UTC)
-
- So you'd write {{e|C}}{{e|O|2}} for CO2 or something? — Omegatron 17:32, 17 November 2006 (UTC)
- Exactly. The idea would be to keep the same functionality as all of the templates currently in operation (as you said, {{e|O|2}} would equal {{oxygen|2}}), but to have all of the templates merged into one, with the element as a parameter. My example is case-insensitive and reacts to {{e|C}} and {{e|carbon}} in the same way. We can also turn all of the existing templates into effective redirects using (oxygen is an example:)
- So you'd write {{e|C}}{{e|O|2}} for CO2 or something? — Omegatron 17:32, 17 November 2006 (UTC)
{{e|oxygen|{{{1}}}|{{{2}}}|{{{3}}}}}
-
-
- Sound good? Nihiltres 19:09, 17 November 2006 (UTC)
-
-
-
- Certainly. However, I think the link parameter should be made optional, because I metioned these templates on Wikipedia talk:WikiProject Chemicals before, and a criticism was the automatic link created by them to the element. If the elementname is not specified (only the symbol is specified), the link should not be formed. Polonium 20:38, 17 November 2006 (UTC)
- Ok, that makes sense, and it's easy to change the code. We can use something like this:
- Certainly. However, I think the link parameter should be made optional, because I metioned these templates on Wikipedia talk:WikiProject Chemicals before, and a criticism was the automatic link created by them to the element. If the elementname is not specified (only the symbol is specified), the link should not be formed. Polonium 20:38, 17 November 2006 (UTC)
-
{{#if:{{{4|}}}|<sup>{{{4}}}</sup>}} {{switch:{{lc:{{{1}}}}} |c=C |carbon=[[Carbon|C]] |o=O |oxygen=[[Oxygen|O]] }} {{#if:{{{2|}}}|<sub>{{{2}}}</sub>|}}{{#if:{{{3|}}}|<sup>{{{3}}}</sup>}}}
-
-
-
- Nihiltres 23:56, 17 November 2006 (UTC)
- There's now a working (I think) version at User:Nihiltres/Sandbox. Check it out, try it, anything – just don't use it in articles while it's still in userspace. Below are some examples. Nihiltres 03:16, 19 November 2006 (UTC)
- Nihiltres 23:56, 17 November 2006 (UTC)
-
-
The chemical symbol should always be linked to the element page, though. — Omegatron 14:31, 22 November 2006 (UTC)
- It might be useful to have a no-linking option for constructing molecular formulas, though - for example,
{{User:Nihiltres/Sandbox|H|2}}{{User:Nihiltres/Sandbox|O}} :[[Water|{{Ce|H|2}}{{Ce|O}}]]
- becomes
- H2O
- while
::[[Water|{{Ce|Hydrogen|2}}{{Ce|Oxygen}}]]
- becomes
- [[Water|H2User:Ce]]
- Think I should change the way it's implemented? Nihiltres 15:08, 22 November 2006 (UTC)
[edit] Unit templates
I will create similar templates for units, like {{gram}} and similar templates for other units, and put them into the category Category:Unit templates. Polonium 20:15, 21 May 2006 (UTC)
[edit] Subst
These templates seem inconsistent about substing; I've started a discussion on Wikipedia talk:Template substitution. There was already a discussion there, which I missed and found as I was going to start it; I'm leaving the link up here anyway. --ais523 15:11, 26 June 2006 (UTC)
- These templates should not be subst'ed, because they contain ParserFunctions (Wikipedia:Template_substitution#Templates_that_should_not_be_substituted). --Ligulem 17:27, 22 November 2006 (UTC)
-
- Hey, couldn't we use, say
<sup>{{{3|}}}</sup>[[Element|Xx]]<sub>{{{1|}}}</sub><sup>{{{2|}}}</sup>
-
- rather than
{{#if:{{{3|}}}|<sup>{{{3}}}</sup>}}[[Element|Xx]]{{#if:{{{1|}}}|<sub>{{{1}}}</sub>}}{{#if:{{{2|}}}|<sup>{{{2}}}</sup>}}