![]() | This template does not require a rating on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||
|
This template should be protected soon, since almost 150 articles allready use it. Also, I would like to have a feature for writing charges (something like if you start the number with a + or a -, it will put it automatically as sup instead of sub). Or possibly add another option such as the link one, say charge, which will come automatically at the end as a superscript. Thanks, and great template. Nergaal ( talk) 04:49, 30 January 2008 (UTC)
*{{chem/sandbox|H|2|O}} *{{chem/sandbox|2|H|2|O}} *{{chem/sandbox|H|3|O|+|link=hydronium}} *{{chem/sandbox|1|2|A}} *{{chem/sandbox|1|A}} *{{chem/sandbox|14|2|A|3}} *{{chem/sandbox|1|A|3}} *{{chem/sandbox|1|2|A|3|2+}} *{{chem/sandbox|1|A|3|-}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F|6|G|7|H|8|I|9|J|10}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F|6|G|7|H|8|I|9|J}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F|6|G|7|H|8|I|9}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F|6|G|7|H|8|I}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F|6|G|7|H|8}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F|6|G|7|H}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F|6|G|7}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F|6|G}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F|6}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E}} *{{chem/sandbox|A|1|B|2|C|3|D|4}} *{{chem/sandbox|A|1|B|2|C|3|D}} *{{chem/sandbox|A|1|B|2|C|3}} *{{chem/sandbox|A|1|B|2|C}} *{{chem/sandbox|A|1|B|2}} *{{chem/sandbox|A|1|B}} *{{chem/sandbox|A|1}} *{{chem/sandbox|A}} |
|
I just noticed someone
correcting mis-rendering on
noble gas. Having to play special games to make the formula display correctly goes against the point of having the template to do it automatically. Say we want "XeF8". The page previously had {{chem|Xe||F|8}}
. I assume that worked at one time.[cite needed] But now the result of that is just "Xe". None of the other likely chemically correct approaches work either: {{chem|Xe|F|8}}
breaks the template badly, but one shouldn't expect it to work once one reads the template docs, and {{chem|Xe|1|F|8}}
actually displays the 1, which again makes sense with respect to parsing.
The "solution" was {{chem|XeF|8}}
, but that's weird from a chemistry standpoint. "XeF" isn't anything real except a text string (suppose some day we want to enable auto-linking to each element's webpage?). Is it possible to make {{chem|Xe||F|8}}
work correctly? The template syntax appears to use an undefined parameter to indicate the end of the formula...could it look ahead a second position as well. Or could fix {{chem|Xe|1|F|8}}
by having subscript be omitted if it's "1" (which could be over-ridden by some allsubscripts=yes
template parameter if there are cases where one wants to see it).
XeF
8
It seems to be fixed. I'm putting the new version in before we get people wondering what's going on. JIMp talk· cont 17:17, 17 July 2009 (UTC)
The new addition you saw was a minor one. The dozen or so which you didn't see were also minor. As for linking individual elements, {{chem|[[Hydrogen|H]]|2|[[Oxygen|O]]
}} does a fine job. Optionally colouring the elements in standard colours is also possible. As for the case of using lower case letter in place of numbers, I'm afraid it would probably be best to fix these by bot. It's not that it's not possible to accommodate this; the software can tell a lower case from an upper case & so could treat the lower case as a plain number. The problem is that if we have {{chem|C|x|H|y
}} give us "CxHy", then people are going to expect {{chem|Fe|a+
}} to give "Fea+" and come here complaining that the template is broken when they get "Fea+" (we can't read the "+" after a letter, same goes for a "-") ... then there's A
ZX.
JIMp
talk·
cont
09:41, 25 July 2009 (UTC)
The formula S2−
n−1 isn't quite working: S2−
n−1. No idea how to fix it, though. Jimp? :-)—
Tetracube (
talk)
00:03, 18 September 2009 (UTC)
Is it working all right now? JIMp talk· cont 21:06, 24 September 2009 (UTC)
I was building similar functionality when I noticed this template. It seems some of the work on Category:Nuclide templates could be merged with this template into one set of templates. Reusing code reduces the time it takes to maintain these templates and maybe there are some features in one that could benefit the other and vice versa. For instance, I think this template could benefit from the automatic linking in NuclideTemplates (you specify only the element's name or symbol and the "link" argument and the right link for that element is automatically added). — SkyLined ( talk) 12:30, 27 November 2009 (UTC)
Someone using the very old and antiquated IE6 browser noted that
simultaneous sub/superscripts (like SO2−
4) don't show up correctly. Any hope of making this work? Or is IE6 just too outdated and too non-standards-compliant?—
Tetracube (
talk)
00:13, 1 April 2010 (UTC)
Such uses as CH
3F and CF
4 do not work. I changed
what I thought to be a bug, but this does not help.
Incnis Mrsi (
talk)
21:23, 28 February 2012 (UTC)
chem|CH|3|F
}} (i.e. no pipe between letters like in the sulphate example on the doc), everything should be fine. I guess we should make this more clear.
JIMp
talk·
cont
04:35, 29 February 2012 (UTC)chem|C||H|3|F
}}, will work.
JIMp
talk·
cont
04:50, 29 February 2012 (UTC)
chem|C|H|3|F
}}. I've also made an adjustment so that it will handle metastable isomers e.g. {{chem/sandbox|58m|27|Co}}
→ 58m{{
chem|Th(NO|3|)|4}}
→ Th(NO
3)
4 but should be similar to Th(NO3)4 - see
recent edit to Thorium. --
Redrose64 (
talk)
22:38, 3 March 2012 (UTC)
Based on some
edits on March 20, there appears to be a problem with how subscripts in formulas are displayed for some users. The specific example there is the "2" in
H
2
O generated by {{chem|[[hydrogen|H]]|<sub>2</sub>|[[oxygen|O]]}}
. The editor who inserted the explicit <sub> tag left the following note on my talkpage:
The results look correct for me (Firefox 11.0 OS X, and also tried Firefox 3.6.28 (an X11 manual build) on OS X). The actual subscripting happens via {{ su}}, which uses small fontsize and shifted baseline rather than "actual" HTML subscript, so maybe simply a stylesheet platform-portability issue (or conflict with third-party browser extensions? DMacks ( talk) 15:06, 21 March 2012 (UTC)
if we had made this template to produce,
Now this template has no meaning than just being an alternative to the sup
and sub
syntax, I think. It might be complex and hard to do, but would be of great use.
Vanischenu
m
Talk
11:46, 13 July 2012 (UTC)
<sub></sub>
& <sup></sup>
can't do is align the sub- & superscripts. What exactly were you hoping for?
JIMp
talk·
cont
06:02, 9 June 2013 (UTC)Viewing {{chem|H|9|O|4|+}}
in IE 9 the subscript "9" is much smaller than the "4". It looks ugly.
—DIV (
138.194.11.244 (
talk)
00:49, 24 July 2012 (UTC))
This template is wonderful (perhaps the only template in all Wikipedia that is actually good). However it has a bad effect on line spacing, because the formulas come out a bit too tall. This problem does not occur with ordinary <sup>...</sup> See:
I can provide a screenshot if you can't see the problem above. (I am using Chrome with the default "vector" skin for Wikipedia.)
Would it be possible to reduce the font size of sub/sup scripts, and/or push them closer together, and/or lie to the browser about the height of the result to avoid this problem?
(I have just left this request on the {{su}} talk page, but perhaps it is just a matter of setting some parameter?)
Thanks, and all the best, --
Jorge Stolfi (
talk)
01:04, 22 February 2013 (UTC)
<sup></sup>
and <sub></sub>
is align the super- and subscripts. This is done using {{su}} so if there's a problem to be fixed, it'll obviously have to be tackled
over there. I'm afraid I can't really help much. My knowledge of the workings of this template only expends as far as its own subpages (i.e. not as far as the workings of {{su}}).
JIMp
talk·
cont
05:42, 9 June 2013 (UTC)I get that, that is what it does. But it messes up the line spacing. That is a much worse reading faux pas than SO42-. People type all the time in Word or the like and never notice an issue with it. This template is like cramming LaTex into regular prose lines. You can't do it. Needs to be on a separate line. Well, if you keep it there, then fine.
Actually part of the main problem is that Wiki has such tight line spacing from line to line and then between paras. Look how much nicer the space is between paras in edit mode as compared to display mode. This, I think, is similar to the way over-tiny font. It is because Wikipedia thinks it makes them look smarter. TCO ( talk) 06:43, 9 June 2013 (UTC)
In the subtemplate {{ su}} of {{ chem}}, I have changed the default sub/superscript size to 70% from 85%, eliminating the extra line spacing. Also fixed passing the fontsize parameter, in case this appears too small for other applications. − Woodstone ( talk) 09:04, 22 July 2013 (UTC)
This template break something for the wikipedia API. See [ http://en.wikipedia.org/w/api.php?action=query&prop=description&titles=Water&prop=extracts&exintro&explaintext&exsentences=10&format=xml query of the first sentence]. And query of the lead section. Yug (talk) 23:45, 17 October 2013 (UTC)
In the article on
eclampsia, the magnesium ion appears to absorb the following space, Mg2+
like so.
Perhaps this effect is specific to my browser, which is IE.
99.247.1.157 (
talk)
03:25, 16 December 2013 (UTC)
How to write an electron? Instead of "e−" (or "e−"), {{chem|e|-}}
produces a very strange result "-
e" (-
e), and {{chem|e||-}}
produces "e
−
" (e
−
). —
Mikhail Ryazanov (
talk)
22:10, 20 December 2013 (UTC)
Maybe spacing problems can be resolved using subscript characters as ₁₂₃₄₅₆₇₈₉₀ instead of characters in subscript tag (1234567890), the same for superscript (¹²³⁴⁵⁶⁷⁸⁹⁰⁺⁻ instead of 1234567890+-)? -- Sbisolo ( talk) 09:55, 4 April 2014 (UTC)
I undid the recent change to the font size for superscript characters; the change meant that linespacing is increased in text using this template. To see an example, preview radiocarbon dating with the version I reverted from. Mike Christie ( talk - contribs - library) 17:02, 30 December 2014 (UTC)
This template still seems to have the problems with line spacing mentioned in the above discussions - see, for example, Tungsten carbide. Have there been any recent changes that might have reintroduced the problem, or was the problem not fixed in the first place? I'm seeing the issue in both Monobook and Vector, using IE11 and Chrome. Tevildo ( talk) 19:18, 25 August 2015 (UTC)
I thought it was fixed some time ago but if not, the problem is probably with {{ su}}. Jimp 06:28, 9 September 2015 (UTC)
-- [[
User:Edokter]] {{
talk}}
13:46, 28 February 2016 (UTC)
-- [[
User:Edokter]] {{
talk}}
18:59, 28 February 2016 (UTC)-- [[
User:Edokter]] {{
talk}}
19:32, 28 February 2016 (UTC)
-- [[
User:Edokter]] {{
talk}}
19:24, 1 March 2016 (UTC)@
Mike Christie: Should be fixed now. -- [[
User:Edokter]] {{
talk}}
17:05, 28 March 2016 (UTC)
Why is the aligned style used (CO2−
3) when so many other resources, as far as I've researched, don't (SO42-
[1])? Is there a standard form?
Fizzwhiz (
talk)
13:57, 11 November 2016 (UTC)
A latex option would be pretty obvious:
{chem|H|2|O|latex=true} → < math>H_2 O < /math> →
A readable text option would be:
{chem|H|2|O|text=true} → H Subscript 2 O
I'm not going to touch it unless I get a go-ahead. Is this an acceptable idea?
Akiva.avraham ( talk) 12:35, 15 November 2016 (UTC)
<math>
for using LaTeX would be <chem>
. For example:
<chem>H_2O</chem>
→ <math>H_2O</math>
→ .How do I write (i.e. a positively charged
beta particle) with this template? I've tried {{chem|0|+1}}β
and {{chem|+1|0}}β
but they result in +1
0β and +1
0β (i.e. the same, incorrect notation). —
Kri (
talk)
14:58, 25 June 2017 (UTC)
The documentation says to not use this template in citations. {{
chem2}}
triggers dire warnings when used with {{
cite}}
but chem doesn't. Is this a solved problem that is waiting for documentation to catch-up or is it a hidden problem waiting to catch us out?
Stepho
talk
03:11, 2 January 2022 (UTC)
span title="ctx_ver=
) contains a lot of mangled HTML from this template which shouldn't be there.
User:GKFX
talk
19:09, 27 November 2022 (UTC)Tried this: thorium
232 or uranium
238 It did not go well. Help!
Lfstevens (
talk)
20:41, 15 June 2022 (UTC)
In nitromethane, when I triple-click to section the entire lead paragraph, an instance of {chem} is dividing the paragraph into three pieces: before chem, inside chem, and after chem.
This particular box has a somewhat outdated FF installed, but use of triple-click is near universal across many browsers and OSes and it's rare in my experience to see this not work as expected. — MaxEnt 21:20, 19 August 2022 (UTC)
GKFX, if I understand your edits well
[2], should we declare this template {{
Deprecated}}/use{{
Chem2}}
formally? I could support. Or are there technical/usage issues to be resolved?
DePiep (
talk)
08:13, 26 November 2022 (UTC)
{{chem2|X+_{n} }}
→ X+n) and there is a MediaWiki bug with using it in links (
phab:T200704, although you can use the link= parameter as a substitute). In most other cases yes I would switch to {{chem2}}.
User:GKFX
talk
18:58, 27 November 2022 (UTC)
I’ve just come across multiple issues related to this template while browsing using iOS Safari, both in Google’s reprinting of Wikipedia content in infoboxes (e.g. a search for “sulfite” returns a Wikipedia infobox for Sulfite beside Google search results), but also on the Wikipedia pages themselves. Yes, Google is not Wikipedia, but the content they are reproducing comes directly from Wikipedia, and though I’m not privy to Wikipedia’s web analytics, I would wager that a huge amount of contemporary traffic comes straight from Google, specifically the Wikipedia infoboxes I am talking about, and therefore the preview of content that is shown in these boxes is of utmost importance to the project. In case it is important to know, I have observed these unexpected and unwanted behaviors while using an iPad with a slightly older version of iOS/iPadOS, 15.6.1. I have yet to test this in other browsers, but as you may gather from the behaviors described below, this is almost certainly also occurring in all browsers, because it must be related to the way the template itself is encoded into display content.
Actual Behavior
Expected Behavior
Both the display and the result of copying and pasting chemical formulae accessed from Wikipedia content using this template should be accurate, standardized, and consistent, no matter where the Wikipedia content was originally displayed. The order, spacing, and superscripts/subscripts should correct and consistent.
Recommended Fix
The template itself, by the order in which it accepts arguments, seems to acknowledge the proper order of formula-final subscript followed by an ion’s charge/superscript, so it is clear that it is rather the way in which the template is being parsed and encoded to display text, whether that is by using Unicode superscripts/subscripts or / HTML tags, that is the actual problem. However it is being rendered should be reversed, and the extra space removed. Also, if this is a problem for ions, I imagine there are related problems with this template for other types of chemical formulae that end in both subscripts and superscripts.
Hermes Thrice Great ( talk) 07:02, 31 May 2023 (UTC)
Isn't the IUPAC recommendation to stagger the charges? e.g. SO42−
See section 2.10.1 iv p51 of IUPAC (2007) Quantities, Units and Symbols in Physical Chemistry, Third Edition (The “Green Book”) https://iupac.org/wp-content/uploads/2019/05/IUPAC-GB3-2012-2ndPrinting-PDFsearchable.pdf
Ewen ( talk) 06:57, 19 February 2024 (UTC)
![]() | This template does not require a rating on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||
|
This template should be protected soon, since almost 150 articles allready use it. Also, I would like to have a feature for writing charges (something like if you start the number with a + or a -, it will put it automatically as sup instead of sub). Or possibly add another option such as the link one, say charge, which will come automatically at the end as a superscript. Thanks, and great template. Nergaal ( talk) 04:49, 30 January 2008 (UTC)
*{{chem/sandbox|H|2|O}} *{{chem/sandbox|2|H|2|O}} *{{chem/sandbox|H|3|O|+|link=hydronium}} *{{chem/sandbox|1|2|A}} *{{chem/sandbox|1|A}} *{{chem/sandbox|14|2|A|3}} *{{chem/sandbox|1|A|3}} *{{chem/sandbox|1|2|A|3|2+}} *{{chem/sandbox|1|A|3|-}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F|6|G|7|H|8|I|9|J|10}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F|6|G|7|H|8|I|9|J}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F|6|G|7|H|8|I|9}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F|6|G|7|H|8|I}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F|6|G|7|H|8}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F|6|G|7|H}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F|6|G|7}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F|6|G}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F|6}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5|F}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E|5}} *{{chem/sandbox|A|1|B|2|C|3|D|4|E}} *{{chem/sandbox|A|1|B|2|C|3|D|4}} *{{chem/sandbox|A|1|B|2|C|3|D}} *{{chem/sandbox|A|1|B|2|C|3}} *{{chem/sandbox|A|1|B|2|C}} *{{chem/sandbox|A|1|B|2}} *{{chem/sandbox|A|1|B}} *{{chem/sandbox|A|1}} *{{chem/sandbox|A}} |
|
I just noticed someone
correcting mis-rendering on
noble gas. Having to play special games to make the formula display correctly goes against the point of having the template to do it automatically. Say we want "XeF8". The page previously had {{chem|Xe||F|8}}
. I assume that worked at one time.[cite needed] But now the result of that is just "Xe". None of the other likely chemically correct approaches work either: {{chem|Xe|F|8}}
breaks the template badly, but one shouldn't expect it to work once one reads the template docs, and {{chem|Xe|1|F|8}}
actually displays the 1, which again makes sense with respect to parsing.
The "solution" was {{chem|XeF|8}}
, but that's weird from a chemistry standpoint. "XeF" isn't anything real except a text string (suppose some day we want to enable auto-linking to each element's webpage?). Is it possible to make {{chem|Xe||F|8}}
work correctly? The template syntax appears to use an undefined parameter to indicate the end of the formula...could it look ahead a second position as well. Or could fix {{chem|Xe|1|F|8}}
by having subscript be omitted if it's "1" (which could be over-ridden by some allsubscripts=yes
template parameter if there are cases where one wants to see it).
XeF
8
It seems to be fixed. I'm putting the new version in before we get people wondering what's going on. JIMp talk· cont 17:17, 17 July 2009 (UTC)
The new addition you saw was a minor one. The dozen or so which you didn't see were also minor. As for linking individual elements, {{chem|[[Hydrogen|H]]|2|[[Oxygen|O]]
}} does a fine job. Optionally colouring the elements in standard colours is also possible. As for the case of using lower case letter in place of numbers, I'm afraid it would probably be best to fix these by bot. It's not that it's not possible to accommodate this; the software can tell a lower case from an upper case & so could treat the lower case as a plain number. The problem is that if we have {{chem|C|x|H|y
}} give us "CxHy", then people are going to expect {{chem|Fe|a+
}} to give "Fea+" and come here complaining that the template is broken when they get "Fea+" (we can't read the "+" after a letter, same goes for a "-") ... then there's A
ZX.
JIMp
talk·
cont
09:41, 25 July 2009 (UTC)
The formula S2−
n−1 isn't quite working: S2−
n−1. No idea how to fix it, though. Jimp? :-)—
Tetracube (
talk)
00:03, 18 September 2009 (UTC)
Is it working all right now? JIMp talk· cont 21:06, 24 September 2009 (UTC)
I was building similar functionality when I noticed this template. It seems some of the work on Category:Nuclide templates could be merged with this template into one set of templates. Reusing code reduces the time it takes to maintain these templates and maybe there are some features in one that could benefit the other and vice versa. For instance, I think this template could benefit from the automatic linking in NuclideTemplates (you specify only the element's name or symbol and the "link" argument and the right link for that element is automatically added). — SkyLined ( talk) 12:30, 27 November 2009 (UTC)
Someone using the very old and antiquated IE6 browser noted that
simultaneous sub/superscripts (like SO2−
4) don't show up correctly. Any hope of making this work? Or is IE6 just too outdated and too non-standards-compliant?—
Tetracube (
talk)
00:13, 1 April 2010 (UTC)
Such uses as CH
3F and CF
4 do not work. I changed
what I thought to be a bug, but this does not help.
Incnis Mrsi (
talk)
21:23, 28 February 2012 (UTC)
chem|CH|3|F
}} (i.e. no pipe between letters like in the sulphate example on the doc), everything should be fine. I guess we should make this more clear.
JIMp
talk·
cont
04:35, 29 February 2012 (UTC)chem|C||H|3|F
}}, will work.
JIMp
talk·
cont
04:50, 29 February 2012 (UTC)
chem|C|H|3|F
}}. I've also made an adjustment so that it will handle metastable isomers e.g. {{chem/sandbox|58m|27|Co}}
→ 58m{{
chem|Th(NO|3|)|4}}
→ Th(NO
3)
4 but should be similar to Th(NO3)4 - see
recent edit to Thorium. --
Redrose64 (
talk)
22:38, 3 March 2012 (UTC)
Based on some
edits on March 20, there appears to be a problem with how subscripts in formulas are displayed for some users. The specific example there is the "2" in
H
2
O generated by {{chem|[[hydrogen|H]]|<sub>2</sub>|[[oxygen|O]]}}
. The editor who inserted the explicit <sub> tag left the following note on my talkpage:
The results look correct for me (Firefox 11.0 OS X, and also tried Firefox 3.6.28 (an X11 manual build) on OS X). The actual subscripting happens via {{ su}}, which uses small fontsize and shifted baseline rather than "actual" HTML subscript, so maybe simply a stylesheet platform-portability issue (or conflict with third-party browser extensions? DMacks ( talk) 15:06, 21 March 2012 (UTC)
if we had made this template to produce,
Now this template has no meaning than just being an alternative to the sup
and sub
syntax, I think. It might be complex and hard to do, but would be of great use.
Vanischenu
m
Talk
11:46, 13 July 2012 (UTC)
<sub></sub>
& <sup></sup>
can't do is align the sub- & superscripts. What exactly were you hoping for?
JIMp
talk·
cont
06:02, 9 June 2013 (UTC)Viewing {{chem|H|9|O|4|+}}
in IE 9 the subscript "9" is much smaller than the "4". It looks ugly.
—DIV (
138.194.11.244 (
talk)
00:49, 24 July 2012 (UTC))
This template is wonderful (perhaps the only template in all Wikipedia that is actually good). However it has a bad effect on line spacing, because the formulas come out a bit too tall. This problem does not occur with ordinary <sup>...</sup> See:
I can provide a screenshot if you can't see the problem above. (I am using Chrome with the default "vector" skin for Wikipedia.)
Would it be possible to reduce the font size of sub/sup scripts, and/or push them closer together, and/or lie to the browser about the height of the result to avoid this problem?
(I have just left this request on the {{su}} talk page, but perhaps it is just a matter of setting some parameter?)
Thanks, and all the best, --
Jorge Stolfi (
talk)
01:04, 22 February 2013 (UTC)
<sup></sup>
and <sub></sub>
is align the super- and subscripts. This is done using {{su}} so if there's a problem to be fixed, it'll obviously have to be tackled
over there. I'm afraid I can't really help much. My knowledge of the workings of this template only expends as far as its own subpages (i.e. not as far as the workings of {{su}}).
JIMp
talk·
cont
05:42, 9 June 2013 (UTC)I get that, that is what it does. But it messes up the line spacing. That is a much worse reading faux pas than SO42-. People type all the time in Word or the like and never notice an issue with it. This template is like cramming LaTex into regular prose lines. You can't do it. Needs to be on a separate line. Well, if you keep it there, then fine.
Actually part of the main problem is that Wiki has such tight line spacing from line to line and then between paras. Look how much nicer the space is between paras in edit mode as compared to display mode. This, I think, is similar to the way over-tiny font. It is because Wikipedia thinks it makes them look smarter. TCO ( talk) 06:43, 9 June 2013 (UTC)
In the subtemplate {{ su}} of {{ chem}}, I have changed the default sub/superscript size to 70% from 85%, eliminating the extra line spacing. Also fixed passing the fontsize parameter, in case this appears too small for other applications. − Woodstone ( talk) 09:04, 22 July 2013 (UTC)
This template break something for the wikipedia API. See [ http://en.wikipedia.org/w/api.php?action=query&prop=description&titles=Water&prop=extracts&exintro&explaintext&exsentences=10&format=xml query of the first sentence]. And query of the lead section. Yug (talk) 23:45, 17 October 2013 (UTC)
In the article on
eclampsia, the magnesium ion appears to absorb the following space, Mg2+
like so.
Perhaps this effect is specific to my browser, which is IE.
99.247.1.157 (
talk)
03:25, 16 December 2013 (UTC)
How to write an electron? Instead of "e−" (or "e−"), {{chem|e|-}}
produces a very strange result "-
e" (-
e), and {{chem|e||-}}
produces "e
−
" (e
−
). —
Mikhail Ryazanov (
talk)
22:10, 20 December 2013 (UTC)
Maybe spacing problems can be resolved using subscript characters as ₁₂₃₄₅₆₇₈₉₀ instead of characters in subscript tag (1234567890), the same for superscript (¹²³⁴⁵⁶⁷⁸⁹⁰⁺⁻ instead of 1234567890+-)? -- Sbisolo ( talk) 09:55, 4 April 2014 (UTC)
I undid the recent change to the font size for superscript characters; the change meant that linespacing is increased in text using this template. To see an example, preview radiocarbon dating with the version I reverted from. Mike Christie ( talk - contribs - library) 17:02, 30 December 2014 (UTC)
This template still seems to have the problems with line spacing mentioned in the above discussions - see, for example, Tungsten carbide. Have there been any recent changes that might have reintroduced the problem, or was the problem not fixed in the first place? I'm seeing the issue in both Monobook and Vector, using IE11 and Chrome. Tevildo ( talk) 19:18, 25 August 2015 (UTC)
I thought it was fixed some time ago but if not, the problem is probably with {{ su}}. Jimp 06:28, 9 September 2015 (UTC)
-- [[
User:Edokter]] {{
talk}}
13:46, 28 February 2016 (UTC)
-- [[
User:Edokter]] {{
talk}}
18:59, 28 February 2016 (UTC)-- [[
User:Edokter]] {{
talk}}
19:32, 28 February 2016 (UTC)
-- [[
User:Edokter]] {{
talk}}
19:24, 1 March 2016 (UTC)@
Mike Christie: Should be fixed now. -- [[
User:Edokter]] {{
talk}}
17:05, 28 March 2016 (UTC)
Why is the aligned style used (CO2−
3) when so many other resources, as far as I've researched, don't (SO42-
[1])? Is there a standard form?
Fizzwhiz (
talk)
13:57, 11 November 2016 (UTC)
A latex option would be pretty obvious:
{chem|H|2|O|latex=true} → < math>H_2 O < /math> →
A readable text option would be:
{chem|H|2|O|text=true} → H Subscript 2 O
I'm not going to touch it unless I get a go-ahead. Is this an acceptable idea?
Akiva.avraham ( talk) 12:35, 15 November 2016 (UTC)
<math>
for using LaTeX would be <chem>
. For example:
<chem>H_2O</chem>
→ <math>H_2O</math>
→ .How do I write (i.e. a positively charged
beta particle) with this template? I've tried {{chem|0|+1}}β
and {{chem|+1|0}}β
but they result in +1
0β and +1
0β (i.e. the same, incorrect notation). —
Kri (
talk)
14:58, 25 June 2017 (UTC)
The documentation says to not use this template in citations. {{
chem2}}
triggers dire warnings when used with {{
cite}}
but chem doesn't. Is this a solved problem that is waiting for documentation to catch-up or is it a hidden problem waiting to catch us out?
Stepho
talk
03:11, 2 January 2022 (UTC)
span title="ctx_ver=
) contains a lot of mangled HTML from this template which shouldn't be there.
User:GKFX
talk
19:09, 27 November 2022 (UTC)Tried this: thorium
232 or uranium
238 It did not go well. Help!
Lfstevens (
talk)
20:41, 15 June 2022 (UTC)
In nitromethane, when I triple-click to section the entire lead paragraph, an instance of {chem} is dividing the paragraph into three pieces: before chem, inside chem, and after chem.
This particular box has a somewhat outdated FF installed, but use of triple-click is near universal across many browsers and OSes and it's rare in my experience to see this not work as expected. — MaxEnt 21:20, 19 August 2022 (UTC)
GKFX, if I understand your edits well
[2], should we declare this template {{
Deprecated}}/use{{
Chem2}}
formally? I could support. Or are there technical/usage issues to be resolved?
DePiep (
talk)
08:13, 26 November 2022 (UTC)
{{chem2|X+_{n} }}
→ X+n) and there is a MediaWiki bug with using it in links (
phab:T200704, although you can use the link= parameter as a substitute). In most other cases yes I would switch to {{chem2}}.
User:GKFX
talk
18:58, 27 November 2022 (UTC)
I’ve just come across multiple issues related to this template while browsing using iOS Safari, both in Google’s reprinting of Wikipedia content in infoboxes (e.g. a search for “sulfite” returns a Wikipedia infobox for Sulfite beside Google search results), but also on the Wikipedia pages themselves. Yes, Google is not Wikipedia, but the content they are reproducing comes directly from Wikipedia, and though I’m not privy to Wikipedia’s web analytics, I would wager that a huge amount of contemporary traffic comes straight from Google, specifically the Wikipedia infoboxes I am talking about, and therefore the preview of content that is shown in these boxes is of utmost importance to the project. In case it is important to know, I have observed these unexpected and unwanted behaviors while using an iPad with a slightly older version of iOS/iPadOS, 15.6.1. I have yet to test this in other browsers, but as you may gather from the behaviors described below, this is almost certainly also occurring in all browsers, because it must be related to the way the template itself is encoded into display content.
Actual Behavior
Expected Behavior
Both the display and the result of copying and pasting chemical formulae accessed from Wikipedia content using this template should be accurate, standardized, and consistent, no matter where the Wikipedia content was originally displayed. The order, spacing, and superscripts/subscripts should correct and consistent.
Recommended Fix
The template itself, by the order in which it accepts arguments, seems to acknowledge the proper order of formula-final subscript followed by an ion’s charge/superscript, so it is clear that it is rather the way in which the template is being parsed and encoded to display text, whether that is by using Unicode superscripts/subscripts or / HTML tags, that is the actual problem. However it is being rendered should be reversed, and the extra space removed. Also, if this is a problem for ions, I imagine there are related problems with this template for other types of chemical formulae that end in both subscripts and superscripts.
Hermes Thrice Great ( talk) 07:02, 31 May 2023 (UTC)
Isn't the IUPAC recommendation to stagger the charges? e.g. SO42−
See section 2.10.1 iv p51 of IUPAC (2007) Quantities, Units and Symbols in Physical Chemistry, Third Edition (The “Green Book”) https://iupac.org/wp-content/uploads/2019/05/IUPAC-GB3-2012-2ndPrinting-PDFsearchable.pdf
Ewen ( talk) 06:57, 19 February 2024 (UTC)