21
$\begingroup$

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.

$\endgroup$
7
  • $\begingroup$ I would consider not including it in the \ce command, but a different command since it enhances readability of the code. $\endgroup$ Feb 19, 2017 at 10:02
  • $\begingroup$ @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). $\endgroup$
    – mhchem
    Feb 19, 2017 at 19:31
  • $\begingroup$ ... several hundred times. $\endgroup$
    – mhchem
    Feb 19, 2017 at 19:50
  • $\begingroup$ 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. $\endgroup$ Feb 20, 2017 at 6:08
  • $\begingroup$ 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. $\endgroup$
    – mhchem
    Feb 20, 2017 at 8:08
  • $\begingroup$ 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. $\endgroup$ Feb 20, 2017 at 8:57
  • $\begingroup$ Regarding font, I could not resist. $\endgroup$
    – mhchem
    Feb 20, 2017 at 14:45

4 Answers 4

23
$\begingroup$

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}$.

$\endgroup$
4
  • 4
    $\begingroup$ Legible both in code and result. Clean and easy. I like it! $\endgroup$
    – tschoppi
    Feb 10, 2017 at 5:41
  • 1
    $\begingroup$ 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. $\endgroup$
    – hBy2Py
    Feb 12, 2017 at 14:45
  • 1
    $\begingroup$ @hBy2Py Parsing would be easier. But the philosophy of mhchem is not about easy parsing but about intuitive input. $\endgroup$
    – mhchem
    Feb 14, 2017 at 13:57
  • $\begingroup$ This is how users type it when using text-only input ex. 1, ex. 2 $\endgroup$
    – mhchem
    Feb 16, 2017 at 12:26
11
$\begingroup$

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}$.

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

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}$.

$\endgroup$
1
  • 1
    $\begingroup$ This is how some users intuitively write things. $\mathrm{1s^22s^22p^63s^1}$ source $\endgroup$
    – mhchem
    Feb 14, 2017 at 13:56
-7
$\begingroup$

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

$\endgroup$
3
  • 3
    $\begingroup$ Dear God, please no. $\endgroup$
    – hBy2Py
    Feb 9, 2017 at 22:10
  • 2
    $\begingroup$ The problem is both readability and discoverability. No search engine is going to interpret that as 4d10 5s1 etc. $\endgroup$ Feb 11, 2017 at 1:00
  • 6
    $\begingroup$ 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.) $\endgroup$
    – mhchem
    Feb 11, 2017 at 17:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .