# Poll: mhchem syntax for electron configuration

As the author of mhchem, I am considering to add electron configuration to \ce. I decided to give it a little bit spacing for readability: $\mathrm{[Kr]\mskip2mu4d^{10}\mskip2mu5s^1\mskip2mu5p^3\mskip2mu5d^4}$.

Now, I'd like to ask you what you consider an intuitive input syntax. I will propose some answers, please vote.

Disclaimer: This is no promise that this feature will come or that I will implement the winning syntax. In fact, it might even be impossible to use a certain syntax because of side-effects.

• I would consider not including it in the \ce command, but a different command since it enhances readability of the code. – Martin - マーチン Feb 19 '17 at 10:02
• @Martin-マーチン I would never have the idea if \ce were not already used that way, here at SE. So I want to support it properly (and with a recommended syntax, although I might support more). – mhchem Feb 19 '17 at 19:31
• ... several hundred times. – mhchem Feb 19 '17 at 19:50
• Yes, probably because it is easier to sub- and superscript numbers this way instead of using html tags. In a pure tex setting I would probably go a different route. Nevertheless, it is wonderful how you take care of us; thank you. – Martin - マーチン Feb 20 '17 at 6:08
• I agree for the LaTeX only setting, where users are used to have specialized commands. For SE (and therefore MathJax/mhchem) I would tend to go for the design principle of desire lines. // While we are at it, I don't like the output of \ce sticking out from the surrounding text when this is not necessary (e.g. just subscripts and superscripts). But changing that would need a major effort of the MathJax core guys or of SE. – mhchem Feb 20 '17 at 8:08
• This is indeed a good idea, especially for MathJax. LaTeX is a lot more flexible to be customised, you can choose your own path there. // The sticking out part of MathJax has become a lot better when we got our own design, see here for some discussion. Previously some user tried to circumvent this by using for exampleH$_2$SO$_4$, which is awkward, because the formula might break at a line end. And since you cannot predict those accurately (esp. mobile) this is a problem for readability. Currently I am quite happy with what it looks like. – Martin - マーチン Feb 20 '17 at 8:57
• Regarding font, I could not resist. – mhchem Feb 20 '17 at 14:45

In order to get $\mathrm{[Kr]\mskip2mu4d^{10}\mskip2mu5s^1\mskip2mu5p^3\mskip2mu5d^4}$, I'd prefer to input $\ce{[Kr] 4d10 5s1 5p3 5d4}$.

• Legible both in code and result. Clean and easy. I like it! – tschoppi Feb 10 '17 at 5:41
• Would it be easier from a parsing perspective to move the orbital population notation inside the square bracket in the markup? e.g., $\ce{[Kr 4d10 5s1 5p3 5d4]}$? Obviously it would still be rendered with only the element symbol bracketed. – hBy2Py Feb 12 '17 at 14:45
• @hBy2Py Parsing would be easier. But the philosophy of mhchem is not about easy parsing but about intuitive input. – mhchem Feb 14 '17 at 13:57
• This is how users type it when using text-only input ex. 1, ex. 2 – mhchem Feb 16 '17 at 12:26

In order to get $\mathrm{[Kr]\mskip2mu4d^{10}\mskip2mu5s^1\mskip2mu5p^3\mskip2mu5d^4}$, I'd prefer to input $\ce{[Kr] 4d^10 5s^1 5p^3 5d^4}$.

• This gets my second vote as an acceptable alternative. – Jan Feb 9 '17 at 12:10
• Seen in the wild (because you get acceptable results, that way). – mhchem Feb 16 '17 at 12:25
• Already used a few dozen times here at SE (when including 4d^{10}). – mhchem Feb 19 '17 at 19:52

In order to get $\mathrm{[Kr]\mskip2mu4d^{10}\mskip2mu5s^1\mskip2mu5p^3\mskip2mu5d^4}$, I'd prefer to input $\ce{[Kr]4d^{10}5s^15p^35d^4}$.

• This is how some users intuitively write things. $\mathrm{1s^22s^22p^63s^1}$ source – mhchem Feb 14 '17 at 13:56

In order to get $\mathrm{[Kr]\mskip2mu4d^{10}\mskip2mu5s^1\mskip2mu5p^3\mskip2mu5d^4}$, I'd prefer to input $\ce{[Kr]4d105s15p35d4}$.

• Dear God, please no. – hBy2Py Feb 9 '17 at 22:10
• The problem is both readability and discoverability. No search engine is going to interpret that as 4d10 5s1 etc. – Geoff Hutchison Feb 11 '17 at 1:00
• The search engine argument is not correct. Try Google, Google Books, Bing with the search term 1s22s22p63s23p6. (BTW, I don't like that syntax either.) – mhchem Feb 11 '17 at 17:23